From e4ad011b0c8eceb69a4f99497f646f7ca8788198 Mon Sep 17 00:00:00 2001 From: Zambom Date: Wed, 4 Jan 2017 16:33:42 -0200 Subject: [PATCH] Adjusting subjects presention in manage categories --- categories/templates/categories/list.html | 254 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------- 1 file changed, 112 insertions(+), 142 deletions(-) diff --git a/categories/templates/categories/list.html b/categories/templates/categories/list.html index feea2fb..bb60a86 100755 --- a/categories/templates/categories/list.html +++ b/categories/templates/categories/list.html @@ -38,165 +38,135 @@
{% for category in categories %} - {% if category.visible %} - - -
-
-
-
-

- - {{category.name}} - -

- {% if user.is_staff or user in category.coordinators.all %} -
-
- - + {% if category.visible %} +
+
+
+
+

+ + {{category.name}} + +

+ {% if user.is_staff or user in category.coordinators.all %} +
+
+ + +
-
- {% else %} -
-
- {% endif %} - + {% else %} +
+
+ {% endif %} +
- +
-
-
- - - {% if category.coordinators.all|length > 0 %} -

{% trans "Coordinator(s) " %}: - {{ category.coordinators.all|join:', ' }} -

- {% else %} -

{% trans "It doesn't possess coordinators" %}

- {% endif %} - - {{category.description|safe}} - - {% if user in category.coordinators.all %} - - {% endif %} -
- {% for subject in category.subjects %} - {% include "subjects/subject_card.html" %} - {% endfor %} -
- - -
+
+ + + + {% if category.coordinators.all|length > 0 %} +

{% trans "Coordinator(s) " %}: + {{ category.coordinators.all|join:', ' }} +

+ {% else %} +

{% trans "It doesn't possess coordinators" %}

+ {% endif %} + + {{category.description|safe}} + + {% if user in category.coordinators.all %} + + {% endif %} - - - - {% comment %} -
- {% for subject in subjects %} - {% include "categories/category_card.html" %} - {% endfor %} +
+ {% for subject in category.subject_category.all %} + {% include "subjects/subject_card.html" %} + {% endfor %} +
- {% endcomment %} -
- +
{% elif request.user in category.coordinators.all or request.user.is_staff %} - - - -
-
-
-
-

- - {{category.name}} - -

- {% if user.is_staff or user in category.coordinators.all %} -
-
- - +
+
+
+
+

+ + {{category.name}} + +

+ {% if user.is_staff or user in category.coordinators.all %} +
+
+ + +
-
- {% else %} -
-
- {% endif %} - -
- - - - -
- + {% else %} +
+
+ {% endif %} + +
+ + + + +
+ +
-
-
- - - {% if category.coordinators.all|length > 0 %} -

{% trans "Coordinator(s) " %}: - {{ category.coordinators.all|join:', ' }} -

- {% else %} -

{% trans "It doesn't possess coordinators" %}

- {% endif %} - - {{category.description|safe}} - - {% if user in category.coordinators.all %} - - {% endif %} -
- {% for subject in category.subjects %} - {% include "subjects/subject_card.html" %} - {% endfor %} +
+ + + + {% if category.coordinators.all|length > 0 %} +

{% trans "Coordinator(s) " %}: + {{ category.coordinators.all|join:', ' }} +

+ {% else %} +

{% trans "It doesn't possess coordinators" %}

+ {% endif %} + + {{category.description|safe}} + + {% if user in category.coordinators.all %} + + {% endif %} + +
+ {% for subject in category.subject_category.all %} + {% include "subjects/subject_card.html" %} + {% endfor %} +
- -
- - - - - {% comment %} -
- {% for subject in subjects %} - {% include "categories/category_card.html" %} - {% endfor %} -
- {% endcomment %} -
- {% endif %} {% endfor %}
-- libgit2 0.21.2