From 4aa539e5d93da275c6d882a864a735d5a23e98db Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Tue, 10 Jan 2017 11:08:16 +0100 Subject: [PATCH] answer counts and other minor improvements --- stage2/static/js/checkfile.js | 5 ++++- stage2/templates/stage2/answer_list.html | 11 +++++++---- stage2/templates/stage2/participant.html | 4 +++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/stage2/static/js/checkfile.js b/stage2/static/js/checkfile.js index f15c134..6d3782c 100644 --- a/stage2/static/js/checkfile.js +++ b/stage2/static/js/checkfile.js @@ -8,7 +8,10 @@ $(function() { var ext = this.getAttribute('data-ext'); var re = new RegExp('\\.(' + ext + ')$', 'i'); if (!re.exec(name)) { - alert('Błędne rozszerzenie! Powinno być jedno z: ' + ext.replace(/\|/g, ', ')); + if (/\|/.exec(ext)) + alert('Błędne rozszerzenie! Powinno być jedno z: ' + ext.replace(/\|/g, ', ')); + else + alert('Błędne rozszerzenie! Powinno być: ' + ext); ok = false; } } diff --git a/stage2/templates/stage2/answer_list.html b/stage2/templates/stage2/answer_list.html index 42f90db..aa00891 100644 --- a/stage2/templates/stage2/answer_list.html +++ b/stage2/templates/stage2/answer_list.html @@ -5,11 +5,14 @@

{% if marked %}Ocenione odpowiedzi{% else %}Odpowiedzi do oceny{% endif %}

Zadanie {{ assignment.title }} (max {{ assignment.max_points }} pkt)

{% if assignment.is_active %}Możliwość oceniania zostanie włączona po terminie wysyłania rozwiązań{% endif %}

- {% if marked %} -

Przejdź do odpowiedzi do oceny

- {% else %} -

Przejdź do ocenionych odpowiedzi

+ {% if not assignment.is_active %} + {% if marked %} +

Przejdź do odpowiedzi do oceny

+ {% else %} +

Przejdź do ocenionych odpowiedzi

+ {% endif %} {% endif %} +

{% if not marked and not assignment.is_active %}Pozostało {% endif %}{{ answers|length }} odpowiedzi

{% for answer in answers %}

{{ answer.participant }}

{% for label, attachment in answer.attachments %} diff --git a/stage2/templates/stage2/participant.html b/stage2/templates/stage2/participant.html index f369bb4..ec481f8 100644 --- a/stage2/templates/stage2/participant.html +++ b/stage2/templates/stage2/participant.html @@ -11,7 +11,9 @@ {% for assignment in assignments %}

{{ assignment.title }} (do {{ assignment.deadline }})

-

{{ assignment.content|textile_pl }}

+ {% if assignment.is_active %} +

{{ assignment.content|textile_pl }}

+ {% endif %}
{% csrf_token %} -- 2.20.1