Ignore:
Timestamp:
14 Dec 2014, 15:45:55 (10 years ago)
Author:
Henrik Bettermann
Message:

We do not need the HTMLDisplayWidget. Use simple helper function instead. Tests will follow.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/browser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/browser/layout.py

    r11958 r12229  
    201201            if 'address' in widget.name or \
    202202                'comment' in widget.name or \
     203                'description' in widget.name or \
    203204                'notice' in widget.name:
    204                 widget.height = 6
    205         if self.widgets.get('transcript_comment'):
    206             self.widgets['transcript_comment'].height = 12
    207         if self.widgets.get('jamb_subjects'):
    208             self.widgets['jamb_subjects'].height = 6
     205                widget.height = 3
    209206
    210207class IkobaAddFormPage(UtilityView,AddForm):
  • main/waeup.ikoba/trunk/src/waeup/ikoba/browser/pages.py

    r12192 r12229  
    4242from zope.session.interfaces import ISession
    4343from zope.password.interfaces import IPasswordManager
     44from waeup.ikoba.utils.helpers import html2dict
    4445from waeup.ikoba.browser.layout import (
    4546    IkobaPage, IkobaForm, IkobaEditFormPage, IkobaAddFormPage,
     
    6061
    6162from waeup.ikoba.authentication import LocalRoleSetEvent
    62 from waeup.ikoba.widgets.htmlwidget import HTMLDisplayWidget
    6363from waeup.ikoba.utils.helpers import get_user_account, check_csv_charset
    6464from waeup.ikoba.mandates.mandate import PasswordMandate
     
    723723#
    724724
    725 class ConfigurationContainerDisplayFormPage(IkobaDisplayFormPage):
    726     """View page of the configuration container.
    727     """
    728     grok.require('waeup.managePortalConfiguration')
    729     grok.name('view')
    730     grok.context(IConfigurationContainer)
    731     pnav = 0
    732     label = _(u'View portal configuration')
    733     form_fields = grok.AutoFields(IConfigurationContainer)
    734     form_fields['frontpage'].custom_widget = HTMLDisplayWidget
    735 
    736 
    737725class ConfigurationContainerManageFormPage(IkobaEditFormPage):
    738726    """Manage page of the configuration container. We always use the
     
    747735        'frontpage_dict')
    748736
    749     def _frontpage(self):
    750         view = ConfigurationContainerDisplayFormPage(
    751             self.context,self.request)
    752         view.setUpWidgets()
    753         return view.widgets['frontpage']()
    754 
    755737    @action(_('Save'), style='primary')
    756738    def save(self, **data):
    757739        msave(self, **data)
    758         self.context.frontpage_dict = self._frontpage()
     740        frontpage = getattr(self.context, 'frontpage', None)
     741        portal_language = getUtility(IIkobaUtils).PORTAL_LANGUAGE
     742        self.context.frontpage_dict = html2dict(frontpage, portal_language)
    759743        return
    760744
Note: See TracChangeset for help on using the changeset viewer.