Merge branch 'stage4' of bitbucket.org:Bonus_05/expomap into stage4

remotes/origin/mobile_from_stage4
ya_dim4ik 10 years ago
commit 77a97dfc03
  1. 5
      conference/admin.py
  2. 7
      conference/admin_urls.py
  3. 5
      exposition/admin.py
  4. 6
      exposition/admin_urls.py
  5. 11
      fabfile.py
  6. 30
      functions/admin_views.py
  7. 4
      proj/views.py
  8. 8
      settings/admin.py
  9. 6
      settings/forms.py
  10. 23
      templates/admin/conference/conference_list.html
  11. 2
      templates/admin/expobanner/comment_list.html
  12. 2
      templates/admin/expobanner/pcomment_list.html
  13. 24
      templates/admin/exposition/exposition_list.html
  14. 23
      templates/admin/place_conference/place_conference_list.html
  15. 2
      templates/admin/redirects/list.html
  16. 67
      templates/client/includes/conference/conference_object.html
  17. 8
      templates/client/includes/conference/conference_paid.html
  18. 13
      templates/client/includes/exposition/expo_paid.html
  19. 67
      templates/client/includes/exposition/exposition_object.html
  20. 83
      theme/migrations/0004_auto__del_field_theme_main_page__add_field_theme_main_page_conf__add_f.py
  21. 3
      theme/models.py

@ -26,6 +26,7 @@ from forms import (
)
from functions.admin_views import (
AdminListView,
AdminListViewNoThemeMixin,
AdminView,
stat_paginate_results,
upload_photo
@ -310,6 +311,10 @@ class ConferenceListView(AdminListView):
model = Conference
class ConferenceListViewNoTheme(AdminListViewNoThemeMixin, ConferenceListView):
pass
def upload_conference_photo(request, conf_id):
return upload_photo(request, conf_id, Conference)

@ -1,12 +1,13 @@
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from admin import ConferenceListView, ConferenceView
from admin import ConferenceListView, ConferenceView, ConferenceListViewNoTheme
urlpatterns = patterns('conference.admin',
url(r'^upload-photo/(?P<conf_id>.*)/$', 'upload_conference_photo'),
url(r'^delete/(?P<url>.*)$', 'conference_delete'),
url(r'^copy/$', 'conf_copy'),
url(r'^all/$', ConferenceListView.as_view()),
url(r'^all/$', ConferenceListView.as_view(), name='admin-conference-all'),
url(r'^notheme/$', ConferenceListViewNoTheme.as_view(), name='admin-conference-notheme'),
#url(r'^change/(?P<url>.*)/$', 'conference_change'),
url(r'^switch/(?P<url>.*)/(?P<action>.*)$', 'conference_switch'),
@ -14,4 +15,4 @@ urlpatterns = patterns('conference.admin',
url(r'^(?P<url>.*)/$', ConferenceView.as_view()),
url(r'^$', ConferenceView.as_view()),
)
)

@ -24,6 +24,7 @@ from forms import (
)
from functions.admin_views import (
AdminListView,
AdminListViewNoThemeMixin,
AdminView,
stat_paginate_results,
upload_photo
@ -349,6 +350,10 @@ class ExpositionListView(AdminListView):
model = Exposition
class ExpositionListViewNoTheme(AdminListViewNoThemeMixin, ExpositionListView):
pass
def upload_exposition_photo(request, expo_id):
return upload_photo(request, expo_id, Exposition)

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from admin import ExpositionListView, ExpositionView
from admin import ExpositionListView, ExpositionView, ExpositionListViewNoTheme
urlpatterns = patterns('exposition.admin',
url(r'^upload-photo/(?P<expo_id>.*)/$', 'upload_exposition_photo'),
@ -9,7 +9,9 @@ urlpatterns = patterns('exposition.admin',
#url(r'^add.*/$', 'exposition_add'),
url(r'^delete/(?P<url>.*)/$', 'exposition_delete'),
#url(r'^change/(?P<url>.*)/$', 'exposition_change'),
url(r'^all/$', ExpositionListView.as_view()),
url(r'^all/$', ExpositionListView.as_view(), name='admin-exposition-all'),
url(r'^notheme/$', ExpositionListViewNoTheme.as_view(), name='admin-exposition-notheme'),
url(r'^switch/(?P<url>.*)/(?P<action>.*)$', 'exposition_switch'),
#url(r'^copy/(?P<url>.*)$', 'exposition_copy'),
url(r'^search/$', 'search_expo'),

11
fabfile.py vendored

@ -131,14 +131,25 @@ def c_fix():
def stage4_firstrun():
with cd(REMOTE_HOME_DIR):
call_state('stop')
run('git fetch')
run('git checkout stage4')
run('git checkout -- proj/settings.py')
pull(with_configs=True)
run('python manage.py syncdb')
run('python manage.py migrate theme')
call_state('start')
def ticket1395():
# stage4
with cd(REMOTE_HOME_DIR):
run('python manage.py accounts_check_url')
def ticket1374():
with cd(REMOTE_HOME_DIR):
call_state('stop', only='apache2')
run('git pull')
run('python manage.py migrate theme')
call_state('start', only='apache2')

@ -131,16 +131,38 @@ class AdminListView(FormView):
context.update({'object_list': result})
return self.render_to_response(context)
def get_context_data(self, **kwargs):
context = super(AdminListView, self).get_context_data(**kwargs)
def get_queryset(self):
if issubclass(self.model, TranslatableModel):
qs = self.model.objects.language().all().order_by('name')
return self.model.objects.language().all().order_by('name')
else:
qs = self.model.objects.all().order_by('-modified')
return self.model.objects.all().order_by('-modified')
def get_context_data(self, **kwargs):
context = super(AdminListView, self).get_context_data(**kwargs)
qs = self.get_queryset()
result = self.paginate_func(qs, page=self.request.GET.get('page'))
context['object_list'] = result
return context
class AdminListViewNoThemeMixin(object):
def get_queryset(self):
return self.model.objects.language().filter(theme__isnull=True).order_by('name')
def form_valid(self, form):
qs = form.filter()
qs = qs.filter(theme__isnull=True)
result = self.paginate_func(qs, page=self.request.GET.get('page'))
context = self.get_context_data(form=form)
context.update({'object_list': result})
return self.render_to_response(context)
def get_context_data(self, **kwargs):
context = super(AdminListViewNoThemeMixin, self).get_context_data(**kwargs)
context.update({'notheme': True})
return context
def upload_photo(request, id, Model):
"""
uploading photo to some instance of Model

@ -86,8 +86,8 @@ class MainPageView(JitterCacheMixin, TemplateView):
# update main_page counter
for event in events:
event.main.link.log(self.request, 1)
exposition_themes = Theme.objects.language().order_by('-main_page').filter(types=Theme.types.exposition)[:6]
conference_themes = Theme.objects.language().order_by('-main_page').filter(types=Theme.types.conference)[:6]
exposition_themes = Theme.objects.language().filter(main_page_expo__gt=0, types=Theme.types.exposition)[:6]
conference_themes = Theme.objects.language().filter(main_page_conf__gt=0, types=Theme.types.conference)[:6]
args = {'events': events, 'exposition_themes': exposition_themes, 'conference_themes': conference_themes,
'search_form': ExpositionSearchForm, 'search_action': '/expo/search/',

@ -34,8 +34,8 @@ from article.models import Article
def main_page(request):
exposition_themes = Theme.objects.filter(main_page__gt=0, types=Theme.types.exposition)
confrence_themes = Theme.objects.filter(main_page__gt=0, types=Theme.types.conference)
exposition_themes = Theme.objects.filter(main_page_expo__gt=0, types=Theme.types.exposition)
confrence_themes = Theme.objects.filter(main_page_conf__gt=0, types=Theme.types.conference)
news = Article.objects.news().filter(main_page=1)
blogs = Article.objects.blogs().filter(main_page=1)
@ -46,8 +46,8 @@ def main_page(request):
news_form.fields['main_page_news'].widget.attrs['data-init-text'] = json.dumps(a)
article_form = MainPageArticle(initial={'article' : blogs})
args = { 'theme_form' : MainPageThemes(initial=themes),
args = {'theme_form' : MainPageThemes(initial=themes),
'article_form' : article_form,
'news_form' : news_form}
args.update(csrf(request))
return render_to_response('admin/settings/main_page.html', args)
return render_to_response('admin/settings/main_page.html', args)

@ -40,10 +40,8 @@ class MainPageThemes(forms.Form):
data = self.cleaned_data
exposition_themes = data['exposition_themes']
conference_themes = data['conference_themes']
Theme.objects.filter().update(main_page=0)
exposition_themes.update(main_page=1)
conference_themes.update(main_page=1)
exposition_themes.update(main_page_expo=1)
conference_themes.update(main_page_conf=1)

@ -20,12 +20,25 @@ td a{
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>{% trans "Фильтры" %}</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">{% trans "Найти" %}</button>
</form>
<div class="span4" style="margin-left: 0px;">
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">{% trans "Найти" %}</button>
</form>
</div>
</div>
<div class="span4" style="margin-left: 0px;">
<div class="box-content">
{% if notheme %}
<a class="btn-small btn-success" href="{% url 'admin-conference-all' %}">Отобразить все события</a>
{% else %}
<a class="btn-small btn-danger" href="{% url 'admin-conference-notheme' %}">Отобразить события с пустыми темами</a>
{% endif %}
</div>
</div>
</div>

@ -32,6 +32,6 @@
{% endblock %}
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=page_obj %}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -32,6 +32,6 @@
{% endblock %}
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=page_obj %}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -19,15 +19,29 @@ td a{
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>{% trans "Фильтры" %}</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">{% trans "Найти" %}</button>
</form>
<div class="span4" style="margin-left: 0px;">
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">{% trans "Найти" %}</button>
</form>
</div>
</div>
<div class="span4" style="margin-left: 0px;">
<div class="box-content">
{% if notheme %}
<a class="btn-small btn-success" href="{% url 'admin-exposition-all' %}">Отобразить все события</a>
{% else %}
<a class="btn-small btn-danger" href="{% url 'admin-exposition-notheme' %}">Отобразить события с пустыми темами</a>
{% endif %}
</div>
</div>
</div>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>{% trans "Список выставок" %}</h2>

@ -1,16 +1,17 @@
{% extends 'admin_list.html' %}
{% load i18n %}
{% block body %}
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Фильтры</h2>
<h2><i class="icon-arrow-down"></i>{% trans "Фильтры" %}</h2>
</div>
<div class="box-content">
<form>
{{ form }}
<button type="submit" class="btn">Найти</button>
<button type="submit" class="btn">{% trans "Найти" %}</button>
</form>
</div>
@ -18,16 +19,16 @@
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-arrow-down"></i>Места проведения конференций</h2>
<h2><i class="icon-arrow-down"></i>{% trans "Места проведения конференций" %}</h2>
</div>
<div class="box-content">
<table class="table table-hover">
<thead>
<tr>
<th>Название</th>
<th>Страна</th>
<th>Город</th>
<th>{% trans "Название" %}</th>
<th>{% trans "Страна" %}</th>
<th>{% trans "Город" %}</th>
<th>&nbsp;</th>
</tr>
</thead>
@ -39,27 +40,27 @@
<td>{% ifnotequal item.city None %}{{ item.city }} {% endifnotequal %}</td>
<td class="center sorting_1">
<a class="btn-small btn-info" href="/admin/place_conference/{{ item.url|lower }}/">
Изменить
{% trans "Изменить" %}
</a>
</td>
<td class="center sorting_1">
<a class="btn-small btn-inverse" href="/admin/place_conference/copy/{{ item.url|lower }}">
Копировать
{% trans "Копировать" %}
</a>
</td>
<td>
<a class="btn-small btn-danger" href="/admin/place_conference/delete/{{ item.url|lower }}">
Удалить
{% trans "Удалить" %}
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<a class="btn btn-success" href="/admin/place_conference/add"><i class="icon-plus-sign icon-white"></i> Добавить конферец зал</a>
<a class="btn btn-success" href="/admin/place_conference/add"><i class="icon-plus-sign icon-white"></i> {% trans "Добавить конферец зал" %}</a>
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}
{% endblock %}

@ -32,6 +32,6 @@
{% endblock %}
</div>
{# pagination #}
{% include 'admin/includes/admin_pagination.html' with page_obj=page_obj %}
{% include 'admin/includes/admin_pagination.html' with page_obj=object_list %}
</div>
{% endblock %}

@ -355,46 +355,53 @@
</div>
{% endif %}
{% include 'client/includes/banners/detail_inner_3.html' %}
<div class="e-cat look-also">
<h2 class="sect-title">{% trans 'Смотрите также:' %}</h2>
<a href="{{ event.catalog }}city/{{ event.city.url }}/">{% trans "Конференции" %} {% if request.LANGUAGE_CODE == 'ru' and event.city.inflect %}{{ event.city.inflect }}{% else %}{% trans 'in' %} {{ event.city.name }}{% endif %}</a>
<a href="{{ event.catalog }}country/{{ event.country.url }}/">{% trans "Конференции" %} {% if request.LANGUAGE_CODE == 'ru' and event.country.inflect %}{{ event.country.inflect }}{% else %}{% trans 'in' %} {{ event.country.name }}{% endif %}</a>
<a href="{{ event.catalog }}theme/{{ event.theme.all.0.url }}/country/{{ event.country.url }}/">{% trans "Конференции по тематике " %}&laquo;{{ event.theme.all.0.name|capfirst }}&raquo; {% if request.LANGUAGE_CODE == 'ru' and event.country.inflect %}{{ event.country.inflect }}{% else %}{% trans 'in' %} {{ event.country.name }}{% endif %}</a>
<a href="{{ event.catalog }}theme/{{ event.theme.all.0.url }}/city/{{ event.city.url }}/">{% trans "Конференции по тематике " %}&laquo;{{ event.theme.all.0.name|capfirst }}&raquo; {% if request.LANGUAGE_CODE == 'ru' and event.city.inflect %}{{ event.city.inflect }}{% else %}{% trans 'in' %} {{ event.city.name }}{% endif %}</a>
{% if event.theme.all %}
<a href="{{ event.catalog }}theme/{{ event.theme.all.0.url }}/country/{{ event.country.url }}/">{% trans "Конференции по тематике " %}&laquo;{{ event.theme.all.0.name|capfirst }}&raquo; {% if request.LANGUAGE_CODE == 'ru' and event.country.inflect %}{{ event.country.inflect }}{% else %}{% trans 'in' %} {{ event.country.name }}{% endif %}</a>
<a href="{{ event.catalog }}theme/{{ event.theme.all.0.url }}/city/{{ event.city.url }}/">{% trans "Конференции по тематике " %}&laquo;{{ event.theme.all.0.name|capfirst }}&raquo; {% if request.LANGUAGE_CODE == 'ru' and event.city.inflect %}{{ event.city.inflect }}{% else %}{% trans 'in' %} {{ event.city.name }}{% endif %}</a>
{% endif %}
</div>
{% endblock %}
{% block content_text %}
{% endblock %}
{% block popup %}
{% include 'client/popups/advertise_member.html' with form=advertising_form %}
{% endblock %}
{% block scripts %}
{% if request.GET.debug == '1' %}
<script src="{% static 'client/js/_modules/page.exposition.object.js' %}"></script>
{% else %}
<script src="{% static 'client/js_min/_modules/page.exposition.object.min.js' %}"></script>
{% endif %}
<script>
EXPO.exposition.object.init({
visit:{
activeClass:"visit",
passiveClass:"unvisit",
currentHtml:'<li class="current"><a href="{{ request.user.get_permanent_url }}">{{ request.user.get_full_name }}&nbsp;{% if request.user.company %}({{ request.user.company.name }}){% endif %}</a></li>',
visitorsListId:"visitors-list",
somebodyId:"somebody",
nobodyId:"nobody"
},
note:{
wrapClass:'note-wrap',
wrapDisabledClass:'note-wrap-disabled',
buttonClass:'note-button',
inputClass:'note-text'
},
advertise:{
id:"advert-member-form"
},
addCalendarText:"{% trans 'В расписание' %}",
removeCalendarText:"{% trans 'Из расписания' %}"
});
</script>
{% if request.GET.debug == '1' %}
<script src="{% static 'client/js/_modules/page.exposition.object.js' %}"></script>
{% else %}
<script src="{% static 'client/js_min/_modules/page.exposition.object.min.js' %}"></script>
{% endif %}
<script>
EXPO.exposition.object.init({
visit:{
activeClass:"visit",
passiveClass:"unvisit",
currentHtml:'<li class="current"><a href="{{ request.user.get_permanent_url }}">{{ request.user.get_full_name }}&nbsp;{% if request.user.company %}({{ request.user.company.name }}){% endif %}</a></li>',
visitorsListId:"visitors-list",
somebodyId:"somebody",
nobodyId:"nobody"
},
note:{
wrapClass:'note-wrap',
wrapDisabledClass:'note-wrap-disabled',
buttonClass:'note-button',
inputClass:'note-text'
},
advertise:{
id:"advert-member-form"
},
addCalendarText:"{% trans 'В расписание' %}",
removeCalendarText:"{% trans 'Из расписания' %}"
});
</script>
{% endblock %}

@ -390,13 +390,17 @@
</div>
{% endif %}
{% include 'client/includes/banners/detail_inner_3.html' %}
<div class="e-cat look-also">
<h2 class="sect-title">{% trans 'Смотрите также:' %}</h2>
<a href="{{ event.catalog }}city/{{ event.city.url }}/">{% trans "Конференции" %} {% if request.LANGUAGE_CODE == 'ru' and event.city.inflect %}{{ event.city.inflect }}{% else %}{% trans 'in' %} {{ event.city.name }}{% endif %}</a>
<a href="{{ event.catalog }}country/{{ event.country.url }}/">{% trans "Конференции" %} {% if request.LANGUAGE_CODE == 'ru' and event.country.inflect %}{{ event.country.inflect }}{% else %}{% trans 'in' %} {{ event.country.name }}{% endif %}</a>
<a href="{{ event.catalog }}theme/{{ event.theme.all.0.url }}/country/{{ event.country.url }}/">{% trans "Конференции по тематике " %}&laquo;{{ event.theme.all.0.name|capfirst }}&raquo; {% if request.LANGUAGE_CODE == 'ru' and event.country.inflect %}{{ event.country.inflect }}{% else %}{% trans 'in' %} {{ event.country.name }}{% endif %}</a>
<a href="{{ event.catalog }}theme/{{ event.theme.all.0.url }}/city/{{ event.city.url }}/">{% trans "Конференции по тематике " %}&laquo;{{ event.theme.all.0.name|capfirst }}&raquo; {% if request.LANGUAGE_CODE == 'ru' and event.city.inflect %}{{ event.city.inflect }}{% else %}{% trans 'in' %} {{ event.city.name }}{% endif %}</a>
{% if event.theme.all %}
<a href="{{ event.catalog }}theme/{{ event.theme.all.0.url }}/country/{{ event.country.url }}/">{% trans "Конференции по тематике " %}&laquo;{{ event.theme.all.0.name|capfirst }}&raquo; {% if request.LANGUAGE_CODE == 'ru' and event.country.inflect %}{{ event.country.inflect }}{% else %}{% trans 'in' %} {{ event.country.name }}{% endif %}</a>
<a href="{{ event.catalog }}theme/{{ event.theme.all.0.url }}/city/{{ event.city.url }}/">{% trans "Конференции по тематике " %}&laquo;{{ event.theme.all.0.name|capfirst }}&raquo; {% if request.LANGUAGE_CODE == 'ru' and event.city.inflect %}{{ event.city.inflect }}{% else %}{% trans 'in' %} {{ event.city.name }}{% endif %}</a>
{% endif %}
</div>
{% endblock %}
{% block content_text %}

@ -374,13 +374,16 @@
</ul>
</div>
{% endif %}
<div class="e-cat look-also">
<h2 class="sect-title">{% trans 'Смотрите также:' %}</h2>
<a href="{{ exposition.catalog }}city/{{ exposition.city.url }}/">{% trans "Выставки" %} {% if request.LANGUAGE_CODE == 'ru' and exposition.city.inflect %}{{ exposition.city.inflect }}{% else %}{% trans 'in' %} {{ exposition.city.name }}{% endif %}</a>
<a href="{{ exposition.catalog }}country/{{ exposition.country.url }}/">{% trans "Выставки" %} {% if request.LANGUAGE_CODE == 'ru' and exposition.country.inflect %}{{ exposition.country.inflect }}{% else %}{% trans 'in' %} {{ exposition.country.name }}{% endif %}</a>
<div class="e-cat look-also">
<h2 class="sect-title">{% trans 'Смотрите также:' %}</h2>
<a href="{{ exposition.catalog }}city/{{ exposition.city.url }}/">{% trans "Выставки" %} {% if request.LANGUAGE_CODE == 'ru' and exposition.city.inflect %}{{ exposition.city.inflect }}{% else %}{% trans 'in' %} {{ exposition.city.name }}{% endif %}</a>
<a href="{{ exposition.catalog }}country/{{ exposition.country.url }}/">{% trans "Выставки" %} {% if request.LANGUAGE_CODE == 'ru' and exposition.country.inflect %}{{ exposition.country.inflect }}{% else %}{% trans 'in' %} {{ exposition.country.name }}{% endif %}</a>
{% if exposition.theme.all %}
<a href="{{ exposition.catalog }}theme/{{ exposition.theme.all.0.url }}/country/{{ exposition.country.url }}/">{% trans "Выставки по тематике " %}&laquo;{{ exposition.theme.all.0.name|capfirst }}&raquo; {% if request.LANGUAGE_CODE == 'ru' and exposition.country.inflect %}{{ exposition.country.inflect }}{% else %}{% trans 'in' %} {{ exposition.country.name }}{% endif %}</a>
<a href="{{ exposition.catalog }}theme/{{ exposition.theme.all.0.url }}/city/{{ exposition.city.url }}/">{% trans "Выставки по тематике " %}&laquo;{{ exposition.theme.all.0.name|capfirst }}&raquo; {% if request.LANGUAGE_CODE == 'ru' and exposition.city.inflect %}{{ exposition.city.inflect }}{% else %}{% trans 'in' %} {{ exposition.city.name }}{% endif %}</a>
</div>
{% endif %}
</div>
{% endblock %}
{% block content_text %}

@ -383,43 +383,48 @@
<div class="e-cat look-also">
<h2 class="sect-title">{% trans 'Смотрите также:' %}</h2>
<a href="{{ exposition.catalog }}city/{{ exposition.city.url }}/">{% trans "Выставки" %} {% if request.LANGUAGE_CODE == 'ru' and exposition.city.inflect %}{{ exposition.city.inflect }}{% else %}{% trans 'in' %} {{ exposition.city.name }}{% endif %}</a>
<a href="{{ exposition.catalog }}country/{{ exposition.country.url }}/">{% trans "Выставки" %} {% if request.LANGUAGE_CODE == 'ru' and exposition.country.inflect %}{{ exposition.country.inflect }}{% else %}{% trans 'in' %} {{ exposition.country.name }}{% endif %}</a>
<a href="{{ exposition.catalog }}theme/{{ exposition.theme.all.0.url }}/country/{{ exposition.country.url }}/">{% trans "Выставки по тематике " %}&laquo;{{ exposition.theme.all.0.name|capfirst }}&raquo; {% if request.LANGUAGE_CODE == 'ru' and exposition.country.inflect %}{{ exposition.country.inflect }}{% else %}{% trans 'in' %} {{ exposition.country.name }}{% endif %}</a>
<a href="{{ exposition.catalog }}theme/{{ exposition.theme.all.0.url }}/city/{{ exposition.city.url }}/">{% trans "Выставки по тематике " %}&laquo;{{ exposition.theme.all.0.name|capfirst }}&raquo; {% if request.LANGUAGE_CODE == 'ru' and exposition.city.inflect %}{{ exposition.city.inflect }}{% else %}{% trans 'in' %} {{ exposition.city.name }}{% endif %}</a>
<a href="{{ exposition.catalog }}country/{{ exposition.country.url }}/">{% trans "Выставки" %} {% if request.LANGUAGE_CODE == 'ru' and exposition.country.inflect %}{{ exposition.country.inflect }}{% else %}{% trans 'in' %} {{ exposition.country.name }}{% endif %}</a>
{% if exposition.theme.all %}
<a href="{{ exposition.catalog }}theme/{{ exposition.theme.all.0.url }}/country/{{ exposition.country.url }}/">{% trans "Выставки по тематике " %}&laquo;{{ exposition.theme.all.0.name|capfirst }}&raquo; {% if request.LANGUAGE_CODE == 'ru' and exposition.country.inflect %}{{ exposition.country.inflect }}{% else %}{% trans 'in' %} {{ exposition.country.name }}{% endif %}</a>
<a href="{{ exposition.catalog }}theme/{{ exposition.theme.all.0.url }}/city/{{ exposition.city.url }}/">{% trans "Выставки по тематике " %}&laquo;{{ exposition.theme.all.0.name|capfirst }}&raquo; {% if request.LANGUAGE_CODE == 'ru' and exposition.city.inflect %}{{ exposition.city.inflect }}{% else %}{% trans 'in' %} {{ exposition.city.name }}{% endif %}</a>
{% endif %}
</div>
{% endblock %}
{% block content_text %}
{% endblock %}
{% block popup %}
{% include 'client/popups/advertise_member.html' with form=advertising_form %}
{% endblock %}
{% block scripts %}
{% if request.GET.debug == '1' %}
<script src="{% static 'client/js/_modules/page.exposition.object.js' %}"></script>
{% else %}
<script src="{% static 'client/js_min/_modules/page.exposition.object.min.js' %}"></script>
{% endif %}
<script>
EXPO.exposition.object.init({
visit:{
activeClass:"visit",
passiveClass:"unvisit",
currentHtml:'<li class="current"><a href="{{ request.user.get_permanent_url }}">{{ request.user.get_full_name }}&nbsp;{% if request.user.company %}({{ request.user.company.name }}){% endif %}</a></li>',
visitorsListId:"visitors-list",
somebodyId:"somebody",
nobodyId:"nobody"
},
note:{
wrapClass:'note-wrap',
wrapDisabledClass:'note-wrap-disabled',
buttonClass:'note-button',
inputClass:'note-text'
},
advertise:{
id:"advert-member-form"
},
addCalendarText:"{% trans 'В расписание' %}",
removeCalendarText:"{% trans 'Из расписания' %}"
});
</script>
{% if request.GET.debug == '1' %}
<script src="{% static 'client/js/_modules/page.exposition.object.js' %}"></script>
{% else %}
<script src="{% static 'client/js_min/_modules/page.exposition.object.min.js' %}"></script>
{% endif %}
<script>
EXPO.exposition.object.init({
visit:{
activeClass:"visit",
passiveClass:"unvisit",
currentHtml:'<li class="current"><a href="{{ request.user.get_permanent_url }}">{{ request.user.get_full_name }}&nbsp;{% if request.user.company %}({{ request.user.company.name }}){% endif %}</a></li>',
visitorsListId:"visitors-list",
somebodyId:"somebody",
nobodyId:"nobody"
},
note:{
wrapClass:'note-wrap',
wrapDisabledClass:'note-wrap-disabled',
buttonClass:'note-button',
inputClass:'note-text'
},
advertise:{
id:"advert-member-form"
},
addCalendarText:"{% trans 'В расписание' %}",
removeCalendarText:"{% trans 'Из расписания' %}"
});
</script>
{% endblock %}

@ -0,0 +1,83 @@
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Theme.main_page'
db.delete_column(u'theme_theme', 'main_page')
# Adding field 'Theme.main_page_conf'
db.add_column(u'theme_theme', 'main_page_conf',
self.gf('django.db.models.fields.PositiveIntegerField')(default=0, db_index=True),
keep_default=False)
# Adding field 'Theme.main_page_expo'
db.add_column(u'theme_theme', 'main_page_expo',
self.gf('django.db.models.fields.PositiveIntegerField')(default=0, db_index=True),
keep_default=False)
def backwards(self, orm):
# Adding field 'Theme.main_page'
db.add_column(u'theme_theme', 'main_page',
self.gf('django.db.models.fields.PositiveIntegerField')(default=0, db_index=True),
keep_default=False)
# Deleting field 'Theme.main_page_conf'
db.delete_column(u'theme_theme', 'main_page_conf')
# Deleting field 'Theme.main_page_expo'
db.delete_column(u'theme_theme', 'main_page_expo')
models = {
u'theme.tag': {
'Meta': {'unique_together': '()', 'object_name': 'Tag', 'index_together': '()'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'inflect': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'old_url': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255'}),
'theme': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tags'", 'on_delete': 'models.PROTECT', 'to': u"orm['theme.Theme']"}),
'url': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255'})
},
u'theme.tagtranslation': {
'Meta': {'unique_together': "[('language_code', 'master')]", 'object_name': 'TagTranslation', 'db_table': "u'theme_tag_translation'", 'index_together': '()'},
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'descriptions': ('django.db.models.fields.CharField', [], {'max_length': '250', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'keywords': ('django.db.models.fields.CharField', [], {'max_length': '250', 'blank': 'True'}),
'language_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
'main_title': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'master': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'translations'", 'null': 'True', 'to': u"orm['theme.Tag']"}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '250', 'blank': 'True'})
},
u'theme.theme': {
'Meta': {'unique_together': '()', 'object_name': 'Theme', 'index_together': '()'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'inflect': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'main_page_conf': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0', 'db_index': 'True'}),
'main_page_expo': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0', 'db_index': 'True'}),
'old_url': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255'}),
'types': ('django.db.models.fields.BigIntegerField', [], {'default': 'None'}),
'url': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255'})
},
u'theme.themetranslation': {
'Meta': {'unique_together': "[('language_code', 'master')]", 'object_name': 'ThemeTranslation', 'db_table': "u'theme_theme_translation'", 'index_together': '()'},
'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'descriptions': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'keywords': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
'language_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
'main_title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'master': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'translations'", 'null': 'True', 'to': u"orm['theme.Theme']"}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'})
}
}
complete_apps = ['theme']

@ -54,7 +54,8 @@ class Theme(TranslatableModel):
keywords = models.CharField(max_length=255, blank=True),
)
main_page = models.PositiveIntegerField(default=0, db_index=True)
main_page_conf = models.PositiveIntegerField(default=0, db_index=True)
main_page_expo = models.PositiveIntegerField(default=0, db_index=True)
inflect = models.CharField(max_length=255, blank=True)
def __unicode__(self):

Loading…
Cancel
Save