fix - show answers in participant view for inactive assignments
[edumed.git] / stage2 / templates / stage2 / participant.html
index ec481f8..e6761d2 100644 (file)
 
   {% for assignment in assignments %}
     <h2>{{ assignment.title }} (do {{ assignment.deadline }})</h2>
-    {% if assignment.is_active %}
-      <p>{{ assignment.content|textile_pl }}</p>
-    {% endif %}
-    <form method="POST" action="{% url 'stage2_upload' assignment.id participant.id participant.key %}"
-          enctype="multipart/form-data">
+    <a href="{{ assignment.content_url }}"><strong>Zobacz treść zadania</strong></a>
+    <form method="POST" action="" enctype="multipart/form-data">
       {% csrf_token %}
-      {% for form, attachment in assignment.forms %}
+      {% 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 %}
+      {% for form, attachment in assignment.attachment_forms %}
+        {{ form.assignment_id }}
         <p><strong>{{ form.file.label }}:</strong></p>
         <p>
           {% if assignment.is_active %}{{ form.file }}{% endif %}
@@ -29,7 +35,7 @@
           {% endif %}
         </p>
       {% endfor %}
-      <input type="submit" value="Wyślij"/>
+      {% if assignment.is_active %}<input type="submit" value="Wyślij"/>{% endif %}
     </form>
   {% endfor %}