Commit de72a88b99aceb4ba96d11a0316e6826756158cd
1 parent
b084b599
Exists in
master
and in
5 other branches
Adding condition to show modal for add file #133
Showing
1 changed file
with
3 additions
and
55 deletions
Show diff stats
courses/templates/subject/form_view_teacher.html
... | ... | @@ -314,62 +314,10 @@ |
314 | 314 | </div> |
315 | 315 | </div> |
316 | 316 | </div> |
317 | -<!-- EndModal --> | |
318 | 317 | |
319 | -<!-- MODAL CREATE FILE --> | |
320 | -<div class="modal fade" id="createFileModal" tabindex="-1" role="dialog" aria-labelledby="createFileLabel" style="display: none;"> | |
321 | -<div class="modal-dialog" role="document"> | |
322 | -<div class="modal-content"> | |
323 | - <div class="modal-header"> | |
324 | - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | |
325 | - <h4 class="modal-title" id="createFileLabel">Add File</h4> | |
326 | - </div> | |
327 | - <div class="modal-body"> | |
328 | - <!-- Card --> | |
329 | - | |
330 | - <form class="form-horizontal"> | |
331 | - <fieldset> | |
332 | - | |
333 | - <div class="form-group is-empty"> | |
334 | - <label for="inputName" class="col-md-2 control-label">Name</label> | |
335 | - | |
336 | - <div class="col-md-10"> | |
337 | - <input type="text" class="form-control" id="inputText" placeholder="Name"> | |
338 | - </div> | |
339 | - </div> | |
340 | - | |
341 | - <div class="form-group is-empty is-fileinput"> | |
342 | - <label for="inputFile" class="col-md-2 control-label">File</label> | |
343 | - | |
344 | - <div class="col-md-10"> | |
345 | - <input type="text" readonly="" class="form-control" placeholder="Browse..."> | |
346 | - <input type="file" id="inputFile" multiple=""> | |
347 | - </div> | |
348 | - </div> | |
349 | - | |
350 | - | |
351 | - <div class="form-group"> | |
352 | - <div class="col-md-12 text-center"> | |
353 | - <p><b>The file size shouldn't exceed 10MB</b></p> | |
354 | - </div> | |
355 | - </div> | |
356 | - | |
357 | - <div class="form-group"> | |
358 | - <div class="col-md-12"> | |
359 | - <a href="javascript:void(0)" class="btn btn-raised btn-default">Cancel<div class="ripple-container"></div></a> | |
360 | - <a href="javascript:void(0)" class="btn btn-raised btn-primary">Submit</a> | |
361 | - </div> | |
362 | - </div> | |
363 | - </fieldset> | |
364 | - </form> | |
365 | - | |
366 | - | |
367 | - <!-- .end Card --> | |
368 | - </div> | |
369 | - </div> | |
370 | - </div> | |
371 | -</div> | |
372 | -<!-- EndModal --> | |
318 | +{% if user|has_role:'system_admin' or topic.owner == user%} | |
319 | + {% include "files/create_file.html" %} | |
320 | +{% endif %} | |
373 | 321 | |
374 | 322 | <!-- MODAL REMOVE FILE --> |
375 | 323 | <div class="modal" id="removeFileModal"> | ... | ... |