parent
2003722f4f
commit
d91f3c92ca
3 changed files with 29 additions and 132 deletions
@ -1,25 +0,0 @@ |
|||||||
{% load thumbnail %} |
|
||||||
{% comment %} |
|
||||||
Uses in ajax call |
|
||||||
|
|
||||||
Returns table with files properties |
|
||||||
|
|
||||||
{% endcomment %} |
|
||||||
{% for file in files %} |
|
||||||
<tr> |
|
||||||
<td>{{ file.id }}</td> |
|
||||||
<td> |
|
||||||
{% thumbnail file.file_path "100x100" crop="center" as im %} |
|
||||||
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"> |
|
||||||
{% endthumbnail %} |
|
||||||
</td> |
|
||||||
<td>{{ file.file_name }}</td> |
|
||||||
<td>{{ file.purpose }}</td> |
|
||||||
<td> |
|
||||||
<button class="btn btn-danger delete_file" value="{{ file.id }}"> |
|
||||||
<i class="icon-trash icon-white"></i> Удалить |
|
||||||
</button> |
|
||||||
</td> |
|
||||||
</tr> |
|
||||||
|
|
||||||
{% endfor %} |
|
||||||
@ -1,49 +0,0 @@ |
|||||||
<div class="modal hide fade" id="myModal" > |
|
||||||
<div class="modal-header"> |
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" id="close">×</button> |
|
||||||
<h3>Добавить файл</h3> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div id="form_body"> |
|
||||||
<form method="post" class="form-horizontal" enctype="multipart/form-data" name="file_form" id="file_form" > {% csrf_token %} |
|
||||||
<div class="modal-body"> |
|
||||||
|
|
||||||
|
|
||||||
{{ file_form.model }} |
|
||||||
<input type="hidden" id="obj_id" value="{{ object.id }}"> |
|
||||||
|
|
||||||
{# file_path #} |
|
||||||
<div class="control-group{% if file_form.file_path.errors %}error{% endif %}"> |
|
||||||
<label class="control-label">{{ file_form.file_path.label }}:</label> |
|
||||||
<div class="controls">{{ file_form.file_path }} |
|
||||||
<span class="help-inline">{{ file_form.file_path.errors }}</span> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
{# file purpose #} |
|
||||||
<div class="control-group{% if file_form.purpose.errors %}error{% endif %}"> |
|
||||||
<label class="control-label">{{ file_form.purpose.label }}:</label> |
|
||||||
<div class="controls">{{ file_form.purpose }} |
|
||||||
<span class="help-inline">{{ file_form.purpose.errors }}</span> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
{# file_name #} |
|
||||||
{% with field='file_name' form=file_form languages=languages %} |
|
||||||
{% include 'c_admin/forms/multilang.html' %} |
|
||||||
{% endwith %} |
|
||||||
{# file_description #} |
|
||||||
{% with field='description' form=file_form languages=languages %} |
|
||||||
{% include 'c_admin/forms/multilang.html' %} |
|
||||||
{% endwith %} |
|
||||||
|
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="modal-footer"> |
|
||||||
<div class="controls"> |
|
||||||
<input class="btn btn-primary" type="submit" value="Добавить"> |
|
||||||
<input type="reset" class="btn" value="Отменить" data-dismiss="modal"> |
|
||||||
|
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</form> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
Loading…
Reference in new issue