Skip to content

Commit 5a4fe46

Browse files
committed
finish new hackthon section;move subscription section
1 parent 218c2f2 commit 5a4fe46

File tree

3 files changed

+21
-41
lines changed

3 files changed

+21
-41
lines changed

app/assets/v2/js/pages/hackathon-list.js

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ $(document).ready(function() {
88
$('.nav-link').css('font-weight', '');
99
$(this).addClass('active');
1010
$(this).css('font-weight', '700');
11+
12+
13+
$('.hackathon-list').addClass('hidden');
1114
$('.hackathon-list.' + target).removeClass('hidden');
1215

1316
$('html,body').animate({

app/dashboard/templates/dashboard/hackathon/hackathons.html

+17-21
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@
3838
{% include 'shared/nav_hackathons.html' %}
3939
{% include 'shared/minihero.html' with h1='Hackathons' suppress_logo=0 position_h1_below_logo=True hide_rain=True %}
4040

41-
<div class="row justify-content-md-center">
42-
<form action="//consensys.us11.list-manage.com/subscribe/post?u=947c9b18fc27e0b00fc2ad055&amp;id=b1d45ffdfe"
43-
method="post" id="mc-embedded-subscribe-form" class="col-12 col-md-6 text-center white pb-5 px-5" name="mc-embedded-subscribe-form" target="_blank">
44-
<label for="newsletter-input" class="text-uppercase">{% trans "Signup to get hackathon updates" %}</label>
41+
</div>
42+
43+
<div class="container">
44+
<div class="rounded row justify-content-md-center my-5" style="background-color:#0D0665;">
45+
<form action="//consensys.us11.list-manage.com/subscribe/post?u=947c9b18fc27e0b00fc2ad055&amp;id=b1d45ffdfe" method="post" id="mc-embedded-subscribe-form" class="col-12 col-md-6 text-center white pb-5 pt-4 px-5" name="mc-embedded-subscribe-form" target="_blank">
46+
<label for="newsletter-input">{% trans "Subscribe to get Hackathon news upcoming hackathons!" %}</label>
4547
<div class="form-row pt-1">
4648
<div class="col">
4749
<input name="EMAIL" id="newsletter-input" class="form-control" placeholder="Enter your email" required>
@@ -50,30 +52,22 @@
5052
</div>
5153
</form>
5254
</div>
53-
</div>
54-
<div class="container-fluid">
55-
</div>
5655

57-
<div class="container">
58-
<div id="tabs" class="row my-5">
56+
<div id="tabs" class="row my-4">
5957
<div class="container">
6058
<ul class="nav nav-tabs mt-3" id="myTab" role="tablist">
61-
<li class="nav-item">
62-
<a class="nav-link nav-line active" href="#" data-href="{{ tabs.current.href }}" style="font-weight: 700;">{{ tabs.current.title }} <sup>({{ tabs.current.event_count }})</sup></a>
63-
</li>
64-
<li class="nav-item">
65-
<a class="nav-link nav-line" href="#" data-href="{{ tabs.upcoming.href }}">{{ tabs.upcoming.title }} <sup>({{ tabs.upcoming.event_count }})</sup></a>
66-
</li>
67-
<li class="nav-item">
68-
<a class="nav-link nav-line" href="#" data-href="{{ tabs.finished.href }}">{{ tabs.finished.title }} <sup>({{ tabs.finished.event_count }})</sup></a>
69-
</li>
59+
{% for title, hackathons in events.items %}
60+
<li class="nav-item">
61+
<a class="nav-link nav-line {% if title == 'current' %}active{% endif %}" href="#" data-href="{{ title }}" style="{% if title == 'current' %}font-weight: 700;{% endif %}">{{ title|title }} ({{ hackathons|length }})</a>
62+
</li>
63+
{% endfor %}
7064
</ul>
7165
</div>
7266
</div>
7367

68+
<div class="row my-4">
7469
{% for title, hackathons in events.items %}
7570
{% if hackathons|length %}
76-
<div class="row my-5">
7771
{% for hackathon in hackathons %}
7872
<style>
7973
#{{hackathon.slug}} .card-img-top {
@@ -82,7 +76,7 @@
8276
</style>
8377

8478

85-
<div class="col-xs-12 col-sm-6 col-lg-4">
79+
<div class="col-xs-12 col-sm-6 col-lg-4 hackathon-list {{ title }} {% if title != 'current' %}hidden{% endif %}">
8680
<div class="card mb-5" id="{{hackathon.slug}}">
8781
{% firstof hackathon.logo_svg or hackathon.logo as logo %}
8882
{% if logo %}
@@ -115,9 +109,11 @@ <h5 class="card-title"><a href="{% url 'hackathon' hackathon.slug %}">{{ hackath
115109
</div>
116110
</div>
117111
{% endfor %}
118-
</div>
119112
{% endif %}
120113
{% endfor %}
114+
</div>
115+
116+
121117
</div>
122118
{% include 'shared/analytics.html' %}
123119
{% include 'shared/footer_scripts.html' %}

app/dashboard/views.py

+1-20
Original file line numberDiff line numberDiff line change
@@ -4110,25 +4110,7 @@ def hackathon_registration(request):
41104110

41114111
def get_hackathons(request):
41124112
"""Handle rendering all Hackathons."""
4113-
4114-
tabs = {
4115-
'current': {
4116-
'title': 'Current',
4117-
'event_count': HackathonEvent.objects.current().order_by('-start_date').count(),
4118-
'href': 'current'
4119-
},
4120-
'upcoming': {
4121-
'title': 'Upcoming',
4122-
'event_count': HackathonEvent.objects.upcoming().order_by('-start_date').count(),
4123-
'href': 'upcoming'
4124-
},
4125-
'finished': {
4126-
'title': 'Finished',
4127-
'event_count': HackathonEvent.objects.finished().order_by('-start_date').count(),
4128-
'href': 'finished'
4129-
}
4130-
}
4131-
4113+
41324114
events = {
41334115
'current': HackathonEvent.objects.current().filter(visible=True).order_by('-start_date'),
41344116
'upcoming': HackathonEvent.objects.upcoming().filter(visible=True).order_by('-start_date'),
@@ -4139,7 +4121,6 @@ def get_hackathons(request):
41394121
'title': 'Hackathons',
41404122
'card_desc': "Gitcoin runs Virtual Hackathons. Learn, earn, and connect with the best hackers in the space -- only on Gitcoin.",
41414123
'events': events,
4142-
'tabs': tabs,
41434124
}
41444125
return TemplateResponse(request, 'dashboard/hackathon/hackathons.html', params)
41454126

0 commit comments

Comments
 (0)