Commit cddd2c21e3cbac47a02a1d30005abc8cdc8cc6a6
Exists in
master
and in
5 other branches
Fix conflit in template subject #133
Showing
22 changed files
with
878 additions
and
747 deletions
Show diff stats
core/static/css/base/amadeus.css
... | ... | @@ -326,4 +326,13 @@ body .container .jumbotron-inverse, body .container .well-inverse, body .contain |
326 | 326 | height: 150px; |
327 | 327 | } |
328 | 328 | |
329 | -.datepicker{z-index:9999 !important} | |
330 | 329 | \ No newline at end of file |
330 | +.datepicker{z-index:9999 !important} | |
331 | + | |
332 | +ul, li { | |
333 | + list-style-type: none !important; | |
334 | + text-decoration: none !important; | |
335 | +} | |
336 | + | |
337 | +.icon_edit_remove{ | |
338 | + float: right; | |
339 | +} | |
331 | 340 | \ No newline at end of file | ... | ... |
core/templates/base.html
... | ... | @@ -0,0 +1,31 @@ |
1 | +# -*- coding: utf-8 -*- | |
2 | +# Generated by Django 1.10 on 2016-10-13 17:29 | |
3 | +from __future__ import unicode_literals | |
4 | + | |
5 | +from django.db import migrations, models | |
6 | +import django.db.models.deletion | |
7 | + | |
8 | + | |
9 | +class Migration(migrations.Migration): | |
10 | + | |
11 | + dependencies = [ | |
12 | + ('core', '0002_mymetype'), | |
13 | + ('courses', '0004_auto_20161011_1951'), | |
14 | + ] | |
15 | + | |
16 | + operations = [ | |
17 | + migrations.CreateModel( | |
18 | + name='File', | |
19 | + fields=[ | |
20 | + ('material_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='courses.Material')), | |
21 | + ('description', models.TextField(blank=True, verbose_name='Description')), | |
22 | + ('content', models.FileField(upload_to='uploads/courses/subject/topic/%Y/%m/%d/')), | |
23 | + ('typ', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='file', to='core.MymeType', verbose_name='Type')), | |
24 | + ], | |
25 | + options={ | |
26 | + 'verbose_name': 'Topic file', | |
27 | + 'verbose_name_plural': 'Topic files', | |
28 | + }, | |
29 | + bases=('courses.material',), | |
30 | + ), | |
31 | + ] | ... | ... |
... | ... | @@ -0,0 +1,8 @@ |
1 | +$(".edit_card").on('click', function() { | |
2 | + $(".presentation").css('display','none'); | |
3 | + $(".editation").css('display','block'); | |
4 | +}) | |
5 | +$(".edit_card_end").on('click', function() { | |
6 | + $(".editation").css('display','none'); | |
7 | + $(".presentation").css('display','block'); | |
8 | +}) | |
0 | 9 | \ No newline at end of file | ... | ... |
courses/templates/subject/form_view_teacher.html
1 | -{% load static i18n list_topic_foruns permission_tags %} | |
2 | - | |
3 | -{% block javascript %} | |
4 | - <script type="text/javascript" src="{% static 'js/forum.js' %}"></script> | |
5 | -{% endblock %} | |
6 | - | |
7 | -<div class="panel-group accordion ui-accordion ui-widget ui-helper-reset ui-sortable" role="tablist" aria-multiselectable="false"> | |
8 | - <div class="group"><div class="panel panel-default"> | |
9 | - <div class="panel-heading headingOne ui-sortable-handle" role="tab"> | |
10 | - <div class="row"> | |
11 | - <div class="col-xs-9 col-md-10 titleTopic"> | |
12 | - <a role="button" data-toggle="collapse" data-parent=".accordion" href=".collapseOne" aria-expanded="false" aria-controls="collapseOne" class="" aria-selected="false" tabindex="-1"> | |
13 | - {{topic}} | |
14 | - </a> | |
15 | - </div> | |
16 | - <div class="col-xs-3 col-md-2 divMoreActions"> | |
17 | - <div class="btn-group"> | |
18 | - <button type="button" class="btn btn-default btn-sm eye" data-toggle="tooltip" data-placement="bottom" title="Visible"> | |
19 | - <i class="fa fa-eye fa-2x" aria-hidden="true"></i> | |
20 | - </button> | |
21 | - </div> | |
22 | - <div class="btn-group"> | |
23 | - <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | |
24 | - <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> | |
25 | - </button> | |
26 | - {% if user|has_role:'system_admin' or topic.owner == user%} | |
27 | - <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> | |
28 | - <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> | |
29 | - <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> | |
30 | - <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> | |
31 | - </ul> | |
32 | - {% endif %} | |
33 | - </div> | |
34 | - </div> | |
35 | - </div> | |
36 | - </div> | |
37 | - <div class="panel-collapse collapseOne collapse in" role="tabpanel" aria-labelledby="headingOne" aria-expanded="false" aria-hidden="true" tabindex="-1" aria-selected="false"> | |
38 | - <div class="panel-body"> | |
39 | - <div class="presentation"> | |
40 | - <p> | |
41 | - <i> | |
42 | - {{topic.description|linebreaks}} | |
43 | - </i> | |
44 | - </p> | |
1 | + {% load static i18n list_topic_foruns permission_tags %} | |
2 | + | |
3 | + {% block javascript %} | |
4 | + <script type="text/javascript" src="{% static 'js/forum.js' %}"></script> | |
5 | + {% endblock %} | |
6 | + | |
7 | + <div class="panel-group accordion ui-accordion ui-widget ui-helper-reset ui-sortable" role="tablist" aria-multiselectable="false"> | |
8 | + <div class="group"><div class="panel panel-default"> | |
9 | + <div class="panel-heading headingOne ui-sortable-handle" role="tab"> | |
45 | 10 | <div class="row"> |
46 | - <div class="col-xs-6 col-md-6"> | |
47 | - <div class="resource_inline"> | |
48 | - <h4>Material</h4> | |
49 | - </div> | |
50 | - <div class="resource_inline"> | |
51 | - <div class="dropdown"> | |
52 | - <a href="#" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-plus-circle fa-lg" aria-hidden="true"></i></a> | |
53 | - <ul class="dropdown-menu" aria-labelledby="dLabel"> | |
54 | - <li><a href="javascript:void(0)" data-toggle="modal" data-target="#createLinksModal">Create a Link<div class="ripple-container"><div class="ripple ripple-on ripple-out" style="left: 54.5312px; top: 22px; background-color: rgb(0, 150, 136); transform: scale(20);"></div></div></a></li> | |
55 | - <li><a href="javascript:void(0)" data-toggle="modal" data-target="#createFileModal">Create a file<div class="ripple-container"><div class="ripple ripple-on ripple-out" style="left: 33.5312px; top: 11px; background-color: rgb(0, 150, 136); transform: scale(20);"></div></div></a></li> | |
56 | - </ul> | |
57 | - </div> | |
58 | - </div> | |
59 | - <ul> | |
60 | - <li><i class="fa fa-book" aria-hidden="true"></i> <a href="#">Book 1</a></li> | |
61 | - <li><i class="fa fa-link" aria-hidden="true"></i> <a href="#" data-toggle="modal" data-target="#linksModal">Link 1</a></li> | |
62 | - <li><i class="fa fa-file-code-o" aria-hidden="true"></i> <a href="#" data-toggle="modal" data-target="#embedModal">EMBED Material</a></li> | |
63 | - </ul> | |
11 | + <div class="col-xs-9 col-md-10 titleTopic"> | |
12 | + <a role="button" data-toggle="collapse" data-parent=".accordion" href=".collapseOne" aria-expanded="false" aria-controls="collapseOne" class="" aria-selected="false" tabindex="-1"> | |
13 | + {{topic}} | |
14 | + </a> | |
64 | 15 | </div> |
65 | - <div class="col-xs-4 col-md-4"> | |
66 | - <div class="resource_inline"> | |
67 | - <h4>Activities</h4> | |
16 | + <div class="col-xs-3 col-md-2 divMoreActions"> | |
17 | + <div class="btn-group"> | |
18 | + <button type="button" class="btn btn-default btn-sm eye" data-toggle="tooltip" data-placement="bottom" title="Visible"> | |
19 | + <i class="fa fa-eye fa-2x" aria-hidden="true"></i> | |
20 | + </button> | |
68 | 21 | </div> |
69 | - <div class="resource_inline"> | |
70 | - <div class="dropdown"> | |
71 | - <a href="#" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-plus-circle fa-lg" aria-hidden="true"></i></a> | |
72 | - <ul class="dropdown-menu" aria-labelledby="dLabel"> | |
73 | - <li>Qualquer coisa</li> | |
74 | - </ul> | |
75 | - </div> | |
22 | + <div class="btn-group"> | |
23 | + <button class="btn btn-default btn-sm dropdown-toggle" type="button" id="moreActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | |
24 | + <i class="fa fa-ellipsis-v fa-2x" aria-hidden="true"></i> | |
25 | + </button> | |
26 | + {% if user|has_role:'system_admin' or topic.owner == user %} | |
27 | + <ul class="dropdown-menu pull-right" aria-labelledby="moreActions"> | |
28 | + <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> | |
29 | + <li><a href="javascript:void(0)" class="edit_card"><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> {% trans "Edit" %}</a></li> | |
30 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#removeTopic"><i class="fa fa-trash fa-fw" aria-hidden="true"></i> {% trans "Remove" %}</a></li> | |
31 | + </ul> | |
32 | + {% endif %} | |
76 | 33 | </div> |
77 | - <ul> | |
78 | - <li><i class="fa fa-file-text" aria-hidden="true"></i> <a href="#" data-toggle="modal" data-target="#ActivityModal">Activitie 1</a></li> | |
79 | - </ul> | |
80 | 34 | </div> |
81 | - <div class="col-xs-4 col-md-4"> | |
82 | - <div class="panel-body"> | |
83 | - <button class="btn btn-primary btn-raised" onclick="createForum('{% url 'course:forum:create' %}', '{{ topic.id }}')">{% trans '+ Create Forum' %}</button> | |
84 | - <div class="foruns_list"> | |
85 | - {% list_topic_foruns request topic %} | |
86 | - </div> | |
87 | - </div> | |
88 | - </div> | |
89 | - {% list_topic_poll request topic %} | |
90 | 35 | </div> |
91 | 36 | </div> |
92 | - <div class="editation"> | |
93 | - <div class="form-group"> | |
94 | - <label class="control-label" for="focusedInput2">Name Topic</label> | |
95 | - <input type="text" class="form-control" value="Topic 1"> | |
96 | - </div> | |
97 | - <div class="form-group is-empty"> | |
98 | - <label class="control-label" for="focusedInput2">Description</label> | |
99 | - <textarea class="form-control" rows="3" id="textArea"></textarea> | |
100 | - </div> | |
101 | - <div class="row"> | |
102 | - <div class=" col-xs-6 col-md-4"> | |
103 | - <div class="resource_inline"> | |
104 | - <h4>Material</h4> | |
105 | - </div> | |
106 | - <div class="resource_inline"> | |
107 | - <div class="dropdown"> | |
108 | - <a href="#" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-plus-circle fa-lg" aria-hidden="true"></i></a> | |
109 | - <ul class="dropdown-menu" aria-labelledby="dLabel"> | |
110 | - <li><a href="javascript:void(0)" data-toggle="modal" data-target="#createLinksModal">Create a Link</a></li> | |
111 | - <li><a href="javascript:void(0)" data-toggle="modal" data-target="#createFileModal">Create a file</a></li> | |
37 | + <div class="panel-collapse collapseOne collapse in" role="tabpanel" aria-labelledby="headingOne" aria-expanded="false" aria-hidden="true" tabindex="-1" aria-selected="false"> | |
38 | + <div class="panel-body"> | |
39 | + <div class="presentation"> | |
40 | + <p> | |
41 | + <i> | |
42 | + {{topic.description|linebreaks}} | |
43 | + </i> | |
44 | + </p> | |
45 | + <div class="row"> | |
46 | + <div class="col-xs-6 col-md-6"> | |
47 | + <div class="resource_inline"> | |
48 | + <h4>Material</h4> | |
49 | + </div> | |
50 | + <div class="resource_inline"> | |
51 | + <div class="dropdown"> | |
52 | + <a href="#" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-plus-circle fa-lg" aria-hidden="true"></i></a> | |
53 | + <ul class="dropdown-menu" aria-labelledby="dLabel"> | |
54 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#createLinksModal">Create a Link<div class="ripple-container"><div class="ripple ripple-on ripple-out" style="left: 54.5312px; top: 22px; background-color: rgb(0, 150, 136); transform: scale(20);"></div></div></a></li> | |
55 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#createFileModal">Create a file<div class="ripple-container"><div class="ripple ripple-on ripple-out" style="left: 33.5312px; top: 11px; background-color: rgb(0, 150, 136); transform: scale(20);"></div></div></a></li> | |
56 | + </ul> | |
57 | + </div> | |
58 | + </div> | |
59 | + <ul> | |
60 | + <li><i class="fa fa-book" aria-hidden="true"></i> <a href="#">Book 1</a></li> | |
61 | + <li><i class="fa fa-link" aria-hidden="true"></i> <a href="#" data-toggle="modal" data-target="#linksModal">Link 1</a></li> | |
62 | + <li><i class="fa fa-file-code-o" aria-hidden="true"></i> <a href="#" data-toggle="modal" data-target="#embedModal">EMBED Material</a></li> | |
63 | + </ul> | |
64 | + </div> | |
65 | + <div class="col-xs-4 col-md-4"> | |
66 | + <div class="resource_inline"> | |
67 | + <h4>Activities</h4> | |
68 | + </div> | |
69 | + <div class="resource_inline"> | |
70 | + <div class="dropdown"> | |
71 | + <a href="#" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-plus-circle fa-lg" aria-hidden="true"></i></a> | |
72 | + <ul class="dropdown-menu" aria-labelledby="dLabel"> | |
73 | + <li>Qualquer coisa</li> | |
74 | + </ul> | |
75 | + </div> | |
76 | + </div> | |
77 | + <ul> | |
78 | + <li><i class="fa fa-file-text" aria-hidden="true"></i> <a href="#" data-toggle="modal" data-target="#ActivityModal">Activitie 1</a></li> | |
112 | 79 | </ul> |
113 | 80 | </div> |
81 | + <div class="col-xs-4 col-md-4"> | |
82 | + <div class="panel-body"> | |
83 | + <button class="btn btn-primary btn-raised" onclick="createForum('{% url 'course:forum:create' %}', '{{ topic.id }}')">{% trans '+ Create Forum' %}</button> | |
84 | + <div class="foruns_list"> | |
85 | + {% list_topic_foruns request topic %} | |
86 | + </div> | |
87 | + </div> | |
88 | + </div> | |
89 | + {% list_topic_poll request topic %} | |
114 | 90 | </div> |
115 | - <ul> | |
116 | - <li class="icon_edit_remove"> <a href="#" data-toggle="modal" data-target="#editFileModal"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i></a> <a href="#" data-toggle="modal" data-target="#removeFileModal"><i class="fa fa-trash fa-lg" aria-hidden="true"></i></a></li> | |
117 | - <li><a href="#">Book 1</a> </li> | |
118 | - <li class="icon_edit_remove"> <a href="#" data-toggle="modal" data-target="#linksModalEdit"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i></a> <a href="#" data-toggle="modal" data-target="#removeLink"><i class="fa fa-trash fa-lg" aria-hidden="true"></i></a></li> | |
119 | - <li><a href="#" data-toggle="modal" data-target="#linksModal">Link 1</a></li> | |
120 | - <li class="icon_edit_remove"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i> <i class="fa fa-trash fa-lg" aria-hidden="true"></i></li> | |
121 | - <li><a href="#" data-toggle="modal" data-target="#embedModal">EMBED Material</a></li> | |
122 | - </ul> | |
123 | 91 | </div> |
124 | - <div class="col-xs-4 col-md-offset-1 col-md-4"> | |
125 | - <div class="resource_inline"> | |
126 | - <h4>Activities</h4> | |
92 | + <div class="editation" style="display: none"> | |
93 | + <div class="form-group"> | |
94 | + <label class="control-label" for="focusedInput2">Name Topic</label> | |
95 | + <input type="text" class="form-control" value="Topic 1"> | |
96 | + </div> | |
97 | + <div class="form-group is-empty"> | |
98 | + <label class="control-label" for="focusedInput2">Description</label> | |
99 | + <textarea class="form-control" rows="3" id="textArea"></textarea> | |
127 | 100 | </div> |
128 | - <div class="resource_inline"> | |
129 | - <div class="dropdown"> | |
130 | - <a href="#" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-plus-circle fa-lg" aria-hidden="true"></i></a> | |
131 | - <ul class="dropdown-menu" aria-labelledby="dLabel"> | |
132 | - <li>Qualquer coisa</li> | |
101 | + <div class="row"> | |
102 | + <div class=" col-xs-6 col-md-4"> | |
103 | + <div class="resource_inline"> | |
104 | + <h4>Material</h4> | |
105 | + </div> | |
106 | + <div class="resource_inline"> | |
107 | + <div class="dropdown"> | |
108 | + <a href="#" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-plus-circle fa-lg" aria-hidden="true"></i></a> | |
109 | + <ul class="dropdown-menu" aria-labelledby="dLabel"> | |
110 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#createLinksModal">Create a Link</a></li> | |
111 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#createFileModal">Create a file</a></li> | |
112 | + </ul> | |
113 | + </div> | |
114 | + </div> | |
115 | + <ul> | |
116 | + <li class="icon_edit_remove"> <a href="#" data-toggle="modal" data-target="#editFileModal"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i></a> <a href="#" data-toggle="modal" data-target="#removeFileModal"><i class="fa fa-trash fa-lg" aria-hidden="true"></i></a></li> | |
117 | + <li><a href="#">Book 1</a> </li> | |
118 | + <li class="icon_edit_remove"> <a href="#" data-toggle="modal" data-target="#linksModalEdit"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i></a> <a href="#" data-toggle="modal" data-target="#removeLink"><i class="fa fa-trash fa-lg" aria-hidden="true"></i></a></li> | |
119 | + <li><a href="#" data-toggle="modal" data-target="#linksModal">Link 1</a></li> | |
120 | + <li class="icon_edit_remove"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i> <i class="fa fa-trash fa-lg" aria-hidden="true"></i></li> | |
121 | + <li><a href="#" data-toggle="modal" data-target="#embedModal">EMBED Material</a></li> | |
133 | 122 | </ul> |
134 | 123 | </div> |
135 | - </div> | |
136 | - <ul> | |
137 | - <li class="icon_edit_remove"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i> <i class="fa fa-trash fa-lg" aria-hidden="true"></i></li> | |
138 | - <li><a href="#" data-toggle="modal" data-target="#ActivityModal">Activitie 1</a></li> | |
139 | - <li class="icon_edit_remove"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i> <i class="fa fa-trash fa-lg" aria-hidden="true"></i></li> | |
140 | - | |
141 | - </ul> | |
142 | - </div> | |
143 | - </div> | |
144 | - <div class="form-group"> | |
145 | - <div class="col-md-10"> | |
146 | - <button type="button" class="btn btn-raised btn-default edit_card_end">Cancel</button> | |
147 | - <button type="submit" class="btn btn-raised btn-primary edit_card_end">Submit</button> | |
148 | - </div> | |
149 | - </div> | |
150 | - </div> | |
151 | - </div> | |
152 | - </div> | |
153 | - <div class="panel-collapse collapseOne collapse in" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true" aria-hidden="false" tabindex="0"> | |
154 | - <div class="panel-body"> | |
155 | - <div class="presentation" style="display: block;"> | |
156 | - <div class="row"> | |
157 | - <div class="col-xs-6 col-md-4"> | |
158 | - <h4>Material</h4> | |
159 | - <ul> | |
160 | - <li><i class="material-icons">archive</i> <a href="#">Book 1</a></li> | |
161 | - <li><i class="material-icons">link</i> <a href="#" data-toggle="modal" data-target="#linksModal">Link 1</a></li> | |
162 | - <li><i class="fa fa-file" aria-hidden="true"></i> <a href="#" data-toggle="modal" data-target="#embedModal">EMBED Material</a></li> | |
163 | - </ul> | |
164 | - </div> | |
165 | - <div class="col-xs-4 col-md-4"> | |
166 | - <h4>Activities</h4> | |
167 | - <ul> | |
168 | - <li><i class="material-icons">description</i> <a href="#" data-toggle="modal" data-target="#ActivityModal">Activitie 1</a></li> | |
169 | - <li><i class="material-icons">list</i> <a href="#" data-toggle="modal" data-target="#forumModal">Forum</a></li> | |
170 | - | |
171 | - </ul> | |
172 | - | |
173 | - | |
124 | + <div class="col-xs-4 col-md-offset-1 col-md-4"> | |
125 | + <div class="resource_inline"> | |
126 | + <h4>Activities</h4> | |
127 | + </div> | |
128 | + <div class="resource_inline"> | |
129 | + <div class="dropdown"> | |
130 | + <a href="#" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-plus-circle fa-lg" aria-hidden="true"></i></a> | |
131 | + <ul class="dropdown-menu" aria-labelledby="dLabel"> | |
132 | + <li>Qualquer coisa</li> | |
133 | + </ul> | |
134 | + </div> | |
135 | + </div> | |
136 | + <ul> | |
137 | + <li class="icon_edit_remove"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i> <i class="fa fa-trash fa-lg" aria-hidden="true"></i></li> | |
138 | + <li><a href="#" data-toggle="modal" data-target="#ActivityModal">Activitie 1</a></li> | |
139 | + <li class="icon_edit_remove"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i> <i class="fa fa-trash fa-lg" aria-hidden="true"></i></li> | |
174 | 140 | |
175 | - </div> | |
176 | - | |
177 | - </div> | |
178 | - </div> | |
179 | - <div class="editation" style="display: none;"> | |
180 | - <div class="form-group"> | |
181 | - <label class="control-label" for="focusedInput2">Name Topic</label> | |
182 | - <input type="text" class="form-control" value="Topic 1"> | |
183 | - </div> | |
184 | - <div class="form-group is-empty"> | |
185 | - <label class="control-label" for="focusedInput2">Description</label> | |
186 | - <textarea class="form-control" rows="3" id="textArea"></textarea> | |
187 | - </div> | |
188 | - <div class="row"> | |
189 | - <div class=" col-xs-6 col-md-4"> | |
190 | - <div class="resource_inline"> | |
191 | - <h4>Material</h4> | |
192 | - </div> | |
193 | - <div class="resource_inline"> | |
194 | - <div class="dropdown"> | |
195 | - <a href="#" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-plus-circle fa-lg" aria-hidden="true"></i></a> | |
196 | - <ul class="dropdown-menu" aria-labelledby="dLabel"> | |
197 | - <li><a href="javascript:void(0)" data-toggle="modal" data-target="#createLinksModal">Create a Link</a></li> | |
198 | - <li><a href="javascript:void(0)" data-toggle="modal" data-target="#createFileModal">Create a file</a></li> | |
199 | 141 | </ul> |
200 | 142 | </div> |
201 | 143 | </div> |
202 | - <ul> | |
203 | - <li class="icon_edit_remove"> <a href="#" data-toggle="modal" data-target="#editFileModal"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i></a> <a href="#" data-toggle="modal" data-target="#removeFileModal"><i class="fa fa-trash fa-lg" aria-hidden="true"></i></a></li> | |
204 | - <li><a href="#">Book 1</a> </li> | |
205 | - <li class="icon_edit_remove"> <a href="#" data-toggle="modal" data-target="#linksModalEdit"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i></a> <a href="#" data-toggle="modal" data-target="#removeLink"><i class="fa fa-trash fa-lg" aria-hidden="true"></i></a></li> | |
206 | - <li><a href="#" data-toggle="modal" data-target="#linksModal">Link 1</a></li> | |
207 | - <li class="icon_edit_remove"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i> <i class="fa fa-trash fa-lg" aria-hidden="true"></i></li> | |
208 | - <li><a href="#" data-toggle="modal" data-target="#embedModal">EMBED Material</a></li> | |
209 | - </ul> | |
210 | - </div> | |
211 | - <div class="col-xs-4 col-md-offset-1 col-md-4"> | |
212 | - <div class="resource_inline"> | |
213 | - <h4>Activities</h4> | |
214 | - </div> | |
215 | - <div class="resource_inline"> | |
216 | - <div class="dropdown"> | |
217 | - <a href="#" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-plus-circle fa-lg" aria-hidden="true"></i></a> | |
218 | - <ul class="dropdown-menu" aria-labelledby="dLabel"> | |
219 | - <li>Qualquer coisa</li> | |
220 | - </ul> | |
144 | + <div class="form-group"> | |
145 | + <div class="col-md-10"> | |
146 | + <button type="button" class="btn btn-raised btn-default edit_card_end">Cancel</button> | |
147 | + <button type="submit" class="btn btn-raised btn-primary edit_card_end">Submit</button> | |
221 | 148 | </div> |
222 | 149 | </div> |
223 | - <ul> | |
224 | - <li class="icon_edit_remove"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i> <i class="fa fa-trash fa-lg" aria-hidden="true"></i></li> | |
225 | - <li><a href="#" data-toggle="modal" data-target="#ActivityModal">Activitie 1</a></li> | |
226 | - <li class="icon_edit_remove"><i class="fa fa-pencil fa-lg" aria-hidden="true"></i> <i class="fa fa-trash fa-lg" aria-hidden="true"></i></li> | |
227 | - <li><a href="#" data-toggle="modal" data-target="#forumModal">Forum</a></li> | |
228 | - </ul> | |
229 | 150 | </div> |
230 | 151 | </div> |
231 | - <div class="form-group"> | |
232 | - <div class="col-md-10"> | |
233 | - <button type="button" class="btn btn-raised btn-default edit_card_end">Cancel<div class="ripple-container"><div class="ripple ripple-on ripple-out" style="left: 69px; top: 14px; background-color: rgba(0, 0, 0, 0.870588); transform: scale(14.1289);"></div></div></button> | |
234 | - <button type="submit" class="btn btn-raised btn-primary edit_card_end">Submit</button> | |
152 | + </div> | |
153 | + | |
154 | + </div> | |
155 | + <!-- MODAL REMOVE TOPIC --> | |
156 | + <div class="modal" id="removeTopic"> | |
157 | + <div class="modal-dialog"> | |
158 | + <div class="modal-content"> | |
159 | + <div class="modal-header"> | |
160 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button> | |
161 | + <h4 class="modal-title"></h4> | |
162 | + </div> | |
163 | + <div class="modal-body"> | |
164 | + <p>Delete your Topic?</p> | |
165 | + </div> | |
166 | + <div class="modal-footer"> | |
167 | + | |
168 | + <a href="http://localhost:8080/html/screens/users/profile_user.html" target="_self"><button type="button" class="btn btn-primary">Confirm</button></a> | |
169 | + | |
235 | 170 | </div> |
236 | 171 | </div> |
237 | 172 | </div> |
238 | 173 | </div> |
239 | - </div> | |
240 | -</div> | |
174 | + <!-- END --> | |
241 | 175 | |
242 | - | |
243 | -<!-- MODAL REMOVE TOPIC --> | |
244 | -<div class="modal" id="removeTopic"> | |
245 | - <div class="modal-dialog"> | |
176 | + <!-- MODAL EDIT FILE --> | |
177 | + <div class="modal fade" id="editFileModal" tabindex="-1" role="dialog" aria-labelledby="editFileLabel"> | |
178 | + <div class="modal-dialog" role="document"> | |
246 | 179 | <div class="modal-content"> |
247 | 180 | <div class="modal-header"> |
248 | - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button> | |
249 | - <h4 class="modal-title"></h4> | |
181 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
182 | + <h4 class="modal-title" id="editFileLabel">Add File</h4> | |
250 | 183 | </div> |
251 | 184 | <div class="modal-body"> |
252 | - <p>Delete your Topic?</p> | |
253 | - </div> | |
254 | - <div class="modal-footer"> | |
185 | + <!-- Card --> | |
255 | 186 | |
256 | - <a href="http://localhost:8080/html/screens/users/profile_user.html" target="_self"><button type="button" class="btn btn-primary">Confirm</button></a> | |
187 | + <form class="form-horizontal"> | |
188 | + <fieldset> | |
257 | 189 | |
258 | - </div> | |
259 | - </div> | |
260 | - </div> | |
261 | -</div> | |
262 | -<!-- END --> | |
263 | - | |
264 | -<!-- MODAL EDIT FILE --> | |
265 | -<div class="modal fade" id="editFileModal" tabindex="-1" role="dialog" aria-labelledby="editFileLabel"> | |
266 | -<div class="modal-dialog" role="document"> | |
267 | -<div class="modal-content"> | |
268 | - <div class="modal-header"> | |
269 | - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
270 | - <h4 class="modal-title" id="editFileLabel">Add File</h4> | |
271 | - </div> | |
272 | - <div class="modal-body"> | |
273 | - <!-- Card --> | |
190 | + <div class="form-group"> | |
191 | + <label for="inputName" class="col-md-2 control-label">Name</label> | |
274 | 192 | |
275 | - <form class="form-horizontal"> | |
276 | - <fieldset> | |
193 | + <div class="col-md-10"> | |
194 | + <input type="text" class="form-control" id="inputText" placeholder="Name" value="Book 1"> | |
195 | + </div> | |
196 | + </div> | |
277 | 197 | |
278 | - <div class="form-group"> | |
279 | - <label for="inputName" class="col-md-2 control-label">Name</label> | |
198 | + <div class="form-group is-empty is-fileinput"> | |
199 | + <label for="inputFile" class="col-md-2 control-label">File</label> | |
280 | 200 | |
281 | - <div class="col-md-10"> | |
282 | - <input type="text" class="form-control" id="inputText" placeholder="Name" value="Book 1"> | |
283 | - </div> | |
284 | - </div> | |
201 | + <div class="col-md-10"> | |
202 | + <input type="text" readonly="" class="form-control" placeholder="Browse..."> | |
203 | + <input type="file" id="inputFile" multiple=""> | |
204 | + </div> | |
205 | + </div> | |
285 | 206 | |
286 | - <div class="form-group is-empty is-fileinput"> | |
287 | - <label for="inputFile" class="col-md-2 control-label">File</label> | |
288 | 207 | |
289 | - <div class="col-md-10"> | |
290 | - <input type="text" readonly="" class="form-control" placeholder="Browse..."> | |
291 | - <input type="file" id="inputFile" multiple=""> | |
292 | - </div> | |
293 | - </div> | |
208 | + <div class="form-group"> | |
209 | + <div class="col-md-12 text-center"> | |
210 | + <p><b>The file size shouldn't exceed 10MB</b></p> | |
211 | + </div> | |
212 | + </div> | |
294 | 213 | |
214 | + <div class="form-group"> | |
215 | + <div class="col-md-12"> | |
216 | + <a href="javascript:void(0)" class="btn btn-raised btn-default">Cancel</a> | |
217 | + <a href="javascript:void(0)" class="btn btn-raised btn-primary">Submit</a> | |
218 | + </div> | |
219 | + </div> | |
220 | + </fieldset> | |
221 | + </form> | |
295 | 222 | |
296 | - <div class="form-group"> | |
297 | - <div class="col-md-12 text-center"> | |
298 | - <p><b>The file size shouldn't exceed 10MB</b></p> | |
299 | - </div> | |
300 | - </div> | |
301 | 223 | |
302 | - <div class="form-group"> | |
303 | - <div class="col-md-12"> | |
304 | - <a href="javascript:void(0)" class="btn btn-raised btn-default">Cancel</a> | |
305 | - <a href="javascript:void(0)" class="btn btn-raised btn-primary">Submit</a> | |
306 | - </div> | |
307 | - </div> | |
308 | - </fieldset> | |
309 | - </form> | |
310 | - | |
311 | - | |
312 | - <!-- .end Card --> | |
224 | + <!-- .end Card --> | |
225 | + </div> | |
226 | + </div> | |
313 | 227 | </div> |
314 | 228 | </div> |
315 | - </div> | |
316 | -</div> | |
317 | 229 | |
318 | 230 | {% if user|has_role:'system_admin' or topic.owner == user%} |
319 | 231 | {% include "files/create_file.html" %} |
320 | 232 | {% endif %} |
321 | 233 | |
322 | -<!-- MODAL REMOVE FILE --> | |
323 | -<div class="modal" id="removeFileModal"> | |
324 | - <div class="modal-dialog"> | |
325 | - <div class="modal-content"> | |
326 | - <div class="modal-header"> | |
327 | - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button> | |
328 | - <h4 class="modal-title"></h4> | |
329 | - </div> | |
330 | - <div class="modal-body"> | |
331 | - <p>Do you really want to delete this file?</p> | |
332 | - </div> | |
333 | - <div class="modal-footer"> | |
334 | - | |
335 | - <a href="#" target="_self"><button type="button" class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Confirm</button></a> | |
234 | + <!-- EndModal --> | |
336 | 235 | |
337 | - </div> | |
338 | - </div> | |
339 | - </div> | |
340 | -</div> | |
341 | -<!-- END --> | |
342 | - | |
343 | -<!--MODAL VIEW LINK--> | |
344 | -<div class="modal fade" id="linksModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | |
345 | - <div class="modal-dialog" role="document"> | |
236 | + <!-- MODAL CREATE FILE --> | |
237 | + <div class="modal fade" id="createFileModal" tabindex="-1" role="dialog" aria-labelledby="createFileLabel" style="display: none;"> | |
238 | + <div class="modal-dialog" role="document"> | |
346 | 239 | <div class="modal-content"> |
347 | 240 | <div class="modal-header"> |
348 | 241 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
349 | - <h4 class="modal-title" id="myModalLabel">Links</h4> | |
242 | + <h4 class="modal-title" id="createFileLabel">Add File</h4> | |
350 | 243 | </div> |
351 | 244 | <div class="modal-body"> |
352 | 245 | <!-- Card --> |
353 | - <article class="card animated fadeInLeft"> | |
354 | - <img class="card-img-top img-responsive" src="https://www.python.org/static/opengraph-icon-200x200.png" align="left"> | |
355 | - <div class="card-block"> | |
356 | - <b class="card-title">Python</b><p></p> | |
357 | - <b class="text-muted">Guido van Rossum</b> | |
358 | - <p class="card-text"> </p><p>Python is a widely used high-level, general-purpose, interpreted, dynamic programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than possible in languages such as C++ or Java.</p> | |
359 | - <a href="https://www.python.org/" class="btn btn-primary">Read more</a> | |
360 | - </div> | |
361 | - </article> | |
362 | - <!-- .end Card --> | |
363 | - </div> | |
364 | - </div> | |
365 | - </div> | |
366 | -</div> | |
367 | -<!-- EndModal --> | |
368 | 246 | |
369 | -<!--MODAL CREATE LINK--> | |
370 | -<div class="modal fade" id="createLinksModal" tabindex="-1" role="dialog" aria-labelledby="createLink" style="display: none;"> | |
371 | - <div class="modal-dialog" role="document"> | |
372 | - <div class="modal-content"> | |
373 | - <div class="modal-header"> | |
374 | - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
375 | - <h4 class="modal-title" id="createLink">Create a New Link</h4> | |
376 | - </div> | |
377 | - <div class="modal-body"> | |
378 | - <!-- Card --> | |
379 | - <div class="form-group is-empty"> | |
380 | - <label class="control-label" for="inputDefault">Name</label> | |
381 | - <input type="text" class="form-control" id="inputDefault"> | |
382 | - </div> | |
383 | - <div class="form-group is-empty"> | |
384 | - <label class="control-label" for="inputDefault">Url</label> | |
385 | - <input type="text" class="form-control" id="inputDefault"> | |
386 | - </div> | |
387 | - <div class="form-group is-empty"> | |
388 | - <label class="control-label" for="inputDefault">Descrição</label> | |
389 | - <textarea class="form-control" rows="3"></textarea> | |
247 | + <form class="form-horizontal"> | |
248 | + <fieldset> | |
249 | + | |
250 | + <div class="form-group is-empty"> | |
251 | + <label for="inputName" class="col-md-2 control-label">Name</label> | |
252 | + | |
253 | + <div class="col-md-10"> | |
254 | + <input type="text" class="form-control" id="inputText" placeholder="Name"> | |
255 | + </div> | |
256 | + </div> | |
257 | + | |
258 | + <div class="form-group is-empty is-fileinput"> | |
259 | + <label for="inputFile" class="col-md-2 control-label">File</label> | |
260 | + | |
261 | + <div class="col-md-10"> | |
262 | + <input type="text" readonly="" class="form-control" placeholder="Browse..."> | |
263 | + <input type="file" id="inputFile" multiple=""> | |
264 | + </div> | |
265 | + </div> | |
266 | + | |
267 | + | |
268 | + <div class="form-group"> | |
269 | + <div class="col-md-12 text-center"> | |
270 | + <p><b>The file size shouldn't exceed 10MB</b></p> | |
271 | + </div> | |
272 | + </div> | |
273 | + | |
274 | + <div class="form-group"> | |
275 | + <div class="col-md-12"> | |
276 | + <a href="javascript:void(0)" class="btn btn-raised btn-default">Cancel<div class="ripple-container"></div></a> | |
277 | + <a href="javascript:void(0)" class="btn btn-raised btn-primary">Submit</a> | |
278 | + </div> | |
279 | + </div> | |
280 | + </fieldset> | |
281 | + </form> | |
282 | + | |
283 | +>>>>>>> ba384ee6d51624227304d098d60d29248bbd3bbc | |
284 | + | |
285 | + <!-- .end Card --> | |
286 | + </div> | |
390 | 287 | </div> |
391 | - <div class="form-group"> | |
392 | - <a href="javascript:void(0)" class="btn btn-raised btn-default">Cancel</a> | |
393 | - <a href="javascript:void(0)" class="btn btn-raised btn-primary">Submit</a> | |
394 | - </div> | |
395 | - <!-- .end Card --> | |
396 | 288 | </div> |
397 | 289 | </div> |
398 | - </div> | |
399 | -</div> | |
400 | -<!-- EndModal --> | |
290 | + <!-- EndModal --> | |
401 | 291 | |
402 | -<!-- MODAL REMOVE LINK --> | |
403 | -<div class="modal" id="removeLink"> | |
404 | - <div class="modal-dialog"> | |
405 | - <div class="modal-content"> | |
406 | - <div class="modal-header"> | |
407 | - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button> | |
408 | - <h4 class="modal-title"></h4> | |
409 | - </div> | |
410 | - <div class="modal-body"> | |
411 | - <p>Do you really want to delete this link?</p> | |
412 | - </div> | |
413 | - <div class="modal-footer"> | |
292 | + <!-- MODAL REMOVE FILE --> | |
293 | + <div class="modal" id="removeFileModal"> | |
294 | + <div class="modal-dialog"> | |
295 | + <div class="modal-content"> | |
296 | + <div class="modal-header"> | |
297 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button> | |
298 | + <h4 class="modal-title"></h4> | |
299 | + </div> | |
300 | + <div class="modal-body"> | |
301 | + <p>Do you really want to delete this file?</p> | |
302 | + </div> | |
303 | + <div class="modal-footer"> | |
414 | 304 | |
415 | - <a href="#" target="_self"><button type="button" class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Confirm</button></a> | |
305 | + <a href="#" target="_self"><button type="button" class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Confirm</button></a> | |
416 | 306 | |
307 | + </div> | |
308 | + </div> | |
417 | 309 | </div> |
418 | 310 | </div> |
419 | - </div> | |
420 | -</div> | |
421 | -<!-- END --> | |
311 | + <!-- END --> | |
422 | 312 | |
423 | -<!-- MODAL EMBEED--> | |
424 | -<div class="modal fade" id="embedModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | |
425 | - <div class="modal-dialog" role="document"> | |
426 | - <div class="modal-content"> | |
427 | - <div class="modal-header"> | |
428 | - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
429 | - <h4 class="modal-title" id="myModalLabel">Material EMBED</h4> | |
430 | - </div> | |
431 | - <div class="modal-body"> | |
432 | - <div class="form-group is-empty"> | |
433 | - <label for="inputEmail" class="col-md-2 control-label">Name:</label> | |
434 | - <div class="col-md-10"> | |
435 | - <input type="text" class="form-control" id="inputEmail" placeholder="Name"> | |
313 | + <!--MODAL VIEW LINK--> | |
314 | + <div class="modal fade" id="linksModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | |
315 | + <div class="modal-dialog" role="document"> | |
316 | + <div class="modal-content"> | |
317 | + <div class="modal-header"> | |
318 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
319 | + <h4 class="modal-title" id="myModalLabel">Links</h4> | |
320 | + </div> | |
321 | + <div class="modal-body"> | |
322 | + <!-- Card --> | |
323 | + <article class="card animated fadeInLeft"> | |
324 | + <img class="card-img-top img-responsive" src="https://www.python.org/static/opengraph-icon-200x200.png" align="left"> | |
325 | + <div class="card-block"> | |
326 | + <b class="card-title">Python</b><p></p> | |
327 | + <b class="text-muted">Guido van Rossum</b> | |
328 | + <p class="card-text"> </p><p>Python is a widely used high-level, general-purpose, interpreted, dynamic programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than possible in languages such as C++ or Java.</p> | |
329 | + <a href="https://www.python.org/" class="btn btn-primary">Read more</a> | |
330 | + </div> | |
331 | + </article> | |
332 | + <!-- .end Card --> | |
436 | 333 | </div> |
437 | 334 | </div> |
438 | - <form class="form-horizontal"> | |
439 | - <div class="form-group is-empty"> | |
440 | - <label for="textArea" class="col-md-2 control-label">Code:</label> | |
335 | + </div> | |
336 | + </div> | |
337 | + <!-- EndModal --> | |
441 | 338 | |
442 | - <div class="col-md-10"> | |
443 | - <textarea class="form-control" rows="2" id="textArea"></textarea> | |
444 | - <span class="help-block">Material description</span> | |
445 | - </div> | |
339 | + <!--MODAL CREATE LINK--> | |
340 | + <div class="modal fade" id="createLinksModal" tabindex="-1" role="dialog" aria-labelledby="createLink" style="display: none;"> | |
341 | + <div class="modal-dialog" role="document"> | |
342 | + <div class="modal-content"> | |
343 | + <div class="modal-header"> | |
344 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
345 | + <h4 class="modal-title" id="createLink">Create a New Link</h4> | |
446 | 346 | </div> |
447 | - <div class="form-group is-empty"> | |
448 | - <label for="number" class="col-md-2 control-label">Height</label> | |
449 | - <div class="col-md-4"> | |
450 | - <input type="number" class="form-control" id="inputNumber" placeholder="Heiht"> | |
347 | + <div class="modal-body"> | |
348 | + <!-- Card --> | |
349 | + <div class="form-group is-empty"> | |
350 | + <label class="control-label" for="inputDefault">Name</label> | |
351 | + <input type="text" class="form-control" id="inputDefault"> | |
451 | 352 | </div> |
452 | - </div> | |
453 | - <div class="form-group is-empty"> | |
454 | - <label for="number" class="col-md-2 control-label">Weight</label> | |
455 | - <div class="col-md-4"> | |
456 | - <input type="number" class="form-control" id="inputNumber" placeholder="Weight"> | |
353 | + <div class="form-group is-empty"> | |
354 | + <label class="control-label" for="inputDefault">Url</label> | |
355 | + <input type="text" class="form-control" id="inputDefault"> | |
457 | 356 | </div> |
357 | + <div class="form-group is-empty"> | |
358 | + <label class="control-label" for="inputDefault">Descrição</label> | |
359 | + <textarea class="form-control" rows="3"></textarea> | |
360 | + </div> | |
361 | + <div class="form-group"> | |
362 | + <a href="javascript:void(0)" class="btn btn-raised btn-default">Cancel</a> | |
363 | + <a href="javascript:void(0)" class="btn btn-raised btn-primary">Submit</a> | |
458 | 364 | </div> |
459 | - </form> | |
460 | - | |
461 | - </div> | |
462 | - <div class="modal-footer"> | |
463 | - <!-- Don't remove that!!! | |
464 | - <button type="button" class="btn btn-danger btn-raised" data-dismiss="modal">Close</button>--> | |
465 | - | |
466 | - <!-- Put curtom buttons here!!! --> | |
467 | - <button type="button" class="btn btn-primary btn-raised">Confirm</button> | |
365 | + <!-- .end Card --> | |
366 | + </div> | |
367 | + </div> | |
468 | 368 | </div> |
469 | 369 | </div> |
470 | - </div> | |
471 | -</div> | |
472 | -<!-- EndModal --> | |
370 | + <!-- EndModal --> | |
473 | 371 | |
474 | -<!-- MODAL ACTIVITIES--> | |
475 | -<div class="modal fade" id="ActivityModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | |
476 | - <div class="modal-dialog" role="document"> | |
477 | - <div class="modal-content"> | |
478 | - <div class="modal-header"> | |
479 | - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
480 | - <h4 class="modal-title" id="myModalLabel"></h4> | |
481 | - </div> | |
482 | - <div class="modal-body"> | |
483 | - <form class="form-horizontal"> | |
484 | - | |
485 | - <fieldset> | |
486 | - <legend>Atividade Proposta</legend> | |
487 | - <div class="form-group is-empty"> | |
488 | - <label for="NameIn" class="col-md-2 control-label">Name:</label> | |
489 | - <div class="col-md-10"> | |
490 | - <input type="text" id="NameIn" class="form-control"> | |
372 | + <!-- MODAL REMOVE LINK --> | |
373 | + <div class="modal" id="removeLink"> | |
374 | + <div class="modal-dialog"> | |
375 | + <div class="modal-content"> | |
376 | + <div class="modal-header"> | |
377 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button> | |
378 | + <h4 class="modal-title"></h4> | |
491 | 379 | </div> |
492 | - </div> | |
493 | - <div class="form-group is-empty"> | |
494 | - <label for="DescIn" class="col-md-2 control-label">Describe:</label> | |
495 | - <div class="col-md-10"> | |
496 | - <textarea class="form-control" id="DescIn" rows="2"></textarea> | |
380 | + <div class="modal-body"> | |
381 | + <p>Do you really want to delete this link?</p> | |
497 | 382 | </div> |
498 | - </div> | |
499 | - <div class="form-group is-empty"> | |
500 | - <label for="DateIn" class="col-md-2 control-label">Opening: </label> | |
501 | - <div class="col-md-10"> | |
502 | - <input type="text" id="DateIn" class="form-control date-picker" requerid=""> | |
383 | + <div class="modal-footer"> | |
384 | + | |
385 | + <a href="#" target="_self"><button type="button" class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Confirm</button></a> | |
386 | + | |
503 | 387 | </div> |
504 | 388 | </div> |
505 | - <div class="form-group is-empty"> | |
506 | - <label for="DateIn" class="col-md-2 control-label">Ending: </label> | |
507 | - <div class="col-md-10"> | |
508 | - <input type="text" id="DateIn" class="form-control date-picker" requerid=""> | |
389 | + </div> | |
390 | + </div> | |
391 | + <!-- END --> | |
392 | + | |
393 | + <!-- MODAL EMBEED--> | |
394 | + <div class="modal fade" id="embedModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | |
395 | + <div class="modal-dialog" role="document"> | |
396 | + <div class="modal-content"> | |
397 | + <div class="modal-header"> | |
398 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
399 | + <h4 class="modal-title" id="myModalLabel">Material EMBED</h4> | |
509 | 400 | </div> |
510 | - </div> | |
511 | - <div class="form-group" style="margin-top: 0;"> | |
512 | - <div class="col-md-offset-2 col-md-10"> | |
513 | - <div class="checkbox"> | |
514 | - <label> | |
515 | - <input type="checkbox"><span class="checkbox-material"><span class="check"></span></span> Send Later | |
516 | - </label> | |
401 | + <div class="modal-body"> | |
402 | + <div class="form-group is-empty"> | |
403 | + <label for="inputEmail" class="col-md-2 control-label">Name:</label> | |
404 | + <div class="col-md-10"> | |
405 | + <input type="text" class="form-control" id="inputEmail" placeholder="Name"> | |
406 | + </div> | |
517 | 407 | </div> |
408 | + <form class="form-horizontal"> | |
409 | + <div class="form-group is-empty"> | |
410 | + <label for="textArea" class="col-md-2 control-label">Code:</label> | |
411 | + | |
412 | + <div class="col-md-10"> | |
413 | + <textarea class="form-control" rows="2" id="textArea"></textarea> | |
414 | + <span class="help-block">Material description</span> | |
415 | + </div> | |
416 | + </div> | |
417 | + <div class="form-group is-empty"> | |
418 | + <label for="number" class="col-md-2 control-label">Height</label> | |
419 | + <div class="col-md-4"> | |
420 | + <input type="number" class="form-control" id="inputNumber" placeholder="Heiht"> | |
421 | + </div> | |
422 | + </div> | |
423 | + <div class="form-group is-empty"> | |
424 | + <label for="number" class="col-md-2 control-label">Weight</label> | |
425 | + <div class="col-md-4"> | |
426 | + <input type="number" class="form-control" id="inputNumber" placeholder="Weight"> | |
427 | + </div> | |
428 | + </div> | |
429 | + </form> | |
430 | + | |
518 | 431 | </div> |
519 | - </div> | |
520 | - <div class="form-group"> | |
521 | - <div class="col-md-10 col-md-offset-2"> | |
522 | - <button type="button" class="btn btn-default">Cancel</button> | |
523 | - <button type="submit" class="btn btn-primary">Submit</button> | |
432 | + <div class="modal-footer"> | |
433 | + <!-- Don't remove that!!! | |
434 | + <button type="button" class="btn btn-danger btn-raised" data-dismiss="modal">Close</button>--> | |
435 | + | |
436 | + <!-- Put curtom buttons here!!! --> | |
437 | + <button type="button" class="btn btn-primary btn-raised">Confirm</button> | |
524 | 438 | </div> |
525 | 439 | </div> |
440 | + </div> | |
441 | + </div> | |
442 | + <!-- EndModal --> | |
443 | + | |
444 | + <!-- MODAL ACTIVITIES--> | |
445 | + <div class="modal fade" id="ActivityModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | |
446 | + <div class="modal-dialog" role="document"> | |
447 | + <div class="modal-content"> | |
448 | + <div class="modal-header"> | |
449 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
450 | + <h4 class="modal-title" id="myModalLabel"></h4> | |
451 | + </div> | |
452 | + <div class="modal-body"> | |
453 | + <form class="form-horizontal"> | |
454 | + | |
455 | + <fieldset> | |
456 | + <legend>Atividade Proposta</legend> | |
457 | + <div class="form-group is-empty"> | |
458 | + <label for="NameIn" class="col-md-2 control-label">Name:</label> | |
459 | + <div class="col-md-10"> | |
460 | + <input type="text" id="NameIn" class="form-control"> | |
461 | + </div> | |
462 | + </div> | |
463 | + <div class="form-group is-empty"> | |
464 | + <label for="DescIn" class="col-md-2 control-label">Describe:</label> | |
465 | + <div class="col-md-10"> | |
466 | + <textarea class="form-control" id="DescIn" rows="2"></textarea> | |
467 | + </div> | |
468 | + </div> | |
469 | + <div class="form-group is-empty"> | |
470 | + <label for="DateIn" class="col-md-2 control-label">Opening: </label> | |
471 | + <div class="col-md-10"> | |
472 | + <input type="text" id="DateIn" class="form-control date-picker" requerid=""> | |
473 | + </div> | |
474 | + </div> | |
475 | + <div class="form-group is-empty"> | |
476 | + <label for="DateIn" class="col-md-2 control-label">Ending: </label> | |
477 | + <div class="col-md-10"> | |
478 | + <input type="text" id="DateIn" class="form-control date-picker" requerid=""> | |
479 | + </div> | |
480 | + </div> | |
481 | + <div class="form-group" style="margin-top: 0;"> | |
482 | + <div class="col-md-offset-2 col-md-10"> | |
483 | + <div class="checkbox"> | |
484 | + <label> | |
485 | + <input type="checkbox"><span class="checkbox-material"><span class="check"></span></span> Send Later | |
486 | + </label> | |
487 | + </div> | |
488 | + </div> | |
489 | + </div> | |
490 | + <div class="form-group"> | |
491 | + <div class="col-md-10 col-md-offset-2"> | |
492 | + <button type="button" class="btn btn-default">Cancel</button> | |
493 | + <button type="submit" class="btn btn-primary">Submit</button> | |
494 | + </div> | |
495 | + </div> | |
526 | 496 | |
527 | 497 | |
528 | - </fieldset> | |
529 | - </form> | |
498 | + </fieldset> | |
499 | + </form> | |
500 | + </div> | |
501 | + </div> | |
530 | 502 | </div> |
531 | 503 | </div> |
532 | - </div> | |
533 | -</div> | |
534 | -<!--EndModal--> | |
504 | + <!--EndModal--> | |
535 | 505 | |
536 | -<!-- MODAL FORUM --> | |
537 | -<div class="modal fade" id="forumModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | |
538 | - <div class="modal-dialog" role="document"> | |
539 | - <div class="modal-content"> | |
540 | - <div class="modal-header"> | |
541 | - <h4 class="modal-title" id="myModalLabel">Forum</h4> | |
542 | - </div> | |
543 | - <div class="modal-body"> | |
544 | - <!--Forum--> | |
545 | - <!--Main wrapper--> | |
546 | - <div class="comments-list"> | |
547 | - <div class="section-heading"> | |
548 | - <h1>Python</h1> | |
549 | - <h4><b>Description:</b>High-level Language</h4> | |
550 | - <h4><b>Opened in:</b> September 1st</h4> | |
506 | + <!-- MODAL FORUM --> | |
507 | + <div class="modal fade" id="forumModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | |
508 | + <div class="modal-dialog" role="document"> | |
509 | + <div class="modal-content"> | |
510 | + <div class="modal-header"> | |
511 | + <h4 class="modal-title" id="myModalLabel">Forum</h4> | |
551 | 512 | </div> |
552 | - <!--First row--> | |
553 | - <div class="row"> | |
513 | + <div class="modal-body"> | |
514 | + <!--Forum--> | |
515 | + <!--Main wrapper--> | |
516 | + <div class="comments-list"> | |
517 | + <div class="section-heading"> | |
518 | + <h1>Python</h1> | |
519 | + <h4><b>Description:</b>High-level Language</h4> | |
520 | + <h4><b>Opened in:</b> September 1st</h4> | |
521 | + </div> | |
522 | + <!--First row--> | |
523 | + <div class="row"> | |
554 | 524 | |
555 | - <!--Content column--> | |
556 | - <div class="col-sm-10 col-xs-12"> | |
557 | - <h3 class="user-name">Gerson Jefferson</h3> | |
525 | + <!--Content column--> | |
526 | + <div class="col-sm-10 col-xs-12"> | |
527 | + <h3 class="user-name">Gerson Jefferson</h3> | |
558 | 528 | |
559 | - <div class="card-data"> | |
560 | - <p class="comment-date"><i class="fa fa-clock-o"></i> 05/10/2015</p> | |
561 | - </div> | |
529 | + <div class="card-data"> | |
530 | + <p class="comment-date"><i class="fa fa-clock-o"></i> 05/10/2015</p> | |
531 | + </div> | |
562 | 532 | |
563 | - <p class="comment-text">Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat | |
564 | - cupidatat non proident.</p> | |
533 | + <p class="comment-text">Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat | |
534 | + cupidatat non proident.</p> | |
535 | + </div> | |
536 | + <!--/.Content column--> | |
537 | + </div> | |
538 | + <a class="btn btn-sm" style="float: right;" data-toggle="collapse" href="#collapse1" aria-expanded="false" aria-controls="collapseExample">Reply</a> | |
539 | + <div class="collapse" id="collapse1"> | |
540 | + <div class="md-form"> | |
541 | + <div class="form-group is-empty"><input type="text" id="form1" class="form-control" placeholder="comment on the cometary"></div><span class="input-group-btn"> | |
542 | + <button type="button" class="btn btn-sm"> | |
543 | + <i class="fa fa-paper-plane"> Send</i> | |
544 | + </button> | |
545 | + </span> | |
546 | + </div> | |
565 | 547 | </div> |
566 | - <!--/.Content column--> | |
567 | - </div> | |
568 | - <a class="btn btn-sm" style="float: right;" data-toggle="collapse" href="#collapse1" aria-expanded="false" aria-controls="collapseExample">Reply</a> | |
569 | - <div class="collapse" id="collapse1"> | |
570 | - <div class="md-form"> | |
571 | - <div class="form-group is-empty"><input type="text" id="form1" class="form-control" placeholder="comment on the cometary"></div><span class="input-group-btn"> | |
572 | - <button type="button" class="btn btn-sm"> | |
573 | - <i class="fa fa-paper-plane"> Send</i> | |
574 | - </button> | |
575 | - </span> | |
576 | 548 | </div> |
577 | - </div> | |
578 | - </div> | |
579 | 549 | |
580 | - <!--/.First row--> | |
550 | + <!--/.First row--> | |
581 | 551 | |
582 | - <!--Second row--> | |
583 | - <div class="row"> | |
552 | + <!--Second row--> | |
553 | + <div class="row"> | |
584 | 554 | |
585 | - <!--Content column--> | |
586 | - <div class="col-sm-10 col-xs-12"> | |
587 | - <h3 class="user-name">Cherielly</h3> | |
555 | + <!--Content column--> | |
556 | + <div class="col-sm-10 col-xs-12"> | |
557 | + <h3 class="user-name">Cherielly</h3> | |
588 | 558 | |
589 | - <div class="card-data"> | |
590 | - <p class="comment-date"><i class="fa fa-clock-o"></i> 08/10/2015</p> | |
591 | - </div> | |
559 | + <div class="card-data"> | |
560 | + <p class="comment-date"><i class="fa fa-clock-o"></i> 08/10/2015</p> | |
561 | + </div> | |
592 | 562 | |
593 | - <p class="comment-text">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam | |
594 | - voluptatem quia voluptas sit aspernatur.</p> | |
595 | - </div> | |
596 | - <!--/.Content column--> | |
597 | - </div> | |
598 | - <a class="btn btn-sm" style="float: right;" data-toggle="collapse" href="#collapse2" aria-expanded="false" aria-controls="collapseExample">Reply</a> | |
599 | - <div class="collapse" id="collapse2"> | |
600 | - <div class="md-form"> | |
601 | - <div class="form-group is-empty"><input type="text" id="form1" class="form-control" placeholder="comment on the cometary"></div><span class="input-group-btn"> | |
602 | - <button type="button" class="btn btn-sm"> | |
603 | - <i class="fa fa-paper-plane"> Send</i> | |
604 | - </button> | |
605 | - </span> | |
563 | + <p class="comment-text">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam | |
564 | + voluptatem quia voluptas sit aspernatur.</p> | |
606 | 565 | </div> |
607 | - </div> | |
608 | - | |
566 | + <!--/.Content column--> | |
567 | + </div> | |
568 | + <a class="btn btn-sm" style="float: right;" data-toggle="collapse" href="#collapse2" aria-expanded="false" aria-controls="collapseExample">Reply</a> | |
569 | + <div class="collapse" id="collapse2"> | |
570 | + <div class="md-form"> | |
571 | + <div class="form-group is-empty"><input type="text" id="form1" class="form-control" placeholder="comment on the cometary"></div><span class="input-group-btn"> | |
572 | + <button type="button" class="btn btn-sm"> | |
573 | + <i class="fa fa-paper-plane"> Send</i> | |
574 | + </button> | |
575 | + </span> | |
576 | + </div> | |
577 | + </div> | |
609 | 578 | |
610 | - <!--/.Second row--> | |
611 | 579 | |
612 | - <!--Third row--> | |
613 | - <div class="row"> | |
580 | + <!--/.Second row--> | |
614 | 581 | |
582 | + <!--Third row--> | |
583 | + <div class="row"> | |
615 | 584 | |
616 | - <!--Content column--> | |
617 | - <div class="col-sm-10 col-xs-12"> | |
618 | - <h3 class="user-name">Gemozecleia</h3> | |
619 | 585 | |
620 | - <div class="card-data"> | |
621 | - <p class="comment-date"><i class="fa fa-clock-o"></i> 17/10/2015 | |
622 | - </p></div> | |
586 | + <!--Content column--> | |
587 | + <div class="col-sm-10 col-xs-12"> | |
588 | + <h3 class="user-name">Gemozecleia</h3> | |
623 | 589 | |
624 | - <p class="comment-text">At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa | |
625 | - qui officia. | |
626 | - </p> | |
627 | - </div> | |
628 | - <!--/.Content column--> | |
590 | + <div class="card-data"> | |
591 | + <p class="comment-date"><i class="fa fa-clock-o"></i> 17/10/2015 | |
592 | + </p></div> | |
629 | 593 | |
630 | - </div> | |
631 | - <a class="btn btn-sm" style="float: right;" data-toggle="collapse" href="#collapse3" aria-expanded="false" aria-controls="collapseExample">Reply</a> | |
632 | - <div class="collapse" id="collapse3"> | |
633 | - <div class="md-form"> | |
634 | - <div class="form-group is-empty"><input type="text" id="form1" class="form-control" placeholder="comment on the cometary"></div><span class="input-group-btn"> | |
635 | - <button type="button" class="btn btn-sm"> | |
636 | - <i class="fa fa-paper-plane"> Send</i> | |
637 | - </button> | |
638 | - </span> | |
594 | + <p class="comment-text">At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa | |
595 | + qui officia. | |
596 | + </p> | |
639 | 597 | </div> |
640 | - </div> | |
598 | + <!--/.Content column--> | |
641 | 599 | |
642 | - <!--/.Third row--> | |
643 | - <div class="row"> | |
644 | - <div class="form-group is-empty"> | |
645 | - <div class="col-sm-10 col-xs-12"> | |
646 | - <input type="text" id="addon3a" class="form-control" placeholder="Add Comment"> | |
647 | - | |
648 | - <span class="input-group-btn"> | |
649 | - <button type="button" class="btn btn-fab btn-fab-mini"> | |
650 | - <i class="material-icons">send</i> | |
651 | - </button> | |
652 | - </span> | |
600 | + </div> | |
601 | + <a class="btn btn-sm" style="float: right;" data-toggle="collapse" href="#collapse3" aria-expanded="false" aria-controls="collapseExample">Reply</a> | |
602 | + <div class="collapse" id="collapse3"> | |
603 | + <div class="md-form"> | |
604 | + <div class="form-group is-empty"><input type="text" id="form1" class="form-control" placeholder="comment on the cometary"></div><span class="input-group-btn"> | |
605 | + <button type="button" class="btn btn-sm"> | |
606 | + <i class="fa fa-paper-plane"> Send</i> | |
607 | + </button> | |
608 | + </span> | |
609 | + </div> | |
610 | + </div> | |
611 | + | |
612 | + <!--/.Third row--> | |
613 | + <div class="row"> | |
614 | + <div class="form-group is-empty"> | |
615 | + <div class="col-sm-10 col-xs-12"> | |
616 | + <input type="text" id="addon3a" class="form-control" placeholder="Add Comment"> | |
617 | + | |
618 | + <span class="input-group-btn"> | |
619 | + <button type="button" class="btn btn-fab btn-fab-mini"> | |
620 | + <i class="material-icons">send</i> | |
621 | + </button> | |
622 | + </span> | |
623 | + </div> | |
624 | + </div> | |
653 | 625 | </div> |
654 | - </div> | |
655 | - </div> | |
656 | - | |
657 | - </div> | |
658 | - <div class="modal-footer"> | |
659 | - <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> | |
660 | - <button type="button" class="btn btn-primary">Save changes</button> | |
661 | - </div> | |
662 | - </div> | |
663 | - </div> | |
664 | -</div> | |
665 | -<!--EndForumModal--> | |
666 | 626 | |
667 | -<!-- MODAL LINK EDIT--> | |
668 | -<div class="modal fade" id="linksModalEdit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | |
669 | - <div class="modal-dialog" role="document"> | |
670 | - <div class="modal-content"> | |
671 | - <div class="modal-header"> | |
672 | - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
673 | - <h4 class="modal-title" id="myModalLabel">Links</h4> | |
674 | - </div> | |
675 | - <div class="modal-body"> | |
676 | - <!-- Card --> | |
677 | - <div class="form-group"> | |
678 | - <label class="control-label" for="inputDefault">Name</label> | |
679 | - <input value="Python" type="text" class="form-control" id="inputDefault"> | |
680 | - </div> | |
681 | - <div class="form-group"> | |
682 | - <label class="control-label" for="inputDefault">Url</label> | |
683 | - <input value="https://www.python.org/" type="text" class="form-control" id="inputDefault"> | |
684 | - </div> | |
685 | - <div class="form-group is-empty"> | |
686 | - <label class="control-label" for="inputDefault">Descrição</label> | |
687 | - <textarea class="form-control" rows="3"></textarea> | |
627 | + </div> | |
628 | + <div class="modal-footer"> | |
629 | + <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> | |
630 | + <button type="button" class="btn btn-primary">Save changes</button> | |
631 | + </div> | |
688 | 632 | </div> |
689 | - <div class="form-group"> | |
690 | - <a href="javascript:void(0)" class="btn btn-raised btn-default">Cancel</a> | |
691 | - <a href="javascript:void(0)" class="btn btn-raised btn-primary">Submit</a> | |
692 | - </div> | |
693 | - <!-- .end Card --> | |
694 | 633 | </div> |
695 | 634 | </div> |
696 | - </div> | |
697 | -</div> | |
698 | -<!-- EndModal --> | |
699 | -</div> | |
700 | -</div> | |
701 | - | |
635 | + <!--EndForumModal--> | |
702 | 636 | |
703 | -<div class="modal fade" id="createForum" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | |
704 | - <div class="modal-dialog" role="document"> | |
637 | + <!-- MODAL LINK EDIT--> | |
638 | + <div class="modal fade" id="linksModalEdit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | |
639 | + <div class="modal-dialog" role="document"> | |
705 | 640 | <div class="modal-content"> |
706 | - <div class="modal-header"> | |
707 | - <h4 class="modal-title" id="myModalLabel">{% trans 'Forum' %}</h4> | |
641 | + <div class="modal-header"> | |
642 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
643 | + <h4 class="modal-title" id="myModalLabel">Links</h4> | |
644 | + </div> | |
645 | + <div class="modal-body"> | |
646 | + <!-- Card --> | |
647 | + <div class="form-group"> | |
648 | + <label class="control-label" for="inputDefault">Name</label> | |
649 | + <input value="Python" type="text" class="form-control" id="inputDefault"> | |
708 | 650 | </div> |
709 | - <div class="modal-body"> | |
710 | - <section> | |
711 | - <div class="forum_form"></div> | |
712 | - </section> | |
651 | + <div class="form-group"> | |
652 | + <label class="control-label" for="inputDefault">Url</label> | |
653 | + <input value="https://www.python.org/" type="text" class="form-control" id="inputDefault"> | |
713 | 654 | </div> |
714 | - <div class="modal-footer"> | |
715 | - <button type="button" class="btn btn-danger btn-raised" data-dismiss="modal">{% trans 'Close' %}</button> | |
716 | - <button type="button" onclick="$('#forum_create').submit();" class="btn btn-primary btn-raised">{% trans 'Create' %}</button> | |
655 | + <div class="form-group is-empty"> | |
656 | + <label class="control-label" for="inputDefault">Descrição</label> | |
657 | + <textarea class="form-control" rows="3"></textarea> | |
717 | 658 | </div> |
659 | + <div class="form-group"> | |
660 | + <a href="javascript:void(0)" class="btn btn-raised btn-default">Cancel</a> | |
661 | + <a href="javascript:void(0)" class="btn btn-raised btn-primary">Submit</a> | |
662 | + </div> | |
663 | + <!-- .end Card --> | |
664 | + </div> | |
718 | 665 | </div> |
666 | + </div> | |
667 | + </div> | |
668 | + <!-- EndModal --> | |
719 | 669 | </div> |
720 | -</div> | |
670 | + </div> | |
671 | + | |
672 | + | |
673 | + <div class="modal fade" id="createForum" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | |
674 | + <div class="modal-dialog" role="document"> | |
675 | + <div class="modal-content"> | |
676 | + <div class="modal-header"> | |
677 | + <h4 class="modal-title" id="myModalLabel">{% trans 'Forum' %}</h4> | |
678 | + </div> | |
679 | + <div class="modal-body"> | |
680 | + <section> | |
681 | + <div class="forum_form"></div> | |
682 | + </section> | |
683 | + </div> | |
684 | + <div class="modal-footer"> | |
685 | + <button type="button" class="btn btn-danger btn-raised" data-dismiss="modal">{% trans 'Close' %}</button> | |
686 | + <button type="button" onclick="$('#forum_create').submit();" class="btn btn-primary btn-raised">{% trans 'Create' %}</button> | |
687 | + </div> | |
688 | + </div> | |
689 | + </div> | |
690 | + </div> | |
721 | 691 | \ No newline at end of file | ... | ... |
courses/urls.py
... | ... | @@ -26,5 +26,8 @@ urlpatterns = [ |
26 | 26 | url(r'^subjects/categories$',views.IndexSubjectCategoryView.as_view(), name='subject_category_index'), |
27 | 27 | url(r'^forum/', include('forum.urls', namespace = 'forum')), |
28 | 28 | url(r'^poll/', include('poll.urls', namespace = 'poll')), |
29 | + url(r'^exam/', include('exam.urls', namespace = 'exam')), | |
30 | + | |
31 | + | |
29 | 32 | |
30 | 33 | ] | ... | ... |
exam/admin.py
1 | 1 | from django.contrib import admin |
2 | 2 | |
3 | -# Register your models here. | |
3 | +from .models import Exam, Answer | |
4 | + | |
5 | +class ExamAdmin(admin.ModelAdmin): | |
6 | + list_display = ['name', 'slug','begin_date','limit_date'] | |
7 | + search_fields = ['name','slug'] | |
8 | + | |
9 | +class AnswerAdmin(admin.ModelAdmin): | |
10 | + list_display = ['answer','order'] | |
11 | + search_fields = ['answer'] | |
12 | + | |
13 | +admin.site.register(Exam, ExamAdmin) | |
14 | +admin.site.register(Answer, AnswerAdmin) | ... | ... |
exam/forms.py
1 | +from django.utils.translation import ugettext_lazy as _ | |
1 | 2 | from django import forms |
2 | 3 | from .models import Exam |
3 | 4 | |
4 | 5 | class ExamForm(forms.ModelForm): |
5 | 6 | def clean_end_date(self): |
6 | - beginDate = self.data['beginDate'] | |
7 | - endDate = self.data['endDate'] | |
7 | + begin_date = self.data['begin_date'] | |
8 | + limit_date = self.data['limit_date'] | |
8 | 9 | |
9 | - if beginDate and endDate and endDate < beginDate: | |
10 | + if begin_date and limit_date and limit_date < begin_date: | |
10 | 11 | raise forms.ValidationError(_('The end date may not be before the start date.')) |
11 | 12 | return endDate |
12 | 13 | |
13 | - def clean_begin_date(self): | |
14 | - endDate = self.data['endDate'] | |
15 | - beginDate = self.data['beginDate'] | |
16 | - | |
17 | - if enDate and benginDate and beginDate <= endDate: | |
18 | - raise forms.ValidationError(_('The exam start date must be after the end of registration.')) | |
19 | - return beginDate | |
20 | - | |
21 | - def clean_end_date(self): | |
22 | - beginDate = self.data['beginDate'] | |
23 | - endDate = self.data['endDate'] | |
24 | - | |
25 | - if beginDate and endDate and endDate < beginDate: | |
26 | - raise forms.ValidationError(_('The finish date may not be before the start date.')) | |
27 | - return end_date | |
28 | - | |
29 | - | |
30 | 14 | |
31 | 15 | class Meta: |
32 | 16 | model = Exam |
33 | - fields = ['name','beginDate','endDate'] | |
17 | + fields = ['name','begin_date','limit_date'] | |
34 | 18 | |
35 | 19 | widgets = { |
36 | 20 | 'name': forms.TextInput(attrs={'placeholder': 'Exam?'}), |
37 | - 'beginDate': forms.DateTimeInput(attrs={'placeholder': 'Start date to resolve the exam'}), | |
38 | - 'endDate': forms.DateTimeInput(attrs={'placeholder': 'Finish date permited to resolve the exam'}), | |
21 | + 'begin_date': forms.DateTimeInput(attrs={'placeholder': _('Start date to resolve the exam')}), | |
22 | + 'limit_date': forms.DateTimeInput(attrs={'placeholder': _('Finish date permited to resolve the exam')}), | |
39 | 23 | } | ... | ... |
exam/models.py
... | ... | @@ -5,23 +5,19 @@ from users.models import User |
5 | 5 | from core.models import Resource |
6 | 6 | from courses.models import Activity |
7 | 7 | |
8 | - | |
9 | - | |
10 | -class Exam(models.Model): | |
11 | - name = models.CharField(_('Name'), max_length = 100) | |
12 | - beginDate = models.DateTimeField(_('Start Date'), auto_now_add = True) | |
13 | - endDate = models.DateTimeField(_('Date of last update'), auto_now=True) | |
8 | +class Exam(Activity): | |
9 | + begin_date = models.DateField(_('Begin of Course Date')) | |
14 | 10 | |
15 | 11 | class Meta: |
16 | - #ordering = ('create_date','name') | |
17 | 12 | verbose_name = _('Exam') |
18 | 13 | verbose_name_plural = _('Exams') |
19 | 14 | |
20 | 15 | def __str__(self): |
21 | 16 | return str(self.name) + str("/") + str(self.topic) |
22 | 17 | |
18 | + | |
23 | 19 | class Answer(models.Model): |
24 | - answer = models.CharField(_("Answer"), max_length = 200) | |
20 | + answer = models.CharField(_("Answer"), max_length = 300) | |
25 | 21 | order = models.PositiveSmallIntegerField(_("Order")) |
26 | 22 | exam = models.ForeignKey(Exam, verbose_name = _('Answers'), related_name='answers') |
27 | 23 | ... | ... |
exam/permisissions.py
... | ... | @@ -1,12 +0,0 @@ |
1 | -from rolepermissions.permissions import register_object_checker | |
2 | -from amadeus.roles import SystemAdmin | |
3 | - | |
4 | -@register_object_checker() | |
5 | -def edit_exam(role, user, exam): | |
6 | - if (role == SystemAdmin): | |
7 | - return True | |
8 | - | |
9 | - if (user in exam.topic.subject.professors.all()): | |
10 | - return True | |
11 | - | |
12 | - return False |
... | ... | @@ -0,0 +1,12 @@ |
1 | +from rolepermissions.permissions import register_object_checker | |
2 | +from amadeus.roles import SystemAdmin | |
3 | + | |
4 | +@register_object_checker() | |
5 | +def edit_exam(role, user, exam): | |
6 | + if (role == SystemAdmin): | |
7 | + return True | |
8 | + | |
9 | + if (user in exam.topic.subject.professors.all()): | |
10 | + return True | |
11 | + | |
12 | + return False | ... | ... |
exam/templates/exam/form_exam.html
... | ... | @@ -1,60 +0,0 @@ |
1 | -<div class="panel panel-info"> | |
2 | - <div class="panel-heading"> | |
3 | - <h3 class="panel-title">New Exam</h3> | |
4 | - </div> | |
5 | - <div class="panel-body"> | |
6 | - <form class="form-horizontal"> | |
7 | - | |
8 | - <div class="form-group"> | |
9 | - <label for="examName" class="col-md-2 control-label">Exam Name</label> | |
10 | - | |
11 | - <div class="col-md-10"> | |
12 | - <input type="text" class="form-control" id="examName" placeholder="Exam Name"> | |
13 | - </div> | |
14 | - | |
15 | - | |
16 | - </div> | |
17 | - <div class="form-group"> | |
18 | - <label for="Date" class="col-md-2 control-label">Exam Period</label> | |
19 | - <div class="col-md-5"> | |
20 | - <input type="date" class="form-control" id="beginDate" placeholder="Begin Date"> | |
21 | - | |
22 | - </div> | |
23 | - <div class="col-md-5"> | |
24 | - <input type="date" class="form-control" id="endDate" placeholder="End Date"> | |
25 | - | |
26 | - </div> | |
27 | - </div> | |
28 | - <div class="form-group"> | |
29 | - <label for="deadline" class="col-md-2 control-label">Allow submissions after deadline?</label> | |
30 | - <div class="col-md-10"> | |
31 | - <label> | |
32 | - <input type="checkbox"> | |
33 | - </label> | |
34 | - </div> | |
35 | - </div> | |
36 | - <div class="form-group"> | |
37 | - <label for="questionType" class="col-md-2 control-label">Question Type</label> | |
38 | - <div class="col-md-10"> | |
39 | - <select id="questionType" class="form-control" onchange="showDiv (this)"> | |
40 | - <option selected disabled>Question Type</option> | |
41 | - <option value="0">Multiple Choice</option> | |
42 | - <option value="1">True or False</option> | |
43 | - <option value="2">Gap Filling</option> | |
44 | - <option value="3">Discursive Question</option> | |
45 | - </select> | |
46 | - </div> | |
47 | - </div> | |
48 | - </form> | |
49 | - </div> | |
50 | -</div> | |
51 | - | |
52 | -<script> | |
53 | - function showDiv (elem) { | |
54 | - if (elem.value == 0) { | |
55 | - document.getElementById('multipleChoice').style.display = "block"; | |
56 | - } else if (elem.value == 1) { | |
57 | - document.getElementById('trueOrFalse').style.display = "block"; | |
58 | - } | |
59 | - } | |
60 | -</script> |
exam/urls.py
... | ... | @@ -3,7 +3,8 @@ from django.conf.urls import url |
3 | 3 | from . import views |
4 | 4 | |
5 | 5 | urlpatterns = [ |
6 | - url(r'^create/(?P<slug>[\w\-_]+)/$', views.CreateExam.as_view(), name='create_poll'), | |
7 | - url(r'^update/(?P<slug>[\w\-_]+)/$', views.UpdateExam.as_view(), name='update_poll'), | |
8 | - | |
6 | + url(r'^create/(?P<slug>[\w\-_]+)/$', views.CreateExam.as_view(), name='create_exam'), | |
7 | + url(r'^update/(?P<slug>[\w\-_]+)/$', views.UpdateExam.as_view(), name='update_exam'), | |
8 | + url(r'^view/(?P<slug>[\w\-_]+)/$', views.ViewExam.as_view(), name='view_exam'), | |
9 | + url(r'^delete/(?P<slug>[\w\-_]+)/$', views.DeleteExam.as_view(), name='delete_exam'), | |
9 | 10 | ] | ... | ... |
exam/views.py
... | ... | @@ -8,6 +8,7 @@ from django.core.urlresolvers import reverse_lazy |
8 | 8 | from django.utils.translation import ugettext_lazy as _ |
9 | 9 | from rolepermissions.verifications import has_role |
10 | 10 | from rolepermissions.verifications import has_object_permission |
11 | +from django.db.models import Q | |
11 | 12 | # from django.views.generic.edit import FormMixin |
12 | 13 | |
13 | 14 | from .forms import ExamForm |
... | ... | @@ -16,34 +17,76 @@ from core.mixins import NotificationMixin |
16 | 17 | from users.models import User |
17 | 18 | from courses.models import Course, Topic |
18 | 19 | |
19 | -class CreateExam(LoginRequiredMixin,generic.CreateView): | |
20 | +class ViewExam(LoginRequiredMixin,generic.DetailView): | |
20 | 21 | |
21 | - login_url = reverse_lazy("core:home") | |
22 | - redirect_field_name = 'next' | |
23 | 22 | model = Exam |
24 | - form_class = PollForm | |
25 | 23 | context_object_name = 'exam' |
26 | - template_name = 'exam/form_exam.html' | |
27 | - success_url = reverse_lazy('core:home') | |
24 | + template_name = 'exam/view.html' | |
25 | + | |
26 | + def get_object(self, queryset=None): | |
27 | + return get_object_or_404(Exam, slug = self.kwargs.get('slug')) | |
28 | + | |
29 | + def form_invalid(self, form,**kwargs): | |
30 | + context = super(ViewExam, self).form_invalid(form) | |
31 | + answers = {} | |
32 | + for key in self.request.POST: | |
33 | + if(key != 'csrfmiddlewaretoken' and key != 'name' and key!= 'begin_date' and key != 'limit_date' and key != 'all_students' and key != 'students'): | |
34 | + answers[key] = self.request.POST[key] | |
35 | + | |
36 | + keys = sorted(answers) | |
37 | + context.context_data['answers'] = answers | |
38 | + context.context_data['keys'] = keys | |
39 | + return context | |
28 | 40 | |
29 | 41 | def form_valid(self, form): |
30 | - self.object = form.save(commit = False) | |
31 | - topic = get_object_or_404(Topic, slug = self.kwargs.get('slug')) | |
32 | - self.object.topic = topic | |
33 | - self.object.save() | |
42 | + exam = self.object | |
43 | + exam = form.save(commit = False) | |
44 | + exam.answers.all().delete() | |
45 | + exam.save() | |
46 | + | |
34 | 47 | |
35 | 48 | for key in self.request.POST: |
36 | - if(key != 'csrfmiddlewaretoken' and key != 'name' and key != 'beginDate' and key != 'endDate'): | |
37 | - answer = Answer(answer=self.request.POST[key],order=key,poll=self.object) | |
49 | + if(key != 'csrfmiddlewaretoken' and key != 'name' and key != 'begin_date' and key != 'limit_date' and key != 'all_students' and key != 'students'): | |
50 | + answer = Answer(answer=self.request.POST[key],order=key,exam=exam) | |
38 | 51 | answer.save() |
39 | 52 | |
40 | - return super(CreateExam, self).form_valid(form) | |
53 | + return super(ViewExam, self).form_valid(form) | |
54 | + | |
55 | + def get_context_data(self, **kwargs): | |
56 | + context = super(ViewExam, self).get_context_data(**kwargs) | |
57 | + exam = self.object | |
58 | + context['course'] = exam.topic.subject.course | |
59 | + context['subject'] = exam.topic.subject | |
60 | + context['subjects'] = exam.topic.subject.course.subjects.all() | |
61 | + | |
62 | + answers = {} | |
63 | + for answer in exam.answers.all(): | |
64 | + answers[answer.order] = answer.answer | |
65 | + | |
66 | + keys = sorted(answers) | |
67 | + context['answers'] = answers | |
68 | + context['keys'] = keys | |
69 | + | |
70 | + print (context) | |
71 | + return context | |
72 | + | |
73 | + | |
74 | +class CreateExam(LoginRequiredMixin,HasRoleMixin,generic.CreateView): | |
75 | + | |
76 | + allowed_roles = ['professor', 'system_admin'] | |
77 | + login_url = reverse_lazy("core:home") | |
78 | + redirect_field_name = 'next' | |
79 | + model = Exam | |
80 | + form_class = ExamForm | |
81 | + context_object_name = 'exam' | |
82 | + template_name = 'exam/create.html' | |
83 | + success_url = reverse_lazy('core:home') | |
41 | 84 | |
42 | 85 | def form_invalid(self, form,**kwargs): |
43 | 86 | context = super(CreateExam, self).form_invalid(form) |
44 | 87 | answers = {} |
45 | 88 | for key in self.request.POST: |
46 | - if(key != 'csrfmiddlewaretoken' and key != 'name' and key != 'beginDate' and key != 'endDate'): | |
89 | + if(key != 'csrfmiddlewaretoken' and key != 'name' and key != 'begin_date' and key != 'limit_date' and key != 'all_students' and key != 'students'): | |
47 | 90 | answers[key] = self.request.POST[key] |
48 | 91 | |
49 | 92 | keys = sorted(answers) |
... | ... | @@ -51,47 +94,115 @@ class CreateExam(LoginRequiredMixin,generic.CreateView): |
51 | 94 | context.context_data['keys'] = keys |
52 | 95 | return context |
53 | 96 | |
54 | -class UpdateExam(LoginRequiredMixin,generic.UpdateView): | |
97 | + def form_valid(self, form): | |
98 | + self.object = form.save(commit = False) | |
99 | + topic = get_object_or_404(Topic, slug = self.kwargs.get('slug')) | |
100 | + self.object.topic = topic | |
101 | + self.object.save() | |
55 | 102 | |
103 | + for key in self.request.POST: | |
104 | + if(key != 'csrfmiddlewaretoken' and key != 'name' and key != 'begin_date' and key != 'limit_date' and key != 'all_students' and key != 'students'): | |
105 | + answer = Answer(answer=self.request.POST[key],order=key,exam=self.object) | |
106 | + answer.save() | |
107 | + | |
108 | + return super(CreatePoll, self).form_valid(form) | |
109 | + | |
110 | + def get_context_data(self, **kwargs): | |
111 | + context = super(CreateExam, self).get_context_data(**kwargs) | |
112 | + topic = get_object_or_404(Topic, slug = self.kwargs.get('slug')) | |
113 | + context['course'] = topic.subject.course | |
114 | + context['subject'] = topic.subject | |
115 | + context['subjects'] = topic.subject.course.subjects.all() | |
116 | + return context | |
117 | + | |
118 | +class UpdateExam(LoginRequiredMixin,HasRoleMixin,generic.UpdateView): | |
119 | + | |
120 | + allowed_roles = ['professor', 'system_admin'] | |
56 | 121 | login_url = reverse_lazy("core:home") |
57 | 122 | redirect_field_name = 'next' |
58 | 123 | model = Exam |
59 | 124 | form_class = ExamForm |
60 | 125 | context_object_name = 'exam' |
61 | - template_name = 'poll/form_exam.html' | |
126 | + template_name = 'exam/update.html' | |
62 | 127 | success_url = reverse_lazy('core:home') |
63 | 128 | |
64 | 129 | def dispatch(self, *args, **kwargs): |
65 | - poll = get_object_or_404(Poll, slug = self.kwargs.get('slug')) | |
66 | - | |
130 | + exam = get_object_or_404(Exam, slug = self.kwargs.get('slug')) | |
67 | 131 | if(not has_object_permission('edit_exam', self.request.user, exam)): |
68 | 132 | return self.handle_no_permission() |
69 | - return super(UpdateExam, self).dispatch(*args, **kwargs) | |
133 | + return super(UpdatePoll, self).dispatch(*args, **kwargs) | |
70 | 134 | |
71 | 135 | def get_object(self, queryset=None): |
72 | - return get_object_or_404(Poll, slug = self.kwargs.get('slug')) | |
136 | + return get_object_or_404(Exam, slug = self.kwargs.get('slug')) | |
137 | + | |
138 | + def form_invalid(self, form,**kwargs): | |
139 | + context = super(UpdateExam, self).form_invalid(form) | |
140 | + answers = {} | |
141 | + for key in self.request.POST: | |
142 | + if(key != 'csrfmiddlewaretoken' and key != 'name' and key != 'begin_date' and key != 'limit_date' and key != 'all_students' and key != 'students'): | |
143 | + answers[key] = self.request.POST[key] | |
144 | + | |
145 | + keys = sorted(answers) | |
146 | + context.context_data['answers'] = answers | |
147 | + context.context_data['keys'] = keys | |
148 | + return context | |
73 | 149 | |
74 | 150 | def form_valid(self, form): |
75 | - poll = self.object | |
76 | - poll = form.save(commit = False) | |
77 | - poll.answers.all().delete() | |
78 | - poll.save() | |
151 | + exam = self.object | |
152 | + exam = form.save(commit = False) | |
153 | + exam.answers.all().delete() | |
154 | + exam.save() | |
155 | + | |
79 | 156 | |
80 | 157 | for key in self.request.POST: |
81 | - if(key != 'csrfmiddlewaretoken' and key != 'name' and key != 'beginDate' and key != 'endDate'): | |
158 | + if(key != 'csrfmiddlewaretoken' and key != 'name' and key != 'begin_date' and key != 'limit_date' and key != 'all_students' and key != 'students'): | |
82 | 159 | answer = Answer(answer=self.request.POST[key],order=key,exam=exam) |
83 | 160 | answer.save() |
84 | 161 | |
85 | 162 | return super(UpdateExam, self).form_valid(form) |
86 | 163 | |
87 | - def form_invalid(self, form,**kwargs): | |
88 | - context = super(UpdateExam, self).form_invalid(form) | |
164 | + def get_context_data(self, **kwargs): | |
165 | + context = super(UpdateExam, self).get_context_data(**kwargs) | |
166 | + exam = self.object | |
167 | + context['course'] = exam.topic.subject.course | |
168 | + context['subject'] = exam.topic.subject | |
169 | + context['subjects'] = exam.topic.subject.course.subjects.all() | |
170 | + | |
89 | 171 | answers = {} |
90 | - for key in self.request.POST: | |
91 | - if(key != 'csrfmiddlewaretoken' and key != 'name' and key != 'beginDate' and key != 'endDate'): | |
92 | - answers[key] = self.request.POST[key] | |
172 | + for answer in exam.answers.all(): | |
173 | + # print (key.answer) | |
174 | + answers[answer.order] = answer.answer | |
93 | 175 | |
94 | 176 | keys = sorted(answers) |
95 | - context.context_data['answers'] = answers | |
96 | - context.context_data['keys'] = keys | |
177 | + context['answers'] = answers | |
178 | + context['keys'] = keys | |
179 | + | |
180 | + return context | |
181 | + | |
182 | +class DeleteExam(LoginRequiredMixin, HasRoleMixin, generic.DeleteView): | |
183 | + | |
184 | + allowed_roles = ['professor', 'system_admin'] | |
185 | + login_url = reverse_lazy("core:home") | |
186 | + redirect_field_name = 'next' | |
187 | + model = Exam | |
188 | + template_name = 'exam/remove.html' | |
189 | + | |
190 | + def dispatch(self, *args, **kwargs): | |
191 | + exam = get_object_or_404(Exam, slug = self.kwargs.get('slug')) | |
192 | + if(not has_object_permission('delete_exam', self.request.user, exam)): | |
193 | + return self.handle_no_permission() | |
194 | + return super(DeleteExam, self).dispatch(*args, **kwargs) | |
195 | + | |
196 | + | |
197 | + def get_context_data(self, **kwargs): | |
198 | + context = super(DeleteExam, self).get_context_data(**kwargs) | |
199 | + context['course'] = self.object.topic.subject.course | |
200 | + context['subject'] = self.object.topic.subject | |
201 | + context['exam'] = self.object | |
202 | + context['subjects'] = self.object.topic.subject.course.subjects.filter(Q(visible=True) | Q(professors__in=[self.request.user])) | |
203 | + if (has_role(self.request.user,'system_admin')): | |
204 | + context['subjects'] = self.object.topic.subject.course.subjects.all() | |
97 | 205 | return context |
206 | + | |
207 | + def get_success_url(self): | |
208 | + return reverse_lazy('course:view_topic', kwargs={'slug' : self.object.topic.slug}) | ... | ... |
forum/tests/test_model_answer.py
forum/tests/test_view_forum.py
... | ... | @@ -5,7 +5,7 @@ from rolepermissions.shortcuts import assign_role |
5 | 5 | |
6 | 6 | from users.models import User |
7 | 7 | from courses.models import CourseCategory, Course, Subject, Topic |
8 | -from forum.models import Forum | |
8 | +from forum.models import Forum, Post, PostAnswer | |
9 | 9 | |
10 | 10 | class ForumViewTestCase (TestCase): |
11 | 11 | |
... | ... | @@ -69,12 +69,33 @@ class ForumViewTestCase (TestCase): |
69 | 69 | ) |
70 | 70 | self.forum.save() |
71 | 71 | |
72 | + self.post = Post.objects.create( | |
73 | + user = self.user, | |
74 | + message = 'posting a test', | |
75 | + modification_date = '2016-11-09', | |
76 | + post_date = '2016-10-03', | |
77 | + forum = self.forum, | |
78 | + ) | |
79 | + self.post.save() | |
80 | + | |
81 | + self.answer = PostAnswer.objects.create( | |
82 | + user = self.user, | |
83 | + post = self.post, | |
84 | + message = 'testing a post answer', | |
85 | + modification_date = '2016-10-05', | |
86 | + answer_date = '2016-10-04', | |
87 | + ) | |
88 | + self.answer.save() | |
89 | + | |
72 | 90 | |
73 | 91 | self.client.login(username='test', password='testing') |
74 | 92 | self.index_url = reverse('course:forum:view', kwargs={'slug':self.forum.slug}) |
75 | 93 | self.create_url = reverse('course:forum:create') |
76 | 94 | self.update_url = reverse('course:forum:update', kwargs={'pk':self.forum.pk}) |
77 | 95 | |
96 | + self.createPost_url = reverse('course:forum:create_post') | |
97 | + self.updatePost_url = reverse('course:forum:update_post', kwargs={'pk':self.post.pk}) | |
98 | + | |
78 | 99 | ######################### ForumDetailView ######################### |
79 | 100 | |
80 | 101 | def test_ForumDetail_view_ok (self): |
... | ... | @@ -143,4 +164,42 @@ class ForumViewTestCase (TestCase): |
143 | 164 | response = self.client.post(self.update_url, data) |
144 | 165 | self.assertEquals (response.status_code, 302) |
145 | 166 | |
146 | - forum = Forum.objects.get(name='Forum Updated') | |
147 | 167 | \ No newline at end of file |
168 | + forum = Forum.objects.get(name='Forum Updated') | |
169 | + | |
170 | +######################### CreatePostView ######################### | |
171 | + | |
172 | + def test_CreatePost_form_error (self): | |
173 | + data = {'message': '', 'forum': ''} | |
174 | + | |
175 | + #response = self.client.post(self.createPost_url, data) | |
176 | + #self.assertEquals (response.status_code, 400) | |
177 | + | |
178 | + def test_CreatePost_form_ok (self): | |
179 | + data = { | |
180 | + 'forum': str(self.forum.id), | |
181 | + 'message':'posting a test2' | |
182 | + } | |
183 | + | |
184 | + response = self.client.post(self.createPost_url, data) | |
185 | + self.assertEquals (response.status_code, 302) | |
186 | + | |
187 | + post = Post.objects.get(message='posting a test2') | |
188 | + | |
189 | +######################### UpdatePostView ######################### | |
190 | + | |
191 | + def test_UpdatePost_form_error (self): | |
192 | + data = {'message': ''} | |
193 | + | |
194 | + response = self.client.post(self.updatePost_url, data) | |
195 | + self.assertFormError (response, 'form', 'message', 'Este campo é obrigatório.') | |
196 | + | |
197 | + def test_UpdatePost_form_ok (self): | |
198 | + data = {'message':'updating a post'} | |
199 | + | |
200 | + response = self.client.post(self.updatePost_url, data) | |
201 | + #self.assertEquals (response.status_code, 302) | |
202 | + | |
203 | + #self.assertEquals(self.post.message, 'updating a post') | |
204 | + | |
205 | + | |
206 | + | ... | ... |
links/tests.py
1 | 1 | from django.test import TestCase,Client |
2 | 2 | from django.core.urlresolvers import reverse |
3 | 3 | from rolepermissions.shortcuts import assign_role |
4 | +from django.utils.translation import ugettext_lazy as _ | |
4 | 5 | |
5 | 6 | from users.models import User |
6 | 7 | from .models import * |
8 | +from .forms import * | |
7 | 9 | |
8 | 10 | # Create your tests here. |
9 | 11 | class LinkTestCase(TestCase): |
... | ... | @@ -28,8 +30,10 @@ class LinkTestCase(TestCase): |
28 | 30 | "link" : 'teste.com' |
29 | 31 | } |
30 | 32 | response = self.client.post(url, data) |
33 | + #self.assertEqual(response.status_code, 200) | |
34 | + self.assertFormError(response,'form',"link",_("Please enter a valid URL")) | |
31 | 35 | self.assertEqual(Link.objects.all().count(),links+1) #After creating one link, if OK, the link was created successfully. |
32 | - self.assertEqual(response.status_code, 200) | |
36 | + self.assertEqual(response.status_code, 302) #If OK, User is getting redirected correctly. | |
33 | 37 | self.assertTemplateUsed(template_name = 'links/link_modal.html') |
34 | 38 | # def test_update_link(): |
35 | 39 | # pass |
... | ... | @@ -41,8 +45,11 @@ class LinkTestCase(TestCase): |
41 | 45 | ) |
42 | 46 | self.client.login(username='user', password = 'testing') |
43 | 47 | links = Link.objects.all().count() |
48 | + deletedlink = Link.objects.get(name = self.link.name) | |
44 | 49 | url = reverse('course:delete_link',kwargs={'linkname': self.link.name}) |
45 | 50 | self.assertEqual(Link.objects.all().count(),links) |
46 | - response = self.client.get(url) | |
47 | - self.assertEqual(Link.objects.all().count(),links - 1) | |
48 | - self.assertEqual(response.status_code, 200) | |
51 | + response = self.client.post(url) | |
52 | + self.assertEqual(Link.objects.all().count(),links - 1) #Objeto removido | |
53 | + self.assertEqual(Link.objects.filter(name= deletedlink.name).exists(),False) #Objeto removido e sua não-existência verificada | |
54 | + #self.assertEqual(Link.objects.filter(name= deletedlink.name).exists(),True) #Objeto removido e sua existência verificada, se ERRO, objeto foi removido com sucesso! | |
55 | + self.assertEqual(response.status_code, 302) #If OK, User is getting redirected correctly. | ... | ... |
links/views.py
... | ... | @@ -12,7 +12,7 @@ from .forms import * |
12 | 12 | class CreateLink(generic.CreateView): |
13 | 13 | template_name = 'links/link_modal.html' |
14 | 14 | form_class = CreateLinkForm |
15 | - success_url = reverse_lazy() | |
15 | + success_url = reverse_lazy('course:manage') | |
16 | 16 | context_object_name = 'links' |
17 | 17 | |
18 | 18 | def form_valid(self, form): |
... | ... | @@ -29,7 +29,7 @@ def deleteLink(request,linkname): |
29 | 29 | link = get_object_or_404(Link,name = linkname) |
30 | 30 | link.delete() |
31 | 31 | messages.success(request,_("Link deleted Successfully!")) |
32 | - return redirect('course:update_topic') | |
32 | + return redirect('course:manage') | |
33 | 33 | class UpdateLink(generic.UpdateView): |
34 | 34 | template_name = 'links/' |
35 | 35 | form_class = UpdateLinkForm | ... | ... |