diff --git a/specialist_catalog/forms.py b/specialist_catalog/forms.py index 7571b53a..c7860937 100644 --- a/specialist_catalog/forms.py +++ b/specialist_catalog/forms.py @@ -33,6 +33,21 @@ class SpecialistCatalogForm(TranslatableModelForm): 'big_cities': CKEditorWidget, } + def __init__(self, *args, **kwargs): + + super(SpecialistCatalogForm, self).__init__(*args, **kwargs) + if kwargs.get('instance'): + instance = kwargs['instance'] + if instance.type == SpecialistCatalog._country: + qs = Specialist.objects.filter(country=instance.country) + else: + qs = Specialist.objects.filter(city=instance.city) + + self.fields['specialists'] = forms.ModelMultipleChoiceField(label=u"Специалисты", required=False, + queryset=qs) + + + def save(self, commit=True): place = self.cleaned_data.get('city') or self.cleaned_data.get('country') place_inflect = place.inflect or place.name diff --git a/specialist_catalog/models.py b/specialist_catalog/models.py index f92a0cd3..428eb6dc 100644 --- a/specialist_catalog/models.py +++ b/specialist_catalog/models.py @@ -26,6 +26,8 @@ class Specialist(models.Model): class SpecialistCatalog(TranslatableModel): + _country = 1 + _city = 2 price = models.IntegerField(verbose_name=u"Цена", default=200) currency = models.CharField(max_length=255, verbose_name=u"Валюта", default=u"EUR") logo = models.ImageField(db_column= "logo_preview", verbose_name=u"Логотип", blank=True, upload_to='specialist_catalog/logo_preview/') diff --git a/templates/client/base_catalog.html b/templates/client/base_catalog.html index ac80542d..8bedcc02 100644 --- a/templates/client/base_catalog.html +++ b/templates/client/base_catalog.html @@ -27,9 +27,10 @@ {% include 'client/includes/side_confs.html' %} -
{% include 'client/includes/banners/aside_2.html' %} + {% include 'client/includes/translators_aside.html' %} +
diff --git a/templates/client/includes/booking_block.html b/templates/client/includes/booking_block.html index 4f686236..8528a43c 100644 --- a/templates/client/includes/booking_block.html +++ b/templates/client/includes/booking_block.html @@ -8,16 +8,16 @@
- {% trans 'Все отели поблизости' %} + {% trans 'Все отели поблизости' %}
{% endif %}
- {% include 'client/includes/booking_block.html' with city=event.city place=event.place %} + {% include 'client/includes/booking_block.html' with city=event.city place=event.place event=event %}
{% if event.get_nearest_events|slice:":6" %}
diff --git a/templates/client/includes/event_object.html b/templates/client/includes/event_object.html deleted file mode 100644 index fc06f421..00000000 --- a/templates/client/includes/event_object.html +++ /dev/null @@ -1,319 +0,0 @@ -{% load static %} -{% load i18n %} -{% load thumbnail %} -{% load template_filters %} - -{% block page_body %} -
-
- - -
-
-
- {% if exposition.main_title %} - {{ exposition.main_title|safe }} {{ exposition.name|safe }} - {% else %} - {{ exposition.name|safe }} - {% endif %} -
-
- -
- {% with obj=exposition %} - {% include 'client/includes/show_date_block.html' %} - {% endwith %} -
- {% if exposition.place %} -
-
-
- {{ exposition.place.adress }} -
- -
- - -
- {% endif %} -
-
-
- {% with event=exposition user=user %} - {% include 'client/includes/visit_button.html' %} - {% endwith %} - - {% with event=exposition user=user %} - {% include 'client/includes/calendar_button.html' %} - {% endwith %} - {% trans 'заметка' %} -
- -
-
-
-
- -
- -
- {% for tag in exposition.tag.all %} - {{ tag }}, - {% endfor %} -
-
-
-
- -
- -
- - {% include 'includes/event_steps.html' with event=exposition filter=filter %} - - {% if exposition.get_photos %} - {% with photos=exposition.get_photos|slice:"5" %} -
- -
- - -
- {% endwith %} - {% endif %} - {% if exposition.description %} -
- -
{% trans 'О выставке' %} {{ exposition.name|safe }}
-
{{ exposition.description|safe|linebreaks }}
-
-
- {% endif %} -
-
{% trans 'Дополнительная информация' %}
- -
-
{% trans 'Организатор' %}:
-
- {% for organiser in exposition.organiser.all %} - {{ organiser.name }}
- {{ organiser.web_page }}
- {{ organiser.email }} - {% endfor %} -
- {% if exposition.web_page %} -
{% trans 'Веб-сайт' %}:
-
- {{ exposition.web_page }} -
- {% endif %} - - {% if exposition.get_audience %} -
{% trans 'Аудитория' %}:
-
- {{ exposition.get_audience }} -
- {% endif %} - - {% if exposition.get_periodic %} -
{% trans 'Периодичность' %}:
-
{{ exposition.get_periodic }}
- {% endif %} - - {% if exposition.products %} -
{% trans 'Экспонируемые продукты' %}:
-
{{ exposition.products|safe|linebreaks }}
- {% endif %} - -
- -
-
-
-
-
-
{% trans 'Участники' %}
- {% trans 'Все участники' %} -
- -
- -
-
-
{% trans 'Посетители' %}
-
- - {% trans 'Все посетители' %} -
-
- - {% if exposition.place %} -
-
- {% if exposition.place %} -
-
{% trans 'Общая выставочная площадь' %}
-
- {% if exposition.place.total_area %} - {{ exposition.place.total_area }} {% trans 'м²' %} - {% endif %} -
-
- {% endif %} - -
- {% if exposition.visitors %} -
{{ exposition.visitors }} {% trans 'учасников' %}
- {% endif %} - {% if exposition.members %} -
{{ exposition.members }} {% trans 'посетителей' %}
- {% endif %} - {% if exposition.foundation_year %} -
{% trans 'Основано в' %} {{ exposition.foundation_year }} {% trans 'году' %}
- {% endif %} -
-
- {% endif %} - -
- - {% include 'client/includes/booking_block.html' with city=exposition.city place=exposition.place %} - -
- {% if exposition.get_nearest_events|slice:":6" %} -
-
{% trans 'Ближайшие выставки по тематике' %} «{{ exposition.theme.all.0 }}»
- -
- {% endif %} - - -{% endblock %} -{% block content_text %} -{% endblock %} \ No newline at end of file diff --git a/templates/client/includes/exposition/expo_paid.html b/templates/client/includes/exposition/expo_paid.html index 74796195..fc2e3547 100644 --- a/templates/client/includes/exposition/expo_paid.html +++ b/templates/client/includes/exposition/expo_paid.html @@ -318,7 +318,7 @@ {% endif %}
- {% include 'client/includes/booking_block.html' with city=exposition.city place=exposition.place %} + {% include 'client/includes/booking_block.html' with city=exposition.city place=exposition.place event=exposition %}
{% if exposition.get_nearest_events|slice:":6" %}
diff --git a/templates/client/includes/exposition/exposition_object.html b/templates/client/includes/exposition/exposition_object.html index 01d93f8a..1847213f 100644 --- a/templates/client/includes/exposition/exposition_object.html +++ b/templates/client/includes/exposition/exposition_object.html @@ -315,7 +315,7 @@
{% endif %} - {% include 'client/includes/booking_block.html' with city=exposition.city place=exposition.place %} + {% include 'client/includes/booking_block.html' with city=exposition.city place=exposition.place event=exposition %}
{% if exposition.get_nearest_events|slice:":6" %}
diff --git a/templates/client/includes/translators_aside.html b/templates/client/includes/translators_aside.html new file mode 100644 index 00000000..a28b6c96 --- /dev/null +++ b/templates/client/includes/translators_aside.html @@ -0,0 +1,14 @@ +{% load i18n %} +
+
{% trans 'Переводчики' %}
+ +
\ No newline at end of file diff --git a/templates/client/popups/announce_subscription.html b/templates/client/popups/announce_subscription.html index fc63f17c..f8a8c2c8 100644 --- a/templates/client/popups/announce_subscription.html +++ b/templates/client/popups/announce_subscription.html @@ -6,7 +6,7 @@ diff --git a/templates/client/service/remotely.html b/templates/client/service/remotely.html index 1a7e3a42..e3d07e02 100644 --- a/templates/client/service/remotely.html +++ b/templates/client/service/remotely.html @@ -278,7 +278,7 @@
{% if object %}
- {% include 'client/includes/booking_block.html' with city=object.city place=object.place %} + {% include 'client/includes/booking_block.html' with city=object.city place=object.place event=object %}
{% endif %} diff --git a/templates/client/service/tickets.html b/templates/client/service/tickets.html index 63372e45..ea79acea 100644 --- a/templates/client/service/tickets.html +++ b/templates/client/service/tickets.html @@ -290,7 +290,7 @@ {% if object %}
- {% include 'client/includes/booking_block.html' with city=object.city place=object.place %} + {% include 'client/includes/booking_block.html' with city=object.city place=object.place event=object %}
{% endif %} diff --git a/templates/client/service/tour.html b/templates/client/service/tour.html index 393a0e77..08496475 100644 --- a/templates/client/service/tour.html +++ b/templates/client/service/tour.html @@ -374,7 +374,7 @@ {% if object %}
- {% include 'client/includes/booking_block.html' with city=object.city place=object.place %} + {% include 'client/includes/booking_block.html' with city=object.city place=object.place event=object %}
{% endif %} diff --git a/templates/client/service/translator.html b/templates/client/service/translator.html index c0236e37..8ab216cb 100644 --- a/templates/client/service/translator.html +++ b/templates/client/service/translator.html @@ -374,7 +374,7 @@ {% if object %}
- {% include 'client/includes/booking_block.html' with city=object.city place=object.place %} + {% include 'client/includes/booking_block.html' with city=object.city place=object.place event=object %}
{% endif %} diff --git a/templates/client/specialist_catalog/catalog_detailed.html b/templates/client/specialist_catalog/catalog_detailed.html index d087aca8..a46d36f1 100644 --- a/templates/client/specialist_catalog/catalog_detailed.html +++ b/templates/client/specialist_catalog/catalog_detailed.html @@ -36,10 +36,9 @@
{{ object.title }}
-
+
{{ object.main_descr|safe }}
-
@@ -63,7 +62,7 @@
{% if object.big_cities %}
-

Крупные города:

+

{% trans 'Города, в которых мы предоставляем переводчиков:' %}

{{ object.big_cities|safe }}
{% endif %} @@ -72,7 +71,7 @@
-

Коротко о наших преимуществах:

+

{% trans 'Коротко о наших преимуществах:' %}

{{ object.benefits|safe }}
@@ -228,9 +227,9 @@
-
от {{ object.price }} {{ object.currency }} / день
+
от {{ object.price }} {{ object.currency }} / {% trans 'день' %}
@@ -238,9 +237,6 @@
- - -
{% if request.GET.debug == '1' %} @@ -257,14 +253,12 @@ {% with object.specialists.all as specialists %} {% if specialists %}
-
Наши специалисты
+
{% trans 'Наши специалисты' %}
- - {% endfor %} - -
-
{% endif %} {% endwith %} @@ -297,7 +286,7 @@
-
Отзывы клиентов:
+
{% trans 'Отзывы клиентов:' %}
{% for feedback in feedbacks %}