parent
897b23b592
commit
e002028cab
15 changed files with 374 additions and 17 deletions
@ -0,0 +1,84 @@ |
||||
{% extends 'base.html' %} |
||||
{% load static %} |
||||
|
||||
{% block scripts %} |
||||
{# selects #} |
||||
<link href="{% static 'js/select/select2.css' %}" rel="stylesheet"/> |
||||
<script src="{% static 'js/select/select2.js' %}"></script> |
||||
<script> |
||||
$(function(){ |
||||
$('#id_fr').datetimepicker({ |
||||
todayHighlight: true, |
||||
format : 'yyyy-mm-dd', |
||||
minView:2 |
||||
}); |
||||
$('#id_to').datetimepicker({ |
||||
todayHighlight: true, |
||||
format : 'yyyy-mm-dd', |
||||
minView:2 |
||||
}); |
||||
$('#id_theme').select2({width: "element"}); |
||||
$('#id_country').select2({width: "element"}); |
||||
$('#id_exposition').select2({ |
||||
placeholder: 'Найти', |
||||
width: 'element', |
||||
ajax: { |
||||
url: '/admin/exposition/search/', |
||||
dataType: "json", |
||||
quietMillis: 200, |
||||
multiple: true, |
||||
|
||||
data: function(term, page, theme){ |
||||
return {term: term, |
||||
page: page}; |
||||
}, |
||||
|
||||
results: function (data) { |
||||
var results = []; |
||||
$.each(data, function(index, item){ |
||||
results.push({ |
||||
id: item.id, |
||||
text: item.label |
||||
}); |
||||
}); |
||||
return {results: results}; |
||||
} |
||||
}, |
||||
initSelection : function(element, callback) { |
||||
var id= $(element).val(); |
||||
var text = $(element).attr('data-init-text'); |
||||
callback({id: id, text:text}); |
||||
|
||||
} |
||||
}); |
||||
}); |
||||
|
||||
</script> |
||||
{% endblock %} |
||||
|
||||
{% block body %} |
||||
<form method="post" class="form-horizontal" name="form2" id="form2" enctype="multipart/form-data"> {% csrf_token %} |
||||
<fieldset> |
||||
<div class="box span8"> |
||||
<div class="box-header well"> |
||||
<h2><i class="icon-pencil"></i>{{ form.verbose }}</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="controls"> |
||||
<input class="btn btn-large btn-primary" type="submit" value="Готово"> |
||||
<input class="btn btn-large" type="reset" value="Отмена"> |
||||
</div> |
||||
</form> |
||||
{% endblock %} |
||||
@ -0,0 +1,36 @@ |
||||
{% extends 'base.html' %} |
||||
|
||||
{% block body %} |
||||
|
||||
<div class="box span8"> |
||||
<div class="box-header well"> |
||||
<h2><i class="icon-arrow-down"></i>Список выставок в топе</h2> |
||||
</div> |
||||
<div class="box-content"> |
||||
{% block list_table %} |
||||
<a class="btn btn-success" href="{% url 'expobanner-create_top' %}"><i class="icon-plus-sign icon-white"></i> Добавить выставку</a> |
||||
<table class="table table-hover"> |
||||
<thead> |
||||
<tr> |
||||
<th>Выставка</th> |
||||
<th> </th> |
||||
<th> </th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{% for item in object_list %} |
||||
<tr> |
||||
<td>{{ item }}</td> |
||||
<td><a href="{% url 'expobanner-update_top' item.top_id %}">Изменить</a> </td> |
||||
<td><a href="{% url 'expobanner_stat_top' item.top_id %}">Статистика</a> </td> |
||||
</tr> |
||||
{% endfor %} |
||||
</tbody> |
||||
</table> |
||||
{% endblock %} |
||||
</div> |
||||
{# pagination #} |
||||
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %} |
||||
</div> |
||||
|
||||
{% endblock %} |
||||
@ -0,0 +1,13 @@ |
||||
<div id="expo_top_events"> |
||||
|
||||
</div> |
||||
<script> |
||||
/* НУЖНО ЛИ??? */ |
||||
window.sendData = { |
||||
"theme": [{% for item in themes %}{{ item }}{% endfor %}], |
||||
"country": "{{ country }}", |
||||
"city": "{{ city }}", |
||||
"tag": "{{ tag }}" |
||||
}; |
||||
var url = "/expo-b/get-tops/"; |
||||
</script> |
||||
@ -0,0 +1,102 @@ |
||||
{% load static %} |
||||
{% load i18n %} |
||||
{% load template_filters %} |
||||
|
||||
<ul class="cat-list cl-exhibitions"> |
||||
|
||||
{% for obj in objects %} |
||||
<li class="cl-item {% if obj.canceled %}canceled{% endif %}"> |
||||
<div class="cl-item-wrap clearfix"> |
||||
{% if not obj.canceled %} |
||||
<a href="{% if not obj.paid_new_id %}{{ obj.get_permanent_url }}{% else %}{{ obj.get_paid_catalog_url }}{% endif %}"> |
||||
{% if obj.expohit %} |
||||
<div class="hit"></div> |
||||
{% endif %} |
||||
<div class="cli-pict"> |
||||
{% with obj=obj %} |
||||
{% include 'client/includes/show_logo.html' %} |
||||
{% endwith %} |
||||
</div> |
||||
</a> |
||||
|
||||
{% else %} |
||||
<div class="cancel"></div> |
||||
<div class="cli-pict"> |
||||
{% with obj=obj %} |
||||
{% include 'client/includes/show_logo.html' %} |
||||
{% endwith %} |
||||
</div> |
||||
{% endif %} |
||||
<div class="cli-info"> |
||||
<div class="cli-top clearfix"> |
||||
{% if obj.quality_label.ufi.is_set %} |
||||
<div class="cli-approved"> |
||||
<img src="{% static 'client/img/approved-logo.png' %}" alt="" title="Approved Event" /> |
||||
</div> |
||||
{% endif %} |
||||
<header> |
||||
<div class="cli-title"><a href="{% if not obj.paid_new_id %}{{ obj.get_permanent_url }}{% else %}{{ obj.get_paid_catalog_url }}{% endif %}">{{ obj.name|safe }}</a></div> |
||||
</header> |
||||
<div class="cli-descr"> |
||||
{{ obj.main_title|safe }} |
||||
</div> |
||||
</div> |
||||
<div class="cli-bot clearfix"> |
||||
<div class="cli-date"> |
||||
{% with obj=obj %} |
||||
{% include 'client/includes/show_date_block.html' %} |
||||
{% endwith %} |
||||
</div> |
||||
{% if obj.country %} |
||||
<div class="cli-place"> |
||||
<a href="{{ obj.catalog }}country/{{ obj.country.url }}/">{{ obj.country }}</a>, <a href="{{ obj.catalog }}city/{{ obj.city.url }}/">{{ obj.city }}</a> |
||||
{% if obj.place %} |
||||
, <a href="/places/{{ obj.place.url }}/">{{ obj.place }}</a> |
||||
{% endif %} |
||||
</div> |
||||
{% endif %} |
||||
</div> |
||||
</div> |
||||
<div class="cli-buttons clearfix"> |
||||
<div class="cli-m-buttons"> |
||||
{% include 'client/includes/exposition/services.html' with obj=obj %} |
||||
{% include 'client/includes/calendar_button.html' with obj=obj%} |
||||
<div class="{% if request.user.is_authenticated%}note-wrap{% else %}note-wrap-disabled{% endif %}"> |
||||
{% with note=obj|note_by_user:request.user %} |
||||
<a class="button green icon-note {% if note %}active{% endif %} note-button" href="/expo/add-note/{{ obj.url }}/">{% trans 'заметка' %}</a> |
||||
<div class="note-overlay"> |
||||
<form action=""> |
||||
<textarea name="note_text" class="note-text"> {{ note }}</textarea> |
||||
</form> |
||||
</div> |
||||
{% endwith %} |
||||
</div> |
||||
{% if request.user.is_admin %} |
||||
<div class="note-wrap"> |
||||
<a class="button green " href="/admin/exposition/{{ obj.url }}/">{% trans 'изменить' %}</a> |
||||
</div> |
||||
{% endif %} |
||||
<div></div> |
||||
</div> |
||||
<div class="cli-s-buttons"> |
||||
{% include 'client/buttons/booking_button.html' with object=obj %} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<footer class="clearfix"> |
||||
<div class="cli-stats"> |
||||
{% if obj.visitors %} |
||||
<span class="visitors" title="Посетители">{{ obj.visitors }}</span> |
||||
{% endif %} |
||||
{% if obj.members %} |
||||
<span class="participants" title="Участники">{{ obj.members }}</span> |
||||
{% endif %} |
||||
</div> |
||||
<div class="cli-tags"> |
||||
{% include 'client/includes/exposition/tags.html' with obj=obj %} |
||||
</div> |
||||
</footer> |
||||
</li> |
||||
{% endfor %} |
||||
|
||||
</ul> |
||||
Loading…
Reference in new issue