|
|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
{% extends 'admin/base.html' %} |
|
|
|
|
|
|
|
|
|
{% load staticfiles %} |
|
|
|
|
{% block body %} |
|
|
|
|
|
|
|
|
|
<div class="box span10"> |
|
|
|
|
@ -9,65 +9,75 @@ |
|
|
|
|
<div class="box-content"> |
|
|
|
|
<form class="form-horizontal" method="get"> |
|
|
|
|
<fieldset> |
|
|
|
|
|
|
|
|
|
<!-- Form Name --> |
|
|
|
|
<legend>Filter subscribers</legend> |
|
|
|
|
|
|
|
|
|
<!-- Search input--> |
|
|
|
|
<div class="control-group"> |
|
|
|
|
<label class="control-label" for="id_email">{{ form.email.label }}</label> |
|
|
|
|
|
|
|
|
|
<div class="controls"> |
|
|
|
|
{# <input id="Email" name="Email" type="text" placeholder="Email"#} |
|
|
|
|
{# class="input-xlarge search-query">#} |
|
|
|
|
{{ form.email }} |
|
|
|
|
|
|
|
|
|
<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> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- Select Basic --> |
|
|
|
|
<div class="control-group"> |
|
|
|
|
<label class="control-label" for="id_theme">{{ form.theme.label }}</label> |
|
|
|
|
|
|
|
|
|
<div class="controls"> |
|
|
|
|
{{ form.theme }} |
|
|
|
|
<!-- Theme --> |
|
|
|
|
<div class="control-group"> |
|
|
|
|
<label class="control-label" for="id_theme">{{ form.theme.label }}</label> |
|
|
|
|
<div class="controls"> |
|
|
|
|
{{ form.theme }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- Select Basic --> |
|
|
|
|
<div class="control-group"> |
|
|
|
|
<label class="control-label" for="id_country">{{ form.id_country }}</label> |
|
|
|
|
<!-- Country --> |
|
|
|
|
<div class="control-group"> |
|
|
|
|
<label class="control-label" for="id_country">{{ form.country.label }}</label> |
|
|
|
|
<div class="controls"> |
|
|
|
|
{{ form.country }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="controls"> |
|
|
|
|
{{ form.country }} |
|
|
|
|
<!-- Area --> |
|
|
|
|
<div class="control-group"> |
|
|
|
|
<label class="control-label" for="id_area">{{ form.area.label }}</label> |
|
|
|
|
<div class="controls"> |
|
|
|
|
{{ form.area }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- Select Basic --> |
|
|
|
|
<div class="control-group"> |
|
|
|
|
<label class="control-label" for="id_area">{{ form.area.label }}</label> |
|
|
|
|
<!-- Submit newsletter --> |
|
|
|
|
<div class="control-group"> |
|
|
|
|
<label class="control-label" for="id_active">{{ form.active.label }}</label> |
|
|
|
|
<div class="controls"> |
|
|
|
|
{{ form.active }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="controls"> |
|
|
|
|
{{ form.area }} |
|
|
|
|
<!-- Valid email --> |
|
|
|
|
<div class="control-group"> |
|
|
|
|
<label class="control-label" for="id_area">{{ form.valid.label }}</label> |
|
|
|
|
<div class="controls"> |
|
|
|
|
{{ form.valid }} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<!-- Button --> |
|
|
|
|
<div class="control-group"> |
|
|
|
|
<label class="control-label" for="submit"></label> |
|
|
|
|
<!-- Buttons --> |
|
|
|
|
<div class="control-group"> |
|
|
|
|
<label class="control-label" for="submit"></label> |
|
|
|
|
|
|
|
|
|
<div class="controls"> |
|
|
|
|
<button id="submit" name="submit" class="btn btn-info">Filter</button> |
|
|
|
|
<div class="controls"> |
|
|
|
|
<button id="submit" class="btn btn-primary">Filter</button> |
|
|
|
|
<a href="{% url 'export_contacts' %}" id="export" class="btn btn-warning">Export to xls <i class="icon-circle-arrow-down"></i></a> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</fieldset> |
|
|
|
|
</form> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<table class="table table-hover"> |
|
|
|
|
|
|
|
|
|
<thead> |
|
|
|
|
<thead> |
|
|
|
|
<tr> |
|
|
|
|
<th>Email</th> |
|
|
|
|
<th>Имя</th> |
|
|
|
|
@ -78,27 +88,55 @@ |
|
|
|
|
<th>Дата редактирования</th> |
|
|
|
|
<th> </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> |
|
|
|
|
</tr> |
|
|
|
|
{% endfor %} |
|
|
|
|
</tbody> |
|
|
|
|
</table> |
|
|
|
|
</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> |
|
|
|
|
</tr> |
|
|
|
|
{% endfor %} |
|
|
|
|
</tbody> |
|
|
|
|
</table> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
{# pagination #} |
|
|
|
|
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %} |
|
|
|
|
</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: 'Страны'}); |
|
|
|
|
$("#id_area").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; |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
</script> |
|
|
|
|
{% endblock %} |