Commit 293bba0d5d6b489bb60bc82dcbd7f447f4e76d0b
1 parent
062db0ca
Exists in
master
and in
5 other branches
call template tags in topic #183
Showing
1 changed file
with
14 additions
and
90 deletions
Show diff stats
courses/templates/subject/form_view_teacher.html
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | {% block javascript %} |
4 | 4 | <script type="text/javascript" src="{% static 'js/forum.js' %}"></script> |
5 | + <script src="{% static 'js/file.js' %}"></script> | |
5 | 6 | {% endblock %} |
6 | 7 | |
7 | 8 | <div class="panel-group accordion ui-accordion ui-widget ui-helper-reset ui-sortable" role="tablist" aria-multiselectable="false"> |
... | ... | @@ -51,13 +52,21 @@ |
51 | 52 | <div class="dropdown"> |
52 | 53 | <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 | 54 | <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> | |
55 | + <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> | |
56 | + <li> | |
57 | + <a href="javascript:get_modal_file('{% url 'course:file:create_file' topic.slug %}', '#fileModal', '#divModalFile')"> | |
58 | + Create a file | |
59 | + <div class="ripple-container"> | |
60 | + <div class="ripple ripple-on ripple-out" style="left: 33.5312px; top: 11px; background-color: rgb(0, 150, 136); transform: scale(20);"> | |
61 | + </div> | |
62 | + </div> | |
63 | + </a> | |
64 | + </li> | |
56 | 65 | </ul> |
57 | 66 | </div> |
58 | 67 | </div> |
59 | 68 | <ul> |
60 | - <li><i class="fa fa-book" aria-hidden="true"></i> <a href="#">Book 1</a></li> | |
69 | + {% list_topic_file request topic %} | |
61 | 70 | <li><i class="fa fa-link" aria-hidden="true"></i> <a href="#" data-toggle="modal" data-target="#linksModal">Link 1</a></li> |
62 | 71 | <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 | 72 | </ul> |
... | ... | @@ -108,17 +117,12 @@ |
108 | 117 | <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 | 118 | <ul class="dropdown-menu" aria-labelledby="dLabel"> |
110 | 119 | <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> | |
120 | + <li><a href="javascript:void(0)" data-toggle="modal" data-target="#fileModal">Create a file</a></li> | |
112 | 121 | </ul> |
113 | 122 | </div> |
114 | 123 | </div> |
115 | 124 | <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> | |
125 | + {% list_topic_file_edit request topic %} | |
122 | 126 | </ul> |
123 | 127 | </div> |
124 | 128 | <div class="col-xs-4 col-md-offset-1 col-md-4"> |
... | ... | @@ -172,86 +176,6 @@ |
172 | 176 | </div> |
173 | 177 | </div> |
174 | 178 | <!-- END --> |
175 | - | |
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"> | |
179 | - <div class="modal-content"> | |
180 | - <div class="modal-header"> | |
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> | |
183 | - </div> | |
184 | - <div class="modal-body"> | |
185 | - <!-- Card --> | |
186 | - | |
187 | - <form class="form-horizontal"> | |
188 | - <fieldset> | |
189 | - | |
190 | - <div class="form-group"> | |
191 | - <label for="inputName" class="col-md-2 control-label">Name</label> | |
192 | - | |
193 | - <div class="col-md-10"> | |
194 | - <input type="text" class="form-control" id="inputText" placeholder="Name" value="Book 1"> | |
195 | - </div> | |
196 | - </div> | |
197 | - | |
198 | - <div class="form-group is-empty is-fileinput"> | |
199 | - <label for="inputFile" class="col-md-2 control-label">File</label> | |
200 | - | |
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> | |
206 | - | |
207 | - | |
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> | |
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> | |
222 | - | |
223 | - | |
224 | - <!-- .end Card --> | |
225 | - </div> | |
226 | - </div> | |
227 | - </div> | |
228 | - </div> | |
229 | - | |
230 | -{% if user|has_role:'system_admin' or topic.owner == user%} | |
231 | - {% include "files/create_file.html" %} | |
232 | -{% endif %} | |
233 | - | |
234 | - <!-- MODAL REMOVE FILE --> | |
235 | - <div class="modal" id="removeFileModal"> | |
236 | - <div class="modal-dialog"> | |
237 | - <div class="modal-content"> | |
238 | - <div class="modal-header"> | |
239 | - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button> | |
240 | - <h4 class="modal-title"></h4> | |
241 | - </div> | |
242 | - <div class="modal-body"> | |
243 | - <p>Do you really want to delete this file?</p> | |
244 | - </div> | |
245 | - <div class="modal-footer"> | |
246 | - | |
247 | - <a href="#" target="_self"><button type="button" class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Confirm</button></a> | |
248 | - | |
249 | - </div> | |
250 | - </div> | |
251 | - </div> | |
252 | - </div> | |
253 | - <!-- END --> | |
254 | - | |
255 | 179 | <!--MODAL VIEW LINK--> |
256 | 180 | <div class="modal fade" id="linksModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> |
257 | 181 | <div class="modal-dialog" role="document"> | ... | ... |