commit
4bf1894e80
84 changed files with 10853 additions and 1719 deletions
@ -0,0 +1,16 @@ |
||||
2015-07-28 12:23:39,172 [DEBUG] django.db.backends: (0.001) SHOW TABLES; args=() |
||||
2015-07-28 12:23:39,175 [DEBUG] django.db.backends: (0.000) SELECT `service_service`.`id`, `service_service`.`url`, `service_service`.`currency`, `service_service`.`price`, `service_service`.`params`, `service_service`.`template`, `service_service`.`type`, `service_service`.`sort`, `service_service`.`main_page`, `service_service`.`meta_id` FROM `service_service`; args=() |
||||
2015-07-28 12:23:39,200 [DEBUG] django.db.backends: (0.002) SHOW TABLES; args=() |
||||
2015-07-28 12:23:39,201 [DEBUG] django.db.backends: (0.000) SELECT `service_service`.`id`, `service_service`.`url`, `service_service`.`currency`, `service_service`.`price`, `service_service`.`params`, `service_service`.`template`, `service_service`.`type`, `service_service`.`sort`, `service_service`.`main_page`, `service_service`.`meta_id` FROM `service_service`; args=() |
||||
2015-07-28 12:23:39,232 [DEBUG] django.db.backends: (0.001) SHOW TABLES; args=() |
||||
2015-07-28 12:23:39,233 [DEBUG] django.db.backends: (0.000) SELECT `service_service`.`id`, `service_service`.`url`, `service_service`.`currency`, `service_service`.`price`, `service_service`.`params`, `service_service`.`template`, `service_service`.`type`, `service_service`.`sort`, `service_service`.`main_page`, `service_service`.`meta_id` FROM `service_service`; args=() |
||||
2015-07-28 12:23:39,247 [DEBUG] django.db.backends: (0.001) SHOW TABLES; args=() |
||||
2015-07-28 12:23:39,248 [DEBUG] django.db.backends: (0.000) SELECT `service_service`.`id`, `service_service`.`url`, `service_service`.`currency`, `service_service`.`price`, `service_service`.`params`, `service_service`.`template`, `service_service`.`type`, `service_service`.`sort`, `service_service`.`main_page`, `service_service`.`meta_id` FROM `service_service`; args=() |
||||
2015-07-28 12:23:39,284 [DEBUG] django.db.backends: (0.001) SHOW TABLES; args=() |
||||
2015-07-28 12:23:39,285 [DEBUG] django.db.backends: (0.000) SELECT `service_service`.`id`, `service_service`.`url`, `service_service`.`currency`, `service_service`.`price`, `service_service`.`params`, `service_service`.`template`, `service_service`.`type`, `service_service`.`sort`, `service_service`.`main_page`, `service_service`.`meta_id` FROM `service_service`; args=() |
||||
2015-07-28 12:23:39,304 [DEBUG] django.db.backends: (0.001) SHOW TABLES; args=() |
||||
2015-07-28 12:23:39,305 [DEBUG] django.db.backends: (0.000) SELECT `service_service`.`id`, `service_service`.`url`, `service_service`.`currency`, `service_service`.`price`, `service_service`.`params`, `service_service`.`template`, `service_service`.`type`, `service_service`.`sort`, `service_service`.`main_page`, `service_service`.`meta_id` FROM `service_service`; args=() |
||||
2015-07-28 12:23:39,460 [DEBUG] root: Using default logger |
||||
2015-07-28 12:23:39,460 [DEBUG] root: Using default logger |
||||
2015-07-28 12:24:17,361 [DEBUG] django.db.backends: (0.001) SELECT `accounts_user`.`id`, `accounts_user`.`password`, `accounts_user`.`last_login`, `accounts_user`.`is_superuser`, `accounts_user`.`email`, `accounts_user`.`username`, `accounts_user`.`first_name`, `accounts_user`.`last_name`, `accounts_user`.`rating`, `accounts_user`.`url`, `accounts_user`.`is_active`, `accounts_user`.`is_staff`, `accounts_user`.`is_admin`, `accounts_user`.`date_joined`, `accounts_user`.`date_registered`, `accounts_user`.`date_modified`, `accounts_user`.`organiser_id`, `accounts_user`.`translator_id`, `accounts_user`.`company_id`, `accounts_user`.`position` FROM `accounts_user` WHERE `accounts_user`.`email` = 'vaniakov95@gmail.com' ; args=('vaniakov95@gmail.com',) |
||||
2015-07-28 12:24:25,526 [DEBUG] django.db.backends: (0.000) SELECT `accounts_user`.`id`, `accounts_user`.`password`, `accounts_user`.`last_login`, `accounts_user`.`is_superuser`, `accounts_user`.`email`, `accounts_user`.`username`, `accounts_user`.`first_name`, `accounts_user`.`last_name`, `accounts_user`.`rating`, `accounts_user`.`url`, `accounts_user`.`is_active`, `accounts_user`.`is_staff`, `accounts_user`.`is_admin`, `accounts_user`.`date_joined`, `accounts_user`.`date_registered`, `accounts_user`.`date_modified`, `accounts_user`.`organiser_id`, `accounts_user`.`translator_id`, `accounts_user`.`company_id`, `accounts_user`.`position` FROM `accounts_user` WHERE `accounts_user`.`email` = 'vaniakov95@gmail.com' ; args=('vaniakov95@gmail.com',) |
||||
File diff suppressed because one or more lines are too long
@ -1,16 +1,15 @@ |
||||
# -*- coding: utf-8 -*- |
||||
from django.conf.urls import patterns, include, url |
||||
from admin import MetaListView, MetaView |
||||
from .views import CreateSeoText, SeoTextList, EditSeoText, DeleteSeoText |
||||
from django.conf.urls import patterns, url |
||||
from views import CreateSeoText, SeoTextList, EditSeoText, DeleteSeoText |
||||
from .admin import MetaListView, MetaView |
||||
|
||||
urlpatterns = patterns('conference.admin', |
||||
|
||||
urlpatterns = patterns('', |
||||
url(r'^seo/new/$', CreateSeoText.as_view(), name='seo_new'), |
||||
url(r'^seo/all/$', SeoTextList.as_view(), name='seo_all'), |
||||
url(r'^seo/edit/(?P<pk>\d{1,5})/$', EditSeoText.as_view(), name='seo_edit'), |
||||
url(r'^seo/delete/(?P<pk>\d{1,5})/$', DeleteSeoText.as_view(), name='seo_delete'), |
||||
url(r'^all/$', MetaListView.as_view()), |
||||
#url(r'^change/(?P<url>.*)/$', 'conference_change'), |
||||
url(r'^(?P<id>.*)/$', MetaView.as_view()), |
||||
url(r'^(?P<id>\d{1,6})/$', MetaView.as_view()), |
||||
url(r'^$', MetaView.as_view()), |
||||
) |
||||
@ -0,0 +1,20 @@ |
||||
# -*- coding: utf-8 -*- |
||||
from django.conf.urls import url, patterns |
||||
from .views import * |
||||
|
||||
urlpatterns = patterns('', |
||||
url(r'^specialist/new/$', SpecialistCreateView.as_view(), name='specialist_new'), |
||||
url(r'^specialist/all/$', SpecialistListView.as_view(), name='specialist_all'), |
||||
url(r'^specialist/edit/(?P<pk>\d{1,4})/$', SpecialistUpdateView.as_view(), name='specialist_edit'), |
||||
url(r'^specialist/delete/(?P<pk>\d{1,4})/$', SpecialistDeleteView.as_view(), name='specialist_delete'), |
||||
url(r'^catalog/new/$', CatalogCreateView.as_view(), name='catalog_new'), |
||||
url(r'^catalog/all/$', CatalogListView.as_view(), name='catalog_all'), |
||||
url(r'^catalog/city/$', CatalogCityView.as_view(), name='catalog_city'), |
||||
url(r'^catalog/country/$', CatalogCountryView.as_view(), name='catalog_country'), |
||||
url(r'^catalog/edit/(?P<pk>\d{1,4})/$', CatalogUpdateView.as_view(), name='catalog_edit'), |
||||
url(r'^catalog/delete/(?P<pk>\d{1,4})/$', CatalogDeleteView.as_view(), name='catalog_delete'), |
||||
url(r'^catalog/(?P<catalog_pk>\d{1,4})/add_feedback/$', FeedbackCreateView.as_view(), name='feedback_new'), |
||||
#url(r'^catalog/(?P<pk>\d{1,4})/feedbacks/$', FeedbackListView.as_view(), name='feedback_all'), |
||||
url(r'^catalog/(?P<catalog_pk>\d{1,4})/feedback/(?P<id>\d{1,4})/$', FeedbackUpdateView.as_view(), name='feedback_edit'), |
||||
url(r'^feedback/delete/(?P<pk>\d{1,4})/$', FeedbackDeleteView.as_view(), name='feedback_delete'), |
||||
) |
||||
@ -0,0 +1,64 @@ |
||||
# -*- coding: utf-8 -*- |
||||
from django import forms |
||||
from hvad.forms import TranslatableModelForm |
||||
from .models import Specialist, SpecialistCatalog, Feedback, City, Country |
||||
from ckeditor.widgets import CKEditorWidget |
||||
from django.utils.translation import get_language |
||||
|
||||
country_choices = [(c.id, c.name) for c in Country.objects.all()] |
||||
lang_code = get_language()[:2] |
||||
|
||||
default_text = u"Планируете посетить выставку в %s?" \ |
||||
u" Мы предлагаем Вам подобрать переводчика именно под Ваши цели и потребности. " \ |
||||
u"Специализируясь уже более 7 лет на предоставлении переводчиков на выставки и конференции " \ |
||||
u"%s, мы можем предоставить профессионалов со знанием разных " \ |
||||
u"языков на гибких для Вас условиях. Каждый заказ индивидуален для нас, " \ |
||||
u"и итоговая цена зависит от вида перевода, тематики, срочности подбора " \ |
||||
u"специалиста, города и объема работы." |
||||
default_title = u"Переводчики в %s" |
||||
|
||||
|
||||
class SpecialistCatalogForm(TranslatableModelForm): |
||||
|
||||
class Meta: |
||||
model = SpecialistCatalog |
||||
fields = ['price', 'currency', 'logo_preview', 'main_descr', 'place_photo', |
||||
'specialists', 'city', 'country', 'type', 'title', 'benefits', 'big_cities'] |
||||
widgets = { |
||||
'type': forms.Select(choices=(('1', 'Country'), ('2', 'City'))), |
||||
'city': forms.HiddenInput(attrs={'id': 'id_city'}), |
||||
'country': forms.Select(choices=country_choices, attrs={'id': 'id_country'}), |
||||
'main_descr': CKEditorWidget, |
||||
'benefits': CKEditorWidget, |
||||
'big_cities': CKEditorWidget, |
||||
} |
||||
|
||||
def save(self, commit=True): |
||||
place = self.cleaned_data.get('city') or self.cleaned_data.get('country') |
||||
place_inflect = place.inflect or place.name |
||||
if not self.cleaned_data['title']: |
||||
self.cleaned_data['title'] = default_title % place_inflect |
||||
if not self.cleaned_data['main_descr']: |
||||
self.cleaned_data['main_descr'] = default_text % (place_inflect, place_inflect) |
||||
return super(SpecialistCatalogForm, self).save(commit=True) |
||||
|
||||
|
||||
class SpecialistForm(forms.ModelForm): |
||||
|
||||
class Meta: |
||||
model = Specialist |
||||
fields = ['name','country', 'city', 'photo', 'languages'] |
||||
widgets = { |
||||
'city': forms.HiddenInput(attrs={'id': 'id_city'}), |
||||
'country': forms.Select(choices=country_choices, attrs={'id': 'id_country'}) |
||||
} |
||||
|
||||
|
||||
class FeedbackForm(forms.ModelForm): |
||||
|
||||
class Meta: |
||||
model = Feedback |
||||
fields = ['company', 'name', 'text', 'logo', 'catalog'] |
||||
widgets = { |
||||
'text':CKEditorWidget |
||||
} |
||||
@ -0,0 +1 @@ |
||||
__author__ = 'dart_vaider' |
||||
@ -0,0 +1 @@ |
||||
__author__ = 'dart_vaider' |
||||
@ -0,0 +1,34 @@ |
||||
# -*- coding: utf-8 -*- |
||||
|
||||
from django.core.management.base import BaseCommand |
||||
from city.models import City |
||||
from specialist_catalog.models import SpecialistCatalog |
||||
|
||||
default_text = u"Планируете посетить выставку в %s?" \ |
||||
u" Мы предлагаем Вам подобрать переводчика именно под Ваши цели и потребности. " \ |
||||
u"Специализируясь уже более 7 лет на предоставлении переводчиков на выставки и конференции " \ |
||||
u"%s, мы можем предоставить профессионалов со знанием разных " \ |
||||
u"языков на гибких для Вас условиях. Каждый заказ индивидуален для нас, " \ |
||||
u"и итоговая цена зависит от вида перевода, тематики, срочности подбора " \ |
||||
u"специалиста, города и объема работы." |
||||
default_title = u"Переводчики в %s" |
||||
default_logo = "specialist_catalog/logo_preview/default_logo.jpg" |
||||
default_cities = u"<ul><li>Лондон</li><li>Киев</li><li>Барселона</li></ul>" |
||||
|
||||
|
||||
class Command(BaseCommand): |
||||
def handle(self, *args, **options): |
||||
cities = list(City.objects.language('ru').order_by('id')) |
||||
for cty in cities: |
||||
name = cty.inflect or cty.name |
||||
sc = SpecialistCatalog( |
||||
type=2, |
||||
country=cty.country, |
||||
city=cty, |
||||
title=default_title % name, |
||||
main_descr=default_text % (name, name), |
||||
logo_preview=default_logo, |
||||
big_cities=default_cities, |
||||
) |
||||
sc.save() |
||||
print cty.url, " -> ", cty.country.url |
||||
@ -0,0 +1,33 @@ |
||||
# -*- coding: utf-8 -*- |
||||
from django.core.management.base import BaseCommand |
||||
from country.models import Country |
||||
from specialist_catalog.models import SpecialistCatalog |
||||
|
||||
default_text = u"Планируете посетить выставку в %s?" \ |
||||
u" Мы предлагаем Вам подобрать переводчика именно под Ваши цели и потребности. " \ |
||||
u"Специализируясь уже более 7 лет на предоставлении переводчиков на выставки и конференции " \ |
||||
u"%s, мы можем предоставить профессионалов со знанием разных " \ |
||||
u"языков на гибких для Вас условиях. Каждый заказ индивидуален для нас, " \ |
||||
u"и итоговая цена зависит от вида перевода, тематики, срочности подбора " \ |
||||
u"специалиста, города и объема работы." |
||||
default_title = u"Переводчики в %s" |
||||
default_logo = "specialist_catalog/logo_preview/ukraine.gif" |
||||
default_cities = u"<ul><li>Лондон</li><li>Киев</li><li>Барселона</li></ul>" |
||||
lang = 'ru' |
||||
|
||||
|
||||
class Command(BaseCommand): |
||||
def handle(self, *args, **options): |
||||
countries = Country.objects.language('ru').order_by('name') |
||||
for cntry in countries: |
||||
name = cntry.inflect or cntry.name |
||||
sc = SpecialistCatalog( |
||||
type='1', |
||||
country=cntry, |
||||
title=default_title % name, |
||||
main_descr=default_text % (name, name), |
||||
logo_preview=default_logo, |
||||
big_cities=default_cities, |
||||
) |
||||
sc.save() |
||||
print "created for: %s" % cntry.url |
||||
@ -0,0 +1,97 @@ |
||||
# -*- coding: utf-8 -*- |
||||
from django.db import models |
||||
from django.conf import settings |
||||
from hvad.models import TranslatableModel, TranslatedFields, TranslationManager |
||||
from city.models import City |
||||
from country.models import Country |
||||
from django.core.urlresolvers import reverse_lazy |
||||
from django.utils.translation import get_language |
||||
import copy |
||||
|
||||
# types of catalog |
||||
_country = 1 |
||||
_city = 2 |
||||
|
||||
|
||||
class Specialist(models.Model): |
||||
name = models.CharField(max_length=255, verbose_name=u"Полное имя", blank=False) |
||||
languages = models.CharField(max_length=255, verbose_name=u"Языки") |
||||
city = models.ForeignKey(City, on_delete=models.PROTECT, verbose_name=u"Город", blank=True) |
||||
country = models.ForeignKey(Country, on_delete=models.PROTECT, verbose_name=u"Страна") |
||||
photo = models.ImageField(verbose_name=u"Фото", upload_to="specialist_catalog/specialist_photo/", blank=True) |
||||
|
||||
def __unicode__(self): |
||||
return u"%s" % self.name |
||||
|
||||
|
||||
class SpecialistCatalog(TranslatableModel): |
||||
price = models.IntegerField(verbose_name=u"Цена", default=200) |
||||
currency = models.CharField(max_length=255, verbose_name=u"Валюта", default=u"EUR") |
||||
logo_preview = models.ImageField(verbose_name=u"Логотип", blank=True, upload_to='specialist_catalog/logo_preview/') |
||||
place_photo = models.ImageField(verbose_name=u"Фото для города", blank=True, upload_to='specialist_catalog/place_photo/') |
||||
specialists = models.ManyToManyField(Specialist, verbose_name=u"Специалисты", blank=True) |
||||
city = models.ForeignKey(City, on_delete=models.PROTECT, verbose_name=u"Город", unique=True, blank=True) |
||||
country = models.ForeignKey(Country, on_delete=models.PROTECT, verbose_name=u"Страна", blank=False) |
||||
type = models.PositiveSmallIntegerField(verbose_name=u"Тип(Страна/Город)", default=2) |
||||
|
||||
translations = TranslatedFields( |
||||
title=models.CharField(max_length=255, verbose_name=u"Заголовок"), |
||||
main_descr=models.CharField(max_length=1000, verbose_name=u"Краткое описание"), |
||||
benefits=models.CharField(max_length=2000, verbose_name=u"Преимущества"), |
||||
big_cities=models.TextField(verbose_name=u"Крупные города") |
||||
) |
||||
|
||||
def __init__(self, *args, **kwargs): |
||||
super(SpecialistCatalog, self).__init__(*args, **kwargs) |
||||
self.cache_fields = ['title', 'main_descr', 'benefits'] |
||||
self.is_new = True |
||||
|
||||
def get_absolute_url(self): |
||||
global _country, _city |
||||
if self.type == _country: |
||||
return reverse_lazy('spec_catalog_country', kwargs={'slug': self.country.url}) |
||||
return reverse_lazy('spec_catalog_city', kwargs={'slug': self.city.url}) |
||||
|
||||
def save(self, *args, **kwargs): |
||||
super(SpecialistCatalog, self).save(*args, **kwargs) |
||||
self.initial_language = get_language()[:2] or 'ru' |
||||
|
||||
new_values = {field: getattr(self, field) for field in self.cache_fields} |
||||
langs = [code for code, _ in settings.LANGUAGES] |
||||
if self.is_new: |
||||
for lang in langs: |
||||
if lang not in self.get_available_languages(): |
||||
self.translate(lang) |
||||
for key, value in new_values.items(): |
||||
setattr(self, key, value) |
||||
self.save_translations(self) |
||||
else: |
||||
translations = {obj.language_code: obj for obj in list(self.translations.all())} |
||||
for lang in langs: |
||||
if lang is not self.initial_language: |
||||
tr = translations[lang] |
||||
for key, value in new_values.items(): |
||||
#if u'%s' % getattr(tr, key) is u'%s' % self.var_cache[key]: |
||||
setattr(tr, key, value) |
||||
tr.save() |
||||
|
||||
self.lazy_translation_getter(self.initial_language) |
||||
self.var_cache = {var: copy.copy(getattr(self, var)) for var in self.cache_fields} |
||||
self.is_new = False |
||||
return self |
||||
|
||||
def __unicode__(self): |
||||
return self.title |
||||
|
||||
|
||||
class Feedback(models.Model): |
||||
company = models.CharField(max_length=255, verbose_name=u"Название компании") |
||||
name = models.CharField(max_length=100, verbose_name=u"Имя") |
||||
text = models.CharField(max_length=5000, verbose_name=u"Текст отзыва") |
||||
logo = models.ImageField(verbose_name=u"Логотип компании", upload_to='specialist_catalog/feedback_logo/', blank=True) |
||||
catalog = models.ForeignKey(SpecialistCatalog, verbose_name=u"Страница", blank=False) |
||||
|
||||
def __unicode__(self): |
||||
return "Feedback from %s" % self.company |
||||
|
||||
|
||||
@ -0,0 +1,16 @@ |
||||
""" |
||||
This file demonstrates writing tests using the unittest module. These will pass |
||||
when you run "manage.py test". |
||||
|
||||
Replace this with more appropriate tests for your application. |
||||
""" |
||||
|
||||
from django.test import TestCase |
||||
|
||||
|
||||
class SimpleTest(TestCase): |
||||
def test_basic_addition(self): |
||||
""" |
||||
Tests that 1 + 1 always equals 2. |
||||
""" |
||||
self.assertEqual(1 + 1, 2) |
||||
@ -0,0 +1,8 @@ |
||||
# -*- coding: utf-8 -*- |
||||
from django.conf.urls import url, patterns |
||||
from .views import CatalogDetailedView |
||||
|
||||
urlpatterns = patterns('', |
||||
url(r'^city/(?P<slug>.*)/$', CatalogDetailedView.as_view(), {'type': 'city'}, name="spec_catalog_city"), |
||||
url(r'^country/(?P<slug>.*)/$', CatalogDetailedView.as_view(), {'type': 'country'}, name="spec_catalog_country"), |
||||
) |
||||
@ -0,0 +1,171 @@ |
||||
# -*- coding: utf-8 -*- |
||||
from django.views.generic import CreateView, UpdateView, DeleteView, ListView, FormView, DetailView |
||||
from django.views.generic.detail import SingleObjectMixin |
||||
from .forms import * |
||||
from django.core.urlresolvers import reverse_lazy |
||||
from django.conf import settings |
||||
from django.shortcuts import get_object_or_404 |
||||
from service.order_forms import TranslationForm |
||||
from django.http import HttpResponseRedirect |
||||
from django.utils.translation import get_language |
||||
|
||||
# =========== ADMIN VIEWS =========== |
||||
|
||||
# Specialist views |
||||
|
||||
|
||||
class SpecialistCreateView(CreateView): |
||||
form_class = SpecialistForm |
||||
model = Specialist |
||||
template_name = 'admin/specialist/specialist_new.html' |
||||
success_url = reverse_lazy("specialist_all") |
||||
|
||||
|
||||
class SpecialistListView(ListView): |
||||
model = Specialist |
||||
template_name = 'admin/specialist/specialist_all.html' |
||||
paginate_by = settings.ADMIN_PAGINATION |
||||
|
||||
|
||||
class SpecialistUpdateView(UpdateView): |
||||
form_class = SpecialistForm |
||||
model = Specialist |
||||
template_name = 'admin/specialist/specialist_new.html' |
||||
success_url = reverse_lazy("specialist_all") |
||||
|
||||
def get_form(self, form_class): |
||||
form = super(SpecialistUpdateView, self).get_form(form_class) |
||||
form.fields['city'].widget.attrs['data-init-text'] = self.object.city.name |
||||
return form |
||||
|
||||
|
||||
class SpecialistDeleteView(DeleteView): |
||||
model = Specialist |
||||
template_name = 'admin/specialist/specialist_confirm_delete.html' |
||||
success_url = reverse_lazy("specialist_all") |
||||
|
||||
|
||||
# Catalog views |
||||
|
||||
|
||||
class CatalogCreateView(CreateView): |
||||
form_class = SpecialistCatalogForm |
||||
model = SpecialistCatalog |
||||
template_name = 'admin/specialist/catalog_new.html' |
||||
success_url = reverse_lazy("catalog_all") |
||||
|
||||
|
||||
class CatalogListView(ListView): |
||||
model = SpecialistCatalog |
||||
template_name = 'admin/specialist/catalog_all.html' |
||||
paginate_by = settings.ADMIN_PAGINATION |
||||
|
||||
|
||||
class CatalogCityView(ListView): |
||||
model = SpecialistCatalog |
||||
template_name = 'admin/specialist/catalog_all.html' |
||||
paginate_by = settings.ADMIN_PAGINATION |
||||
|
||||
def get_queryset(self): |
||||
qs = super(CatalogCityView, self).get_queryset() |
||||
return qs.filter(type=2) |
||||
|
||||
|
||||
class CatalogCountryView(ListView): |
||||
model = SpecialistCatalog |
||||
template_name = 'admin/specialist/catalog_all.html' |
||||
paginate_by = settings.ADMIN_PAGINATION |
||||
|
||||
def get_queryset(self): |
||||
qs = super(CatalogCountryView, self).get_queryset() |
||||
return qs.filter(type=1) |
||||
|
||||
|
||||
class CatalogUpdateView(UpdateView): |
||||
form_class = SpecialistCatalogForm |
||||
model = SpecialistCatalog |
||||
template_name = 'admin/specialist/catalog_new.html' |
||||
success_url = reverse_lazy("catalog_all") |
||||
|
||||
def get_form(self, form_class): |
||||
form = super(CatalogUpdateView, self).get_form(form_class) |
||||
if self.object.type is 2: # city |
||||
form.fields['city'].widget.attrs['data-init-text'] = self.object.city.name |
||||
return form |
||||
|
||||
|
||||
class CatalogDeleteView(DeleteView): |
||||
model = SpecialistCatalog |
||||
template_name = 'admin/specialist/catalog_confirm_delete.html' |
||||
success_url = reverse_lazy("catalog_all") |
||||
|
||||
|
||||
# Feedback views |
||||
|
||||
|
||||
class FeedbackCreateView(CreateView): |
||||
form_class = FeedbackForm |
||||
model = Feedback |
||||
template_name = 'admin/specialist/feedback_new.html' |
||||
success_url = reverse_lazy("catalog_all") |
||||
|
||||
def get_initial(self): |
||||
catalog = get_object_or_404(SpecialistCatalog, pk=self.kwargs.get('catalog_pk')) |
||||
return {'catalog': catalog} |
||||
|
||||
|
||||
class FeedbackUpdateView(UpdateView): |
||||
form_class = FeedbackForm |
||||
model = Feedback |
||||
template_name = 'admin/specialist/feedback_new.html' |
||||
success_url = reverse_lazy("catalog_all") |
||||
|
||||
def get_initial(self): |
||||
catalog = get_object_or_404(SpecialistCatalog, pk=self.kwargs.get('catalog_pk')) |
||||
return {'catalog': catalog} |
||||
|
||||
|
||||
class FeedbackDeleteView(DeleteView): |
||||
model = Feedback |
||||
template_name = 'admin/specialist/feedback_confirm_delete.html' |
||||
success_url = reverse_lazy("catalog_all") |
||||
|
||||
|
||||
# ========= CLIENT VIEWS ============ |
||||
|
||||
lang = get_language()[:2] |
||||
|
||||
|
||||
class CatalogDetailedView(SingleObjectMixin, FormView): |
||||
model = SpecialistCatalog |
||||
form_class = TranslationForm |
||||
template_name = "client/specialist_catalog/catalog_detailed.html" |
||||
success_url = reverse_lazy("service_thanks") |
||||
|
||||
def get_object(self, queryset=None): |
||||
if self.kwargs.get('type') is "country": |
||||
obj = self.model.objects.language(lang).get(country__url=self.kwargs.get('slug')) |
||||
else: |
||||
obj = self.model.objects.language(lang).get(city__url=self.kwargs.get('slug')) |
||||
self.object = obj |
||||
return obj |
||||
|
||||
def get_context_data(self, **kwargs): |
||||
self.get_object() |
||||
context = super(CatalogDetailedView, self).get_context_data(**kwargs) |
||||
context['object'] = self.object |
||||
return context |
||||
|
||||
def form_valid(self, form): |
||||
order = form.save(commit=False) |
||||
order.save() |
||||
return HttpResponseRedirect(self.success_url) |
||||
|
||||
def get_initial(self): |
||||
obj = self.get_object() |
||||
init = {} |
||||
init['country'] = obj.country.name |
||||
if self.kwargs.get('type') is "city": |
||||
init['city'] = obj.city.name |
||||
return init |
||||
|
||||
@ -0,0 +1,93 @@ |
||||
/** |
||||
* Created by dev on 07.09.2015. |
||||
*/ |
||||
$(document).ready(function () { |
||||
$('select').select2({ |
||||
width: 'element', |
||||
allowClear: true |
||||
}); |
||||
|
||||
$('#id_country').change(function () { |
||||
$.get( |
||||
"/admin/ajax_city/", {'id': $(this).val()}, function (j) { |
||||
|
||||
$('#id_city').html(j); |
||||
$('#id_city').attr('disabled', false); |
||||
|
||||
}); |
||||
}); |
||||
|
||||
|
||||
$('#id_city').select2({ |
||||
placeholder: "Город", |
||||
width: 300, |
||||
ajax: { |
||||
|
||||
url: "/admin/city/search/", |
||||
dataType: "json", |
||||
quietMillis: 200, |
||||
|
||||
data: function (term, page, country) { |
||||
var country = $('#id_country').val(); |
||||
return { |
||||
term: term, |
||||
page: page, |
||||
country: country |
||||
}; |
||||
}, |
||||
|
||||
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}); |
||||
|
||||
} |
||||
|
||||
}); |
||||
|
||||
|
||||
// displaying uploaded photo
|
||||
|
||||
function handleFileSelect(evt) { |
||||
var files = evt.target.files; // FileList object
|
||||
|
||||
// Loop through the FileList and render image files as thumbnails.
|
||||
for (var i = 0, f; f = files[i]; i++) { |
||||
|
||||
// Only process image files.
|
||||
if (!f.type.match('image.*')) { |
||||
continue; |
||||
} |
||||
|
||||
var reader = new FileReader(); |
||||
|
||||
// Closure to capture the file information.
|
||||
|
||||
reader.onload = (function (theFile) { |
||||
return function (e) { |
||||
document.getElementById('list').innerHTML = ['<img class="thumb" src="', |
||||
e.target.result, '" title="', escape(theFile.name), '"/>'].join(''); |
||||
}; |
||||
})(f); |
||||
|
||||
|
||||
// Read in the image file as a data URL.
|
||||
reader.readAsDataURL(f); |
||||
} |
||||
} |
||||
|
||||
document.getElementById('id_photo').addEventListener('change', handleFileSelect, false); |
||||
document.getElementById('id_logo').addEventListener('change', handleFileSelect, false); |
||||
console.log("hello from new specialist view.js"); |
||||
}); |
||||
@ -0,0 +1,120 @@ |
||||
/** |
||||
* Created by dev on 07.09.2015. |
||||
*/ |
||||
$(document).ready(function () { |
||||
$('select').select2({ |
||||
width: 'element', |
||||
allowClear: true |
||||
}); |
||||
|
||||
$('#id_country').change(function () { |
||||
$.get( |
||||
"/admin/ajax_city/", {'id': $(this).val()}, function (j) { |
||||
|
||||
$('#id_city').html(j); |
||||
$('#id_city').attr('disabled', false); |
||||
|
||||
}); |
||||
}); |
||||
|
||||
|
||||
$('#id_city').select2({ |
||||
placeholder: "Город", |
||||
width: 300, |
||||
ajax: { |
||||
|
||||
url: "/admin/city/search/", |
||||
dataType: "json", |
||||
quietMillis: 200, |
||||
|
||||
data: function (term, page, country) { |
||||
var country = $('#id_country').val(); |
||||
return { |
||||
term: term, |
||||
page: page, |
||||
country: country |
||||
}; |
||||
}, |
||||
|
||||
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}); |
||||
|
||||
} |
||||
|
||||
}); |
||||
|
||||
|
||||
// displaying uploaded photo
|
||||
|
||||
function handleFileSelect1(evt) { |
||||
var files = evt.target.files; // FileList object
|
||||
|
||||
// Loop through the FileList and render image files as thumbnails.
|
||||
for (var i = 0, f; f = files[i]; i++) { |
||||
|
||||
// Only process image files.
|
||||
if (!f.type.match('image.*')) { |
||||
continue; |
||||
} |
||||
|
||||
var reader = new FileReader(); |
||||
|
||||
// Closure to capture the file information.
|
||||
|
||||
reader.onload = (function (theFile) { |
||||
return function (e) { |
||||
document.getElementById('list_picture').innerHTML = ['<img class="thumb" src="', |
||||
e.target.result, '" title="', escape(theFile.name), '"/>'].join(''); |
||||
}; |
||||
})(f); |
||||
|
||||
|
||||
// Read in the image file as a data URL.
|
||||
reader.readAsDataURL(f); |
||||
} |
||||
} |
||||
function handleFileSelect2(evt) { |
||||
var files = evt.target.files; // FileList object
|
||||
|
||||
// Loop through the FileList and render image files as thumbnails.
|
||||
for (var i = 0, f; f = files[i]; i++) { |
||||
|
||||
// Only process image files.
|
||||
if (!f.type.match('image.*')) { |
||||
continue; |
||||
} |
||||
|
||||
var reader = new FileReader(); |
||||
|
||||
// Closure to capture the file information.
|
||||
|
||||
reader.onload = (function (theFile) { |
||||
return function (e) { |
||||
document.getElementById('list_logo').innerHTML = ['<img class="thumb" src="', |
||||
e.target.result, '" title="', escape(theFile.name), '"/>'].join(''); |
||||
}; |
||||
})(f); |
||||
|
||||
|
||||
// Read in the image file as a data URL.
|
||||
reader.readAsDataURL(f); |
||||
} |
||||
} |
||||
|
||||
document.getElementById('id_place_photo').addEventListener('change', handleFileSelect1, false); |
||||
document.getElementById('id_logo_preview').addEventListener('change', handleFileSelect2, false); |
||||
console.log("hello from new catalog view.js"); |
||||
}); |
||||
@ -0,0 +1,167 @@ |
||||
/** |
||||
* Created by dev on 07.09.2015. |
||||
*/ |
||||
$(document).ready(function () { |
||||
$('select').select2({ |
||||
width: 'element', |
||||
allowClear: true |
||||
}); |
||||
|
||||
$('#id_country').change(function () { |
||||
$.get( |
||||
"/admin/ajax_city/", {'id': $(this).val()}, function (j) { |
||||
|
||||
$('#id_city').html(j); |
||||
$('#id_city').attr('disabled', false); |
||||
|
||||
}); |
||||
}); |
||||
$('#id_place').select2({ |
||||
placeholder:"Место проведения", |
||||
widht: 400 |
||||
}); |
||||
|
||||
$('#id_city').select2({ |
||||
placeholder: "Город", |
||||
width: 300, |
||||
ajax: { |
||||
|
||||
url: "/admin/city/search/", |
||||
dataType: "json", |
||||
quietMillis: 200, |
||||
|
||||
data: function (term, page, country) { |
||||
var country = $('#id_country').val() |
||||
return { |
||||
term: term, |
||||
page: page, |
||||
country: country |
||||
}; |
||||
}, |
||||
|
||||
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}); |
||||
|
||||
} |
||||
|
||||
}); |
||||
$('#id_0-periodic').select2({ |
||||
placeholder: "Периодичность", |
||||
width: '350px' |
||||
}); |
||||
|
||||
|
||||
$('#id_tag').select2({ |
||||
placeholder: "Теги", |
||||
width: '350px', |
||||
multiple: true, |
||||
ajax: { |
||||
|
||||
url: "/admin/theme/tag/search/", |
||||
dataType: "json", |
||||
quietMillis: 200, |
||||
multiple: true, |
||||
|
||||
data: function (term, page, theme) { |
||||
var theme = $('#id_theme').serialize().replace(/0-theme/g, 'theme'); |
||||
return { |
||||
term: term, |
||||
page: page, |
||||
theme: theme |
||||
}; |
||||
}, |
||||
|
||||
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 data = []; |
||||
$(element.val().split(",")).each(function (i) { |
||||
var item = this.split(':'); |
||||
data.push({ |
||||
id: item[0], |
||||
text: item[1] |
||||
}); |
||||
}); |
||||
callback(data); |
||||
|
||||
} |
||||
|
||||
}); |
||||
// end selects
|
||||
/* |
||||
*/ |
||||
// theme change
|
||||
|
||||
$('#id_theme').change(function () { |
||||
$.get( |
||||
"/admin/ajax_tag/", {'id': $(this).serialize().replace(/0-theme/g, 'theme')}, function (data) { |
||||
var optionValues = []; |
||||
var getValues = []; |
||||
var selectedValues = []; |
||||
//push values sended from server in array
|
||||
$.each(data, function (i, elem) { |
||||
getValues.push(elem[0].toString()) |
||||
}); |
||||
//delete options if they aren't in getvalues
|
||||
//otherwise push it in array
|
||||
//also push in array already selected values
|
||||
$('#id_tag option').each(function () { |
||||
var check = $.inArray($(this), getValues); |
||||
if ($(this).is(':selected')) { |
||||
selectedValues.push($(this).val()) |
||||
} |
||||
if (check == -1) { |
||||
$(this).remove() |
||||
} |
||||
else { |
||||
optionValues.push($(this).val()); |
||||
} |
||||
}); |
||||
//generate new options
|
||||
//old options unchanged
|
||||
var html = ''; |
||||
$.each(data, function (i, elem) { |
||||
var check = $.inArray(elem[0].toString(), optionValues); |
||||
|
||||
if (check == -1) { |
||||
html += '<option value="'; |
||||
html += elem[0]; |
||||
html += '">'; |
||||
html += elem[1]; |
||||
html += '</option>'; |
||||
} |
||||
}); |
||||
$('#id_tag').append(html); |
||||
//select previous selected values
|
||||
$('#id_tag option').each(function () { |
||||
var check = $.inArray($(this).val(), selectedValues) |
||||
if (check != -1) { |
||||
$(this).attr('selected', 'selected'); |
||||
} |
||||
}); |
||||
});//end get
|
||||
});//end change
|
||||
console.log("hello from wizard.js"); |
||||
}); |
||||
@ -0,0 +1,14 @@ |
||||
{% extends 'client/base_catalog.html' %} |
||||
{% load static %} |
||||
{% load i18n %} |
||||
{% load template_filters %} |
||||
|
||||
{% block title %}{{ object.title }} {% endblock %} |
||||
|
||||
{% block content_list %} |
||||
<div id="title"> |
||||
{{ object.h1 }} |
||||
</div> |
||||
<div id="body">{{ object.body }}</div> |
||||
|
||||
{% endblock %} |
||||
@ -0,0 +1,64 @@ |
||||
{% extends 'base.html' %} |
||||
{% load thumbnail %} |
||||
{% 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>{% if request.path == "/admin/specialist_catalog/catalog/city/" %}Город{% elif request.path == "/admin/specialist_catalog/catalog/country/" %}Страна{% else %}Страна/Город{% endif %}</th> |
||||
<th>Количество специалистов</th> |
||||
<th>Link</th> |
||||
<th> </th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{% for item in object_list %} |
||||
<tr> |
||||
|
||||
<td> |
||||
{% thumbnail item.logo_preview "100x100" crop="center" as im %} |
||||
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"> |
||||
{% endthumbnail %}</td> |
||||
<td>{{ item.title }}</td> |
||||
<td>{% if item.type == 1%}{{ item.country.name }}{% else %}{{ item.city.name }}{% endif %}</td> |
||||
<td>{{ item.specialists.count }}</td> |
||||
<td><a href="{{ item.get_absolute_url }}">Заценить</a></td> |
||||
<td class="center sorting_1"> |
||||
<a class="btn-small btn-info" href='{% url "catalog_edit" item.id %}'> |
||||
Изменить |
||||
</a> |
||||
</td> |
||||
|
||||
<td> |
||||
<a class="btn-small btn-danger delete" href='{% url "catalog_delete" item.id %}'> |
||||
Удалить |
||||
</a> |
||||
</td> |
||||
</tr> |
||||
{% endfor %} |
||||
</tbody> |
||||
</table> |
||||
<a class="btn btn-success" href='{% url "catalog_new" %}'> |
||||
<i class="icon-plus-sign icon-white"></i> Хочу еще один </a> |
||||
</div> |
||||
|
||||
<div class="pagination pagination-centered"> |
||||
<ul> |
||||
{% if page_obj.has_previous %} |
||||
<li> <a href="?page={{ page_obj.previous_page_number }}">←</a></li> |
||||
{% endif %} |
||||
|
||||
{% if page_obj.has_next %} |
||||
<li><a href="?page={{ page_obj.next_page_number }}">→</a></li> |
||||
{% endif %} |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
||||
@ -0,0 +1,11 @@ |
||||
{% extends 'base.html' %} |
||||
{% block sidebar %}{% endblock %} |
||||
{% block body %} |
||||
<form action="" method="post">{% csrf_token %} |
||||
<div class="controls"> |
||||
<p>Вы точно хотите удалить "{{ object.title }}" ?</p> |
||||
<input class="btn btn-large btn-danger delete" type="submit" value="Да" /> |
||||
<a class="btn btn-large btn-primary" href = {% url 'catalog_all' %}>Нет</a> |
||||
</div> |
||||
</form> |
||||
{% endblock %} |
||||
@ -0,0 +1,203 @@ |
||||
{% extends 'base.html' %} |
||||
{% load thumbnail %} |
||||
{% load static %} |
||||
{# Displays article form #} |
||||
|
||||
{% block scripts %} |
||||
<script src="{% static 'ckeditor/ckeditor/ckeditor.js' %}"></script> |
||||
{# selects for city and country #} |
||||
<link href="{% static 'js/select/select2.css' %}" rel="stylesheet"/> |
||||
<style> |
||||
.thumb { |
||||
height: 75px; |
||||
border: 1px solid #000; |
||||
margin: 10px 5px 0 0; |
||||
} |
||||
</style> |
||||
<script src="{% static 'js/select/select2.js' %}"></script> |
||||
<script src="{% static 'custom_js/specialist_catalog.js' %}"></script> |
||||
{% endblock %} |
||||
|
||||
{% block body %} |
||||
<form method="post" class="form-horizontal" enctype="multipart/form-data"> {% csrf_token %} |
||||
<fieldset> |
||||
<div class="box span8"> |
||||
<div class="box-header well"> |
||||
<h2><i class="icon-pencil"></i> Добавление каталога специалистов(переводчиков)</h2> |
||||
</div> |
||||
<div class="box-content"> |
||||
{# title #} |
||||
<div class="control-group {% if form.title.errors %}error{% endif %}"> |
||||
<label class="control-label"><b>{{ form.title.label }}:</b></label> |
||||
<div class="controls"> |
||||
{{ form.title }}<span class="help-inline"></span> |
||||
<span class="help-inline">{{ form.title.errors }}</span> |
||||
</div> |
||||
</div> |
||||
{# main_descr #} |
||||
<div class="control-group {% if form.main_descr.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.main_descr.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.main_descr }} |
||||
<span class="help-inline">{{ form.main_descr.errors }}</span> |
||||
</div> |
||||
</div> |
||||
|
||||
{# benefits #} |
||||
<div class="control-group {% if form.benefits.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.benefits.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.benefits }} |
||||
<span class="help-inline">{{ form.benefits.errors }}</span> |
||||
</div> |
||||
</div> |
||||
{# big_cities #} |
||||
<div class="control-group {% if form.big_cities.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.big_cities.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.big_cities }} |
||||
<span class="help-inline">{{ form.big_cities.errors }}</span> |
||||
</div> |
||||
</div> |
||||
|
||||
{# price #} |
||||
<div class="control-group {% if form.price.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.price.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.price }}{{ form.currency.label }}{{ form.currency }} |
||||
<span class="help-inline">{{ form.price.errors }}</span> |
||||
</div> |
||||
</div> |
||||
|
||||
{# type #} |
||||
<div class="control-group {% if form.type.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.type.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.type }} |
||||
<span class="help-inline">{{ form.type.errors }}</span> |
||||
</div> |
||||
</div> |
||||
|
||||
{# country #} |
||||
<div class="control-group {% if form.country.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.country.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.country }} |
||||
<span class="help-inline">{{ form.country.errors }}</span> |
||||
</div> |
||||
</div> |
||||
{# city #} |
||||
<div class="control-group {% if form.city.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.city.label }}(не обязательно):</label> |
||||
<div class="controls"> |
||||
{{ form.city }} |
||||
<span class="help-inline">{{ form.city.errors }}</span> |
||||
</div> |
||||
</div> |
||||
|
||||
{# specialists #} |
||||
<div class="control-group {% if form.specialists.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.specialists.label }}(не обязательно):</label> |
||||
<div class="controls"> |
||||
{{ form.specialists }}<a class="btn " href="{% url 'specialist_new' %}">Довавить</a> |
||||
<span class="help-inline">{{ form.specialists.errors }}</span> |
||||
</div> |
||||
</div> |
||||
{# logo_preview #} |
||||
<div class="control-group {% if form.logo_preview.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.logo_preview.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.logo_preview }} <output id="list_logo"></output> |
||||
<span class="help-inline">{{ form.logo_preview.errors }}</span> |
||||
</div> |
||||
</div> |
||||
{# place_photo #} |
||||
<div class="control-group {% if form.place_photo.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.place_photo.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.place_photo }} <output id="list_picture"></output> |
||||
<span class="help-inline">{{ form.place_photo.errors }}</span> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
|
||||
<div class="controls"> |
||||
|
||||
<input class="btn btn-large btn-primary" type="submit" {% if request.path == '/admin/specialist_catalog/catalog/new/' %} value="Добавить" {% else %} value='Изменить' {% endif %}/> |
||||
<input class="btn btn-large" type="reset" value="Отмена"> |
||||
<a class="btn btn-large" href="{% url 'catalog_all' %}">Чет передумал(а)</a> |
||||
</div> |
||||
</fieldset> |
||||
</form> |
||||
|
||||
<!--Feedbacks block --> |
||||
{% if object.feedback_set.all %} |
||||
{% with object.feedback_set.all as feedbacks %} |
||||
|
||||
<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>Компания</th> |
||||
<th>Текст</th> |
||||
<th> </th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{% for item in feedbacks %} |
||||
<tr> |
||||
|
||||
<td> |
||||
{% thumbnail item.logo "100x100" crop="center" as im %} |
||||
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"> |
||||
{% endthumbnail %}</td> |
||||
<td>{{ item.name }}</td> |
||||
<td>{{ item.company }}</td> |
||||
<td>{{ item.text }}</td> |
||||
<td class="center sorting_1"> |
||||
<a class="btn-small btn-info" href='{% url "feedback_edit" catalog_pk=object.id id=item.id %}'> |
||||
Изменить |
||||
</a> |
||||
</td> |
||||
|
||||
<td> |
||||
<a class="btn-small btn-danger delete" href='{% url "feedback_delete" item.id %}'> |
||||
Удалить |
||||
</a> |
||||
</td> |
||||
</tr> |
||||
{% endfor %} |
||||
</tbody> |
||||
</table> |
||||
<a class="btn btn-success" href='{% url "feedback_new" object.id %}'> |
||||
<i class="icon-plus-sign icon-white"></i> Хочу еще один </a> |
||||
</div> |
||||
|
||||
<div class="pagination pagination-centered"> |
||||
<ul> |
||||
{% if page_obj.has_previous %} |
||||
<li><a href="?page={{ page_obj.previous_page_number }}">←</a></li> |
||||
{% endif %} |
||||
|
||||
{% if page_obj.has_next %} |
||||
<li><a href="?page={{ page_obj.next_page_number }}">→</a></li> |
||||
{% endif %} |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
{% endwith %} |
||||
{% elif object.id %} |
||||
Отзывов еще нет, |
||||
<a class="btn btn-success" href='{% url "feedback_new" catalog_pk=object.id%}'> |
||||
<i class="icon-plus-sign icon-white"></i> Добавить </a> |
||||
{% endif %} |
||||
{% endblock %} |
||||
@ -0,0 +1,62 @@ |
||||
{% extends 'base.html' %} |
||||
{% load thumbnail %} |
||||
{% block body %} |
||||
<div class="box span8"> |
||||
<div class="box-header well"> |
||||
<h2><i class="icon-arrow-down"></i>Отзывы для %(calatolog)</h2> |
||||
</div> |
||||
<div class="box-content"> |
||||
<table class="table table-hover"> |
||||
<thead> |
||||
<tr> |
||||
|
||||
<th>Логотип </th> |
||||
<th>Имя</th> |
||||
<th>Компания</th> |
||||
<th>Текст</th> |
||||
<th> </th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{% for item in object_list %} |
||||
<tr> |
||||
|
||||
<td> |
||||
{% thumbnail item.logo "100x100" crop="center" as im %} |
||||
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"> |
||||
{% endthumbnail %}</td> |
||||
<td>{{ item.name }}</td> |
||||
<td>{{ item.company }}</td> |
||||
<td>{{ item.text }}</td> |
||||
<td class="center sorting_1"> |
||||
<a class="btn-small btn-info" href='{% url "feedback_edit" item.id %}'> |
||||
Изменить |
||||
</a> |
||||
</td> |
||||
|
||||
<td> |
||||
<a class="btn-small btn-danger delete" href='{% url "feedback_delete" item.id %}'> |
||||
Удалить |
||||
</a> |
||||
</td> |
||||
</tr> |
||||
{% endfor %} |
||||
</tbody> |
||||
</table> |
||||
<a class="btn btn-success" href='{% url "feedback_new" %}'> |
||||
<i class="icon-plus-sign icon-white"></i> Хочу еще один </a> |
||||
</div> |
||||
|
||||
<div class="pagination pagination-centered"> |
||||
<ul> |
||||
{% if page_obj.has_previous %} |
||||
<li> <a href="?page={{ page_obj.previous_page_number }}">←</a></li> |
||||
{% endif %} |
||||
|
||||
{% if page_obj.has_next %} |
||||
<li><a href="?page={{ page_obj.next_page_number }}">→</a></li> |
||||
{% endif %} |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
||||
@ -0,0 +1,11 @@ |
||||
{% extends 'base.html' %} |
||||
{% block sidebar %}{% endblock %} |
||||
{% block body %} |
||||
<form action="" method="post">{% csrf_token %} |
||||
<div class="controls"> |
||||
<p>Вы точно хотите удалить "{{ object.name }}" ?</p> |
||||
<input class="btn btn-large btn-danger delete" type="submit" value="Да" /> |
||||
<a class="btn btn-large btn-primary" href = {% url 'catalog_all' %}>Нет</a> |
||||
</div> |
||||
</form> |
||||
{% endblock %} |
||||
@ -0,0 +1,79 @@ |
||||
{% extends 'base.html' %} |
||||
{% load static %} |
||||
{# Displays article form #} |
||||
|
||||
{% block scripts %} |
||||
{# selects for city and country #} |
||||
<link href="{% static 'js/select/select2.css' %}" rel="stylesheet"/> |
||||
<style> |
||||
.thumb { |
||||
height: 75px; |
||||
border: 1px solid #000; |
||||
margin: 10px 5px 0 0; |
||||
} |
||||
</style> |
||||
<script src="{% static 'js/select/select2.js' %}"></script> |
||||
<script src="{% static 'custom_js/specialist.js' %}?ad=ddd"></script> |
||||
{% endblock %} |
||||
|
||||
{% block body %} |
||||
<form method="post" class="form-horizontal" enctype="multipart/form-data"> {% csrf_token %} |
||||
<fieldset> |
||||
<div class="box span8"> |
||||
<div class="box-header well"> |
||||
<h2><i class="icon-pencil"></i> Добавление отз ва</h2> |
||||
</div> |
||||
<div class="box-content"> |
||||
{# name #} |
||||
<div class="control-group {% if form.name.errors %}error{% endif %}"> |
||||
<label class="control-label"><b>{{ form.name.label }}:</b></label> |
||||
<div class="controls"> |
||||
{{ form.name }}<span class="help-inline"></span> |
||||
<span class="help-inline">{{ form.name.errors }}</span> |
||||
</div> |
||||
</div> |
||||
{# company #} |
||||
<div class="control-group {% if form.company.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.company.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.company }} |
||||
<span class="help-inline">{{ form.company.errors }}</span> |
||||
</div> |
||||
</div> |
||||
{# text #} |
||||
<div class="control-group {% if form.text.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.text.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.text }} |
||||
<span class="help-inline">{{ form.text.errors }}</span> |
||||
</div> |
||||
</div> |
||||
{# catalog #} |
||||
<div class="control-group {% if form.catalog.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.catalog.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.catalog }} |
||||
<span class="help-inline">{{ form.catalog.errors }}</span> |
||||
</div> |
||||
</div> |
||||
{# logo #} |
||||
<div class="control-group {% if form.logo.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.logo.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.logo }} <output id="list"></output> |
||||
<span class="help-inline">{{ form.logo.errors }}</span> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
|
||||
<div class="controls"> |
||||
|
||||
<input class="btn btn-large btn-primary" type="submit" value="Добавить/Изменить" /> |
||||
<input class="btn btn-large" type="reset" value="Отмена"> |
||||
</div> |
||||
</fieldset> |
||||
</form> |
||||
|
||||
{% endblock %} |
||||
@ -0,0 +1,62 @@ |
||||
{% extends 'base.html' %} |
||||
{% load thumbnail %} |
||||
{% 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>Город</th> |
||||
<th>Языки</th> |
||||
<th> </th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{% for item in object_list %} |
||||
<tr> |
||||
|
||||
<td> |
||||
{% thumbnail item.photo "100x100" crop="center" as im %} |
||||
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"> |
||||
{% endthumbnail %}</td> |
||||
<td>{{ item.name }}</td> |
||||
<td>{{ item.city.name }}</td> |
||||
<td>{{ item.languages }}</td> |
||||
<td class="center sorting_1"> |
||||
<a class="btn-small btn-info" href='{% url "specialist_edit" item.id %}'> |
||||
Изменить |
||||
</a> |
||||
</td> |
||||
|
||||
<td> |
||||
<a class="btn-small btn-danger delete" href='{% url "specialist_delete" item.id %}'> |
||||
Удалить |
||||
</a> |
||||
</td> |
||||
</tr> |
||||
{% endfor %} |
||||
</tbody> |
||||
</table> |
||||
<a class="btn btn-success" href='{% url "specialist_new" %}'> |
||||
<i class="icon-plus-sign icon-white"></i> Хочу еще </a> |
||||
</div> |
||||
|
||||
<div class="pagination pagination-centered"> |
||||
<ul> |
||||
{% if page_obj.has_previous %} |
||||
<li> <a href="?page={{ page_obj.previous_page_number }}">←</a></li> |
||||
{% endif %} |
||||
|
||||
{% if page_obj.has_next %} |
||||
<li><a href="?page={{ page_obj.next_page_number }}">→</a></li> |
||||
{% endif %} |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
||||
@ -0,0 +1,11 @@ |
||||
{% extends 'base.html' %} |
||||
{% block sidebar %}{% endblock %} |
||||
{% block body %} |
||||
<form action="" method="post">{% csrf_token %} |
||||
<div class="controls"> |
||||
<p>Вы точно хотите удалить "{{ object.name }}" ?</p> |
||||
<input class="btn btn-large btn-danger delete" type="submit" value="Да" /> |
||||
<a class="btn btn-large btn-primary" href = {% url 'specialist_all' %}>Нет</a> |
||||
</div> |
||||
</form> |
||||
{% endblock %} |
||||
@ -0,0 +1,79 @@ |
||||
{% extends 'base.html' %} |
||||
{% load static %} |
||||
{# Displays article form #} |
||||
|
||||
{% block scripts %} |
||||
{# selects for city and country #} |
||||
<link href="{% static 'js/select/select2.css' %}" rel="stylesheet"/> |
||||
<style> |
||||
.thumb { |
||||
height: 75px; |
||||
border: 1px solid #000; |
||||
margin: 10px 5px 0 0; |
||||
} |
||||
</style> |
||||
<script src="{% static 'js/select/select2.js' %}"></script> |
||||
<script src="{% static 'custom_js/specialist.js' %}?ad=ddd"></script> |
||||
{% endblock %} |
||||
|
||||
{% block body %} |
||||
<form method="post" class="form-horizontal" enctype="multipart/form-data"> {% csrf_token %} |
||||
<fieldset> |
||||
<div class="box span8"> |
||||
<div class="box-header well"> |
||||
<h2><i class="icon-pencil"></i> Добавление специалиста(переводчика)</h2> |
||||
</div> |
||||
<div class="box-content"> |
||||
{# name #} |
||||
<div class="control-group {% if form.name.errors %}error{% endif %}"> |
||||
<label class="control-label"><b>{{ form.name.label }}:</b></label> |
||||
<div class="controls"> |
||||
{{ form.name }}<span class="help-inline"></span> |
||||
<span class="help-inline">{{ form.name.errors }}</span> |
||||
</div> |
||||
</div> |
||||
{# languages #} |
||||
<div class="control-group {% if form.languages.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.languages.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.languages }} |
||||
<span class="help-inline">{{ form.languages.errors }}</span> |
||||
</div> |
||||
</div> |
||||
{# country #} |
||||
<div class="control-group {% if form.country.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.country.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.country }} |
||||
<span class="help-inline">{{ form.country.errors }}</span> |
||||
</div> |
||||
</div> |
||||
{# city #} |
||||
<div class="control-group {% if form.city.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.city.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.city }} |
||||
<span class="help-inline">{{ form.city.errors }}</span> |
||||
</div> |
||||
</div> |
||||
{# photo #} |
||||
<div class="control-group {% if form.photo.errors %}error{% endif %}"> |
||||
<label class="control-label">{{ form.photo.label }}:</label> |
||||
<div class="controls"> |
||||
{{ form.photo }} <output id="list"></output> |
||||
<span class="help-inline">{{ form.photo.errors }}</span> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
|
||||
<div class="controls"> |
||||
|
||||
<input class="btn btn-large btn-primary" type="submit" {% if request.path == '/admin/specialist_catalog/specialist/new/' %} value="Добавить" {% else %} value='Изменить' {% endif %}/> |
||||
<input class="btn btn-large" type="reset" value="Отмена"> |
||||
</div> |
||||
</fieldset> |
||||
</form> |
||||
|
||||
{% endblock %} |
||||
@ -0,0 +1,31 @@ |
||||
{% extends 'base_catalog.html' %} |
||||
|
||||
{% block content_list %} |
||||
|
||||
<div class="page-title"> |
||||
<h1>Запрашиваемая страница не найдена</h1> |
||||
</div> |
||||
<div class="m-article error-404"> |
||||
<span class="figure">404:</span> |
||||
<p class="title">Возможно у нее изменился адрес или же она была удалена.<br> Воспользуйтесь поиском по названию, расширенной формой поиска или каталогом событий.</p> |
||||
<div class="clearfix"></div> |
||||
<hr/> |
||||
<section> |
||||
<h2>Каталог выставок</h2> |
||||
<ul class="items-list"> |
||||
{% for item in expo_themes %} |
||||
<li><i class="fa fa-circle"></i><a href="/expo/theme/{{ item.url }}/">{{ item.name }} ({{ item.expo_count }})</a></li> |
||||
{% endfor %} |
||||
</ul> |
||||
</section> |
||||
<hr/> |
||||
<section > |
||||
<h2>Каталог конференций</h2> |
||||
<ul class="items-list"> |
||||
{% for item in conf_themes %} |
||||
<li><i class="fa fa-circle"></i><a href="/conference/theme/{{ item.url }}/">{{ item.name }} ({{ item.conference_count }})</a></li> |
||||
{% endfor %} |
||||
</ul> |
||||
</section> |
||||
</div> |
||||
{% endblock %} |
||||
@ -1,3 +1,3 @@ |
||||
<div class="so-text"> |
||||
<div class="seo-text"> |
||||
<h2>{{ object.title }}</h2>{{ object.body|safe }} |
||||
</div> |
||||
@ -0,0 +1,326 @@ |
||||
{% extends "client/base_catalog.html" %} |
||||
{% load static %} |
||||
{% load thumbnail %} |
||||
{% load i18n %} |
||||
|
||||
{% block head_scripts %} |
||||
|
||||
{% endblock %} |
||||
|
||||
{% block page_body%} |
||||
<div class="page-body clearfix request-form rq-translator"> |
||||
|
||||
<div class="m-article"> |
||||
|
||||
<div class="item-wrap place clearfix"> |
||||
<aside> |
||||
<div class="i-pict"> |
||||
{% thumbnail object.logo_preview "100x100" crop="center" as im %} |
||||
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"> |
||||
{% endthumbnail %} |
||||
</div> |
||||
</aside> |
||||
|
||||
<div class="i-info"> |
||||
<header> |
||||
<div class="i-title">{{ object.title }}</div> |
||||
</header> |
||||
|
||||
<div class="i-descr"> |
||||
{{ object.main_descr }} |
||||
</div> |
||||
<hr/> |
||||
|
||||
<div class="i-address map-opened country_map"> |
||||
|
||||
{# #} |
||||
<div class="i-map"> |
||||
{% thumbnail object.place_photo "957x400" crop="center" as im %} |
||||
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"> |
||||
{% endthumbnail %} |
||||
</div> |
||||
|
||||
{# <!-- позиция для карты задается в атрибуте data-coords -->#} |
||||
{# <div class="map-canvas" id="map-canvas" data-coords="55.751898,37.545172" ></div>#} |
||||
{# <div class="close-map"><a class="toggle-map" href="#">Скрыть карту</a></div>#} |
||||
{# #} |
||||
{# <header>#} |
||||
{# <div class="show-map show-map_1"><a class="toggle-map" href="#">Раскрыть карту</a></div>#} |
||||
{# </header>#} |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
{{ object.big_cities }} |
||||
<div class="country_towns"> |
||||
<h4>Крупные города:</h4> |
||||
{{ object.big_cities }} |
||||
</div> |
||||
|
||||
<hr /> |
||||
|
||||
<div class="i-services country_content"> |
||||
<div class="i-descr"> |
||||
<h4>Коротко о наших преимуществах:</h4> |
||||
<div style="margin-top:20px;"> |
||||
{{ object.benefits|safe }} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
{# ----------------------------------------- FORM ----------------------------------------------#} |
||||
<div class="rq-form service-page" {% if form.errors %}style="display:block"{% endif %}> |
||||
<form method="post">{% csrf_token %} |
||||
|
||||
<hr /> |
||||
|
||||
<div class="rq-form-sect"> |
||||
|
||||
<div class="rqf-title">{% trans 'Информация о переводе' %}</div> |
||||
|
||||
<div class="mf-line cols-2 rq-trans"> |
||||
|
||||
<div class="mf-field"> |
||||
{{ form.languages }} |
||||
|
||||
</div> |
||||
|
||||
<div class="mf-field"> |
||||
{{ form.themes }} |
||||
|
||||
|
||||
</div> |
||||
</div> |
||||
|
||||
<div class="mf-line"> |
||||
<label>Занятость:</label> |
||||
<div class="mf-field rq-tickets-days rq-num"> |
||||
{{ form.days }} {% trans 'дней' %} |
||||
</div> |
||||
|
||||
<div class="mf-field rq-tickets-num rq-num"> |
||||
{{ form.hours }} {% trans 'часов в день' %} |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="mf-line rq-p-days"> |
||||
<label>{% trans 'Даты работы' %}:</label> |
||||
<div class="mf-field"> |
||||
<div class="period"> |
||||
<div class="pwf-field validate-field{% if form.fr.errors %} error-field{% endif %}"> |
||||
<label>{% trans 'с' %}</label> |
||||
{{ form.fr }} |
||||
<div class="error-blob"> |
||||
{{ form.fr.errors }} |
||||
|
||||
</div> |
||||
</div> |
||||
<div class="pwf-field validate-field{% if form.to.errors %} error-field{% endif %}"> |
||||
<label>{% trans 'по' %}</label> |
||||
{{ form.to }} |
||||
<div class="error-blob"> |
||||
{{ form.to.errors }} |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
<hr /> |
||||
|
||||
<div class="rq-form-sect"> |
||||
|
||||
<div class="rqf-title">{% trans 'Ваши контактные данные' %}</div> |
||||
{% if not object %} |
||||
<div class="mf-line rq-person "> |
||||
<div class="mf-field validate-field{% if form.event.errors %} error-field{% endif %}"> |
||||
{{ form.event }} |
||||
<div class="error-blob"> |
||||
{{ form.event.errors }} |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
{% endif %} |
||||
|
||||
<div class="mf-line rq-person"> |
||||
<div class="mf-field validate-field{% if form.person_inf.errors %} error-field{% endif %}"> |
||||
{{ form.person_inf }} |
||||
<div class="error-blob"> |
||||
{{ form.person_inf.errors }} |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="mf-line cols-2 rq-place"> |
||||
<div class="mf-field validate-field rq-country{% if form.country.errors %} error-field{% endif %}"> |
||||
{{ form.country }} |
||||
<div class="error-blob"> |
||||
{{ form.country.errors }} |
||||
|
||||
</div> |
||||
</div> |
||||
|
||||
<div class="mf-field validate-field rq-city{% if form.city.errors %} error-field{% endif %}"> |
||||
{{ form.city }} |
||||
<div class="error-blob"> |
||||
{{ form.city.errors }} |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="mf-line cols-2 rq-contacts"> |
||||
<div class="mf-field validate-field rq-tel{% if form.phone.errors %} error-field{% endif %}"> |
||||
{{ form.phone }} |
||||
<div class="error-blob"> |
||||
{{ form.phone.errors }} |
||||
|
||||
</div> |
||||
</div> |
||||
|
||||
<div class="mf-field validate-field rq-mail{% if form.person.errors %} error-field{% endif %}"> |
||||
{{ form.person }} |
||||
<div class="error-blob"> |
||||
{{ form.person.errors }} |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
<hr /> |
||||
|
||||
<div class="rq-btn-wrap"> |
||||
|
||||
<div class="rq-order-button"> |
||||
<div class="rqob-wrap"> |
||||
<div class="rqob-button"> |
||||
<button type="submit">{% trans 'отправить запрос' %}</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
</form> |
||||
</div> |
||||
{# ----------------------------------------- END FORM -------------------------------------------#} |
||||
|
||||
<div class="rq-btn-wrap rq-btn-to-hide rq-to-hide"> |
||||
<div class="rqb-cols"> |
||||
<div class="rqb-button"> |
||||
<div class="rq-order-button"> |
||||
<div class="rqob-wrap"> |
||||
<div class="rqob-price">от {{ object.price }} {{ object.currency }} / день</div> |
||||
<div class="rqob-button"> |
||||
<a class="ob-text" href="#">заказать услугу</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
|
||||
|
||||
<hr> |
||||
{% if request.GET.debug == '1' %} |
||||
<script src="{% static 'client/js/_modules/page.translator.js' %}"></script> |
||||
{% else %} |
||||
<script src="{% static 'client/js_min/_modules/page.translator.min.js' %}"></script> |
||||
{% endif %} |
||||
<script> |
||||
EXPO.translator.init({}); |
||||
</script> |
||||
|
||||
|
||||
|
||||
|
||||
{% with object.specialists.all as specialists %} |
||||
{% if specialists %} |
||||
<div class="i-staff"> |
||||
<div class="sect-title">Наши специалисты</div> |
||||
|
||||
<div class="i-staff-list"> |
||||
|
||||
<ul> |
||||
{% for spec in specialists %} |
||||
<li> |
||||
<a href="#"> |
||||
<div class="sl-item clearfix"> |
||||
<div class="sl-pict"> |
||||
{% thumbnail spec.photo "100x100" crop="center" as im %} |
||||
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"> |
||||
{% endthumbnail %} |
||||
</div> |
||||
<div class="sl-info"> |
||||
<div class="sl-info-wrap"> |
||||
<div class="sl-name">{{ spec.name }}</div> |
||||
<div class="sl-position">{{ spec.languages }}</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</a> |
||||
</li> |
||||
|
||||
{% endfor %} |
||||
|
||||
</ul> |
||||
|
||||
</div> |
||||
|
||||
</div> |
||||
{% endif %} |
||||
{% endwith %} |
||||
|
||||
</div> |
||||
{% with object.feedback_set.all as feedbacks %} |
||||
{% if feedbacks %} |
||||
<div class="rq-to-hide"> |
||||
|
||||
<div class="s-comments"> |
||||
<div class="sect-title">Отзывы клиентов:</div> |
||||
<div class="cat-list sc-comments"> |
||||
{% for feedback in feedbacks %} |
||||
<div class="cl-item"> |
||||
<div class="cl-item-wrap clearfix"> |
||||
|
||||
<div class="cli-pict"> |
||||
{% thumbnail feedback.logo "100x100" crop="center" as im %} |
||||
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}"> |
||||
{% endthumbnail %} |
||||
</div> |
||||
<div class="cli-info"> |
||||
<div class="cli-top clearfix"> |
||||
<header> |
||||
<div class="cli-title">{{ feedback.company }}</div> |
||||
</header> |
||||
</div> |
||||
|
||||
<div class="sc-name">{{ feedback.name }}</div> |
||||
|
||||
<div class="sc-text"> |
||||
{{ feedback.text }} |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
{% endif %} |
||||
{% endwith %} |
||||
|
||||
</div> |
||||
|
||||
{% endblock %} |
||||
@ -0,0 +1,148 @@ |
||||
{% extends "client/base_catalog.html" %} |
||||
|
||||
|
||||
{% block styles %} |
||||
<style> |
||||
.thumb { |
||||
height: 175px; |
||||
border: 1px solid #000; |
||||
|
||||
} |
||||
|
||||
</style> |
||||
{% endblock %} |
||||
|
||||
{% block content_list %} |
||||
{{ wizard.form.media }} |
||||
|
||||
<div class="page-title"> |
||||
<h1>Добавить событие</h1> |
||||
</div> |
||||
|
||||
<div class="page-body clearfix"> |
||||
<form action="" method="post" enctype="multipart/form-data">{% csrf_token %} |
||||
|
||||
|
||||
<div class="set-sect p-form adm-form passed"> |
||||
<div class="set-sect-title clearfix"> |
||||
<h3>Шаг 1. Основная информация</h3> |
||||
|
||||
<div class="afh-right"> |
||||
<button name="wizard_goto_step" type="submit" class="button icon-edit" |
||||
value="{{ wizard.steps.first }}">изменить |
||||
</button> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
<div class="set-sect p-form adm-form passed"> |
||||
<div class="set-sect-title clearfix"> |
||||
<h3>Шаг 2. Статистика и условия участия</h3> |
||||
|
||||
<div class="afh-right"> |
||||
<button name="wizard_goto_step" type="submit" class="button icon-edit" |
||||
value="{{ wizard.steps.prev }}">изменить |
||||
</button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="set-sect p-form adm-form"> |
||||
<div class="set-sect-title clearfix"> |
||||
<h3>Шаг 3. Добавление фото</h3> |
||||
|
||||
<div class="afh-right"> |
||||
<div class="sst-info"><b>+ 1,2 балла</b> к рейтингу</div> |
||||
</div> |
||||
</div> |
||||
{{ form.errors }} |
||||
{{ wizard.management_form }} |
||||
{% if wizard.form.forms %} |
||||
{{ wizard.form.management_form }} |
||||
{% for form in wizard.form.forms %} |
||||
{{ form }} |
||||
{% endfor %} |
||||
{% else %} |
||||
{% with wizard.form as form %} |
||||
<hr/> |
||||
<div class="mf-photos-list"> |
||||
<div class="mfpl-button-line"> |
||||
<div class="mfpl-button"> |
||||
{{ form.attachments }} |
||||
</div> |
||||
|
||||
<div class="mfpl-text"> |
||||
<p>более полная информация повышает рейтинг вашего мероприятия и позволяет |
||||
ранжировать его выше других</p> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
<ul id="list"></ul> |
||||
<div class="a-bot-buttons-line clearfix"> |
||||
|
||||
<div class="abb-left"> |
||||
<button class="button big grey a-more" type="submit">пропустить этот шаг</button> |
||||
</div> |
||||
|
||||
<div class="abb-right"> |
||||
<button id="next" class="button big orange a-more" type="submit">далее</button> |
||||
</div> |
||||
<div id="res"> </div> |
||||
|
||||
</div> |
||||
{% endwith %} |
||||
{% endif %} |
||||
</div> |
||||
</form> |
||||
|
||||
</div> |
||||
<!-- for response debugging --> |
||||
{% comment %} <script> |
||||
$("#next").click(function(e){ |
||||
e.preventDefault(); |
||||
$.ajax({url: '/wizard/ajax/', success: function(result){ |
||||
$("#res").html(result); |
||||
}}); |
||||
}); |
||||
</script>{% endcomment %} |
||||
|
||||
<script type="text/javascript"> |
||||
var cnt = 0; |
||||
function handleFileSelect(evt) { |
||||
var files = evt.target.files; // FileList object |
||||
|
||||
// Loop through the FileList and render image files as thumbnails. |
||||
for (var i = 0, f; f = files[i]; i++) { |
||||
|
||||
// Only process image files. |
||||
if (!f.type.match('image.*')) { |
||||
continue; |
||||
} |
||||
|
||||
var reader = new FileReader(); |
||||
|
||||
// Closure to capture the file information. |
||||
reader.onload = (function (theFile) { |
||||
return function (e) { |
||||
// Render thumbnail. |
||||
var div = document.createElement('div'); |
||||
|
||||
div.innerHTML = ['<li><div class="mfpli-pict"> <img class="thumb" src="', e.target.result, |
||||
'" title="', theFile.name, |
||||
'"/></div>', '<div class="mfpli-body"> <div class="mf-line full-width"> <div class="mf-field"> <textarea name="pdescr_', |
||||
cnt.toString(), '" cols="30" rows="10" placeholder="Описание"></textarea></div></div>', |
||||
'</li>'].join(''); |
||||
cnt +=1 ; |
||||
document.getElementById('list').insertBefore(div, null); |
||||
}; |
||||
})(f); |
||||
|
||||
// Read in the image file as a data URL. |
||||
reader.readAsDataURL(f); |
||||
} |
||||
} |
||||
|
||||
document.getElementById('files').addEventListener('change', handleFileSelect, false); |
||||
</script> |
||||
{% endblock %} |
||||
@ -1,3 +0,0 @@ |
||||
from django.db import models |
||||
|
||||
# Create your models here. |
||||
@ -1,8 +1,7 @@ |
||||
from django.conf.urls import patterns |
||||
from django.conf.urls import patterns, url |
||||
from .views import ExpoWizard |
||||
from .forms import ExpoForm1, ExpoForm2,ExpoForm3 |
||||
|
||||
from wizard.forms import ExpoForm1, ExpoForm2 |
||||
from wizard.views import ExpoWizard |
||||
formlist = [ExpoForm1,ExpoForm2, ExpoForm3] |
||||
|
||||
urlpatterns = patterns('', |
||||
(r'^$', ExpoWizard.as_view([ExpoForm1, ExpoForm2])) |
||||
) |
||||
urlpatterns = patterns('', url(r'^$', ExpoWizard.as_view(formlist), name = 'add_exposition')) |
||||
Loading…
Reference in new issue