diff --git a/contest/views.py b/contest/views.py index cad2dc3..f226b95 100644 --- a/contest/views.py +++ b/contest/views.py @@ -29,8 +29,9 @@ def contestIndex(request): #messages.success(request, "Great Success") qsoform = QSOForm(request.user) contest = Contest.objects.get(id=1) + qrgs = Frequency.objects.filter(band__contest=contest).order_by("channel") - return render(request, 'contest/index.html', {"qsoform": qsoform, "contest": contest}) + return render(request, 'contest/index.html', {"qsoform": qsoform, "contest": contest, "qrgs": qrgs}) @login_required def log(request): diff --git a/templates/base.html b/templates/base.html index 2d1f27e..77ec846 100644 --- a/templates/base.html +++ b/templates/base.html @@ -45,7 +45,7 @@ Log {% endif %} {% if user.is_staff %} - Register Refs! + Register Users {% endif %} {% else %} Home diff --git a/templates/contest/contestPanel.html b/templates/contest/contestPanel.html new file mode 100644 index 0000000..df41afd --- /dev/null +++ b/templates/contest/contestPanel.html @@ -0,0 +1,13 @@ +
+

The Contest

+
+

+ Welcome to {{ contest.name }}! +

+

We might be laid back people here at {{ contest.name }}, but we have some rules!

+

The QRG-changing is a serious thing. Also there is other stuff. But + maybe it's funnier if you find that out by yourself. And we punish you for not knowing. Such + is live. +

+
+
diff --git a/templates/contest/index.html b/templates/contest/index.html index 7b473bd..a1443b6 100644 --- a/templates/contest/index.html +++ b/templates/contest/index.html @@ -2,6 +2,8 @@ {% block content %}

Welcome, {{ user }}

+
+
{% if user.ref %} {# user has a reference, we can start logging QSOs! #}
@@ -52,5 +54,14 @@
{% endif %} +
+
+ {% include "contest/contestPanel.html" with contest=contest %} +
+
+ {% include "contest/qrgPanel.html" with contest=contest qrgs=qrgs %} +
+ + {% endblock %} diff --git a/templates/contest/overview.html b/templates/contest/overview.html index 51c03c4..f6cd651 100644 --- a/templates/contest/overview.html +++ b/templates/contest/overview.html @@ -4,48 +4,10 @@

Contest Rules && Overview!

-
-

The Contest

-
-

- Welcome to {{ contest.name }}! -

-

We might be laid back people here at {{ contest.name }}, but we have some rules!

-

The QRG-changing is a serious thing. Also there is other stuff. But - maybe it's funnier if you find that out by yourself. And we punish you for not knowing. Such - is live. -

-
-
+ {% include "contest/contestPanel.html" with contest=contest %}
-
-

QRGs

-
-

The following frequencies may be used in this contest

- - - - - - - - - - - {% for qrg in qrgs %} - - - - - - - {% endfor %} - -
ChannelBandQRGNote
{{ qrg.channel }}{{ qrg.band }}{{ qrg.qrg }}{{ qrg.note }}
-
-
+ {% include "contest/qrgPanel.html" with contest=contest qrgs=qrgs %}
{% endblock %} - diff --git a/templates/contest/qrgPanel.html b/templates/contest/qrgPanel.html new file mode 100644 index 0000000..7e72504 --- /dev/null +++ b/templates/contest/qrgPanel.html @@ -0,0 +1,26 @@ +
+

QRGs

+
+

The following frequencies may be used in this contest

+ + + + + + + + + + + {% for qrg in qrgs %} + + + + + + + {% endfor %} + +
ChannelBandQRGNote
{{ qrg.channel }}{{ qrg.band }}{{ qrg.qrg }}{{ qrg.note }}
+
+