Commit e70ce349be0952d2f66148eef7cfc12256745274
1 parent
1fa1cff5
Exists in
master
and in
3 other branches
resolvendo bugs do tipo Quando a categoria tem um assunto com o mesmo nome, est…
…e assunto não abre, apenas fecha a categoria.
Showing
9 changed files
with
94 additions
and
94 deletions
Show diff stats
amadeus/static/js/category.js
@@ -110,7 +110,7 @@ function bindCollapse() { | @@ -110,7 +110,7 @@ function bindCollapse() { | ||
110 | var btn = $(this).parent().find('.fa-angle-right'); | 110 | var btn = $(this).parent().find('.fa-angle-right'); |
111 | 111 | ||
112 | btn = btn[0]; | 112 | btn = btn[0]; |
113 | - | 113 | + |
114 | $(btn).switchClass("fa-angle-right", "fa-angle-down", 250, "easeInOutQuad"); | 114 | $(btn).switchClass("fa-angle-right", "fa-angle-down", 250, "easeInOutQuad"); |
115 | 115 | ||
116 | var url = $(this).parent().find('.log_url').val(); | 116 | var url = $(this).parent().find('.log_url').val(); |
@@ -136,9 +136,9 @@ function bindCollapse() { | @@ -136,9 +136,9 @@ function bindCollapse() { | ||
136 | $('.collapse').on('hide.bs.collapse', function (e) { | 136 | $('.collapse').on('hide.bs.collapse', function (e) { |
137 | if($(this).is(e.target)){ | 137 | if($(this).is(e.target)){ |
138 | var btn = $(this).parent().find('.fa-angle-down'); | 138 | var btn = $(this).parent().find('.fa-angle-down'); |
139 | - | 139 | + |
140 | btn = btn[0]; | 140 | btn = btn[0]; |
141 | - | 141 | + |
142 | $(btn).switchClass("fa-angle-down", "fa-angle-right", 250, "easeInOutQuad"); | 142 | $(btn).switchClass("fa-angle-down", "fa-angle-right", 250, "easeInOutQuad"); |
143 | 143 | ||
144 | var url = $(this).parent().find('.log_url').val(); | 144 | var url = $(this).parent().find('.log_url').val(); |
@@ -165,7 +165,7 @@ $('.category-panel-content').on('shown.bs.collapse', function(e) { | @@ -165,7 +165,7 @@ $('.category-panel-content').on('shown.bs.collapse', function(e) { | ||
165 | if($(this).is(e.target)){ | 165 | if($(this).is(e.target)){ |
166 | var panel_id = $(this).attr('id'); | 166 | var panel_id = $(this).attr('id'); |
167 | var holder = $(this).find('.holder'); | 167 | var holder = $(this).find('.holder'); |
168 | - | 168 | + |
169 | if ($('#' + panel_id + '-accordion').children().length == 0) { | 169 | if ($('#' + panel_id + '-accordion').children().length == 0) { |
170 | var load_sub_url = $(this).find('.load_sub_url').val(); | 170 | var load_sub_url = $(this).find('.load_sub_url').val(); |
171 | 171 | ||
@@ -209,7 +209,7 @@ $('.category-panel-content').on('hidden.bs.collapse', function(e) { | @@ -209,7 +209,7 @@ $('.category-panel-content').on('hidden.bs.collapse', function(e) { | ||
209 | if($(this).is(e.target)){ | 209 | if($(this).is(e.target)){ |
210 | var panel_id = $(this).attr('id'); | 210 | var panel_id = $(this).attr('id'); |
211 | var holder = $(this).find('.holder'); | 211 | var holder = $(this).find('.holder'); |
212 | - | 212 | + |
213 | var items = $('#' + panel_id + '-accordion').children(":visible").length; | 213 | var items = $('#' + panel_id + '-accordion').children(":visible").length; |
214 | 214 | ||
215 | if (items > 10) { | 215 | if (items > 10) { |
@@ -229,4 +229,4 @@ function delete_group(url) { | @@ -229,4 +229,4 @@ function delete_group(url) { | ||
229 | 229 | ||
230 | $('.modal').modal('show'); | 230 | $('.modal').modal('show'); |
231 | }); | 231 | }); |
232 | -} | ||
233 | \ No newline at end of file | 232 | \ No newline at end of file |
233 | +} |
categories/templates/categories/list.html
@@ -40,7 +40,7 @@ | @@ -40,7 +40,7 @@ | ||
40 | <li>{% trans "all subjects" %}</li> | 40 | <li>{% trans "all subjects" %}</li> |
41 | </ul> | 41 | </ul> |
42 | </div> | 42 | </div> |
43 | - {% endif %} | 43 | + {% endif %} |
44 | 44 | ||
45 | <!-- Code for listing categories --> | 45 | <!-- Code for listing categories --> |
46 | <div class="col-md-12 cards-content"> | 46 | <div class="col-md-12 cards-content"> |
@@ -52,14 +52,14 @@ | @@ -52,14 +52,14 @@ | ||
52 | <div class="row"> | 52 | <div class="row"> |
53 | <div class="col-md-12 category-header"> | 53 | <div class="col-md-12 category-header"> |
54 | <h4 class="panel-title"> | 54 | <h4 class="panel-title"> |
55 | - <a class="category-course-link pull-left" data-parent="#accordion" data-toggle="collapse" href="#{{category.slug}}"> | 55 | + <a class="category-course-link pull-left" data-parent="#accordion" data-toggle="collapse" href="#{{category.slug}}_category"> |
56 | <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{category.name}} | 56 | <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{category.name}} |
57 | </a> | 57 | </a> |
58 | </h4> | 58 | </h4> |
59 | - | 59 | + |
60 | <div class="col-md-5 pull-right category-card-items"> | 60 | <div class="col-md-5 pull-right category-card-items"> |
61 | {% if user.is_staff or user in category.coordinators.all %} | 61 | {% if user.is_staff or user in category.coordinators.all %} |
62 | - <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | 62 | + <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
63 | <i class="fa fa-ellipsis-v" aria-hidden="true"></i> | 63 | <i class="fa fa-ellipsis-v" aria-hidden="true"></i> |
64 | </a> | 64 | </a> |
65 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> | 65 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> |
@@ -78,10 +78,10 @@ | @@ -78,10 +78,10 @@ | ||
78 | </div> | 78 | </div> |
79 | </div> | 79 | </div> |
80 | </div> | 80 | </div> |
81 | - <div id="{{category.slug}}" class="panel-collapse panel-body collapse category-panel-content"> | 81 | + <div id="{{category.slug}}_category" class="panel-collapse panel-body collapse category-panel-content"> |
82 | <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" /> | 82 | <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" /> |
83 | <input type="hidden" class="log_id" value="" /> | 83 | <input type="hidden" class="log_id" value="" /> |
84 | - | 84 | + |
85 | {% if category.coordinators.all|length > 0 %} | 85 | {% if category.coordinators.all|length > 0 %} |
86 | <h4><b>{% trans "Coordinator(s) " %}: </b> | 86 | <h4><b>{% trans "Coordinator(s) " %}: </b> |
87 | {{ category.coordinators.all|join:', ' }} | 87 | {{ category.coordinators.all|join:', ' }} |
@@ -89,7 +89,7 @@ | @@ -89,7 +89,7 @@ | ||
89 | {% else %} | 89 | {% else %} |
90 | <h4> {% trans "It doesn't possess coordinators" %} </h4> | 90 | <h4> {% trans "It doesn't possess coordinators" %} </h4> |
91 | {% endif %} | 91 | {% endif %} |
92 | - | 92 | + |
93 | {{category.description|safe}} | 93 | {{category.description|safe}} |
94 | </div> | 94 | </div> |
95 | </div> | 95 | </div> |
@@ -99,14 +99,14 @@ | @@ -99,14 +99,14 @@ | ||
99 | <div class="row"> | 99 | <div class="row"> |
100 | <div class="col-md-12 category-header"> | 100 | <div class="col-md-12 category-header"> |
101 | <h4 class="panel-title"> | 101 | <h4 class="panel-title"> |
102 | - <a class="category-course-link pull-left" data-parent="#accordion" data-toggle="collapse" href="#{{category.slug}}"> | 102 | + <a class="category-course-link pull-left" data-parent="#accordion" data-toggle="collapse" href="#{{category.slug}}_category"> |
103 | <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{category.name}} | 103 | <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{category.name}} |
104 | </a> | 104 | </a> |
105 | </h4> | 105 | </h4> |
106 | 106 | ||
107 | <div class="col-md-5 pull-right category-card-items"> | 107 | <div class="col-md-5 pull-right category-card-items"> |
108 | {% if user.is_staff or user in category.coordinators.all %} | 108 | {% if user.is_staff or user in category.coordinators.all %} |
109 | - <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | 109 | + <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
110 | <i class="fa fa-ellipsis-v" aria-hidden="true"></i> | 110 | <i class="fa fa-ellipsis-v" aria-hidden="true"></i> |
111 | </a> | 111 | </a> |
112 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> | 112 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> |
@@ -121,10 +121,10 @@ | @@ -121,10 +121,10 @@ | ||
121 | </div> | 121 | </div> |
122 | </div> | 122 | </div> |
123 | </div> | 123 | </div> |
124 | - <div id="{{category.slug}}" class="panel-collapse panel-body collapse category-panel-content"> | 124 | + <div id="{{category.slug}}_category" class="panel-collapse panel-body collapse category-panel-content"> |
125 | <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" /> | 125 | <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" /> |
126 | <input type="hidden" class="log_id" value="" /> | 126 | <input type="hidden" class="log_id" value="" /> |
127 | - | 127 | + |
128 | {% if category.coordinators.all|length > 0 %} | 128 | {% if category.coordinators.all|length > 0 %} |
129 | <h4><b>{% trans "Coordinator(s) " %}: </b> | 129 | <h4><b>{% trans "Coordinator(s) " %}: </b> |
130 | {{ category.coordinators.all|join:', ' }} | 130 | {{ category.coordinators.all|join:', ' }} |
@@ -132,7 +132,7 @@ | @@ -132,7 +132,7 @@ | ||
132 | {% else %} | 132 | {% else %} |
133 | <h4> {% trans "It doesn't possess coordinators" %} </h4> | 133 | <h4> {% trans "It doesn't possess coordinators" %} </h4> |
134 | {% endif %} | 134 | {% endif %} |
135 | - | 135 | + |
136 | {{category.description|safe}} | 136 | {{category.description|safe}} |
137 | </div> | 137 | </div> |
138 | </div> | 138 | </div> |
subjects/templates/subjects/initial.html
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | </div> | 13 | </div> |
14 | {% endfor %} | 14 | {% endfor %} |
15 | {% endif %} | 15 | {% endif %} |
16 | - | 16 | + |
17 | 17 | ||
18 | 18 | ||
19 | 19 | ||
@@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
43 | <li class="small"><a href="{% url 'subjects:search' %}?search={{tag.0}}">{{tag.0}}</a></li> | 43 | <li class="small"><a href="{% url 'subjects:search' %}?search={{tag.0}}">{{tag.0}}</a></li> |
44 | {% endif %} | 44 | {% endif %} |
45 | 45 | ||
46 | - | 46 | + |
47 | {% endfor %} | 47 | {% endfor %} |
48 | </ul> | 48 | </ul> |
49 | </div> | 49 | </div> |
@@ -77,7 +77,7 @@ | @@ -77,7 +77,7 @@ | ||
77 | <li class="small"><a href="{% url 'subjects:search' %}?search={{tag.0}}">{{tag.0}}</a></li> | 77 | <li class="small"><a href="{% url 'subjects:search' %}?search={{tag.0}}">{{tag.0}}</a></li> |
78 | {% endif %} | 78 | {% endif %} |
79 | 79 | ||
80 | - | 80 | + |
81 | {% endfor %} | 81 | {% endfor %} |
82 | </ul> | 82 | </ul> |
83 | </div> | 83 | </div> |
@@ -85,10 +85,10 @@ | @@ -85,10 +85,10 @@ | ||
85 | {% endif %} | 85 | {% endif %} |
86 | 86 | ||
87 | 87 | ||
88 | - | ||
89 | - | ||
90 | - | ||
91 | - | 88 | + |
89 | + | ||
90 | + | ||
91 | + | ||
92 | <div class="col-md-12 cards-content"> | 92 | <div class="col-md-12 cards-content"> |
93 | <h2 class=" my-subjects-title"><b><i>{% trans "My Subjects" %} ({{ total_subs }})</i></b></h2> | 93 | <h2 class=" my-subjects-title"><b><i>{% trans "My Subjects" %} ({{ total_subs }})</i></b></h2> |
94 | 94 | ||
@@ -97,7 +97,7 @@ | @@ -97,7 +97,7 @@ | ||
97 | {% for subject in subjects %} | 97 | {% for subject in subjects %} |
98 | {% include "subjects/subject_card.html" with accordion_id="subject-accordion" %} | 98 | {% include "subjects/subject_card.html" with accordion_id="subject-accordion" %} |
99 | {% endfor %} | 99 | {% endfor %} |
100 | - | 100 | + |
101 | {% pagination request paginator page_obj %} | 101 | {% pagination request paginator page_obj %} |
102 | </div> | 102 | </div> |
103 | {% else %} | 103 | {% else %} |
@@ -110,9 +110,9 @@ | @@ -110,9 +110,9 @@ | ||
110 | 110 | ||
111 | <div id="modal_subject"></div> | 111 | <div id="modal_subject"></div> |
112 | {% if user.is_staff %} | 112 | {% if user.is_staff %} |
113 | - <script type="text/javascript" src="{% static "js/charts/home.js" %}"></script> | 113 | + <script type="text/javascript" src="{% static 'js/charts/home.js' %}"></script> |
114 | {% endif %} | 114 | {% endif %} |
115 | - | ||
116 | - <script type="text/javascript" src="{% static "subjects/js/modal_subject.js" %}"></script> | 115 | + |
116 | + <script type="text/javascript" src="{% static 'subjects/js/modal_subject.js' %}"></script> | ||
117 | <script type="text/javascript" src="{% static 'js/category.js' %}"></script> | 117 | <script type="text/javascript" src="{% static 'js/category.js' %}"></script> |
118 | -{% endblock content %} | ||
119 | \ No newline at end of file | 118 | \ No newline at end of file |
119 | +{% endblock content %} |
subjects/templates/subjects/list.html
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | 5 | ||
6 | {% block javascript%} | 6 | {% block javascript%} |
7 | {{ block.super }} | 7 | {{ block.super }} |
8 | - <script type="text/javascript" src=" {% static "subjects/js/modal_subject.js" %} "></script> | 8 | + <script type="text/javascript" src=" {% static 'subjects/js/modal_subject.js' %} "></script> |
9 | {% endblock%} | 9 | {% endblock%} |
10 | 10 | ||
11 | {% block breadcrumbs %} | 11 | {% block breadcrumbs %} |
@@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
39 | <a href="{% url 'subjects:index' %}"><li class="active">{% trans "My subjects" %} ({{ totals.my_subjects }})</li></a> | 39 | <a href="{% url 'subjects:index' %}"><li class="active">{% trans "My subjects" %} ({{ totals.my_subjects }})</li></a> |
40 | <a href="{% url 'subjects:index' 'all' %}" ><li>{% trans "All subjects" %} ({{ totals.all_subjects }})</li></a> | 40 | <a href="{% url 'subjects:index' 'all' %}" ><li>{% trans "All subjects" %} ({{ totals.all_subjects }})</li></a> |
41 | {% endif %} | 41 | {% endif %} |
42 | - | 42 | + |
43 | </ul> | 43 | </ul> |
44 | </div> | 44 | </div> |
45 | 45 | ||
@@ -54,9 +54,9 @@ | @@ -54,9 +54,9 @@ | ||
54 | <div class="row"> | 54 | <div class="row"> |
55 | <div class="col-md-12 category-header"> | 55 | <div class="col-md-12 category-header"> |
56 | <h4 class="panel-title"> | 56 | <h4 class="panel-title"> |
57 | - <a class="category-course-link pull-left" data-parent="#accordion" data-toggle="collapse" href="#{{category.slug}}"> | ||
58 | - <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{ category.name }} | ||
59 | - | 57 | + <a class="category-course-link pull-left" data-parent="#accordion" data-toggle="collapse" href="#{{category.slug}}_category"> |
58 | + <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{ category.name }} | ||
59 | + | ||
60 | {% if not all %} | 60 | {% if not all %} |
61 | ({{ category|subject_count:user }}) | 61 | ({{ category|subject_count:user }}) |
62 | {% else %} | 62 | {% else %} |
@@ -64,10 +64,10 @@ | @@ -64,10 +64,10 @@ | ||
64 | {% endif %} | 64 | {% endif %} |
65 | </a> | 65 | </a> |
66 | </h4> | 66 | </h4> |
67 | - | 67 | + |
68 | <div class="col-md-5 pull-right category-card-items"> | 68 | <div class="col-md-5 pull-right category-card-items"> |
69 | {% if request.user.is_staff or user in category.coordinators.all %} | 69 | {% if request.user.is_staff or user in category.coordinators.all %} |
70 | - <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | 70 | + <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
71 | <i class="fa fa-ellipsis-v" aria-hidden="true"></i> | 71 | <i class="fa fa-ellipsis-v" aria-hidden="true"></i> |
72 | </a> | 72 | </a> |
73 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> | 73 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> |
@@ -79,17 +79,17 @@ | @@ -79,17 +79,17 @@ | ||
79 | <a href="javascript:delete_course.get('{% url 'categories:delete' category.slug %}?view=index','#category','#modal_course')" aria-hidden="true"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans 'Remove' %}</a></li> | 79 | <a href="javascript:delete_course.get('{% url 'categories:delete' category.slug %}?view=index','#category','#modal_course')" aria-hidden="true"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans 'Remove' %}</a></li> |
80 | </ul> | 80 | </ul> |
81 | {% endif %} | 81 | {% endif %} |
82 | - | 82 | + |
83 | </div> | 83 | </div> |
84 | </div> | 84 | </div> |
85 | </div> | 85 | </div> |
86 | </div> | 86 | </div> |
87 | - <div id="{{category.slug}}" class="panel-collapse panel-body collapse category-panel-content"> | 87 | + <div id="{{category.slug}}_category" class="panel-collapse panel-body collapse category-panel-content"> |
88 | <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" /> | 88 | <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" /> |
89 | <input type="hidden" class="log_id" value="" /> | 89 | <input type="hidden" class="log_id" value="" /> |
90 | 90 | ||
91 | <input type="hidden" class="load_sub_url" value="{% url 'subjects:load_view' category.slug %}" /> | 91 | <input type="hidden" class="load_sub_url" value="{% url 'subjects:load_view' category.slug %}" /> |
92 | - | 92 | + |
93 | {% if category.coordinators.all|length > 0 %} | 93 | {% if category.coordinators.all|length > 0 %} |
94 | <h4><b>{% trans "Coordinator(s) " %}: </b> | 94 | <h4><b>{% trans "Coordinator(s) " %}: </b> |
95 | {{ category.coordinators.all|join:', ' }} | 95 | {{ category.coordinators.all|join:', ' }} |
@@ -97,16 +97,16 @@ | @@ -97,16 +97,16 @@ | ||
97 | {% else %} | 97 | {% else %} |
98 | <h4> {% trans "It doesn't possess coordinators" %} </h4> | 98 | <h4> {% trans "It doesn't possess coordinators" %} </h4> |
99 | {% endif %} | 99 | {% endif %} |
100 | - | 100 | + |
101 | {{category.description|safe}} | 101 | {{category.description|safe}} |
102 | - | 102 | + |
103 | {% if request.user in category.coordinators.all or request.user.is_staff %} | 103 | {% if request.user in category.coordinators.all or request.user.is_staff %} |
104 | <a href="{% url 'subjects:create' category.slug %}" class="btn btn-raised btn-success btn-block btn-sm">{% trans "Create new subject" %}</a> | 104 | <a href="{% url 'subjects:create' category.slug %}" class="btn btn-raised btn-success btn-block btn-sm">{% trans "Create new subject" %}</a> |
105 | {% endif %} | 105 | {% endif %} |
106 | - | ||
107 | - <div class="panel-group subject-group" id="{{ category.slug }}-accordion" role="tablist" aria-multiselectable="true"> | ||
108 | - | ||
109 | - </div> | 106 | + |
107 | + <div class="panel-group subject-group" id="{{ category.slug }}_category-accordion" role="tablist" aria-multiselectable="true"> | ||
108 | + | ||
109 | + </div> | ||
110 | <div class="holder text-center"></div> | 110 | <div class="holder text-center"></div> |
111 | </div> | 111 | </div> |
112 | </div> | 112 | </div> |
@@ -116,8 +116,8 @@ | @@ -116,8 +116,8 @@ | ||
116 | <div class="row"> | 116 | <div class="row"> |
117 | <div class="col-md-12 category-header"> | 117 | <div class="col-md-12 category-header"> |
118 | <h4 class="panel-title"> | 118 | <h4 class="panel-title"> |
119 | - <a class="category-course-link pull-left" data-parent="#accordion" data-toggle="collapse" href="#{{category.slug}}"> | ||
120 | - <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{category.name}} | 119 | + <a class="category-course-link pull-left" data-parent="#accordion" data-toggle="collapse" href="#{{category.slug}}_category"> |
120 | + <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{category.name}} | ||
121 | 121 | ||
122 | {% if not all %} | 122 | {% if not all %} |
123 | ({{ category|subject_count:user }}) | 123 | ({{ category|subject_count:user }}) |
@@ -126,10 +126,10 @@ | @@ -126,10 +126,10 @@ | ||
126 | {% endif %} | 126 | {% endif %} |
127 | </a> | 127 | </a> |
128 | </h4> | 128 | </h4> |
129 | - | 129 | + |
130 | <div class="col-md-5 pull-right category-card-items"> | 130 | <div class="col-md-5 pull-right category-card-items"> |
131 | {% if request.user.is_staff or user in category.coordinators.all %} | 131 | {% if request.user.is_staff or user in category.coordinators.all %} |
132 | - <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | 132 | + <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
133 | <i class="fa fa-ellipsis-v" aria-hidden="true"></i> | 133 | <i class="fa fa-ellipsis-v" aria-hidden="true"></i> |
134 | </a> | 134 | </a> |
135 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> | 135 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> |
@@ -140,12 +140,12 @@ | @@ -140,12 +140,12 @@ | ||
140 | <li><a href="javascript:delete_course.get('{% url 'categories:delete' category.slug %}?view=index','#category','#modal_course')"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans 'Remove' %}</a></li> | 140 | <li><a href="javascript:delete_course.get('{% url 'categories:delete' category.slug %}?view=index','#category','#modal_course')"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans 'Remove' %}</a></li> |
141 | </ul> | 141 | </ul> |
142 | {% endif %} | 142 | {% endif %} |
143 | - | 143 | + |
144 | </div> | 144 | </div> |
145 | </div> | 145 | </div> |
146 | </div> | 146 | </div> |
147 | </div> | 147 | </div> |
148 | - <div id="{{category.slug}}" class="panel-collapse panel-body collapse category-panel-content"> | 148 | + <div id="{{category.slug}}_category" class="panel-collapse panel-body collapse category-panel-content"> |
149 | <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" /> | 149 | <input type="hidden" class="log_url" value="{% url 'categories:view_log' category.id %}" /> |
150 | <input type="hidden" class="log_id" value="" /> | 150 | <input type="hidden" class="log_id" value="" /> |
151 | 151 | ||
@@ -158,15 +158,15 @@ | @@ -158,15 +158,15 @@ | ||
158 | {% else %} | 158 | {% else %} |
159 | <h4> {% trans "It doesn't possess coordinators" %} </h4> | 159 | <h4> {% trans "It doesn't possess coordinators" %} </h4> |
160 | {% endif %} | 160 | {% endif %} |
161 | - | 161 | + |
162 | {{category.description|safe}} | 162 | {{category.description|safe}} |
163 | - | 163 | + |
164 | {% if request.user in category.coordinators.all or request.user.is_staff %} | 164 | {% if request.user in category.coordinators.all or request.user.is_staff %} |
165 | <a href="{% url 'subjects:create' category.slug %}" class="btn btn-raised btn-success btn-block btn-sm">{% trans "Create new subject" %}</a> | 165 | <a href="{% url 'subjects:create' category.slug %}" class="btn btn-raised btn-success btn-block btn-sm">{% trans "Create new subject" %}</a> |
166 | {% endif %} | 166 | {% endif %} |
167 | 167 | ||
168 | - <div class="panel-group subject-group" id="{{ category.slug }}-accordion" role="tablist" aria-multiselectable="true"> | ||
169 | - | 168 | + <div class="panel-group subject-group" id="{{ category.slug }}_category-accordion" role="tablist" aria-multiselectable="true"> |
169 | + | ||
170 | </div> | 170 | </div> |
171 | </div> | 171 | </div> |
172 | </div> | 172 | </div> |
@@ -185,12 +185,12 @@ | @@ -185,12 +185,12 @@ | ||
185 | </div> | 185 | </div> |
186 | 186 | ||
187 | <div id="modal_subject"></div> | 187 | <div id="modal_subject"></div> |
188 | - | 188 | + |
189 | <script type="text/javascript" src="{% static 'js/category.js' %}"></script> | 189 | <script type="text/javascript" src="{% static 'js/category.js' %}"></script> |
190 | - <script type="text/javascript" src="{% static "subjects/js/modal_subject.js" %}"></script> | 190 | + <script type="text/javascript" src="{% static 'subjects/js/modal_subject.js' %}"></script> |
191 | <script type="text/javascript"> | 191 | <script type="text/javascript"> |
192 | $(function (){ | 192 | $(function (){ |
193 | - var cat_slug = "{{ cat_slug }}" | 193 | + var cat_slug = "{{ cat_slug }}_category" |
194 | 194 | ||
195 | if (cat_slug != "") { | 195 | if (cat_slug != "") { |
196 | $("#" + cat_slug).collapse('show'); | 196 | $("#" + cat_slug).collapse('show'); |
subjects/templates/subjects/list_search.html
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | 6 | ||
7 | {% block javascript%} | 7 | {% block javascript%} |
8 | {{ block.super }} | 8 | {{ block.super }} |
9 | - <script type="text/javascript" src=" {% static "js/category.js" %} "></script> | 9 | + <script type="text/javascript" src=" {% static 'js/category.js' %} "></script> |
10 | {% endblock%} | 10 | {% endblock%} |
11 | 11 | ||
12 | 12 | ||
@@ -18,11 +18,11 @@ | @@ -18,11 +18,11 @@ | ||
18 | {% with bread|add:tags as term %} | 18 | {% with bread|add:tags as term %} |
19 | {% breadcrumb term 'subjects:index' %} | 19 | {% breadcrumb term 'subjects:index' %} |
20 | {% endwith %} | 20 | {% endwith %} |
21 | - | 21 | + |
22 | 22 | ||
23 | {% endblock breadcrumbs %} | 23 | {% endblock breadcrumbs %} |
24 | 24 | ||
25 | - | 25 | + |
26 | {% block content %} | 26 | {% block content %} |
27 | 27 | ||
28 | {% if messages %} | 28 | {% if messages %} |
@@ -51,21 +51,21 @@ | @@ -51,21 +51,21 @@ | ||
51 | <a href="{% url 'subjects:search' 'subjects' %}?search={{tags}}"><li class="active">{% trans "Subjects" %} ({{ totals.my_subjects }})</li></a> | 51 | <a href="{% url 'subjects:search' 'subjects' %}?search={{tags}}"><li class="active">{% trans "Subjects" %} ({{ totals.my_subjects }})</li></a> |
52 | <a href="{% url 'subjects:search' 'resources' %}?search={{tags}}" ><li>{% trans "Resources" %} ({{ totals.resources }})</li></a> | 52 | <a href="{% url 'subjects:search' 'resources' %}?search={{tags}}" ><li>{% trans "Resources" %} ({{ totals.resources }})</li></a> |
53 | {% endif %} | 53 | {% endif %} |
54 | - | 54 | + |
55 | </ul> | 55 | </ul> |
56 | </div> | 56 | </div> |
57 | 57 | ||
58 | - | 58 | + |
59 | 59 | ||
60 | <div class="col-md-12 cards-content"> | 60 | <div class="col-md-12 cards-content"> |
61 | - | 61 | + |
62 | 62 | ||
63 | {% if not all %} | 63 | {% if not all %} |
64 | <div class="panel-group" id="subject-accordion" role="tablist" aria-multiselectable="true"> | 64 | <div class="panel-group" id="subject-accordion" role="tablist" aria-multiselectable="true"> |
65 | {% for subject in subjects %} | 65 | {% for subject in subjects %} |
66 | {% include "subjects/subject_card.html" with accordion_id="subject-accordion" %} | 66 | {% include "subjects/subject_card.html" with accordion_id="subject-accordion" %} |
67 | {% endfor %} | 67 | {% endfor %} |
68 | - | 68 | + |
69 | {% pagination request paginator page_obj %} | 69 | {% pagination request paginator page_obj %} |
70 | </div> | 70 | </div> |
71 | {% elif resources|length > 0 and all %} | 71 | {% elif resources|length > 0 and all %} |
@@ -73,10 +73,10 @@ | @@ -73,10 +73,10 @@ | ||
73 | {% for resource in resources %} | 73 | {% for resource in resources %} |
74 | {% include "subjects/resource_card.html" with resource=resource accordion_id="subject-accordion" %} | 74 | {% include "subjects/resource_card.html" with resource=resource accordion_id="subject-accordion" %} |
75 | {% endfor %} | 75 | {% endfor %} |
76 | - | 76 | + |
77 | {% pagination request paginator page_obj %} | 77 | {% pagination request paginator page_obj %} |
78 | </div> | 78 | </div> |
79 | - {% else %} | 79 | + {% else %} |
80 | {% endif %} | 80 | {% endif %} |
81 | 81 | ||
82 | </div> | 82 | </div> |
@@ -85,7 +85,7 @@ | @@ -85,7 +85,7 @@ | ||
85 | </div> | 85 | </div> |
86 | 86 | ||
87 | <div id="modal_subject"></div> | 87 | <div id="modal_subject"></div> |
88 | - | 88 | + |
89 | <script type="text/javascript" src="{% static 'js/category.js' %}"></script> | 89 | <script type="text/javascript" src="{% static 'js/category.js' %}"></script> |
90 | - | ||
91 | -{% endblock content %} | ||
92 | \ No newline at end of file | 90 | \ No newline at end of file |
91 | + | ||
92 | +{% endblock content %} |
subjects/templates/subjects/resource_card.html
@@ -6,11 +6,11 @@ | @@ -6,11 +6,11 @@ | ||
6 | {% if has_resource_permissions %} | 6 | {% if has_resource_permissions %} |
7 | <div class="panel panel-info resource-panel"> | 7 | <div class="panel panel-info resource-panel"> |
8 | <div class="panel-heading"> | 8 | <div class="panel-heading"> |
9 | - | 9 | + |
10 | <div class="row"> | 10 | <div class="row"> |
11 | <div class="col-md-12 resource-header"> | 11 | <div class="col-md-12 resource-header"> |
12 | <h4 class="panel-title"> | 12 | <h4 class="panel-title"> |
13 | - <a class="resource-link pull-left" data-parent="#{% if accordion_id %}{{ accordion_id }}{% else %}{{ subject.category.slug }}-accordion{% endif %}" data-toggle="collapse" href="#{{resource.slug}}"> | 13 | + <a class="resource-link pull-left" data-parent="#{% if accordion_id %}{{ accordion_id }}{% else %}{{ subject.category.slug }}_category-accordion{% endif %}" data-toggle="collapse" href="#{{resource.slug}}"> |
14 | <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{ resource }} | 14 | <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{ resource }} |
15 | </a> | 15 | </a> |
16 | </h4> | 16 | </h4> |
@@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
31 | </div> | 31 | </div> |
32 | </div> | 32 | </div> |
33 | 33 | ||
34 | - | 34 | + |
35 | </div> | 35 | </div> |
36 | 36 | ||
37 | <div id="{{resource.slug}}" class="panel-collapse collapse category-panel-content"> | 37 | <div id="{{resource.slug}}" class="panel-collapse collapse category-panel-content"> |
@@ -55,11 +55,11 @@ | @@ -55,11 +55,11 @@ | ||
55 | </div> | 55 | </div> |
56 | {% if resource.brief_description %} | 56 | {% if resource.brief_description %} |
57 | <p>{{resource.brief_description|safe}}</p> | 57 | <p>{{resource.brief_description|safe}}</p> |
58 | - | 58 | + |
59 | {% endif %} | 59 | {% endif %} |
60 | 60 | ||
61 | <a href="{{ resource.access_link }}" {% if resource.show_window %}target="_blank"{% endif %} class="btn btn-success btn-raised"> {% trans "Access Resource" %}</a> | 61 | <a href="{{ resource.access_link }}" {% if resource.show_window %}target="_blank"{% endif %} class="btn btn-success btn-raised"> {% trans "Access Resource" %}</a> |
62 | - | 62 | + |
63 | </div> | 63 | </div> |
64 | 64 | ||
65 | </div> | 65 | </div> |
@@ -67,7 +67,7 @@ | @@ -67,7 +67,7 @@ | ||
67 | {% include "resources/delete.html" with resource=resource %} | 67 | {% include "resources/delete.html" with resource=resource %} |
68 | <script type="text/javascript"> | 68 | <script type="text/javascript"> |
69 | function delete_resource(url) { | 69 | function delete_resource(url) { |
70 | - | 70 | + |
71 | 71 | ||
72 | $.get(url, function (modal) { | 72 | $.get(url, function (modal) { |
73 | $("#resource_{{ topic.slug }}").parent().after(modal); | 73 | $("#resource_{{ topic.slug }}").parent().after(modal); |
subjects/templates/subjects/subject_card.html
@@ -14,14 +14,14 @@ | @@ -14,14 +14,14 @@ | ||
14 | <div class="row"> | 14 | <div class="row"> |
15 | <div class="col-md-12 category-header"> | 15 | <div class="col-md-12 category-header"> |
16 | <h4 class="panel-title"> | 16 | <h4 class="panel-title"> |
17 | - <a class="category-course-link pull-left" data-parent="#{% if accordion_id %}{{ accordion_id }}{% else %}{{ subject.category.slug }}-accordion{% endif %}" data-toggle="collapse" href="#{{subject.slug}}"> | 17 | + <a class="category-course-link pull-left" data-parent="#{% if accordion_id %}{{ accordion_id }}{% else %}{{ subject.category.slug }}_category-accordion{% endif %}" data-toggle="collapse" href="#{{subject.slug}}_subject"> |
18 | <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{ subject }} | 18 | <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button> {{ subject }} |
19 | </a> | 19 | </a> |
20 | </h4> | 20 | </h4> |
21 | 21 | ||
22 | <div class="col-md-5 pull-right category-card-items"> | 22 | <div class="col-md-5 pull-right category-card-items"> |
23 | {% if has_subject_permissions %} | 23 | {% if has_subject_permissions %} |
24 | - <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | 24 | + <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
25 | <i class="fa fa-ellipsis-v" aria-hidden="true"></i> | 25 | <i class="fa fa-ellipsis-v" aria-hidden="true"></i> |
26 | </a> | 26 | </a> |
27 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> | 27 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> |
@@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
48 | </div> | 48 | </div> |
49 | </div> | 49 | </div> |
50 | </div> | 50 | </div> |
51 | - <div id="{{subject.slug}}" class="panel-collapse collapse category-panel-content"> | 51 | + <div id="{{subject.slug}}_subject" class="panel-collapse collapse category-panel-content"> |
52 | <input type="hidden" class="log_url" value="{% url 'subjects:view_log' subject.id %}" /> | 52 | <input type="hidden" class="log_url" value="{% url 'subjects:view_log' subject.id %}" /> |
53 | <input type="hidden" class="log_id" value="" /> | 53 | <input type="hidden" class="log_id" value="" /> |
54 | 54 | ||
@@ -72,9 +72,9 @@ | @@ -72,9 +72,9 @@ | ||
72 | {% if subject.description_brief %} | 72 | {% if subject.description_brief %} |
73 | <p>{{subject.description_brief|safe}}</p> | 73 | <p>{{subject.description_brief|safe}}</p> |
74 | {% endif %} | 74 | {% endif %} |
75 | - | ||
76 | - {% if show_buttons %} | ||
77 | - | 75 | + |
76 | + {% if show_buttons %} | ||
77 | + | ||
78 | {% if has_subject_view_permissions %} | 78 | {% if has_subject_view_permissions %} |
79 | <a href="{% url 'subjects:view' subject.slug %}" class="btn btn-success btn-raised"> {% trans "Access Subject" %}</a> | 79 | <a href="{% url 'subjects:view' subject.slug %}" class="btn btn-success btn-raised"> {% trans "Access Subject" %}</a> |
80 | {% elif subject.subscribe_end|aftertoday %} | 80 | {% elif subject.subscribe_end|aftertoday %} |
subjects/templates/subjects/update.html
@@ -5,12 +5,12 @@ | @@ -5,12 +5,12 @@ | ||
5 | 5 | ||
6 | {% block style %} | 6 | {% block style %} |
7 | {{block.super}} | 7 | {{block.super}} |
8 | - <link rel="stylesheet" type="text/css" href="{% static "css/bootstrap-tagsinput.css" %}"> | 8 | + <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap-tagsinput.css' %}"> |
9 | {% endblock %} | 9 | {% endblock %} |
10 | 10 | ||
11 | {% block javascript %} | 11 | {% block javascript %} |
12 | {{block.super}} | 12 | {{block.super}} |
13 | - <script type="text/javascript" src="{% static "js/bootstrap-tagsinput.js" %} "></script> | 13 | + <script type="text/javascript" src="{% static 'js/bootstrap-tagsinput.js' %} "></script> |
14 | {% endblock %} | 14 | {% endblock %} |
15 | 15 | ||
16 | {% block breadcrumbs %} | 16 | {% block breadcrumbs %} |
@@ -18,9 +18,9 @@ | @@ -18,9 +18,9 @@ | ||
18 | 18 | ||
19 | {% breadcrumb subject.category 'subjects:cat_view' subject.category.slug %} | 19 | {% breadcrumb subject.category 'subjects:cat_view' subject.category.slug %} |
20 | {% breadcrumb subject 'subjects:view' subject.slug %} | 20 | {% breadcrumb subject 'subjects:view' subject.slug %} |
21 | - | 21 | + |
22 | {% trans 'Update: ' as bread %} | 22 | {% trans 'Update: ' as bread %} |
23 | - {% with bread|add:object.name as bread_slug %} | 23 | + {% with bread|add:object.name as bread_slug %} |
24 | {% breadcrumb bread_slug 'subjects:update' %} | 24 | {% breadcrumb bread_slug 'subjects:update' %} |
25 | {% endwith %} | 25 | {% endwith %} |
26 | {% endblock %} | 26 | {% endblock %} |
@@ -33,4 +33,4 @@ | @@ -33,4 +33,4 @@ | ||
33 | </div> | 33 | </div> |
34 | <br clear="all" /> | 34 | <br clear="all" /> |
35 | <br clear="all" /> | 35 | <br clear="all" /> |
36 | -{% endblock %} | ||
37 | \ No newline at end of file | 36 | \ No newline at end of file |
37 | +{% endblock %} |
subjects/templates/subjects/view.html
@@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
43 | 43 | ||
44 | <div class="col-md-5 pull-right category-card-items"> | 44 | <div class="col-md-5 pull-right category-card-items"> |
45 | {% if request.user in subject.professor.all or request.user in subject.category.coordinators.all or request.user.is_staff %} | 45 | {% if request.user in subject.professor.all or request.user in subject.category.coordinators.all or request.user.is_staff %} |
46 | - <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | 46 | + <a href="" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
47 | <i class="fa fa-ellipsis-v" aria-hidden="true"></i> | 47 | <i class="fa fa-ellipsis-v" aria-hidden="true"></i> |
48 | </a> | 48 | </a> |
49 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> | 49 | <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> |
@@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
55 | <li><a href="javascript:delete_subject.get('{% url 'subjects:delete' subject.slug %}?view=index','#subject','#modal_subject')"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans 'Remove' %}</a></li> | 55 | <li><a href="javascript:delete_subject.get('{% url 'subjects:delete' subject.slug %}?view=index','#subject','#modal_subject')"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans 'Remove' %}</a></li> |
56 | </ul> | 56 | </ul> |
57 | {% endif %} | 57 | {% endif %} |
58 | - | 58 | + |
59 | <a href="" class="pull-right action_icon"><i class="fa fa-bar-chart" aria-hidden="true"></i></a> | 59 | <a href="" class="pull-right action_icon"><i class="fa fa-bar-chart" aria-hidden="true"></i></a> |
60 | <a href="{% url 'notifications:view' subject.slug %}" class="pull-right action_icon"> | 60 | <a href="{% url 'notifications:view' subject.slug %}" class="pull-right action_icon"> |
61 | <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> | 61 | <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> |
@@ -76,14 +76,14 @@ | @@ -76,14 +76,14 @@ | ||
76 | {% if has_subject_permissions %} | 76 | {% if has_subject_permissions %} |
77 | <a href="{% url 'topics:create' subject.slug %}" class="btn btn-sm btn-success btn-raised btn-block">{% trans "Create new topic" %}</a> | 77 | <a href="{% url 'topics:create' subject.slug %}" class="btn btn-sm btn-success btn-raised btn-block">{% trans "Create new topic" %}</a> |
78 | {% endif %} | 78 | {% endif %} |
79 | - | 79 | + |
80 | {% include 'topics/list.html' with subject=subject %} | 80 | {% include 'topics/list.html' with subject=subject %} |
81 | </div> | 81 | </div> |
82 | </div> | 82 | </div> |
83 | 83 | ||
84 | <div id="modal_subject"></div> | 84 | <div id="modal_subject"></div> |
85 | - | ||
86 | - | 85 | + |
86 | + | ||
87 | <script type="text/javascript"> | 87 | <script type="text/javascript"> |
88 | {% if resource_new_page %} | 88 | {% if resource_new_page %} |
89 | window.open("{{ resource_new_page_url }}"); | 89 | window.open("{{ resource_new_page_url }}"); |
@@ -101,4 +101,4 @@ | @@ -101,4 +101,4 @@ | ||
101 | } | 101 | } |
102 | }); | 102 | }); |
103 | </script> | 103 | </script> |
104 | -{% endblock content %} | ||
105 | \ No newline at end of file | 104 | \ No newline at end of file |
105 | +{% endblock content %} |