stage 2: nice button
[edumed.git] / stage2 / templates / stage2 / participant.html
index f8ca87d..2b5e3d4 100644 (file)
@@ -1,28 +1,45 @@
-{% extends 'base_super.html' %}
+{% extends 'base.html' %}
+{% load textile_pl from fnp_markup %}
+{% load chunks %}
 
-{% block title %}Drugi etap{% endblock %}
+{% block title %}II etap{% endblock %}
 
 {% block body %}
-  <h1>Drugi etap Olimpiady Cyfrowej</h1>
+  <h1>II etap Olimpiady Cyfrowej</h1>
+
+  {% chunk 'stage2_header' %}
 
   {% for assignment in assignments %}
-    <h2>{{ assignment.title }} (do {{ assignment.deadline }})</h2>
-    <p>{{ assignment.content }}</p>
-    <form method="POST" action="{% url 'stage2_upload' assignment.id participant.id participant.key %}"
-          enctype="multipart/form-data">
+    {% if assignment.title %}
+      <h2>{{ assignment.title }} (do {{ assignment.deadline }})</h2>
+    {% endif %}
+    <p class="box-button" style="max-width: 15em;">
+      <a href="{{ assignment.content_url }}" target="_blank" class="nice-button"><strong>Zobacz treść zadania</strong></a>
+    </p>
+    <form method="POST" action="" enctype="multipart/form-data" class="submit-form">
       {% csrf_token %}
-      {% for form, attachment in assignment.forms %}
+      {% for form, attachment in assignment.attachment_forms %}
+        {{ form.assignment_id }}
         <p><strong>{{ form.file.label }}:</strong></p>
         <p>
-          {% if assignment.active %}{{ form.file }}{% endif %}
+          {% if assignment.is_active %}{{ form.file }}{% endif %}
           {% if attachment.file %}
             <a href="{{ attachment.download_url }}">{{ attachment.filename }}</a>
+            ({{ attachment.file.size|filesizeformat }})
           {% else %}
             (nie wysłano pliku)
           {% endif %}
         </p>
       {% endfor %}
-      <input type="submit" value="Wyślij"/>
+      {% for form in assignment.field_forms %}
+        {{ form.assignment_id }}
+        <p><strong>{{ form.value.label }}:</strong></p>
+        {{ form.value.errors }}
+        <p>
+          {% if assignment.is_active %}{{ form.value }}{% else %}{{ form.value.value }}{% endif %}
+        </p>
+      {% endfor %}
+      {% if assignment.is_active %}<input type="submit" value="Zapisz"/>{% endif %}
     </form>
   {% endfor %}