1621 upd, 1620 done

remotes/origin/stage6
Alexander Burdeiny 9 years ago
parent d1a474c338
commit 71094b4025
  1. 4
      functions/views_help.py
  2. 9
      support/d_dev/settings.py
  3. 9
      support/dev/settings.py
  4. 9
      support/prod/settings.py
  5. 196
      templates/client/includes/exposition/exposition_list.html

@ -2,6 +2,7 @@
import re import re
import datetime import datetime
import json import json
from ConfigParser import ConfigParser
from django.shortcuts import get_object_or_404 from django.shortcuts import get_object_or_404
from django.core.cache import cache from django.core.cache import cache
@ -70,7 +71,8 @@ def get_side_items(event_type, model):
data = cache.get(key) data = cache.get(key)
if data is None: if data is None:
data = [] data = []
config = settings.INI_CONFIG config = ConfigParser()
config.read(settings.INI_CONFIG_PATH)
pks = json.loads(config.get('sections', option, '[]')) pks = json.loads(config.get('sections', option, '[]'))
if pks: if pks:
qs = model.objects.language().filter(pk__in=pks).values_list('pk', 'name', 'url') qs = model.objects.language().filter(pk__in=pks).values_list('pk', 'name', 'url')

@ -3,6 +3,7 @@
import os import os
import django import django
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from ConfigParser import ConfigParser
DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__)) DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
@ -506,6 +507,14 @@ CACHE_RANGE = [60, 120]
DEFAULT_POPUP_COOKIE = 'expo_b_default_popup' DEFAULT_POPUP_COOKIE = 'expo_b_default_popup'
INI_CONFIG_PATH = os.path.join(SITE_ROOT, 'proj/config.ini')
INI_CONFIG = ConfigParser()
INI_CONFIG.read(INI_CONFIG_PATH)
C_CITY_CATALOG_KEY = 'conf_city_catalog'
C_COUNTRY_CATALOG_KEY = 'conf_country_catalog'
E_CITY_CATALOG_KEY = 'expo_city_catalog'
E_COUNTRY_CATALOG_KEY = 'expo_country_catalog'
try: try:
from local import * from local import *
except ImportError, e: except ImportError, e:

@ -3,6 +3,7 @@
import os import os
import django import django
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from ConfigParser import ConfigParser
DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__)) DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
@ -504,6 +505,14 @@ CACHE_RANGE = [60, 120]
DEFAULT_POPUP_COOKIE = 'expo_b_default_popup' DEFAULT_POPUP_COOKIE = 'expo_b_default_popup'
INI_CONFIG_PATH = os.path.join(SITE_ROOT, 'proj/config.ini')
INI_CONFIG = ConfigParser()
INI_CONFIG.read(INI_CONFIG_PATH)
C_CITY_CATALOG_KEY = 'conf_city_catalog'
C_COUNTRY_CATALOG_KEY = 'conf_country_catalog'
E_CITY_CATALOG_KEY = 'expo_city_catalog'
E_COUNTRY_CATALOG_KEY = 'expo_country_catalog'
try: try:
from local import * from local import *
except ImportError, e: except ImportError, e:

@ -3,6 +3,7 @@
import os import os
import django import django
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from ConfigParser import ConfigParser
DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__)) DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__))
@ -503,6 +504,14 @@ CACHE_RANGE = [60, 120]
DEFAULT_POPUP_COOKIE = 'expo_b_default_popup' DEFAULT_POPUP_COOKIE = 'expo_b_default_popup'
INI_CONFIG_PATH = os.path.join(SITE_ROOT, 'proj/config.ini')
INI_CONFIG = ConfigParser()
INI_CONFIG.read(INI_CONFIG_PATH)
C_CITY_CATALOG_KEY = 'conf_city_catalog'
C_COUNTRY_CATALOG_KEY = 'conf_country_catalog'
E_CITY_CATALOG_KEY = 'expo_city_catalog'
E_COUNTRY_CATALOG_KEY = 'expo_country_catalog'
try: try:
from local import * from local import *
except ImportError, e: except ImportError, e:

@ -6,9 +6,9 @@
{% include 'client/includes/banners/tops.html' %} {% include 'client/includes/banners/tops.html' %}
<ul class="cat-list cl-exhibitions"> <ul class="cat-list cl-exhibitions">
{% for obj in objects %} {% for obj in objects %}
<li class="cl-item {% if obj.canceled %}canceled{% endif %}"> <li class="cl-item {% if obj.canceled %}canceled{% endif %}">
<div class="cl-item-wrap clearfix"> <div class="cl-item-wrap clearfix">
{% if not obj.canceled %} {% if not obj.canceled %}
<a target="_blank" href="{% if not obj.paid_new_id %}{{ obj.get_permanent_url }}{% else %}{{ obj.get_paid_catalog_url }}{% endif %}"> <a target="_blank" href="{% if not obj.paid_new_id %}{{ obj.get_permanent_url }}{% else %}{{ obj.get_paid_catalog_url }}{% endif %}">
{% if obj.expohit %} {% if obj.expohit %}
@ -29,96 +29,98 @@
{% endwith %} {% endwith %}
</div> </div>
{% endif %} {% endif %}
<div class="cli-info"> <div class="cli-info">
<div class="cli-top clearfix"> <div class="cli-top clearfix">
{% if obj.quality_label.rsva.is_set %} {% if obj.quality_label.rsva.is_set %}
<div class="cli-approved"> <div class="cli-approved">
<img width="52" height="42" src="{% static 'client/img/rsva.jpg' %}" alt="" title="Approved Event" /> <img width="52" height="42" src="{% static 'client/img/rsva.jpg' %}" alt="" title="Approved Event" />
</div> </div>
{% endif %} {% endif %}
{% if obj.quality_label.exporating.is_set %} {% if obj.quality_label.exporating.is_set %}
<div class="cli-approved"> <div class="cli-approved">
<img width="52" height="42" src="{% static 'client/img/exporating_logo.png' %}" alt="" title="Approved Event" /> <img width="52" height="42" src="{% static 'client/img/exporating_logo.png' %}" alt="" title="Approved Event" />
</div> </div>
{% endif %} {% endif %}
{% if obj.quality_label.ufi.is_set %} {% if obj.quality_label.ufi.is_set %}
<div class="cli-approved"> <div class="cli-approved">
<img width="52" height="42" src="{% static 'client/img/approved-logo.png' %}" alt="" title="Approved Event" /> <img width="52" height="42" src="{% static 'client/img/approved-logo.png' %}" alt="" title="Approved Event" />
</div> </div>
{% endif %} {% endif %}
<header> <header>
<div class="cli-title"><a target="_blank" href="{% if not obj.paid_new_id %}{{ obj.get_permanent_url }}{% else %}{{ obj.get_paid_catalog_url }}{% endif %}">{{ obj.name|safe }}</a></div> <div class="cli-title"><a target="_blank" href="{% if not obj.paid_new_id %}{{ obj.get_permanent_url }}{% else %}{{ obj.get_paid_catalog_url }}{% endif %}">{{ obj.name|safe }}</a></div>
</header> </header>
<div class="cli-descr"> <div class="cli-descr">
{{ obj.main_title|safe }} {{ obj.main_title|safe }}
</div> </div>
</div> </div>
<div class="cli-bot clearfix"> <div class="cli-bot clearfix">
<div class="cli-date"> <div class="cli-date">
{% with obj=obj %} {% with obj=obj %}
{% include 'client/includes/show_date_block.html' %} {% include 'client/includes/show_date_block.html' %}
{% endwith %} {% endwith %}
</div> </div>
{% if obj.country %} {% if obj.country %}
<div class="cli-place"> <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> <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 %} {% if obj.place %}
, <a href="/places/{{ obj.place.url }}/">{{ obj.place }}</a> , <a href="/places/{{ obj.place.url }}/">{{ obj.place }}</a>
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}
</div> </div>
</div> </div>
<div class="cli-buttons clearfix"> <div class="cli-buttons clearfix">
<div class="cli-m-buttons"> <div class="cli-m-buttons">
{% include 'client/includes/exposition/services.html' with obj=obj %} {% include 'client/includes/exposition/services.html' with obj=obj %}
{% include 'client/includes/calendar_button.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 %}"> <div class="{% if request.user.is_authenticated%}note-wrap{% else %}note-wrap-disabled{% endif %}">
{% with note=obj|note_by_user:request.user %} {% 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> <a class="button green icon-note {% if note %}active{% endif %} note-button" href="/expo/add-note/{{ obj.url }}/">{% trans 'заметка' %}</a>
<div class="note-overlay"> <div class="note-overlay">
<form action=""> <form action="">
<textarea name="note_text" class="note-text"> {{ note }}</textarea> <textarea name="note_text" class="note-text"> {{ note }}</textarea>
</form> </form>
</div> </div>
{% endwith %} {% endwith %}
</div> </div>
{% if request.user.is_admin %} {% if request.user.is_admin %}
<div class="note-wrap"> <div class="note-wrap">
<a class="button green " href="/admin/exposition/{{ obj.url }}/">{% trans 'изменить' %}</a> <a class="button green " href="/admin/exposition/{{ obj.url }}/">{% trans 'изменить' %}</a>
</div> </div>
{% endif %} {% endif %}
<div></div> <div></div>
</div> </div>
<div class="cli-s-buttons"> <div class="cli-s-buttons">
{% include 'client/buttons/booking_button.html' with object=obj %} {% include 'client/buttons/booking_button.html' with object=obj %}
</div> </div>
</div> </div>
</div> </div>
<footer class="clearfix"> <footer class="clearfix">
<div class="cli-stats"> <div class="cli-stats">
{% if obj.visitors %} {% if obj.visitors %}
<span class="visitors" title="Посетители">{{ obj.visitors }}</span> <span class="visitors" title="Посетители">{{ obj.visitors }}</span>
{% endif %} {% endif %}
{% if obj.members %} {% if obj.members %}
<span class="participants" title="Участники">{{ obj.members }}</span> <span class="participants" title="Участники">{{ obj.members }}</span>
{% endif %} {% endif %}
</div> </div>
<div class="cli-tags"> <div class="cli-tags">
{% include 'client/includes/exposition/tags.html' with obj=obj %} {% include 'client/includes/exposition/tags.html' with obj=obj %}
</div> </div>
</footer> </footer>
</li> </li>
{% if forloop.counter == 5 or objects|length < 5 %} {% if forloop.counter == 5 %}
{% include 'client/includes/banners/catalog_inner_2.html' %} {% include 'client/includes/banners/catalog_inner_2.html' %}
{% elif forloop.last and objects|length < 5 %}
{% include 'client/includes/banners/catalog_inner_2.html' %}
{% endif %} {% endif %}
{% if forloop.counter == 10 %} {% if forloop.counter == 10 %}
{% include 'client/includes/banners/catalog_inner.html' %} {% include 'client/includes/banners/catalog_inner.html' %}
{%endif %} {%endif %}
{% endfor %} {% endfor %}
</ul> </ul>
{% else %} {% else %}
@ -139,15 +141,15 @@
{% else %} {% else %}
<script src="{% static 'client/js_min/_modules/block.exposition.list.min.js' %}"></script> <script src="{% static 'client/js_min/_modules/block.exposition.list.min.js' %}"></script>
{% endif %}<script> {% endif %}<script>
EXPO.exposition.list.init({ EXPO.exposition.list.init({
note:{ note:{
wrapClass:'note-wrap', wrapClass:'note-wrap',
wrapDisabledClass:'note-wrap-disabled', wrapDisabledClass:'note-wrap-disabled',
buttonClass:'note-button', buttonClass:'note-button',
inputClass:'note-text' inputClass:'note-text'
}, },
addCalendarText:"{% trans 'В расписание' %}", addCalendarText:"{% trans 'В расписание' %}",
removeCalendarText:"{% trans 'Из расписания' %}" removeCalendarText:"{% trans 'Из расписания' %}"
}); });
</script> </script>
{% endblock %} {% endblock %}

Loading…
Cancel
Save