Commit 1be6c47d18b896d8fa00ed54d6585f29a2352cb3

Authored by Felipe Henrique de Almeida Bormann
2 parents 2eecfa55 f40e76a4

Merge branch 'refactoring' of https://github.com/amadeusproject/amadeuslms into refactoring

amadeus/static/css/base/amadeus.css
... ... @@ -162,12 +162,12 @@
162 162 width: 100% !important;
163 163 }
164 164  
165   -#coordinators_accordion .panel-heading {
  165 +#coordinators_accordion .panel-heading, #professors_accordion .panel-heading {
166 166 background: #FFFFFF;
167 167 border: none;
168 168 }
169 169  
170   -#coordinators_accordion .panel-collapse {
  170 +#coordinators_accordion .panel-collapse, #professors_accordion .panel-collapse {
171 171 padding: 10px;
172 172 }
173 173  
... ...
subjects/templates/subjects/create.html
1 1 {% extends 'categories/home.html' %}
2 2  
3   -
4   -
5 3 {% load widget_tweaks static i18n permission_tags django_bootstrap_breadcrumbs switchevenodd %}
6 4  
7   -
8 5 {% block breadcrumbs %}
9 6 {% clear_breadcrumbs %}
10   - {% breadcrumb 'Home' 'categories:index' %}
  7 + {% breadcrumb 'Home' 'subjects:home' %}
11 8  
12   - {% breadcrumb slug 'categories:index' %}
  9 + {% breadcrumb slug 'subjects:index' %}
13 10 {% breadcrumb 'Create Subject' 'subjects:create' %}
14 11 {% endblock %}
15 12  
... ... @@ -20,13 +17,13 @@
20 17 <form method="post" action="" enctype="multipart/form-data">
21 18 {% csrf_token %}
22 19 {% for field in form %}
23   - {% if field.auto_id == 'id_students' %}
  20 + {% if field.auto_id == 'id_students' %}
24 21 <div class="panel-group" id="coordinators_accordion" role="tablist" aria-multiselectable="true">
25 22 <div class="panel panel-info">
26 23 <div class="panel-heading">
27 24 <div class="row">
28 25 <div class="col-md-12">
29   - <a data-parent="#coordinators_accordion" data-toggle="collapse" href="#coords">
  26 + <a data-parent="#coordinators_accordion" data-toggle="collapse" href="#students">
30 27 <h4 class="panel-title">
31 28 <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button><label for="{{ field.auto_id }}">{{ field.label }}</label>
32 29 </h4>
... ... @@ -34,19 +31,19 @@
34 31 </div>
35 32 </div>
36 33 </div>
37   - <div id="coords" class="panel-collapse collapse">
  34 + <div id="students" class="panel-collapse collapse">
38 35 <p><em>{% trans 'Attribute students to subject' %}:</em></p>
39 36 {% render_field field class='form-control' %}
40 37 </div>
41 38 </div>
42 39 </div>
43   - {% elif field.auto_id == 'id_professor' %}
44   - <div class="panel-group" id="coordinators_accordion" role="tablist" aria-multiselectable="true">
  40 + {% elif field.auto_id == 'id_professor' %}
  41 + <div class="panel-group" id="professors_accordion" role="tablist" aria-multiselectable="true">
45 42 <div class="panel panel-info">
46 43 <div class="panel-heading">
47 44 <div class="row">
48 45 <div class="col-md-12">
49   - <a data-parent="#coordinators_accordion" data-toggle="collapse" href="#coords">
  46 + <a data-parent="#professors_accordion" data-toggle="collapse" href="#professors">
50 47 <h4 class="panel-title">
51 48 <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button><label for="{{ field.auto_id }}">{{ field.label }}</label>
52 49 </h4>
... ... @@ -54,7 +51,7 @@
54 51 </div>
55 52 </div>
56 53 </div>
57   - <div id="coords" class="panel-collapse collapse">
  54 + <div id="professors" class="panel-collapse collapse">
58 55 <p><em>{% trans 'Attribute professors to subject' %}:</em></p>
59 56 {% render_field field class='form-control' %}
60 57 </div>
... ...
subjects/views.py
... ... @@ -138,9 +138,9 @@ class SubjectCreateView(CreateView):
138 138  
139 139 def get_context_data(self, **kwargs):
140 140 context = super(SubjectCreateView, self).get_context_data(**kwargs)
  141 + context['title'] = _('Create Subject')
141 142 context['slug'] = self.kwargs['slug']
142   - context['template_extends'] = 'subjects/list.html'
143   - context['subjects_menu_active'] = 'subjects_menu_active';
  143 + context['subjects_menu_active'] = 'subjects_menu_active'
144 144  
145 145 return context
146 146  
... ... @@ -154,8 +154,6 @@ class SubjectCreateView(CreateView):
154 154 return super(SubjectCreateView, self).form_valid(form)
155 155  
156 156 def get_success_url(self):
157   -
158   -
159 157 objeto = self.object.name
160 158  
161 159 messages.success(self.request, _('Subject "%s" was registered on "%s" successfully!')%(objeto, self.kwargs['slug']))
... ...