From c490d4482629d47b1b1a8d3ab10b63733dfd7b79 Mon Sep 17 00:00:00 2001 From: Felipe Henrique de Almeida Bormann Date: Tue, 3 Jan 2017 15:09:15 -0300 Subject: [PATCH] fixed coordinators on subject and improved accordion, still has failures and things to work on, added other improvements in functionality --- amadeus/static/css/base/amadeus.css | 6 +++--- categories/views.py | 4 +--- subjects/templates/subjects/list.html | 27 +++++++++++++++++++++------ subjects/templates/subjects/subject_card.html | 34 ++++++++++++++++++++++++++++++++++ subjects/urls.py | 1 + subjects/views.py | 19 ++++++++++++++++--- 6 files changed, 76 insertions(+), 15 deletions(-) create mode 100644 subjects/templates/subjects/subject_card.html diff --git a/amadeus/static/css/base/amadeus.css b/amadeus/static/css/base/amadeus.css index 4862770..cba0e62 100755 --- a/amadeus/static/css/base/amadeus.css +++ b/amadeus/static/css/base/amadeus.css @@ -92,17 +92,17 @@ height: 30px; } -.core-subjects-options > li{ +.core-subjects-options li{ float:left; padding: 10px; background-color: #FFFFFF; margin: 1px; - border-bottom: 4px; + border-bottom: 10px; border-bottom-style: solid; } -.core-subjects-options > li.active{ +.core-subjects-options li.active{ border-bottom-color: green; } diff --git a/categories/views.py b/categories/views.py index 8ff0f14..429671b 100644 --- a/categories/views.py +++ b/categories/views.py @@ -56,10 +56,8 @@ class IndexView(views.SuperuserRequiredMixin, LoginRequiredMixin, ListView): def get_context_data(self, **kwargs): context = super(IndexView, self).get_context_data(**kwargs) - list_categories = None - categories = self.get_queryset().order_by('name') - + categories = self.get_queryset().order_by('name') context['categories'] = categories return context diff --git a/subjects/templates/subjects/list.html b/subjects/templates/subjects/list.html index 61bc520..dc7e9b6 100644 --- a/subjects/templates/subjects/list.html +++ b/subjects/templates/subjects/list.html @@ -22,8 +22,14 @@ {% endif %}
@@ -70,10 +76,10 @@ -
+
- {% if coordinators %} + {% if category.coordinators.all|length > 0 %}

{% trans "Coordinator(s): " %} {% for coordinator in category.coordinators.all %} {{coordinator.social_name}} @@ -85,12 +91,21 @@ {{category.description|safe}} + + + {% if user in category.coordinators.all %} {% endif %} - +
+ {% for subject in category.subjects %} + {% include "subjects/subject_card.html" %} + {% endfor %} +
+ +

- + {% comment %}
diff --git a/subjects/templates/subjects/subject_card.html b/subjects/templates/subjects/subject_card.html new file mode 100644 index 0000000..fc130c9 --- /dev/null +++ b/subjects/templates/subjects/subject_card.html @@ -0,0 +1,34 @@ +{% load static i18n permission_tags %} +
+
+
+
+

+ + {{subject.name}} + +

+ +
+ + + + +
+ +
+
+
+ +
+

{{subject.init_date}}

+

{{subject.end_date}}

+ +

{{subject.description_brief|safe}}

+ + + + +
+ +
\ No newline at end of file diff --git a/subjects/urls.py b/subjects/urls.py index e2b240e..403c033 100644 --- a/subjects/urls.py +++ b/subjects/urls.py @@ -3,5 +3,6 @@ from . import views urlpatterns = [ url(r'^$', views.IndexView.as_view(), name='index'), + url(r'^(?P