You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

75 lines
2.9 KiB

{% extends 'admin/base.html' %}
{% load static %}
{% block scripts %}
<script src="{% static 'custom_js/formset_add.js' %}"></script>
<script src="{% static 'ckeditor/ckeditor/ckeditor.js' %}"></script>
<link href="{% static 'js/select/select2.css' %}" rel="stylesheet"/>
<script src="{% static 'js/select/select2.js' %}"></script>
<script>
$(function(){
$('select').select2({width: "element"});
//$('#id_country').select2({width: "element"});
})
</script>
{% endblock %}
{% block body %}
<form method="post" class="form-horizontal" name="form2" id="form2" enctype="multipart/form-data"> {% csrf_token %}
<fieldset>
<div class="box span10">
<div class="box-header well">
<h2><i class="icon-pencil"></i>{% if object %}Изменения{% else %}Создание{% endif %} рассылки</h2>
</div>
<div class="box-content">
{% for field in form %}
<div class="control-group {% if field.errors %}error{% endif %}">
<label class="control-label">{% if field.field.required %}<b>{{ field.label }}:</b>{% else %}{{ field.label }}{% endif %}</label>
<div class="controls">{{ field }}
<span class="help-inline">{{ field.errors }}</span>
</div>
</div>
{% endfor %}
</div>
</div>
</fieldset>
<div class="box span10">
<div class="box-header well">
<h2><i class="icon-pencil"></i>Прикрепить файлы</h2>
</div>
<div class="box-content">
{{ attachment_formset.management_form }}
<table class="table table-hover" style=" width: 100%;">
<thead>
<th>тайтл</th>
<th>файл</th>
<th>&nbsp;</th>
</thead>
<tbody>
{% for attachment_form in attachment_formset.forms %}
<tr class="item">
<td>{{ attachment_form.id }}{{ attachment_form.title }}</td>
<td>{{ attachment_form.file_attachment }}</td>
<td><a class="delete btn btn-danger" href="#"><i class="icon-trash icon-white"></i> Удалить</a></td>
</tr>
{% endfor %}
</tbody>
</table>
<p style=" padding-left: 20px"><a id="add" class="btn btn-success" href="#"><i class="icon-plus-sign icon-white"></i> Добавить файл</a></p>
</div>
</div>
<div class="controls">
<input class="btn btn-large btn-primary" type="submit" value="Готово">
<input class="btn btn-large" type="reset" value="Отмена">
</div>
</form>
{% endblock %}