]> git.parisson.com Git - teleforma.git/commitdiff
take the first user period for tabs
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 27 Jun 2014 10:11:49 +0000 (12:11 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 27 Jun 2014 10:11:49 +0000 (12:11 +0200)
teleforma/templates/telemeta/base.html

index 9158d3b924e51bfd77ef670031109dfa08ffcd15..ed295a0130350bdd3854f6abfd9fb184fe117cef 100644 (file)
@@ -112,16 +112,14 @@ alt="logo" />
   <li><a href="{% url teleforma-annals %}" class="yellow">{% trans "Annals" %}</a></li>
 
   {% if periods|length == 1 %}
-   {% with periods.0 as period %}
-      <li><a href="{% url teleforma-exam-scripts-pending period %}" class="green">&nbsp;{% trans "Scripts" %}&nbsp;
-      {% if user.is_staff or user.correctors.all %}{% untreated_scripts_count user period %}
-     {% else %}{% treated_scripts_count user period %}{% endif %}</a>
+      <li><a href="{% url teleforma-exam-scripts-pending periods.0 %}" class="green">&nbsp;{% trans "Scripts" %}&nbsp;
+      {% if user.is_staff or user.correctors.all %}{% untreated_scripts_count user periods.0 %}
+     {% else %}{% treated_scripts_count user periods.0 %}{% endif %}</a>
      </li>
-   {% endwith %}
   {% else %}
     <li><a href="#scripts#" class="green">&nbsp;{% trans "Scripts" %}&nbsp;
-     {% if user.is_staff or user.correctors.all %}{% untreated_scripts_count user period %}
-     {% else %}{% treated_scripts_count user period %}{% endif %}</a>
+     {% if user.is_staff or user.correctors.all %}{% untreated_scripts_count user periods.0 %}
+     {% else %}{% treated_scripts_count user periods.0 %}{% endif %}</a>
       <ul>
        {% for period in periods %}
         <li><a href="{% url teleforma-exam-scripts-pending period.id %}" class="green">{{ period.name }}</a></li>