Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style hackathon list #4997

Merged
merged 4 commits into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions app/dashboard/templates/dashboard/hackathons.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,20 @@
<div class="container">
<div class="row justify-content-around my-5">
{% for hackathon in hackathons %}
<div class="col-xs-12 col-sm-6 col-lg-3">
<div class="card">
{% if hackathon.logo_svg %}
<img class="card-img-top" width="364" src="{{MEDIA_URL}}{{ hackathon.logo_svg }}"/>
{% elif hackathon.logo %}
<img class="card-img-top" width="364" src="{{MEDIA_URL}}{{ hackathon.logo }}"/>
<style>
#{{hackathon.slug}} .card-img-top {
background: {% firstof hackathon.background_color or 'rgb(25, 0, 63)' %};
}
</style>
<div class="col-xs-12 col-sm-6 col-lg-4">
<div class="card mb-5" id="{{hackathon.slug}}">
{% firstof hackathon.logo_svg or hackathon.logo as logo %}
{% if logo %}
<img class="card-img-top" width="364" src="{{MEDIA_URL}}{{logo}}"/>
{% else %}
<div class="card-img-top d-flex align-items-center justify-content-around font-bigger-4 text-center text-white">
{{ hackathon.name }}
</div>
{% endif %}
<div class="card-body">
<h5 class="card-title"><a href="{% url 'hackathon' hackathon.slug %}">{{ hackathon.name }}</a></h5>
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2852,7 +2852,7 @@ def get_hackathons(request):
"""Handle rendering all Hackathons."""

try:
events = HackathonEvent.objects.values()
events = HackathonEvent.objects.values().order_by('-created_on')
except HackathonEvent.DoesNotExist:
raise Http404

Expand Down