diff --git a/webapp/static/css/ohlhafv_header.css b/webapp/static/css/ohlhafv_header.css new file mode 100644 index 0000000..9ac33d7 --- /dev/null +++ b/webapp/static/css/ohlhafv_header.css @@ -0,0 +1,37 @@ +.header-content { + +} + +.header-content .logo { + +} + +.header-content .logo img { + display: block; + height: auto; + margin: auto; +} + +.ohlhafv-banner { + max-width: 1000px; + margin-left: auto; + margin-right: auto; +} + +@media screen and (min-width: 1000px) { + .ohlhafv_header-content { + position: absolute; + left: 0; + top: 0; + background-color: #052f5f; + width: 100%; + } + + .ohlhafv_header { + margin-bottom: 331px; + } +} + +.ohlhafv-banner-image { + width: 100%; +} diff --git a/webapp/static/img/heevi_banner.svg b/webapp/static/img/heevi_banner.svg new file mode 100644 index 0000000..85a4b9b --- /dev/null +++ b/webapp/static/img/heevi_banner.svg @@ -0,0 +1,460 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webapp/templates/form_base.html b/webapp/templates/form_base.html new file mode 100644 index 0000000..8a6f883 --- /dev/null +++ b/webapp/templates/form_base.html @@ -0,0 +1,50 @@ + + +{% load i18n %} +{% load static %} +{% load staticfiles %} + + + + + + + + + {% trans "Aalto-yliopiston Sähköinsinöörikilta ry" %} + + + + + + + + + + + +
+ {% block header %} + {% endblock header %} +
+ + + +
+ {% block content %} + {% endblock %} +
+ + + + diff --git a/webapp/templates/ohlhafv/base.html b/webapp/templates/ohlhafv/base.html new file mode 100644 index 0000000..0692385 --- /dev/null +++ b/webapp/templates/ohlhafv/base.html @@ -0,0 +1,19 @@ +{% extends "form_base.html" %} + +{% load static %} +{% load i18n %} + +{% block header %} + {% include "ohlhafv/header.html" %} +{% endblock header %} + +{% block navigation %} + {% include "ohlhafv/navigation.html" %} +{% endblock %} + +{% block content %} +{% endblock %} + +{% block footer %} + {% include "kaehmy/kaehmy_footer.html" %} +{% endblock footer %} \ No newline at end of file diff --git a/webapp/templates/ohlhafv/header.html b/webapp/templates/ohlhafv/header.html new file mode 100644 index 0000000..5227112 --- /dev/null +++ b/webapp/templates/ohlhafv/header.html @@ -0,0 +1,8 @@ +{% load i18n %} + + +
+ +
diff --git a/webapp/templates/ohlhafv/list.html b/webapp/templates/ohlhafv/list.html new file mode 100644 index 0000000..822da25 --- /dev/null +++ b/webapp/templates/ohlhafv/list.html @@ -0,0 +1,25 @@ +{% extends "ohlhafv/base.html" %} + +{% load static %} +{% load i18n %} + +{% block content %} +
+

{% trans "All challenges" %}

+
+ +
+
{% trans "Total challenges:" %} {{ challenge_count }}
+
+ +{% for challenge in challenges %} +
+

{{ challenge.challenger }} vs. {{ challenge.victim }}

+
+
{{ challenge.series }}
+

{{ challenge.message|linebreaks|urlize }}

+
+
+{% endfor %} + +{% endblock content %} \ No newline at end of file diff --git a/webapp/templates/ohlhafv/navigation.html b/webapp/templates/ohlhafv/navigation.html new file mode 100644 index 0000000..53f3da3 --- /dev/null +++ b/webapp/templates/ohlhafv/navigation.html @@ -0,0 +1,10 @@ +{% load i18n %} + +
+ +
diff --git a/webapp/templates/ohlhafv/ohlhafv.html b/webapp/templates/ohlhafv/new.html similarity index 81% rename from webapp/templates/ohlhafv/ohlhafv.html rename to webapp/templates/ohlhafv/new.html index c4f658b..e7dca76 100644 --- a/webapp/templates/ohlhafv/ohlhafv.html +++ b/webapp/templates/ohlhafv/new.html @@ -1,8 +1,12 @@ -{% extends "webapp_base.html" %} +{% extends "ohlhafv/base.html" %} {% load bootstrap3 %} {% load i18n %} +{% block navigation %} + {% include "ohlhafv/navigation.html" %} +{% endblock %} + {% block content %}

{% trans "Ohlhafv" %}

diff --git a/webapp/templates/ohlhafv/ohlhafv_list.html b/webapp/templates/ohlhafv/ohlhafv_list.html deleted file mode 100644 index a693237..0000000 --- a/webapp/templates/ohlhafv/ohlhafv_list.html +++ /dev/null @@ -1,20 +0,0 @@ -{% extends "webapp_base.html" %} - -{% load static %} -{% load i18n %} -{% load django_tables2 %} - -{% block content %} -
- -
-

{% trans "All challenges" %}

-
- -
- {% trans "Total challenges:" %}{{ application_count }} -
- - {{ table|safe }} -
-{% endblock content %} diff --git a/webapp/views.py b/webapp/views.py index 818bcaf..82922f2 100644 --- a/webapp/views.py +++ b/webapp/views.py @@ -151,7 +151,7 @@ def contact_view(request, *args, **kwargs): def ohlhafv_view(request, *args, **kwargs): """Render Ohlhafv form page.""" form = OhlhafvForm() - return render(request, 'ohlhafv/ohlhafv.html', {'form': form}) + return render(request, 'ohlhafv/new.html', {'form': form}) @ensure_csrf_cookie @@ -173,20 +173,21 @@ def ohlhafv_submit(request, *args, **kwargs): def ohlhafv_list(request, *args, **kwargs): """Present Ohlhafv challenges list.""" challenges = OhlhafvChallenge.objects.all() + challenges = challenges.order_by('-id') - table = OhlhafvTable(challenges, - request=request, - exclude=['id', 'challenger_email', 'victim_email'], - attrs={'class': 'table table-bordered table-hover'}) + #table = OhlhafvTable(challenges, + # request=request, + # exclude=['id', 'challenger_email', 'victim_email'], + # attrs={'class': 'table table-bordered table-hover'}) - table.paginate(page=request.GET.get('page', 1), per_page=25) - table_html = table.as_html(request) + #table.paginate(page=request.GET.get('page', 1), per_page=25) + #table_html = table.as_html(request) context = { - 'table': table_html, + 'challenges': challenges, 'challenge_count': len(challenges), } - return render(request, 'ohlhafv/ohlhafv_list.html', context) + return render(request, 'ohlhafv/list.html', context) @ensure_csrf_cookie