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.
 
 
 
 
 
 

87 lines
2.9 KiB

{% extends 'c_admin/base.html' %}
{% load staticfiles %}
{% block body %}
<div class="box span10">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>История для {{ newsletter.title }}</h2>
</div>
<div class="box-content">
<form id="id_form" class="form-inline">
<div class="form-group">
{{ filter_form.status }}
{{ filter_form.email }}
{% if newsletter.ab_testing %}
{{ filter_form.ab }}
{% endif %}
<button type="submit" class="btn">Применить</button>
</div>
</form>
<table class="table table-hover table table-bordered table-striped">
{% if newsletter.ab_testing %}
<colgroup>
<col width="25%">
<col width="25%">
<col width="25%">
<col width="25%">
</colgroup>
<thead>
<tr>
<th>Дата</th>
<th>Контакт</th>
<th>Статус</th>
<th>Вариант письма</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.creation_date|date:"Y-m-d H:i:s" }}</td>
<td>{{ item.contact.email }}</td>
<td>{{ item.get_verbose_status|safe }}</td>
<td>{{ item.get_ab_display }}</td>
</tr>
{% endfor %}
{% else %}
<colgroup>
<col width="33%">
<col width="33%">
<col width="33%">
</colgroup>
<thead>
<tr>
<th>Дата</th>
<th>Контакт</th>
<th>Статус</th>
</tr>
</thead>
<tbody>
{% for item in object_list %}
<tr>
<td>{{ item.creation_date|date:"Y-m-d H:i:s" }}</td>
<td>{{ item.contact.email }}</td>
<td>{{ item.get_verbose_status|safe }}</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
{# pagination #}
{% include 'c_admin/includes/admin_pagination.html' with page_obj=page_obj %}
</div>
<script>
$(document).ready(function(){
$("#filter").on('change', function(event){
console.log("click");
$("#id_form").submit();
})
})
</script>
{% endblock %}