Commit a89fdab1b9c9f3254b902299d64977686e8fc68f
Exists in
master
and in
5 other branches
Fixing conflit in avaliation migration
Showing
8 changed files
with
94 additions
and
59 deletions
Show diff stats
avaliacao/migrations/0001_initial.py
... | ... | @@ -11,7 +11,8 @@ class Migration(migrations.Migration): |
11 | 11 | initial = True |
12 | 12 | |
13 | 13 | dependencies = [ |
14 | - ('courses', '0001_initial'), | |
14 | + | |
15 | + ('courses', '0002_subject_students'), | |
15 | 16 | ] |
16 | 17 | |
17 | 18 | operations = [ |
... | ... | @@ -24,8 +25,8 @@ class Migration(migrations.Migration): |
24 | 25 | ('end_date', models.DateField(verbose_name='End of Avaliacao Date')), |
25 | 26 | ], |
26 | 27 | options={ |
27 | - 'verbose_name_plural': 'Avaliacoes', | |
28 | 28 | 'verbose_name': 'Avaliacao', |
29 | + 'verbose_name_plural': 'Avaliacoes', | |
29 | 30 | }, |
30 | 31 | bases=('courses.activity',), |
31 | 32 | ), | ... | ... |
... | ... | @@ -0,0 +1,22 @@ |
1 | +# -*- coding: utf-8 -*- | |
2 | +# Generated by Django 1.10 on 2016-10-05 21:02 | |
3 | +from __future__ import unicode_literals | |
4 | + | |
5 | +from django.conf import settings | |
6 | +from django.db import migrations, models | |
7 | + | |
8 | + | |
9 | +class Migration(migrations.Migration): | |
10 | + | |
11 | + dependencies = [ | |
12 | + migrations.swappable_dependency(settings.AUTH_USER_MODEL), | |
13 | + ('courses', '0001_initial'), | |
14 | + ] | |
15 | + | |
16 | + operations = [ | |
17 | + migrations.AddField( | |
18 | + model_name='subject', | |
19 | + name='students', | |
20 | + field=models.ManyToManyField(related_name='subject_student', to=settings.AUTH_USER_MODEL, verbose_name='Students'), | |
21 | + ), | |
22 | + ] | ... | ... |
courses/models.py
... | ... | @@ -54,7 +54,8 @@ class Subject(models.Model): |
54 | 54 | create_date = models.DateTimeField(_('Creation Date'), auto_now_add = True) |
55 | 55 | update_date = models.DateTimeField(_('Date of last update'), auto_now=True) |
56 | 56 | course = models.ForeignKey(Course, verbose_name = _('Course'), related_name="subjects") |
57 | - professors = models.ManyToManyField(User,verbose_name=_('Professors'), related_name='subjects') | |
57 | + professors = models.ManyToManyField(User,verbose_name=_('Professors'), related_name='professors_subjects') | |
58 | + students = models.ManyToManyField(User,verbose_name=_('Students'), related_name='subject_student') | |
58 | 59 | |
59 | 60 | |
60 | 61 | class Meta: | ... | ... |
courses/templates/course/index.html
... | ... | @@ -54,17 +54,16 @@ |
54 | 54 | {% endif %} |
55 | 55 | |
56 | 56 | <div class="col-md-12"> |
57 | - <div class="input-group"> | |
58 | - <div class="form-group is-empty"><input type="search" class="form-control" placeholder="Search Courses"></div> | |
59 | - <span class="input-group-btn input-group-sm"> | |
60 | - <button type="button" class="btn btn-fab btn-fab-mini"> | |
61 | - <i class="material-icons">search</i> | |
62 | - </button> | |
63 | - </span> | |
64 | - </div> | |
57 | + <div class="input-group"> | |
58 | + <div class="form-group is-empty"><input type="search" class="form-control" placeholder="Search Courses"></div> | |
59 | + <span class="input-group-btn input-group-sm"> | |
60 | + <button type="button" class="btn btn-fab btn-fab-mini"> | |
61 | + <i class="material-icons">search</i> | |
62 | + </button> | |
63 | + </span> | |
65 | 64 | </div> |
65 | +</div> | |
66 | 66 | {% if user|has_role:'professor, system_admin' %} |
67 | - | |
68 | 67 | <div class="col-md-12"> |
69 | 68 | {% if courses|length > 0 %} |
70 | 69 | {% for course in courses_teacher %} |
... | ... | @@ -140,10 +139,7 @@ |
140 | 139 | </div> |
141 | 140 | </div> |
142 | 141 | </div> |
143 | -{% endif %} | |
144 | - | |
145 | -{% if user|has_role:'students' %} | |
146 | - | |
142 | +{% else %} | |
147 | 143 | {% if courses|length > 0 %} |
148 | 144 | {% for course in courses_student %} |
149 | 145 | <div class="col-md-12"> | ... | ... |
courses/templates/course/view.html
... | ... | @@ -52,16 +52,10 @@ |
52 | 52 | <div class="panel panel-info"> |
53 | 53 | <div class="panel-heading headingOne"> |
54 | 54 | <div class="row"> |
55 | - <div class="col-xs-8 col-md-9 titleTopic"> | |
55 | + <div class="col-xs-8 col-md-10 titleTopic"> | |
56 | 56 | <h4>{{course}}</h4> |
57 | 57 | </div> |
58 | - <div class="col-xs-4 col-md-3" id="divMoreActions"> | |
59 | - <div class="btn-group"> | |
60 | - <button type="button" class="btn btn-default btn-sm eye" data-toggle="tooltip" data-placement="bottom" title="Visible"> | |
61 | - <i class="fa fa-eye fa-2x" aria-hidden="true"></i> | |
62 | - </button> | |
63 | - | |
64 | - </div> | |
58 | + <div class="col-xs-4 col-md-2" id="divMoreActions"> | |
65 | 59 | <div class="btn-group"> |
66 | 60 | <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
67 | 61 | <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> |
... | ... | @@ -190,17 +184,12 @@ |
190 | 184 | <div class="panel panel-info"> |
191 | 185 | <div class="panel-heading headingTwo ui-sortable-handle" role="tab"> |
192 | 186 | <div class="row"> |
193 | - <div class="col-xs-9 col-md-9 titleTopic"> | |
187 | + <div class="col-xs-9 col-md-10 titleTopic"> | |
194 | 188 | <a role="button" data-toggle="collapse" data-parent="#accordion" href=".collapseTwo" aria-expanded="true" aria-controls="collapseTwo"> |
195 | 189 | <h4 style="color:white">{{subject.name}}</h4> |
196 | 190 | </a> |
197 | 191 | </div> |
198 | - <div class="col-xs-3 col-md-3" id="divMoreActions"> | |
199 | - <div class="btn-group"> | |
200 | - <button type="button" class="btn btn-default btn-sm eye" data-toggle="tooltip" data-placement="bottom" title="Visible"> | |
201 | - <i class="fa fa-eye fa-2x" aria-hidden="true"></i> | |
202 | - </button> | |
203 | - </div> | |
192 | + <div class="col-xs-3 col-md-2" id="divMoreActions"> | |
204 | 193 | <div class="btn-group"> |
205 | 194 | <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
206 | 195 | <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> | ... | ... |
courses/templates/subject/form_view_teacher.html
... | ... | @@ -11,8 +11,22 @@ |
11 | 11 | <div class="col-md-9 col-sm-9"> |
12 | 12 | <h3>{{ topic }}</h3> |
13 | 13 | </div> |
14 | - <div class="col-md-3 col-sm-3"> | |
15 | - <a href="{% url 'course:update_topic' topic.slug%}" class="btn">{% trans "edit" %}</a> | |
14 | + <div class="col-xs-4 col-md-3 divMoreActions"> | |
15 | + <div class="btn-group"> | |
16 | + <button type="button" class="btn btn-default btn-sm eye" data-toggle="tooltip" data-placement="bottom" title="Visible"> | |
17 | + <i class="fa fa-eye fa-2x" aria-hidden="true"></i> | |
18 | + </button> | |
19 | + </div> | |
20 | + <div class="btn-group"> | |
21 | + <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | |
22 | + <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> | |
23 | + </button> | |
24 | + <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> | |
25 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#myModal4"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> {% trans "Replicate" %}</a></li> | |
26 | + <li><a href="{% url 'course:update_subject' subject.slug %}" data-toggle="modal" data-target="#editSubject"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans "Edit" %}</a></li> | |
27 | + <li><a href="{% url 'course:delete_subject' subject.slug %}" data-toggle="modal" data-target="#removeSubject"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans "Remove" %}</a></li> | |
28 | + </ul> | |
29 | + </div> | |
16 | 30 | </div> |
17 | 31 | </div> |
18 | 32 | </div> | ... | ... |
courses/templates/subject/index.html
... | ... | @@ -36,19 +36,28 @@ |
36 | 36 | <div class="panel panel-info"> |
37 | 37 | <div class="panel-heading"> |
38 | 38 | <div class="row"> |
39 | - <div class="col-md-7 col-sm-7"> | |
39 | + <div class="col-md-9 col-sm-7"> | |
40 | 40 | <h3>{{subject}}</h3> |
41 | 41 | </div> |
42 | - <div class="col-md-2 col-sm-2"> | |
43 | - {% if user|has_role:'system_admin' or user in subject.professors %} | |
44 | - <a href="{% url 'course:update_subject' subject.slug%}" class="btn">{% trans "edit" %}</a> | |
45 | - {% endif %} | |
46 | - </div> | |
47 | - <div class="col-md-3 col-sm-3"> | |
48 | - {% if user|has_role:'system_admin' or user in subject.professors %} | |
49 | - <a href="{% url 'course:delete_subject' subject.slug%}" class="btn">{% trans "delete" %}</a> | |
50 | - {% endif %} | |
51 | - </div> | |
42 | + <div class="col-xs-4 col-md-3 divMoreActions"> | |
43 | + <div class="btn-group"> | |
44 | + <button type="button" class="btn btn-default btn-sm eye" data-toggle="tooltip" data-placement="bottom" title="Visible"> | |
45 | + <i class="fa fa-eye fa-2x" aria-hidden="true"></i> | |
46 | + </button> | |
47 | + </div> | |
48 | + {% if user|has_role:'system_admin' or user in subject.professors %} | |
49 | + <div class="btn-group"> | |
50 | + <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | |
51 | + <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> | |
52 | + </button> | |
53 | + <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> | |
54 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#myModal4"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> {% trans "Replicate" %}</a></li> | |
55 | + <li><a href="{% url 'course:update_subject' subject.slug %}" data-toggle="modal" data-target="#editSubject"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans "Edit" %}</a></li> | |
56 | + <li><a href="{% url 'course:delete_subject' subject.slug %}" data-toggle="modal" data-target="#removeSubject"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans "Remove" %}</a></li> | |
57 | + </ul> | |
58 | + </div> | |
59 | + {% endif %} | |
60 | + </div> | |
52 | 61 | </div> |
53 | 62 | </div> |
54 | 63 | <div class="panel-body"> | ... | ... |
courses/templates/topic/index.html
... | ... | @@ -50,19 +50,23 @@ |
50 | 50 | <div class="panel panel-info"> |
51 | 51 | <div class="panel-heading"> |
52 | 52 | <div class="row"> |
53 | - <div class="col-md-7 col-sm-7"> | |
53 | + <div class="col-md-10 col-sm-7"> | |
54 | 54 | <h3>{{subject}}</h3> |
55 | 55 | </div> |
56 | - <div class="col-md-2 col-sm-2"> | |
57 | - {% if user|has_role:'system_admin' or user in subject.professors %} | |
58 | - <a href="{% url 'course:update_subject' subject.slug%}" class="btn">{% trans "edit" %}</a> | |
59 | - {% endif %} | |
60 | - </div> | |
61 | - <div class="col-md-3 col-sm-3"> | |
62 | - {% if user|has_role:'system_admin' or user in subject.professors %} | |
63 | - <a href="{% url 'course:delete_subject' subject.slug%}" class="btn">{% trans "delete" %}</a> | |
64 | - {% endif %} | |
65 | - </div> | |
56 | + <div class="col-xs-4 col-md-2 divMoreActions"> | |
57 | + {% if user|has_role:'system_admin' or user in subject.professors %} | |
58 | + <div class="btn-group"> | |
59 | + <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | |
60 | + <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> | |
61 | + </button> | |
62 | + <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> | |
63 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#myModal4"><i class="fa fa-files-o fa-fw" aria-hidden="true"></i> {% trans "Replicate" %}</a></li> | |
64 | + <li><a href="{% url 'course:update_subject' subject.slug %}" data-toggle="modal" data-target="#editSubject"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans "Edit" %}</a></li> | |
65 | + <li><a href="{% url 'course:delete_subject' subject.slug %}" data-toggle="modal" data-target="#removeSubject"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans "Remove" %}</a></li> | |
66 | + </ul> | |
67 | + </div> | |
68 | + {% endif %} | |
69 | + </div> | |
66 | 70 | </div> |
67 | 71 | </div> |
68 | 72 | <div class="panel-body"> |
... | ... | @@ -108,11 +112,10 @@ |
108 | 112 | </div> |
109 | 113 | {% else %} |
110 | 114 | <div class="col-md-4"> |
111 | - <input type="hidden" name="id" value=""> | |
112 | - <input type="hidden" name="student" value=""> | |
115 | + <!--<input type="hidden" name="id" value=""> | |
116 | + <input type="hidden" name="student" value="">--> | |
113 | 117 | <div class="form-group {% if form.pdf.errors %} has-error {% endif %}"> |
114 | - <label for="id_pdf">PDF</label> | |
115 | - {{form.pdf}} | |
118 | + {{ form.as_p }} | |
116 | 119 | </div> |
117 | 120 | <button type="submit" class="btn btn-success" id="send_button">Enviar</button> |
118 | 121 | </div> | ... | ... |