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.
 
 
 
 
 
 

168 lines
7.6 KiB

{% extends 'admin/base.html' %}
{% load staticfiles %}
{% block body %}
<div class="box span10">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Список контактов <a class="btn" href="{% url 'import_newsletters_contacts' %}">Импорт</a></h2>
</div>
<div class="box-content">
<form class="form-horizontal" method="get">
<fieldset>
<!-- Form Name -->
<legend>Filter subscribers <i class="icon-circle-arrow-down"></i></legend>
<div class="toggled">
<!-- Email -->
<div class="control-group">
<label class="control-label" for="id_email">{{ form.email.label }}</label>
<div class="controls">
{{ form.email }}
</div>
</div>
<!-- Theme -->
<div class="control-group">
<label class="control-label" for="id_theme">{{ form.theme.label }}</label>
<div class="controls">
{{ form.theme }}
</div>
</div>
<!-- Country -->
<div class="control-group">
<label class="control-label" for="id_country">{{ form.country.label }}</label>
<div class="controls">
{{ form.country }}
</div>
</div>
<!-- City -->
<div class="control-group">
<label class="control-label" for="id_city">{{ form.city.label }}</label>
<div class="controls">
{{ form.city }}
</div>
</div>
<!-- Area -->
<div class="control-group">
<label class="control-label" for="id_area">{{ form.area.label }}</label>
<div class="controls">
{{ form.area }}
</div>
</div>
<!-- Mailing list -->
<div class="control-group">
<label class="control-label" for="id_mailinglist">{{ form.mailinglist.label }}</label>
<div class="controls">
{{ form.mailinglist }}
</div>
</div>
<!-- Submit newsletter -->
<div class="control-group">
<label class="control-label" for="id_active">{{ form.active.label }}</label>
<div class="controls">
{{ form.active }}
</div>
</div>
<!-- Valid email -->
<div class="control-group">
<label class="control-label" for="id_area">{{ form.valid.label }}</label>
<div class="controls">
{{ form.valid }}
</div>
</div>
<!-- Buttons -->
<div class="control-group">
<label class="control-label" for="submit"></label>
<div class="controls">
<button id="submit" class="btn btn-primary">Фильтровать </button>
<a href="{% url 'export_contacts' %}" id="export" class="btn btn-warning">Экспорт в xls <i class="icon-circle-arrow-down"></i></a>
<a href="{% url 'newsletters_mailinglist_create' %}" id="mailinglist" class="btn btn-success">Создать сп. рассылки <i class="icon-list"></i></a>
</div>
</div>
</div>
</fieldset>
</form>
<table class="table table-hover">
<thead>
<tr>
<th>Email</th>
<th>Имя</th>
<th>Тестер</th>
<th>Подписчик</th>
<th>Потверждена подписка</th>
<th>Дата создания</th>
<th>Дата редактирования</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.email }}</td>
<td>{{ item.first_name }}</td>
<td>{% if item.tester %}<span class="label label-success">да</span>{% else %}
<span class="label label-important">нет</span>{% endif %}</td>
<td>{% if item.subscriber %}<span class="label label-success">да</span>{% else %}
<span class="label label-important">нет</span>{% endif %}</td>
<td>{% if item.activated %}<span class="label label-success">да</span>{% else %}
<span class="label label-important">нет</span>{% endif %}</td>
<td>{{ item.creation_date|date:"Y-m-d H:i" }}</td>
<td>{{ item.modification_date|date:"Y-m-d H:i" }}</td>
<td><a href="{% url 'newsletters_contact_update' item.contactsettings.id %}">Изменить</a></td>
<td><a href="{% url 'newsletters_contact_delete' item.id %}">Удалить</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}
{% block scripts %}
<script src="{% static 'js/select2.min.js' %}"></script>
<link href="{% static 'js/select/select2.css' %}" rel='stylesheet'>
<script>
$(document).ready(function () {
$("#id_theme").select2({width: 283, placeholder: 'Тематики'});
$("#id_country").select2({width: 283, placeholder: 'Страны'});
$("#cities").select2({width: 283, placeholder: 'Города'});
$("#id_area").select2({width: 283, placeholder: 'Географическая зона'});
$("#id_mailinglist").select2({width: 283, placeholder: 'Список рассылки'});
var get_param = window.location.search;
if (!get_param) {
$('.toggled').collapse('hide');
}
$('legend').on('click', function () {
$('.toggled').collapse('toggle');
});
$('#export').on('click', function(event){
event.preventDefault();
window.location = "{% url 'export_contacts' %}" + get_param;
});
$('#mailinglist').on('click', function(event){
event.preventDefault();
window.location = "{% url 'newsletters_mailinglist_create' %}" + get_param;
})
})
</script>
{% endblock %}