Пример #1
0
 def _process_conference(self):
     form = ConferenceLayoutForm(obj=self._get_form_defaults(),
                                 event=self.event)
     css_form = CSSForm()
     logo_form = LogoForm()
     tt_theme_settings_form = _make_theme_settings_form(
         self.event, form.timetable_theme.data)
     tt_form_valid = tt_theme_settings_form.validate_on_submit(
     ) if tt_theme_settings_form else True
     if form.validate_on_submit() and tt_form_valid:
         if tt_theme_settings_form:
             layout_settings.set(self.event, 'timetable_theme_settings',
                                 tt_theme_settings_form.data)
         else:
             layout_settings.delete(self.event, 'timetable_theme_settings')
         data = {
             unicode(key): value
             for key, value in form.data.iteritems()
             if key in layout_settings.defaults
         }
         layout_settings.set_multi(self.event, data)
         if form.theme.data == '_custom':
             layout_settings.set(self.event, 'use_custom_css', True)
         flash(_('Settings saved'), 'success')
         return redirect(url_for('.index', self.event))
     else:
         if self.event.logo_metadata:
             logo_form.logo.data = self.event
         if self.event.has_stylesheet:
             css_form.css_file.data = self.event
     return WPLayoutEdit.render_template(
         'layout_conference.html',
         self.event,
         form=form,
         logo_form=logo_form,
         css_form=css_form,
         timetable_theme_settings_form=tt_theme_settings_form)