parent
4706d1eeb4
commit
9b7037c34d
12 changed files with 0 additions and 873 deletions
@ -1,2 +0,0 @@ |
|||||||
Должен был быть модуль для добавления событий и других даных через кабинет пользователя. |
|
||||||
Остановленна разработка по ненадобности, так как делается функционал добавление событий через црм |
|
||||||
@ -1,76 +0,0 @@ |
|||||||
# -*- coding: utf-8 -*- |
|
||||||
from django import forms |
|
||||||
from theme.models import Theme |
|
||||||
from place_exposition.models import PlaceExposition |
|
||||||
from country.models import Country |
|
||||||
from multiupload.fields import MultiFileField, MultiFileInput |
|
||||||
from django.utils.translation import ugettext as _ |
|
||||||
|
|
||||||
|
|
||||||
choices = ((0, ''), (1.0, _(u'Ежегодно')), (2.0, _(u'2 раза в год')), (3.0, _(u'3 раза в год')), (4.0, _(u'4 раза в год')), |
|
||||||
(5.0, _(u'5 раз в год')), (0.5, _(u'Раз в 2 года')), ( |
|
||||||
0.33, _(u'Раз в 3 года')), (0.25, _(u'Раз в 4 года'))) |
|
||||||
|
|
||||||
places = [(item.id, item.name) for item in PlaceExposition.objects.language().all()] |
|
||||||
places.insert(0,('', _(u'Не выбрано'))) |
|
||||||
|
|
||||||
|
|
||||||
class ExpoForm1(forms.Form): |
|
||||||
""" |
|
||||||
main information about exposition |
|
||||||
""" |
|
||||||
name = forms.CharField(max_length=255, widget=forms.TextInput(attrs={'placeholder': _(u"Введите название выставки")})) |
|
||||||
main_title = forms.CharField(max_length=255, widget=forms.TextInput(attrs={'placeholder': _(u"Краткое описание выставки (необязательно)")})) |
|
||||||
description = forms.CharField(widget=forms.Textarea(attrs={'placeholder': _(u"Полное описание выставки"), 'cols':30, 'rows':10})) |
|
||||||
date_start = forms.DateField(widget=forms.TextInput(attrs={'class':'data dateFrom', 'placeholder':_(u'дд.мм.гг')})) |
|
||||||
date_end = forms.DateField(widget=forms.TextInput(attrs={'class':'data dateTo','placeholder':_(u'дд.мм.гг')})) |
|
||||||
|
|
||||||
country = forms.ChoiceField(label=_(u'Страна'), choices=[(c.id, c.name) for c in Country.objects.all()], widget=forms.Select(attrs={'id':'id_country'})) |
|
||||||
theme = forms.MultipleChoiceField(label=_('Тематики'), choices=[(item.id, item.name) for item in Theme.objects.language().all()], widget=forms.SelectMultiple(attrs={'id':'id_theme'})) |
|
||||||
place = forms.ChoiceField(label=_(u'Место проведения'), required=False, choices=places, widget=forms.Select(attrs={'id':'id_place'})) |
|
||||||
city = forms.CharField(label=_(u'Город'), widget=forms.HiddenInput(attrs={'id':'id_city'})) |
|
||||||
tag = forms.CharField(label=_(u'Теги'), widget=forms.HiddenInput(attrs={'id':'id_tag'}), required=False) |
|
||||||
|
|
||||||
audience1 = forms.BooleanField(required=False) |
|
||||||
audience2 = forms.BooleanField(required=False) |
|
||||||
audience3 = forms.BooleanField(required=False) |
|
||||||
periodic = forms.ChoiceField(choices=choices, required=False) |
|
||||||
membership1 = forms.BooleanField(required=False) |
|
||||||
membership2 = forms.BooleanField(required=False) |
|
||||||
membership3 = forms.BooleanField(required=False) |
|
||||||
web_site = forms.URLField(required=False, widget=forms.TextInput(attrs={'placeholder': _(u"Веб-сайт (необязательно)")})) |
|
||||||
products = forms.CharField(widget=forms.Textarea(attrs={'placeholder': _(u"Экспонируемые продукты"), 'cols':30, 'rows':10})) |
|
||||||
time_start = forms.TimeField() |
|
||||||
time_end = forms.TimeField() |
|
||||||
logo = forms.ImageField(widget=forms.FileInput(attrs={'class':"button big icon-clip"}), required=False) |
|
||||||
|
|
||||||
|
|
||||||
class ExpoForm2(forms.Form): |
|
||||||
""" |
|
||||||
statistics |
|
||||||
""" |
|
||||||
found_year = forms.IntegerField() |
|
||||||
# ticket price |
|
||||||
pre_one_day = forms.FloatField(widget=forms.TextInput(attrs={'placeholder':_(u'на один день')})) |
|
||||||
pre_all_days = forms.FloatField(widget=forms.TextInput(attrs={'placeholder':_(u'на все дни')})) |
|
||||||
one_day = forms.FloatField(widget=forms.TextInput(attrs={'placeholder':_(u'на один день')})) |
|
||||||
all_days = forms.FloatField(widget=forms.TextInput(attrs={'placeholder':_(u'на все дни')})) |
|
||||||
|
|
||||||
# rent price |
|
||||||
equiped = forms.FloatField(widget=forms.TextInput(attrs={'placeholder':_(u'оборудованная площадь')})) |
|
||||||
unequiped = forms.FloatField(widget=forms.TextInput(attrs={'placeholder':_(u'необорудованная площадь')})) |
|
||||||
open_square = forms.FloatField(widget=forms.TextInput(attrs={'placeholder':_(u'открытая площадь')})) |
|
||||||
min_square = forms.FloatField() |
|
||||||
registration_depos = forms.FloatField() |
|
||||||
deadline_date = forms.DateField(widget=forms.TextInput(attrs={'placeholder':_(u'дд.мм.гг')})) |
|
||||||
|
|
||||||
|
|
||||||
class ExpoForm3(forms.Form): |
|
||||||
""" |
|
||||||
photos from last expositions |
|
||||||
""" |
|
||||||
attachments = MultiFileField(min_num=0, max_num=6, max_file_size=1024*1024*5, widget=MultiFileInput( |
|
||||||
attrs={'class':'button big icon-camera', 'value': _(u'выберите фотографии'), 'id': 'files'} |
|
||||||
)) |
|
||||||
|
|
||||||
|
|
||||||
@ -1,16 +0,0 @@ |
|||||||
""" |
|
||||||
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) |
|
||||||
@ -1,7 +0,0 @@ |
|||||||
from django.conf.urls import patterns, url |
|
||||||
from .views import ExpoWizard |
|
||||||
from .forms import ExpoForm1, ExpoForm2,ExpoForm3 |
|
||||||
|
|
||||||
formlist = [ExpoForm1,ExpoForm2, ExpoForm3] |
|
||||||
|
|
||||||
urlpatterns = patterns('', url(r'^$', ExpoWizard.as_view(formlist), name = 'add_exposition')) |
|
||||||
@ -1,131 +0,0 @@ |
|||||||
from django.contrib.formtools.wizard.views import SessionWizardView |
|
||||||
from django.core.files.storage import FileSystemStorage |
|
||||||
from django.http import HttpResponseRedirect, HttpResponseForbidden |
|
||||||
from django.conf import settings |
|
||||||
from django.contrib.auth.decorators import login_required |
|
||||||
from django.utils.decorators import method_decorator |
|
||||||
from django.core.exceptions import PermissionDenied |
|
||||||
|
|
||||||
import os |
|
||||||
from photologue.models import Photo |
|
||||||
from exposition.models import Exposition |
|
||||||
from functions.form_check import translit_with_separator |
|
||||||
from accounts.models import User |
|
||||||
from country.models import Country |
|
||||||
from city.models import City |
|
||||||
from place_exposition.models import PlaceExposition |
|
||||||
from theme.models import Tag, Theme |
|
||||||
|
|
||||||
class LoginRequiredMixin(object): |
|
||||||
@method_decorator(login_required) |
|
||||||
def dispatch(self, request, *args, **kwargs): |
|
||||||
if not request.user.organiser: |
|
||||||
raise PermissionDenied |
|
||||||
return super(LoginRequiredMixin, self).dispatch(request, *args, **kwargs) |
|
||||||
|
|
||||||
|
|
||||||
# defining different template for every form |
|
||||||
TEMPLATES = { |
|
||||||
'0': 'client/wizard/first_step.html', |
|
||||||
'1': 'client/wizard/second_step.html', |
|
||||||
'2': 'client/wizard/third_step.html' |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
class ExpoWizard(LoginRequiredMixin, SessionWizardView): |
|
||||||
|
|
||||||
"""main view that handle all data from 3 forms(steps) and finally create an Exposition""" |
|
||||||
|
|
||||||
# storing temporary files during upload |
|
||||||
location = os.path.join(settings.MEDIA_ROOT, 'temp') |
|
||||||
file_storage = FileSystemStorage(location, settings.MEDIA_URL) |
|
||||||
SUCCESS_URL = "/" |
|
||||||
|
|
||||||
def get_template_names(self): |
|
||||||
return [TEMPLATES[self.steps.current]] |
|
||||||
|
|
||||||
def done(self, form_list, **kwargs): |
|
||||||
# getting data and files |
|
||||||
upload_logo = form_list[0].cleaned_data.get('logo') |
|
||||||
upload_images = self.request.FILES.getlist(u'2-attachments') |
|
||||||
data = self.get_all_cleaned_data() |
|
||||||
|
|
||||||
# creating new exposition |
|
||||||
lang = self.request.LANGUAGE_CODE |
|
||||||
expo = Exposition.objects.language(lang).create( |
|
||||||
name=data.get('name'), |
|
||||||
data_begin=data.get('date_start'), |
|
||||||
data_end=data.get('date_end'), |
|
||||||
main_title=data.get('main_title'), |
|
||||||
description=data.get('description'), |
|
||||||
products=data.get('products'), |
|
||||||
|
|
||||||
country=Country.objects.language(lang).get(id=data.get('country')), |
|
||||||
city=City.objects.language(lang).get(id=data.get('city')), |
|
||||||
place=PlaceExposition.objects.language(lang).get(id=data.get('place')), |
|
||||||
|
|
||||||
periodic=data.get('periodic'), |
|
||||||
web_page=data.get('web_site'), |
|
||||||
logo=data.get('logo'), |
|
||||||
|
|
||||||
foundation_year=data.get('found_year'), |
|
||||||
area=data.get('square'), |
|
||||||
price_day=data.get('one_day'), |
|
||||||
price_all=data.get('all_days'), |
|
||||||
price_day_bar=data.get('pre_one_day'), |
|
||||||
price_all_bar=data.get('pre_all_days'), |
|
||||||
|
|
||||||
min_area=data.get('min_square'), |
|
||||||
registration_payment=data.get('registration_depos'), |
|
||||||
application_deadline=data.get('deadline_date'), |
|
||||||
min_closed_area=data.get('unequiped'), |
|
||||||
min_open_area=data.get('open_square'), |
|
||||||
min_closed_equipped_area=data.get('equiped'), |
|
||||||
url=translit_with_separator(data.get('name')), |
|
||||||
quality_label=0, |
|
||||||
audience=0, |
|
||||||
creator=User.objects.get(id=self.request.user.id) |
|
||||||
) |
|
||||||
# adding photo to gallery |
|
||||||
photos = [] |
|
||||||
for i, photo in enumerate(upload_images): |
|
||||||
photos.append(Photo.objects.language(self.request.LANGUAGE_CODE).create( |
|
||||||
image=photo, |
|
||||||
title=data.get(u'pdescr_%i' % i, photo.name)) |
|
||||||
) |
|
||||||
for photo in photos: |
|
||||||
expo.upload_photo(photo) |
|
||||||
|
|
||||||
expo.tag = Tag.objects.language(lang).filter(id__in=data.get('tag').split(',')) |
|
||||||
expo.theme = Theme.objects.language(lang).filter(id__in=data.get('theme')) |
|
||||||
|
|
||||||
# setting bit fields audience and quality_label |
|
||||||
self.set_flags(expo, data) |
|
||||||
expo.save() |
|
||||||
|
|
||||||
# remove temporary files if it has any |
|
||||||
if upload_logo: |
|
||||||
self.file_storage.delete(upload_logo.name) |
|
||||||
if upload_images: |
|
||||||
for f in upload_images: |
|
||||||
self.file_storage.delete(f.name) |
|
||||||
|
|
||||||
return HttpResponseRedirect(self.SUCCESS_URL) |
|
||||||
|
|
||||||
@staticmethod |
|
||||||
def set_flags(expo, data): |
|
||||||
if data['membership1']: |
|
||||||
expo.quality_label = (expo.quality_label | Exposition.quality_label.exporating) |
|
||||||
if data['membership2']: |
|
||||||
expo.quality_label = (expo.quality_label | Exposition.quality_label.rsva) |
|
||||||
if data['membership3']: |
|
||||||
expo.quality_label = (expo.quality_label | Exposition.quality_label.ufi) |
|
||||||
|
|
||||||
if data['audience1']: |
|
||||||
expo.audience = (expo.audience | Exposition.audience.experts) |
|
||||||
if data['audience2']: |
|
||||||
expo.audience = expo.audience | getattr(Exposition.audience, 'experts and consumers') |
|
||||||
if data['audience3']: |
|
||||||
expo.audience = expo.audience | (getattr(Exposition.audience, 'general public')) |
|
||||||
|
|
||||||
|
|
||||||
@ -1,209 +0,0 @@ |
|||||||
{% extends 'client/base_catalog.html' %} |
|
||||||
{% load static %} |
|
||||||
{% load i18n %} |
|
||||||
|
|
||||||
{% block head_scripts %} |
|
||||||
<script src="{% static 'js/select/select2.js' %}"></script> |
|
||||||
<script src="{% static 'custom_js/wizard.js' %}"></script> |
|
||||||
{% endblock %} |
|
||||||
|
|
||||||
{% block content_list %} |
|
||||||
{{ form.errors }} |
|
||||||
<div class="page-body clearfix"> |
|
||||||
<div class="set-sect p-form adm-form"> |
|
||||||
<div class="set-sect-title clearfix"> |
|
||||||
{{ wizard.form.media }} |
|
||||||
<h3>{% blocktrans with step=wizard.steps.step1%}Шаг {{ step }}. Основная информация{% endblocktrans %}</h3> |
|
||||||
</div> |
|
||||||
<form action="" enctype="multipart/form-data" method="post">{% csrf_token %} |
|
||||||
{{ wizard.management_form }} |
|
||||||
{% with wizard.form as form %} |
|
||||||
<div class="adm-form-body"> |
|
||||||
<div class="mf-line "> |
|
||||||
<div class="mf-field"> |
|
||||||
<label>{% trans "Тематика:" %}</label> |
|
||||||
{{ form.theme }} |
|
||||||
</div> |
|
||||||
<div class="mf-field"> |
|
||||||
<label>{% trans "Теги:" %}</label> |
|
||||||
{{ form.tag }} |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<hr/> |
|
||||||
|
|
||||||
<h2>{% trans "Описание выставки" %}</h2> |
|
||||||
|
|
||||||
<div class="mf-line"> |
|
||||||
<div class="mf-field"> |
|
||||||
{{ form.name }} |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="mf-line full-width"> |
|
||||||
<div class="mf-field"> |
|
||||||
{{ form.main_title }} |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="mf-line full-width"> |
|
||||||
<div class="mf-field"> |
|
||||||
{{ form.description }} |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<hr/> |
|
||||||
|
|
||||||
<div id="dates-range" class="mf-line"> |
|
||||||
<label class="h2">{% trans "Даты проведения:" %}</label> |
|
||||||
|
|
||||||
<div class="mf-field"> |
|
||||||
<div class="period"> |
|
||||||
<div class="pwf-field"> |
|
||||||
<label>{% trans "с" %}</label> |
|
||||||
{{ form.date_start }} |
|
||||||
</div> |
|
||||||
<div class="pwf-field"> |
|
||||||
<label>{% trans "по" %}</label> |
|
||||||
{{ form.date_end }} |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<hr/> |
|
||||||
|
|
||||||
<div class="mfs-location"> |
|
||||||
|
|
||||||
<h2>{% trans "Локация" %}</h2> |
|
||||||
|
|
||||||
<div class="mf-line"> |
|
||||||
<div class="mf-field"> |
|
||||||
<h3>{% trans "Место проведения:" %}</h3> |
|
||||||
{{ form.place }} |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="mf-line"> |
|
||||||
<div class="mf-field"> |
|
||||||
<h3>{% trans "Страна:" %}</h3> |
|
||||||
{{ form.country }} |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="mf-field"> |
|
||||||
<h3>{% trans "Город:" %}</h3> |
|
||||||
{{ form.city }} |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
<hr/> |
|
||||||
|
|
||||||
<div class="mfs-additional"> |
|
||||||
<h2>{% trans "Дополнительная информация" %}</h2> |
|
||||||
|
|
||||||
<div class="mf-line mf-targets"> |
|
||||||
<label>{% trans "Аудитория:" %}</label> |
|
||||||
|
|
||||||
<div class="mf-field"> |
|
||||||
|
|
||||||
<div class="clearfix"> |
|
||||||
<div class="mff-col"> |
|
||||||
<label class="checkbox">{{ form.audience1 }}{% trans "специалисты" %}</label> |
|
||||||
<label class="checkbox">{{ form.audience2 }}{% trans "специалисты и потребители" %}</label> |
|
||||||
<label class="checkbox">{{ form.audience3 }}{% trans "широкая публика" %}</label> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="mff-col"> |
|
||||||
{% trans "Периодичность:" %} |
|
||||||
{{ form.periodic }} |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<hr/> |
|
||||||
|
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="mf-line mf-membership"> |
|
||||||
<label>{% trans "Членства и знаки качества:" %}</label> |
|
||||||
|
|
||||||
<div class="mf-field"> |
|
||||||
<label class="checkbox">{{ form.membership1 }}Exporating</label> |
|
||||||
<label class="checkbox">{{ form.membership2 }}RSVA</label> |
|
||||||
<label class="checkbox">{{ form.membership3 }}UFI</label> |
|
||||||
<hr/> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="mf-line mf-prod"> |
|
||||||
<div class="mf-field"> |
|
||||||
{{ form.web_site }} |
|
||||||
|
|
||||||
{{ form.products }} |
|
||||||
|
|
||||||
<hr/> |
|
||||||
|
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="mf-line mf-time"> |
|
||||||
<label>{% trans "Время работы:" %}</label> |
|
||||||
|
|
||||||
<div id="work-time" class="mf-field"> |
|
||||||
<div class="w-time"> |
|
||||||
<div class="w-time-wrap"> |
|
||||||
<label>c</label> |
|
||||||
{{ form.time_start }} |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="w-time-wrap"> |
|
||||||
<label>до</label> |
|
||||||
{{ form.time_end }} |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
<hr/> |
|
||||||
|
|
||||||
<div class="mf-line mf-logo"> |
|
||||||
<label class="h2">{% trans "Логотип:" %}</label> |
|
||||||
|
|
||||||
<div class="mf-field"> |
|
||||||
<div class="input-file clearfix"> |
|
||||||
{{ form.logo }} |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<hr/> |
|
||||||
</div> |
|
||||||
<div class="a-bot-buttons-line clearfix"> |
|
||||||
|
|
||||||
<div class="abb-right"> |
|
||||||
<input class="button big orange a-more" type="submit" value="Дале >"/> |
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
|
|
||||||
</form> |
|
||||||
|
|
||||||
{% endwith %} |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="set-sect p-form adm-form not-active"> |
|
||||||
<div class="set-sect-title clearfix"> |
|
||||||
<h3>{% trans "Шаг 2. Статистика и условия участия" %}</h3> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="set-sect p-form adm-form not-active"> |
|
||||||
<div class="set-sect-title clearfix"> |
|
||||||
<h3>{% trans "Шаг 3. Добавление фото" %}</h3> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
<hr/> |
|
||||||
{% endblock %} |
|
||||||
@ -1,259 +0,0 @@ |
|||||||
{% extends 'client/base_catalog.html' %} |
|
||||||
{% load static %} |
|
||||||
{% load i18n %} |
|
||||||
|
|
||||||
{% block head_scripts %} |
|
||||||
<script src="{% static 'js/select/select2.js' %}"></script> |
|
||||||
<script> |
|
||||||
$(document).ready(function () { |
|
||||||
$('select').select2({ |
|
||||||
width: 'element', |
|
||||||
allowClear: true |
|
||||||
}); |
|
||||||
}); |
|
||||||
</script> |
|
||||||
{% endblock %} |
|
||||||
|
|
||||||
|
|
||||||
{% block content_list %} |
|
||||||
{{ form.errors }} |
|
||||||
<div class="page-title"> |
|
||||||
<h1>{% trans "Добавить событие" %}</h1> |
|
||||||
</div> |
|
||||||
<div class="page-body clearfix"> |
|
||||||
<form action="" method="post">{% csrf_token %} |
|
||||||
|
|
||||||
{{ wizard.form.media }} |
|
||||||
<div class="set-sect p-form adm-form passed"> |
|
||||||
<div class="set-sect-title clearfix"> |
|
||||||
<h3>{% trans "Шаг 1. Основная информация" %}</h3> |
|
||||||
|
|
||||||
<div class="afh-right"> |
|
||||||
<button name="wizard_goto_step" type="submit" class="button icon-edit" |
|
||||||
value="{{ wizard.steps.prev }}">{% trans "изменить" %} |
|
||||||
</button> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
|
|
||||||
<div class="set-sect p-form adm-form"> |
|
||||||
<div class="set-sect-title clearfix"> |
|
||||||
<h3>{% trans "Шаг 2. Статистика и условия участия" %}</h3> |
|
||||||
|
|
||||||
<div class="afh-right"> |
|
||||||
<div class="sst-info">{% blocktrans %}<b>+ 0,9 баллов</b> к рейтингу{% endblocktrans %}</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
{{ 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="mfs-additional mf-stat"> |
|
||||||
|
|
||||||
<div class="mf-line mf-prod mf-short-input"> |
|
||||||
<label>{% trans "Год основания:" %}</label> |
|
||||||
{{ form.found_year }} |
|
||||||
<div class="mf-field"> |
|
||||||
|
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<hr/> |
|
||||||
|
|
||||||
<h2>{% trans "Стоимость посещения и участия" %}</h2> |
|
||||||
|
|
||||||
<div class="e-price-wrap"> |
|
||||||
<div class="epr-layout"> |
|
||||||
|
|
||||||
<div class="eprl-col"> |
|
||||||
<div class="eprl-col-wrap"> |
|
||||||
|
|
||||||
<div class="epr-subtitle">{% trans "Стоимость билетов" %}</div> |
|
||||||
|
|
||||||
<div class="tp-wrap"> |
|
||||||
|
|
||||||
<ul class="pr-list"> |
|
||||||
|
|
||||||
<li> |
|
||||||
{{ form.one_day }} |
|
||||||
<select name="oneDayCurrency1"> |
|
||||||
<option value="rur">{% trans "руб" %}</option> |
|
||||||
<option value="usd">usd</option> |
|
||||||
<option value="eur">eur</option> |
|
||||||
</select> |
|
||||||
</li> |
|
||||||
|
|
||||||
<li> |
|
||||||
{{ form.all_days }} |
|
||||||
<select name="allDaysCurrency1"> |
|
||||||
<option value="rur">{% trans "руб" %}</option> |
|
||||||
<option value="usd">usd</option> |
|
||||||
<option value="eur">eur</option> |
|
||||||
</select> |
|
||||||
</li> |
|
||||||
|
|
||||||
</ul> |
|
||||||
|
|
||||||
<div class="tp-descr">{% trans "Предварительная регистрация" %}</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
|
|
||||||
<hr/> |
|
||||||
|
|
||||||
<div class="tp-wrap"> |
|
||||||
|
|
||||||
<ul class="pr-list"> |
|
||||||
|
|
||||||
<li> |
|
||||||
{{ form.pre_one_day }} |
|
||||||
<select name="oneDayCurrency2"> |
|
||||||
<option value="1">{% trans "руб" %}</option> |
|
||||||
<option value="2">usd</option> |
|
||||||
<option value="3">eur</option> |
|
||||||
</select> |
|
||||||
</li> |
|
||||||
|
|
||||||
<li> |
|
||||||
{{ form.pre_all_days }} |
|
||||||
<select name="allDaysCurrency2"> |
|
||||||
<option value="1">{% trans "руб" %}</option> |
|
||||||
<option value="2">usd</option> |
|
||||||
<option value="3">eur</option> |
|
||||||
</select> |
|
||||||
</li> |
|
||||||
|
|
||||||
</ul> |
|
||||||
|
|
||||||
<div class="tp-descr grey">{% trans "Регистрация на стойке" %}</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="eprl-col"> |
|
||||||
<div class="eprl-col-wrap"> |
|
||||||
|
|
||||||
<div class="epr-subtitle">{% trans "Стоимость аренды 1м²" %}</div> |
|
||||||
|
|
||||||
<ul class="pr-list"> |
|
||||||
|
|
||||||
<li> |
|
||||||
{{ form.equiped }} |
|
||||||
<select name="areaCurrency1"> |
|
||||||
<option value="1">руб</option> |
|
||||||
<option value="2">usd</option> |
|
||||||
<option value="3">eur</option> |
|
||||||
</select> |
|
||||||
</li> |
|
||||||
|
|
||||||
<li> |
|
||||||
{{ form.unequiped }} |
|
||||||
<select name="areaCurrency2"> |
|
||||||
<option value="1">{% trans "руб" %}</option> |
|
||||||
<option value="2">usd</option> |
|
||||||
<option value="3">eur</option> |
|
||||||
</select> |
|
||||||
</li> |
|
||||||
|
|
||||||
<li> |
|
||||||
{{ form.open_square }} |
|
||||||
<select name="areaCurrency3"> |
|
||||||
<option value="1">{% trans "руб" %}</option> |
|
||||||
<option value="2">usd</option> |
|
||||||
<option value="3">eur</option> |
|
||||||
</select> |
|
||||||
</li> |
|
||||||
|
|
||||||
</ul> |
|
||||||
|
|
||||||
<hr/> |
|
||||||
|
|
||||||
<div class="mf-line mf-min-area"> |
|
||||||
<label>{% trans "Минимальная площадь:" %}</label> |
|
||||||
|
|
||||||
<div class="mf-field"> |
|
||||||
{{ form.min_square }} |
|
||||||
м² |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<hr/> |
|
||||||
|
|
||||||
<div class="mf-line mf-reg-payment"> |
|
||||||
<label>{% trans "Регистрационный взнос:" %}</label> |
|
||||||
|
|
||||||
<div class="mf-field"> |
|
||||||
{{ form.registration_depos }} |
|
||||||
<select name="areaCurrency3"> |
|
||||||
<option value="1">{% trans "руб" %}</option> |
|
||||||
<option value="2">usd</option> |
|
||||||
<option value="3">eur</option> |
|
||||||
</select> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<hr/> |
|
||||||
|
|
||||||
<div class="mf-line mf-deadline"> |
|
||||||
<label>{% trans "Крайний срок подачи заявки:" %}</label> |
|
||||||
|
|
||||||
<div class="mf-field"> |
|
||||||
<div class="period"> |
|
||||||
<div class="pwf-field"> |
|
||||||
{{ form.deadline_date }} |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<hr/> |
|
||||||
|
|
||||||
<div class="a-bot-buttons-line clearfix"> |
|
||||||
|
|
||||||
<div class="abb-left"> |
|
||||||
<div class="mfpl-button-line"> |
|
||||||
{# <div class="mfpl-button">#} |
|
||||||
{# <a class="button big grey a-more" href="#">пропустить этот шаг</a>#} |
|
||||||
{# </div>#} |
|
||||||
|
|
||||||
<div class="mfpl-text"> |
|
||||||
<p>{% trans "более полная информация повышает рейтинг вашего мероприятия и позволяет ранжировать его выше других" %}</p> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
<button class="button big orange a-more" type="submit">{% trans "Дале" %}</button> |
|
||||||
|
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
<div class="set-sect p-form adm-form passed"> |
|
||||||
<div class="set-sect-title clearfix"> |
|
||||||
<h3>{% trans "Шаг 3. Добавление фото" %}</h3> |
|
||||||
|
|
||||||
|
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</form> |
|
||||||
</div> |
|
||||||
|
|
||||||
{% endwith %} |
|
||||||
{% endif %} |
|
||||||
|
|
||||||
{% endblock %} |
|
||||||
@ -1,147 +0,0 @@ |
|||||||
{% extends "client/base_catalog.html" %} |
|
||||||
{% load i18n %} |
|
||||||
|
|
||||||
{% block styles %} |
|
||||||
<style> |
|
||||||
.thumb { |
|
||||||
height: 175px; |
|
||||||
border: 1px solid #000; |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
</style> |
|
||||||
{% endblock %} |
|
||||||
|
|
||||||
{% block content_list %} |
|
||||||
{{ wizard.form.media }} |
|
||||||
|
|
||||||
<div class="page-title"> |
|
||||||
<h1>{% trans "Добавить событие" %}</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>{% trans "Шаг 1. Основная информация" %}</h3> |
|
||||||
|
|
||||||
<div class="afh-right"> |
|
||||||
<button name="wizard_goto_step" type="submit" class="button icon-edit" |
|
||||||
value="{{ wizard.steps.first }}">{% trans "изменить" %} |
|
||||||
</button> |
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<div class="set-sect p-form adm-form passed"> |
|
||||||
<div class="set-sect-title clearfix"> |
|
||||||
<h3>{% trans "Шаг 2. Статистика и условия участия" %}</h3> |
|
||||||
|
|
||||||
<div class="afh-right"> |
|
||||||
<button name="wizard_goto_step" type="submit" class="button icon-edit" |
|
||||||
value="{{ wizard.steps.prev }}">{% trans "изменить" %} |
|
||||||
</button> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<div class="set-sect p-form adm-form"> |
|
||||||
<div class="set-sect-title clearfix"> |
|
||||||
<h3>{% trans "Шаг 3. Добавление фото" %}</h3> |
|
||||||
|
|
||||||
<div class="afh-right"> |
|
||||||
<div class="sst-info">{% blocktrans %}<b>+ 1,2 балла</b> к рейтингу{% endblocktrans %}</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>{% trans "более полная информация повышает рейтинг вашего мероприятия и позволяет ранжировать его выше других" %}</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">{% trans "пропустить этот шаг" %}</button> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="abb-right"> |
|
||||||
<button id="next" class="button big orange a-more" type="submit">{% trans "далее" %}</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,25 +0,0 @@ |
|||||||
{% extends 'client/base_catalog.html' %} |
|
||||||
{% load i18n %} |
|
||||||
|
|
||||||
{% block content_list %} |
|
||||||
{{ wizard.form.media }} |
|
||||||
<p>{% blocktrans with step=wizard.steps.step1 count=wizard.steps.count %}Step {{ step }} of {{ count }}{% endblocktrans %}</p> |
|
||||||
<form action="" method="post">{% csrf_token %} |
|
||||||
<table> |
|
||||||
{{ wizard.management_form }} |
|
||||||
{% if wizard.form.forms %} |
|
||||||
{{ wizard.form.management_form }} |
|
||||||
{% for form in wizard.form.forms %} |
|
||||||
{{ form }} |
|
||||||
{% endfor %} |
|
||||||
{% else %} |
|
||||||
{{ wizard.form }} |
|
||||||
{% endif %} |
|
||||||
</table> |
|
||||||
{% if wizard.steps.prev %} |
|
||||||
<button name="wizard_goto_step" type="submit" value="{{ wizard.steps.first }}"> "{% trans "first step" %}" </button> |
|
||||||
<button name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}"> "{% trans "prev step" %}"</button> |
|
||||||
{% endif %} |
|
||||||
<input type="submit" value= "submit"/> |
|
||||||
</form> |
|
||||||
{% endblock %} |
|
||||||
Loading…
Reference in new issue