...
...
@@ -0,0 +1,347 @@
1
+{% load static i18n %}
2
+{% load widget_tweaks %}
3
+
4
+<form method="post" action="" enctype="multipart/form-data">
5
+ {% csrf_token %}
6
+
7
+ {% render_field form.control_subject %}
8
+
9
+ <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput">
10
+ <label for="{{ form.name.auto_id }}">{{ form.name.label }} <span>*</span></label>
11
+ {% render_field form.name class='form-control' %}
12
+
13
+ <span id="helpBlock" class="help-block">{{ form.name.help_text }}</span>
14
+
15
+ {% if form.name.errors %}
16
+ <div class="alert alert-danger alert-dismissible" role="alert">
17
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
18
+ <span aria-hidden="true">×</span>
19
+ </button>
20
+ <ul>
21
+ {% for error in form.name.errors %}
22
+ <li>{{ error }}</li>
23
+ {% endfor %}
24
+ </ul>
25
+ </div>
26
+ {% endif %}
27
+ </div>
28
+
29
+ <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput">
30
+ <label for="{{ form.url.auto_id }}">{{ form.url.label }} <span>*</span></label>
31
+ {% render_field form.url class='form-control' %}
32
+
33
+ <span id="helpBlock" class="help-block">{{ form.url.help_text }}</span>
34
+
35
+ {% if form.url.errors %}
36
+ <div class="alert alert-danger alert-dismissible" role="alert">
37
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
38
+ <span aria-hidden="true">×</span>
39
+ </button>
40
+ <ul>
41
+ {% for error in form.url.errors %}
42
+ <li>{{ error }}</li>
43
+ {% endfor %}
44
+ </ul>
45
+ </div>
46
+ {% endif %}
47
+ </div>
48
+
49
+ <legend>{% trans 'Common resources settings' %}</legend>
50
+
51
+ <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput">
52
+ <label for="{{ form.brief_description.auto_id }}">{{ form.brief_description.label }}</label>
53
+ {% render_field form.brief_description class='form-control text_wysiwyg' %}
54
+
55
+ <span id="helpBlock" class="help-block">{{ form.brief_description.help_text }}</span>
56
+
57
+ {% if form.brief_description.errors %}
58
+ <div class="alert alert-danger alert-dismissible" role="alert">
59
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
60
+ <span aria-hidden="true">×</span>
61
+ </button>
62
+ <ul>
63
+ {% for error in form.brief_description.errors %}
64
+ <li>{{ error }}</li>
65
+ {% endfor %}
66
+ </ul>
67
+ </div>
68
+ {% endif %}
69
+ </div>
70
+
71
+ <div class="form-group{% if form.has_error %} has-error {% endif %} is-fileinput">
72
+ <label for="{{ form.tags.auto_id }}">{{ form.tags.label }}</label>
73
+ {% render_field form.tags class='form-control' data-role="tagsinput" %}
74
+
75
+ <span id="helpBlock" class="help-block">{{ form.tags.help_text }}</span>
76
+
77
+ {% if form.tags.errors %}
78
+ <div class="alert alert-danger alert-dismissible" role="alert">
79
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
80
+ <span aria-hidden="true">×</span>
81
+ </button>
82
+ <ul>
83
+ {% for error in form.tags.errors %}
84
+ <li>{{ error }}</li>
85
+ {% endfor %}
86
+ </ul>
87
+ </div>
88
+ {% endif %}
89
+ </div>
90
+
91
+ <div class="panel-group" id="professors_accordion" role="tablist" aria-multiselectable="true">
92
+ <div class="panel panel-info">
93
+ <div class="panel-heading">
94
+ <div class="row">
95
+ <div class="col-md-12">
96
+ <a data-parent="#professors_accordion" data-toggle="collapse" href="#notifications">
97
+ <h4 class="panel-title">
98
+ <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button><label>{% trans 'Pendencies Notifications' %}</label>
99
+ </h4>
100
+ </a>
101
+ </div>
102
+ </div>
103
+ </div>
104
+ <div id="notifications" class="panel-collapse collapse">
105
+
106
+ <div class="notifies">
107
+ <div style="text-align:left">
108
+ {% render_field pendencies_form.id %}
109
+ {% render_field pendencies_form.resource %}
110
+ {% render_field pendencies_form.subject class='pend_subj' %}
111
+
112
+ <div class="form-group{% if pendencies_form.has_error %} has-error {% endif %} row">
113
+ <label for="{{ pendencies_form.action.auto_id }}" class="pull-left action_label contol-label">
114
+ {% trans 'Action not performed by the user' %}:
115
+ </label>
116
+ <div class="col-md-3">
117
+ {% render_field pendencies_form.action class='form-control' %}
118
+ </div>
119
+
120
+ <br clear="all" />
121
+
122
+ <span id="helpBlock" class="help-block">{{ pendencies_form.action.help_text }}</span>
123
+
124
+ {% if pendencies_form.action.errors %}
125
+ <div class="alert alert-danger alert-dismissible" role="alert">
126
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
127
+ <span aria-hidden="true">×</span>
128
+ </button>
129
+ <ul>
130
+ {% for error in pendencies_form.action.errors %}
131
+ <li>{{ error }}</li>
132
+ {% endfor %}
133
+ </ul>
134
+ </div>
135
+ {% endif %}
136
+ </div>
137
+ <br clear="all" />
138
+ <div class="row">
139
+ <div class="col-md-12">
140
+ <p>{% trans 'Wished period' %}: </p>
141
+ </div>
142
+ </div>
143
+ <div class="form-group{% if pendencies_form.has_error %} has-error {% endif %} row">
144
+ <div class="col-lg-2 col-md-2 col-sm-2 col-xs-3 checkbox">
145
+ <label>
146
+ {% render_field pendencies_form.begin_date_check class="begin_date" %} {{ pendencies_form.begin_date.label }}
147
+ </label>
148
+ </div>
149
+ <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
150
+ {% render_field pendencies_form.begin_date class='form-control datetime-picker begin_date_input' %}
151
+ </div>
152
+ </div>
153
+ <div class="row">
154
+ <span id="helpBlock" class="help-block">{{ pendencies_form.begin_date.help_text }}</span>
155
+
156
+ {% if pendencies_form.begin_date.errors %}
157
+ <div class="alert alert-danger alert-dismissible" role="alert">
158
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
159
+ <span aria-hidden="true">×</span>
160
+ </button>
161
+ <ul>
162
+ {% for error in pendencies_form.begin_date.errors %}
163
+ <li>{{ error }}</li>
164
+ {% endfor %}
165
+ </ul>
166
+ </div>
167
+ {% endif %}
168
+ </div>
169
+ <div class="form-group{% if pendencies_form.has_error %} has-error {% endif %} row">
170
+ <div class="col-lg-2 col-md-2 col-sm-2 col-xs-3 checkbox">
171
+ <label>
172
+ {% render_field pendencies_form.end_date_check class="end_date" %} {{ pendencies_form.end_date.label }}
173
+ </label>
174
+ </div>
175
+ <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
176
+ {% render_field pendencies_form.end_date class='form-control datetime-picker end_date_input' %}
177
+ </div>
178
+ </div>
179
+ <div class="row">
180
+ <span id="helpBlock" class="help-block">{{ pendencies_form.end_date.help_text }}</span>
181
+
182
+ {% if pendencies_form.end_date.errors %}
183
+ <div class="alert alert-danger alert-dismissible" role="alert">
184
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
185
+ <span aria-hidden="true">×</span>
186
+ </button>
187
+ <ul>
188
+ {% for error in pendencies_form.end_date.errors %}
189
+ <li>{{ error }}</li>
190
+ {% endfor %}
191
+ </ul>
192
+ </div>
193
+ {% endif %}
194
+ </div>
195
+ </div>
196
+ </div>
197
+ </div>
198
+ </div>
199
+
200
+ <div class="panel panel-info">
201
+ <div class="panel-heading">
202
+ <div class="row">
203
+ <div class="col-md-12">
204
+ <a data-parent="#professors_accordion" data-toggle="collapse" href="#students">
205
+ <h4 class="panel-title">
206
+ <button class="btn btn-default btn-xs text-center cat-selector"><i class="fa fa-angle-right fa-2x" aria-hidden="true"></i></button><label for="{{ form.students.auto_id }}">{{ form.students.label }}</label>
207
+ </h4>
208
+ </a>
209
+ </div>
210
+ </div>
211
+ </div>
212
+ <div id="students" class="panel-collapse collapse">
213
+ <div class="form-group{% if form.has_error %} has-error {% endif %}">
214
+ <div class=" checkbox">
215
+ <label for="{{ form.all_students.auto_id }}">
216
+ {% render_field form.all_students %} {{ form.all_students.label }}
217
+ </label>
218
+ </div>
219
+
220
+ <span id="helpBlock" class="help-block">{{ form.all_students.help_text }}</span>
221
+
222
+ {% if form.all_students.errors %}
223
+ <div class="alert alert-danger alert-dismissible" role="alert">
224
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
225
+ <span aria-hidden="true">×</span>
226
+ </button>
227
+ <ul>
228
+ {% for error in form.all_students.errors %}
229
+ <li>{{ error }}</li>
230
+ {% endfor %}
231
+ </ul>
232
+ </div>
233
+ {% endif %}
234
+ </div>
235
+
236
+ <p><em>{% trans 'Attribute students to webpage' %}:</em></p>
237
+ {% render_field form.students class='form-control' %}
238
+
239
+ <span id="helpBlock" class="help-block">{{ form.students.help_text }}</span>
240
+
241
+ {% if form.students.errors %}
242
+ <div class="alert alert-danger alert-dismissible" role="alert">
243
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
244
+ <span aria-hidden="true">×</span>
245
+ </button>
246
+ <ul>
247
+ {% for error in form.students.errors %}
248
+ <li>{{ error }}</li>
249
+ {% endfor %}
250
+ </ul>
251
+ </div>
252
+ {% endif %}
253
+
254
+ <br clear="all" />
255
+
256
+ <p><em>{% trans 'Attribute groups to webpage' %}:</em></p>
257
+ {% render_field form.groups class='form-control' %}
258
+
259
+ <span id="helpBlock" class="help-block">{{ form.groups.help_text }}</span>
260
+
261
+ {% if form.groups.errors %}
262
+ <div class="alert alert-danger alert-dismissible" role="alert">
263
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
264
+ <span aria-hidden="true">×</span>
265
+ </button>
266
+ <ul>
267
+ {% for error in form.groups.errors %}
268
+ <li>{{ error }}</li>
269
+ {% endfor %}
270
+ </ul>
271
+ </div>
272
+ {% endif %}
273
+ </div>
274
+ </div>
275
+ </div>
276
+
277
+ <div class="form-group{% if form.has_error %} has-error {% endif %}">
278
+ <div class=" checkbox">
279
+ <label for="{{ form.show_window.auto_id }}">
280
+ {% render_field form.show_window %} {{ form.show_window.label }}
281
+ </label>
282
+ </div>
283
+
284
+ <span id="helpBlock" class="help-block">{{ form.show_window.help_text }}</span>
285
+
286
+ {% if form.show_window.errors %}
287
+ <div class="alert alert-danger alert-dismissible" role="alert">
288
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
289
+ <span aria-hidden="true">×</span>
290
+ </button>
291
+ <ul>
292
+ {% for error in form.show_window.errors %}
293
+ <li>{{ error }}</li>
294
+ {% endfor %}
295
+ </ul>
296
+ </div>
297
+ {% endif %}
298
+ </div>
299
+
300
+ <div class="form-group{% if form.has_error %} has-error {% endif %}">
301
+ <div class=" checkbox">
302
+ <label for="{{ form.visible.auto_id }}">
303
+ {% render_field form.visible %} {{ form.visible.label }}
304
+ </label>
305
+ </div>
306
+
307
+ <span id="helpBlock" class="help-block">{{ form.visible.help_text }}</span>
308
+
309
+ {% if form.visible.errors %}
310
+ <div class="alert alert-danger alert-dismissible" role="alert">
311
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
312
+ <span aria-hidden="true">×</span>
313
+ </button>
314
+ <ul>
315
+ {% for error in form.visible.errors %}
316
+ <li>{{ error }}</li>
317
+ {% endfor %}
318
+ </ul>
319
+ </div>
320
+ {% endif %}
321
+ </div>
322
+
323
+ <div class="col-md-12 col-lg-12 col-sm-12 col-xs-12">
324
+ <div class="text-center">
325
+ <input type="submit" value="{% trans 'Save' %}" class="btn btn-raised btn-success" />
326
+ </div>
327
+ </div>
328
+</form>
329
+<script type="text/javascript">
330
+ $(function() {
331
+ var begin_val = $('.begin_date_input').val(),
332
+ end_val = $('.end_date_input').val();
333
+
334
+ if (begin_val != '') {
335
+ $(".begin_date").prop('checked', true);
336
+ }
337
+
338
+ if (end_val != '') {
339
+ $(".end_date").prop('checked', true);
340
+ }
341
+
342
+ {% if not pendencies_form.is_valid and pendencies_form.is_bound %}
343
+ $("#notifications").collapse('toggle');
344
+ {% endif %}
345
+ });
346
+</script>
347
+<script type="text/javascript" src="{% static 'js/resources.js' %}"></script>
0
348
\ No newline at end of file
...
...