Skip to content

#P04 As Participant, I would like to see a list of any upcoming Hackathons.#76

Merged
stefdworschak merged 48 commits intoCode-Institute-Community:masterfrom
Ri-Dearg:p04
Oct 18, 2020
Merged

#P04 As Participant, I would like to see a list of any upcoming Hackathons.#76
stefdworschak merged 48 commits intoCode-Institute-Community:masterfrom
Ri-Dearg:p04

Conversation

@Ri-Dearg
Copy link
Contributor

Hiya! I have a draft to fix issue #21 ready to go.

Description

  • A simple ListView that displays the Hackathon models in a card-based format. I tried to make it similar to lessons on the CI lesson pages.
  • The view is paginated for every eight objects. I provided links for an organiser's page and a detail page in the future.
  • The pagination buttons are also an include template using the default page_obj, so it is modular, allowing use for other paginated lists.
  • I have added additional styles to style.css for the cards, the paginator and text colors.
  • Added a draft menu item in the Navbar, "Hackathons".

Tests

  • I wrote tests that check for the templates used, URL status, context and queryset.
  • I have verified the page with the HTML5 verifier.
  • Responsiveness checked using the Chrome inspector on all device sizes.

Known Bugs
None I can find, the view keeps it simple! 😃

Let me know what ye think, what yere vision is, I'll put in the additions to fix it right up!

Screenshots
Screenshot 2020-10-17 at 18 49 29
Screenshot 2020-10-17 at 18 50 28
Screenshot 2020-10-17 at 18 51 22

Ri-Dearg and others added 30 commits October 14, 2020 15:28
Created hackathon app and moved tests inside its own module.
Updating branch with base files.
Connected the "hackathon" app by urls and settings"
Foregin Key fields will be revised as other models are created.
Added to admin. Minor adjustment made to Hackathon related name field
Updated comments. Must update all FK fields.
Foreign Keys match the schema closely but need review. See comments.
Syncing with changes from upstream repo
Sitched the *-Link fields for URLFields. Added comments.
Sitched the *-Link fields for URLFields. Added comments.

Added URLFields to project Model

Changed *_link to URLField, added comments. This commit fixes issue #61
…to m05

Updating commits to append request to issue.
Should not be commited here.
Also Changed model field name for readability.
@Ri-Dearg Ri-Dearg marked this pull request as draft October 17, 2020 17:24
Copy link
Member

@stefdworschak stefdworschak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Ri-Dearg looks great. Just finish up the few minor changes and I will merge it.

def setUp(self):
"""Sets up the models for testing"""
user = User.objects.create(username="testuser")
user.save()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove user.save(). The model is saved automatically when you call create(). Might have overlooked that in your previous tests. If you have used the same there you can go back in another PR and change that as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do!


/* TEXT */
.p-orange {
color: var(--p-orange);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you keep the indentation level consistend (4 spaces). Please adjust for anything below as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll go fix that up now

<h6 class="card-subtitle mb-2 text-muted">{{ hackathon.start_date }} - {{ hackathon.end_date }}</h6>
<p class="card-text">{{ hackathon.description }}</p>
{% if hackathon.organiser %}
<p>Organiser: <a href="#" class="p-blue card-link">{{ hackathon.organiser }}</a></p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we need to show the organiser, but let's leave it for the moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought it could be handy if people had public-facing profiles. It might not be so useful otherwise.

@@ -0,0 +1,18 @@
<ul class="pagination justify-content-center">
{% if page_obj.has_previous %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really cool solution for pagination!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@stefdworschak
Copy link
Member

Actually, just saw it's only a draft. But I'd say we can merge it already and you can work on the other pages in another PR.

Copy link
Contributor Author

@Ri-Dearg Ri-Dearg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format changes made for style.css and removed .save().

@Ri-Dearg Ri-Dearg marked this pull request as ready for review October 18, 2020 13:28
@stefdworschak
Copy link
Member

@Ri-Dearg looks great! Merging now.

@stefdworschak stefdworschak added the hacktoberfest-accepted Accepted PR during Hacktoberfest label Oct 18, 2020
@stefdworschak stefdworschak merged commit 9e1e81b into Code-Institute-Community:master Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted Accepted PR during Hacktoberfest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#P04. As Participant, I would like to see a list of any upcoming Hackathons.

2 participants

Comments