Ignore:
Timestamp:
25 Feb 2012, 12:52:38 (13 years ago)
Author:
Henrik Bettermann
Message:

Set fallback and default frontpages if frontpage attribute is an empty string.

Remove title attribute from University objects. The titke should be part of the frontpage ReST.

Tests will follow.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt

    r7700 r7703  
    3535  >>> print browser.contents
    3636  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
    37   ...Welcome to the...
     37  ...Welcome to...
    3838  ...
    3939
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py

    r7702 r7703  
    285285    grok.context(IUniversity)
    286286    pnav = 0
    287 
    288     @property
    289     def label(self):
    290         return self.context['configuration'].title
     287    label = ''
    291288
    292289    @property
     
    294291        portal_language = getUtility(ISIRPUtils).PORTAL_LANGUAGE
    295292        lang = self.request.cookies.get('sirp.language', portal_language)
    296         return self.context['configuration'].frontpage_dict.get(lang,'')
     293        html = self.context['configuration'].frontpage_dict.get(lang,'')
     294        if html =='':
     295            html = self.context[
     296                'configuration'].frontpage_dict.get(portal_language,'')
     297        if html =='':
     298            return _(u'<h1>Welcome to WAeUP.SIRP</h1>')
     299        else:
     300            return html
    297301
    298302class AdministrationPage(SIRPPage):
  • main/waeup.sirp/trunk/src/waeup/sirp/frontpage.rst

    r7702 r7703  
     1Welcome to the Student Information and Registration Portal
     2==========================================================
     3
    14This is the default frontpage of the portal written
    25in `reStructuredText (reST)
     
    3235
    3336>>de<<
     37Willkommen im Studenteninformations- und Registrierungsportal
     38=============================================================
     39
    3440Dies ist die Standard-Startseite des Portals. Sie wurde in der Markup-Sprache
    3541`reStructuredText (reST) <http://docutils.sourceforge.net/docs/user/rst/quickref.html>`_
  • main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py

    r7702 r7703  
    398398        )
    399399
    400     title = schema.TextLine(
    401         title = u'Title of Frontpage',
    402         default = u'Welcome to the Student Information and Registration ' +
    403                   u'Portal of Sample University',
    404         required = False,
    405         )
    406 
    407400    skin = schema.Choice(
    408401        title = u'Skin',
  • main/waeup.sirp/trunk/src/waeup/sirp/widgets/restwidget.py

    r7702 r7703  
    4343            value = self.context.default
    4444        if value == self.context.missing_value:
    45             return ""
     45            return {}
    4646        parts = value.split('>>')
    4747        elements = {}
Note: See TracChangeset for help on using the changeset viewer.