Commit 735ee8bdc9dd257bdf2aacc4e9e2413a29ccd54d
1 parent
0256201a
Exists in
master
and in
5 other branches
Minor fixes
Showing
8 changed files
with
173 additions
and
81 deletions
Show diff stats
amadeus/settings.py
@@ -78,8 +78,8 @@ TEMPLATES = [ | @@ -78,8 +78,8 @@ TEMPLATES = [ | ||
78 | 'django.contrib.auth.context_processors.auth', | 78 | 'django.contrib.auth.context_processors.auth', |
79 | 'django.contrib.messages.context_processors.messages', | 79 | 'django.contrib.messages.context_processors.messages', |
80 | 80 | ||
81 | - # 'core.context_processors.notifications', | ||
82 | - # 'courses.context_processors.courses', | 81 | + 'core.context_processors.notifications', |
82 | + 'courses.context_processors.courses', | ||
83 | ], | 83 | ], |
84 | }, | 84 | }, |
85 | }, | 85 | }, |
app/views.py
@@ -42,7 +42,7 @@ class AppIndex(LoginRequiredMixin, LogMixin, ListView, NotificationMixin): | @@ -42,7 +42,7 @@ class AppIndex(LoginRequiredMixin, LogMixin, ListView, NotificationMixin): | ||
42 | else: | 42 | else: |
43 | self.template_name = "home_teacher_student_content.html" | 43 | self.template_name = "home_teacher_student_content.html" |
44 | 44 | ||
45 | - #super(AppIndex, self).createNotification("testando notificacao de login", resource_name="home", resource_link="/") | 45 | + super(AppIndex, self).createNotification("testando notificacao de login", resource_name="home", resource_link="/") |
46 | return self.response_class(request = self.request, template = self.template_name, context = context, using = self.template_engine, **response_kwargs) | 46 | return self.response_class(request = self.request, template = self.template_name, context = context, using = self.template_engine, **response_kwargs) |
47 | 47 | ||
48 | 48 |
core/migrations/0001_initial.py
1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
2 | -# Generated by Django 1.10 on 2016-09-20 13:57 | 2 | +# Generated by Django 1.10 on 2016-09-20 21:15 |
3 | from __future__ import unicode_literals | 3 | from __future__ import unicode_literals |
4 | 4 | ||
5 | import autoslug.fields | 5 | import autoslug.fields |
6 | -from django.conf import settings | ||
7 | from django.db import migrations, models | 6 | from django.db import migrations, models |
8 | import django.db.models.deletion | 7 | import django.db.models.deletion |
9 | 8 | ||
@@ -13,7 +12,6 @@ class Migration(migrations.Migration): | @@ -13,7 +12,6 @@ class Migration(migrations.Migration): | ||
13 | initial = True | 12 | initial = True |
14 | 13 | ||
15 | dependencies = [ | 14 | dependencies = [ |
16 | - migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
17 | ] | 15 | ] |
18 | 16 | ||
19 | operations = [ | 17 | operations = [ |
@@ -33,7 +31,6 @@ class Migration(migrations.Migration): | @@ -33,7 +31,6 @@ class Migration(migrations.Migration): | ||
33 | name='Action_Resource', | 31 | name='Action_Resource', |
34 | fields=[ | 32 | fields=[ |
35 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | 33 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
36 | - ('action', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Action', verbose_name='Action_Applied')), | ||
37 | ], | 34 | ], |
38 | options={ | 35 | options={ |
39 | 'verbose_name_plural': 'Action_Resources', | 36 | 'verbose_name_plural': 'Action_Resources', |
@@ -45,8 +42,6 @@ class Migration(migrations.Migration): | @@ -45,8 +42,6 @@ class Migration(migrations.Migration): | ||
45 | fields=[ | 42 | fields=[ |
46 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | 43 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
47 | ('datetime', models.DateTimeField(auto_now_add=True, verbose_name='Date and Time of action')), | 44 | ('datetime', models.DateTimeField(auto_now_add=True, verbose_name='Date and Time of action')), |
48 | - ('action_resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Action_Resource', verbose_name='Action_Resource')), | ||
49 | - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Actor')), | ||
50 | ], | 45 | ], |
51 | options={ | 46 | options={ |
52 | 'verbose_name_plural': 'Logs', | 47 | 'verbose_name_plural': 'Logs', |
@@ -61,8 +56,6 @@ class Migration(migrations.Migration): | @@ -61,8 +56,6 @@ class Migration(migrations.Migration): | ||
61 | ('read', models.BooleanField(default=False, verbose_name='Read')), | 56 | ('read', models.BooleanField(default=False, verbose_name='Read')), |
62 | ('datetime', models.DateTimeField(auto_now_add=True, verbose_name='Date and Time of action')), | 57 | ('datetime', models.DateTimeField(auto_now_add=True, verbose_name='Date and Time of action')), |
63 | ('action_resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Action_Resource', verbose_name='Action_Resource')), | 58 | ('action_resource', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Action_Resource', verbose_name='Action_Resource')), |
64 | - ('actor', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='notification_Performer', to=settings.AUTH_USER_MODEL, verbose_name='Perfomer')), | ||
65 | - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notification_Actor', to=settings.AUTH_USER_MODEL, verbose_name='User')), | ||
66 | ], | 59 | ], |
67 | options={ | 60 | options={ |
68 | 'verbose_name_plural': 'Notifications', | 61 | 'verbose_name_plural': 'Notifications', |
@@ -83,9 +76,4 @@ class Migration(migrations.Migration): | @@ -83,9 +76,4 @@ class Migration(migrations.Migration): | ||
83 | 'verbose_name': 'Resource', | 76 | 'verbose_name': 'Resource', |
84 | }, | 77 | }, |
85 | ), | 78 | ), |
86 | - migrations.AddField( | ||
87 | - model_name='action_resource', | ||
88 | - name='resource', | ||
89 | - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Resource', verbose_name='Resource'), | ||
90 | - ), | ||
91 | ] | 79 | ] |
@@ -0,0 +1,50 @@ | @@ -0,0 +1,50 @@ | ||
1 | +# -*- coding: utf-8 -*- | ||
2 | +# Generated by Django 1.10 on 2016-09-20 21:15 | ||
3 | +from __future__ import unicode_literals | ||
4 | + | ||
5 | +from django.conf import settings | ||
6 | +from django.db import migrations, models | ||
7 | +import django.db.models.deletion | ||
8 | + | ||
9 | + | ||
10 | +class Migration(migrations.Migration): | ||
11 | + | ||
12 | + initial = True | ||
13 | + | ||
14 | + dependencies = [ | ||
15 | + ('core', '0001_initial'), | ||
16 | + migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
17 | + ] | ||
18 | + | ||
19 | + operations = [ | ||
20 | + migrations.AddField( | ||
21 | + model_name='notification', | ||
22 | + name='actor', | ||
23 | + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='notification_Performer', to=settings.AUTH_USER_MODEL, verbose_name='Perfomer'), | ||
24 | + ), | ||
25 | + migrations.AddField( | ||
26 | + model_name='notification', | ||
27 | + name='user', | ||
28 | + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notification_Actor', to=settings.AUTH_USER_MODEL, verbose_name='User'), | ||
29 | + ), | ||
30 | + migrations.AddField( | ||
31 | + model_name='log', | ||
32 | + name='action_resource', | ||
33 | + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Action_Resource', verbose_name='Action_Resource'), | ||
34 | + ), | ||
35 | + migrations.AddField( | ||
36 | + model_name='log', | ||
37 | + name='user', | ||
38 | + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Actor'), | ||
39 | + ), | ||
40 | + migrations.AddField( | ||
41 | + model_name='action_resource', | ||
42 | + name='action', | ||
43 | + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Action', verbose_name='Action_Applied'), | ||
44 | + ), | ||
45 | + migrations.AddField( | ||
46 | + model_name='action_resource', | ||
47 | + name='resource', | ||
48 | + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Resource', verbose_name='Resource'), | ||
49 | + ), | ||
50 | + ] |
courses/migrations/0001_initial.py
1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
2 | -# Generated by Django 1.10 on 2016-09-20 13:57 | 2 | +# Generated by Django 1.10 on 2016-09-20 21:15 |
3 | from __future__ import unicode_literals | 3 | from __future__ import unicode_literals |
4 | 4 | ||
5 | import autoslug.fields | 5 | import autoslug.fields |
6 | -from django.conf import settings | ||
7 | from django.db import migrations, models | 6 | from django.db import migrations, models |
8 | import django.db.models.deletion | 7 | import django.db.models.deletion |
9 | 8 | ||
@@ -14,7 +13,6 @@ class Migration(migrations.Migration): | @@ -14,7 +13,6 @@ class Migration(migrations.Migration): | ||
14 | 13 | ||
15 | dependencies = [ | 14 | dependencies = [ |
16 | ('core', '0001_initial'), | 15 | ('core', '0001_initial'), |
17 | - migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
18 | ] | 16 | ] |
19 | 17 | ||
20 | operations = [ | 18 | operations = [ |
@@ -24,7 +22,6 @@ class Migration(migrations.Migration): | @@ -24,7 +22,6 @@ class Migration(migrations.Migration): | ||
24 | ('resource_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.Resource')), | 22 | ('resource_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.Resource')), |
25 | ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='Creation Date')), | 23 | ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='Creation Date')), |
26 | ('limit_date', models.DateTimeField(verbose_name='Deliver Date')), | 24 | ('limit_date', models.DateTimeField(verbose_name='Deliver Date')), |
27 | - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='student')), | ||
28 | ], | 25 | ], |
29 | bases=('core.resource',), | 26 | bases=('core.resource',), |
30 | ), | 27 | ), |
@@ -37,8 +34,8 @@ class Migration(migrations.Migration): | @@ -37,8 +34,8 @@ class Migration(migrations.Migration): | ||
37 | ('create_date', models.DateField(auto_now_add=True, verbose_name='Creation Date')), | 34 | ('create_date', models.DateField(auto_now_add=True, verbose_name='Creation Date')), |
38 | ], | 35 | ], |
39 | options={ | 36 | options={ |
40 | - 'verbose_name': 'Category', | ||
41 | 'verbose_name_plural': 'Categories', | 37 | 'verbose_name_plural': 'Categories', |
38 | + 'verbose_name': 'Category', | ||
42 | }, | 39 | }, |
43 | ), | 40 | ), |
44 | migrations.CreateModel( | 41 | migrations.CreateModel( |
@@ -56,13 +53,10 @@ class Migration(migrations.Migration): | @@ -56,13 +53,10 @@ class Migration(migrations.Migration): | ||
56 | ('init_date', models.DateField(verbose_name='Begin of Course Date')), | 53 | ('init_date', models.DateField(verbose_name='Begin of Course Date')), |
57 | ('end_date', models.DateField(verbose_name='End of Course Date')), | 54 | ('end_date', models.DateField(verbose_name='End of Course Date')), |
58 | ('image', models.ImageField(blank=True, upload_to='courses/', verbose_name='Image')), | 55 | ('image', models.ImageField(blank=True, upload_to='courses/', verbose_name='Image')), |
59 | - ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Category', verbose_name='Category')), | ||
60 | - ('professors', models.ManyToManyField(related_name='courses', to=settings.AUTH_USER_MODEL, verbose_name='Professors')), | ||
61 | - ('students', models.ManyToManyField(related_name='courses_student', to=settings.AUTH_USER_MODEL, verbose_name='Students')), | ||
62 | ], | 56 | ], |
63 | options={ | 57 | options={ |
64 | - 'verbose_name': 'Course', | ||
65 | 'verbose_name_plural': 'Courses', | 58 | 'verbose_name_plural': 'Courses', |
59 | + 'verbose_name': 'Course', | ||
66 | 'ordering': ('create_date', 'name'), | 60 | 'ordering': ('create_date', 'name'), |
67 | }, | 61 | }, |
68 | ), | 62 | ), |
@@ -71,7 +65,6 @@ class Migration(migrations.Migration): | @@ -71,7 +65,6 @@ class Migration(migrations.Migration): | ||
71 | fields=[ | 65 | fields=[ |
72 | ('resource_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.Resource')), | 66 | ('resource_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.Resource')), |
73 | ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='Creation Date')), | 67 | ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='Creation Date')), |
74 | - ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='student')), | ||
75 | ], | 68 | ], |
76 | bases=('core.resource',), | 69 | bases=('core.resource',), |
77 | ), | 70 | ), |
@@ -87,12 +80,10 @@ class Migration(migrations.Migration): | @@ -87,12 +80,10 @@ class Migration(migrations.Migration): | ||
87 | ('end_date', models.DateField(verbose_name='End of Subject Date')), | 80 | ('end_date', models.DateField(verbose_name='End of Subject Date')), |
88 | ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='Creation Date')), | 81 | ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='Creation Date')), |
89 | ('update_date', models.DateTimeField(auto_now=True, verbose_name='Date of last update')), | 82 | ('update_date', models.DateTimeField(auto_now=True, verbose_name='Date of last update')), |
90 | - ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subjects', to='courses.Course', verbose_name='Course')), | ||
91 | - ('professors', models.ManyToManyField(related_name='subjects', to=settings.AUTH_USER_MODEL, verbose_name='Professors')), | ||
92 | ], | 83 | ], |
93 | options={ | 84 | options={ |
94 | - 'verbose_name': 'Subject', | ||
95 | 'verbose_name_plural': 'Subjects', | 85 | 'verbose_name_plural': 'Subjects', |
86 | + 'verbose_name': 'Subject', | ||
96 | 'ordering': ('create_date', 'name'), | 87 | 'ordering': ('create_date', 'name'), |
97 | }, | 88 | }, |
98 | ), | 89 | ), |
@@ -106,23 +97,11 @@ class Migration(migrations.Migration): | @@ -106,23 +97,11 @@ class Migration(migrations.Migration): | ||
106 | ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='Creation Date')), | 97 | ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='Creation Date')), |
107 | ('update_date', models.DateTimeField(auto_now=True, verbose_name='Date of last update')), | 98 | ('update_date', models.DateTimeField(auto_now=True, verbose_name='Date of last update')), |
108 | ('visible', models.BooleanField(default=False, verbose_name='Visible')), | 99 | ('visible', models.BooleanField(default=False, verbose_name='Visible')), |
109 | - ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Owner')), | ||
110 | - ('subject', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Subject', verbose_name='Subject')), | ||
111 | ], | 100 | ], |
112 | options={ | 101 | options={ |
113 | - 'verbose_name': 'Topic', | ||
114 | 'verbose_name_plural': 'Topics', | 102 | 'verbose_name_plural': 'Topics', |
103 | + 'verbose_name': 'Topic', | ||
115 | 'ordering': ('create_date', 'name'), | 104 | 'ordering': ('create_date', 'name'), |
116 | }, | 105 | }, |
117 | ), | 106 | ), |
118 | - migrations.AddField( | ||
119 | - model_name='material', | ||
120 | - name='topic', | ||
121 | - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Topic', verbose_name='Topic'), | ||
122 | - ), | ||
123 | - migrations.AddField( | ||
124 | - model_name='activity', | ||
125 | - name='topic', | ||
126 | - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Topic', verbose_name='Topic'), | ||
127 | - ), | ||
128 | ] | 107 | ] |
@@ -0,0 +1,75 @@ | @@ -0,0 +1,75 @@ | ||
1 | +# -*- coding: utf-8 -*- | ||
2 | +# Generated by Django 1.10 on 2016-09-20 21:15 | ||
3 | +from __future__ import unicode_literals | ||
4 | + | ||
5 | +from django.conf import settings | ||
6 | +from django.db import migrations, models | ||
7 | +import django.db.models.deletion | ||
8 | + | ||
9 | + | ||
10 | +class Migration(migrations.Migration): | ||
11 | + | ||
12 | + initial = True | ||
13 | + | ||
14 | + dependencies = [ | ||
15 | + ('courses', '0001_initial'), | ||
16 | + migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
17 | + ] | ||
18 | + | ||
19 | + operations = [ | ||
20 | + migrations.AddField( | ||
21 | + model_name='topic', | ||
22 | + name='owner', | ||
23 | + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Owner'), | ||
24 | + ), | ||
25 | + migrations.AddField( | ||
26 | + model_name='topic', | ||
27 | + name='subject', | ||
28 | + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Subject', verbose_name='Subject'), | ||
29 | + ), | ||
30 | + migrations.AddField( | ||
31 | + model_name='subject', | ||
32 | + name='course', | ||
33 | + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subjects', to='courses.Course', verbose_name='Course'), | ||
34 | + ), | ||
35 | + migrations.AddField( | ||
36 | + model_name='subject', | ||
37 | + name='professors', | ||
38 | + field=models.ManyToManyField(related_name='subjects', to=settings.AUTH_USER_MODEL, verbose_name='Professors'), | ||
39 | + ), | ||
40 | + migrations.AddField( | ||
41 | + model_name='material', | ||
42 | + name='student', | ||
43 | + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='student'), | ||
44 | + ), | ||
45 | + migrations.AddField( | ||
46 | + model_name='material', | ||
47 | + name='topic', | ||
48 | + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Topic', verbose_name='Topic'), | ||
49 | + ), | ||
50 | + migrations.AddField( | ||
51 | + model_name='course', | ||
52 | + name='category', | ||
53 | + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Category', verbose_name='Category'), | ||
54 | + ), | ||
55 | + migrations.AddField( | ||
56 | + model_name='course', | ||
57 | + name='professors', | ||
58 | + field=models.ManyToManyField(related_name='courses', to=settings.AUTH_USER_MODEL, verbose_name='Professors'), | ||
59 | + ), | ||
60 | + migrations.AddField( | ||
61 | + model_name='course', | ||
62 | + name='students', | ||
63 | + field=models.ManyToManyField(related_name='courses_student', to=settings.AUTH_USER_MODEL, verbose_name='Students'), | ||
64 | + ), | ||
65 | + migrations.AddField( | ||
66 | + model_name='activity', | ||
67 | + name='student', | ||
68 | + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='student'), | ||
69 | + ), | ||
70 | + migrations.AddField( | ||
71 | + model_name='activity', | ||
72 | + name='topic', | ||
73 | + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='courses.Topic', verbose_name='Topic'), | ||
74 | + ), | ||
75 | + ] |
courses/templates/subject/form_view_student.html
1 | {% load i18n %} | 1 | {% load i18n %} |
2 | 2 | ||
3 | <div class="panel panel-default"> | 3 | <div class="panel panel-default"> |
4 | - <a href="{% url 'course:view_topic' topic.slug %}"> | ||
5 | - <div class="panel-heading"> | ||
6 | - <div class="row"> | ||
7 | - <div class="col-md-9 col-sm-9"> | ||
8 | - <h3>{{topic}}</h3> | ||
9 | - </div> | ||
10 | - </div> | ||
11 | - </div> | ||
12 | - </a> | ||
13 | - </div> | ||
14 | - | ||
15 | - <div class="panel-body"> | ||
16 | - <p>{{topic.description|linebreaks}}</p> | ||
17 | - </div> | 4 | + <a href="{% url 'course:view_topic' topic.slug %}"> |
5 | + <div class="panel-heading"> | ||
6 | + <div class="row"> | ||
7 | + <div class="col-md-9 col-sm-9"> | ||
8 | + <h3>{{topic}}</h3> | ||
9 | + </div> | ||
10 | + </div> | ||
11 | + </div> | ||
12 | + </a> | ||
18 | </div> | 13 | </div> |
14 | +<div class="panel-body"> | ||
15 | + <p>{{topic.description|linebreaks}}</p> | ||
16 | +</div> | ||
19 | \ No newline at end of file | 17 | \ No newline at end of file |
courses/templates/subject/index.html
@@ -41,37 +41,39 @@ | @@ -41,37 +41,39 @@ | ||
41 | {% endblock %} | 41 | {% endblock %} |
42 | 42 | ||
43 | {% block content %} | 43 | {% block content %} |
44 | - <div class="panel panel-info"> | ||
45 | - <div class="panel-heading"> | 44 | + <div class="panel panel-info"> |
45 | + <div class="panel-heading"> | ||
46 | <div class="row"> | 46 | <div class="row"> |
47 | - <div class="col-md-7 col-sm-7"> | ||
48 | - <h3>{{subject}}</h3> | ||
49 | - </div> | ||
50 | - <div class="col-md-2 col-sm-2"> | 47 | + <div class="col-md-7 col-sm-7"> |
48 | + <h3>{{subject}}</h3> | ||
49 | + </div> | ||
50 | + <div class="col-md-2 col-sm-2"> | ||
51 | {% if user|has_role:'system_admin' or user in subject.professors %} | 51 | {% if user|has_role:'system_admin' or user in subject.professors %} |
52 | - <a href="{% url 'course:update_subject' subject.slug%}" class="btn">{% trans "edit" %}</a> | 52 | + <a href="{% url 'course:update_subject' subject.slug%}" class="btn">{% trans "edit" %}</a> |
53 | {% endif %} | 53 | {% endif %} |
54 | - </div> | 54 | + </div> |
55 | <div class="col-md-3 col-sm-3"> | 55 | <div class="col-md-3 col-sm-3"> |
56 | {% if user|has_role:'system_admin' or user in subject.professors %} | 56 | {% if user|has_role:'system_admin' or user in subject.professors %} |
57 | - <a href="{% url 'course:delete_subject' subject.slug%}" class="btn">{% trans "delete" %}</a> | 57 | + <a href="{% url 'course:delete_subject' subject.slug%}" class="btn">{% trans "delete" %}</a> |
58 | {% endif %} | 58 | {% endif %} |
59 | - </div> | ||
60 | - </div> | ||
61 | - </div> | ||
62 | - <div class="panel-body"> | ||
63 | - <p> | ||
64 | - {{subject.description|linebreaks}} | ||
65 | - </p> | ||
66 | - </div> | ||
67 | - </div> | ||
68 | -{% for topic in topics %} | ||
69 | - {% if user|has_role:'system_admin' or topic.owner == user%} | ||
70 | - {% include "subject/form_view_teacher.html" %} | ||
71 | - {% else %} | ||
72 | - {% include "subject/form_view_student.html" %} | ||
73 | - {% endif %} | ||
74 | -{% endfor %} | 59 | + </div> |
60 | + </div> | ||
61 | + </div> | ||
62 | + <div class="panel-body"> | ||
63 | + <p> | ||
64 | + {{subject.description|linebreaks}} | ||
65 | + </p> | ||
66 | + </div> | ||
67 | + </div> | ||
68 | + | ||
69 | + {% for topic in topics %} | ||
70 | + {% if user|has_role:'system_admin' or topic.owner == user%} | ||
71 | + {% include "subject/form_view_teacher.html" %} | ||
72 | + {% else %} | ||
73 | + {% include "subject/form_view_student.html" %} | ||
74 | + {% endif %} | ||
75 | + {% endfor %} | ||
76 | + | ||
75 | {% if user|has_role:'system_admin' or topic.owner == user%} | 77 | {% if user|has_role:'system_admin' or topic.owner == user%} |
76 | <a name="create_topic" class="btn btn-primary btn-md btn-block" href="{% url 'course:create_topic' subject.slug %}">{% trans "Create Topic" %}</a> | 78 | <a name="create_topic" class="btn btn-primary btn-md btn-block" href="{% url 'course:create_topic' subject.slug %}">{% trans "Create Topic" %}</a> |
77 | {% endif %} | 79 | {% endif %} |