conference alternative text admin support

remotes/origin/1203
Ivan Kovalkovskyi 10 years ago
parent a2c4b55f5b
commit e70f80d80a
  1. 4
      conference/admin.py
  2. 2
      conference/forms.py
  3. 7
      templates/admin/conference/conference.html
  4. 10
      templates/admin/conference/conference_add.html
  5. 2
      templates/admin/theme/theme_blog_new.html

@ -159,7 +159,7 @@ def conference_change(request, url):
#initial StatisticFormSet
StatisticFormSet = modelformset_factory(Statistic, form=StatisticForm, exclude=('conference',))
#fill form with data from database
data = {'web_page':conference.web_page, 'foundation_year': conference.foundation_year,
data = {'web_page':conference.web_page, 'place_alt': conference.place_alt, 'foundation_year': conference.foundation_year,
'data_begin':conference.data_begin, 'data_end':conference.data_end, 'currency':conference.currency,
'tax':conference.tax, 'min_price':conference.min_price, 'max_price':conference.max_price,
'link':conference.link, 'conference_id':conference.id, 'expohit': conference.expohit,
@ -233,7 +233,7 @@ class ConferenceView(AdminView):
return super(ConferenceView, self).get_form(form_class)
obj = self.set_obj()
if obj:
data = {'web_page':obj.web_page, 'foundation_year': obj.foundation_year,
data = {'web_page':obj.web_page, 'place_alt':obj.place_alt, 'foundation_year': obj.foundation_year,
'data_begin':obj.data_begin, 'data_end':obj.data_end, 'currency':obj.currency,
'tax':obj.tax, 'min_price':obj.min_price, 'max_price':obj.max_price,
'link':obj.link, 'conference_id':obj.id, 'expohit': obj.expohit, 'periodic':obj.periodic,

@ -56,6 +56,7 @@ class ConferenceCreateForm(forms.Form):
place = forms.ChoiceField(label=u'Место проведения', required=False,
choices=places)
place_alt = forms.CharField(label = u"Альтернативное название места", required=False)
#creates select input with empty choices cause it will be filled with ajax
city = forms.CharField(label=u'Город', widget=forms.HiddenInput())
@ -160,6 +161,7 @@ class ConferenceCreateForm(forms.Form):
conference.canceled = data['canceled']
conference.moved = data['moved']
conference.periodic = data['periodic']
conference.place_alt = data['place_alt']
# generates bitfield
flag = 0
if data['quality_label']:

@ -134,6 +134,13 @@
<span class="help-inline">{{ form.place.errors }}</span>
</div>
</div>
{# place_alt #}
<div class="control-group {% if form.place_alt.errors %}error{% endif %}">
<label class="control-label">{{ form.place_alt.label }}:</label>
<div class="controls">{{ form.place_alt }}
<span class="help-inline">{{ form.place_alt.errors }}</span>
</div>
</div>
{# theme #}
<div class="control-group {% if form.theme.errors %}error{% endif %}">
<label class="control-label"><b>{{ form.theme.label }}:</b></label>

@ -47,7 +47,7 @@
<div class="box span8" >
<div class="box-header well">
<h2><i class="icon-pencil"></i> Основная информация</h2>
<h2><i class="icon-pencil"></i> Основная информаdция</h2>
</div>
<div class="box-content">
{# Hidden inputs uses for comparing with TmpFile objects #}
@ -99,6 +99,14 @@
<span class="help-inline">{{ form.place.errors }}</span>
</div>
</div>
{# place #}
<div class="control-group {% if form.place_alt.errors %}error{% endif %}">
<label class="control-label">{{ form.place_alt.label }}:</label>
<div class="controls">{{ form.place_alt }}
<span class="help-inline">{{ form.place_alt.errors }}</span>
</div>
</div>
{# theme #}
<div class="control-group {% if form.theme.errors %}error{% endif %}">
<label class="control-label"><b>{{ form.theme.label }}:</b></label>

@ -17,7 +17,7 @@
<form method="post" class="form-horizontal"> {% csrf_token %}{{ form.errors }}
<fieldset>
<legend><i class="icon-edit"></i>{% if theme_id %} Изменить {% else %} Добавить {% endif %}тему</legend>
<legend><i class="icon-edit"></i>{% if object %} Изменить {% else %} Добавить {% endif %}тему</legend>
<div class="box span8">
<div class="box-header well">
<h2><i class="icon-pencil"></i> Информация</h2>

Loading…
Cancel
Save