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.
 
 
 
 
 
 

106 lines
3.2 KiB

{% extends 'base.html' %}
{% block scripts %}
<script>
$(document).ready(function(){
$('.on').click(function(){
var url = $(this).attr('href')
var $this = $(this)
$.get(
url, function(data){
if (data == 'on'){
$this.hide();
$this.siblings('.off').show();
}
});//end get
return false;
});
$('.off').click(function(){
var url = $(this).attr('href')
var $this = $(this)
$.get(
url, function(data){
if (data == 'off'){
$this.hide();
$this.siblings('.on').show();
}
}
)
return false;
});
});
</script>
{% endblock %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Список выставок</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>Название</th>
<th>Дата начала</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for item in objects %}
<tr>
<td>{{ item.name }}</td>
<td>{{ item.data_begin }}</td>
<td>
<a class="btn-small btn-warning off" style="{% if item.is_published %}{% else %}display: none;{% endif %}"
href="/admin/exposition/switch/{{ item.url }}/off">
Отключить
</a>
<a class="btn-small btn-success on" style="{% if item.is_published %}display: none;{% else %}{% endif %}"
href="/admin/exposition/switch/{{ item.url }}/on">
Включить
</a>
</td>
<td>
<a class="btn-small btn-info" href="/admin/exposition/change/{{ item.url|lower }}">
Изменить
</a>
</td>
<td>
<a class="btn-small btn-inverse" href="/admin/exposition/copy/{{ item.url }}" id="copy">
Копировать
</a>
</td>
<td class="center sorting_1">
<a class="btn-small btn-danger" href="/admin/exposition/delete/{{ item.url|lower }}">
Удалить
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/exposition/add"><i class="icon-plus-sign icon-white"></i> Добавить выставку</a>
</div>
{# pagination #}
<div class="pagination pagination-centered">
<ul>
{% if objects.has_previous %}
<li> <a href="?page={{ objects.previous_page_number }}"></a></li>
{% endif %}
{% if objects.has_next %}
<li><a href="?page={{ objects.next_page_number }}"></a></li>
{% endif %}
</ul>
</div>
</div>
{% endblock %}