Ignore:
Timestamp:
1 Dec 2011, 10:11:59 (13 years ago)
Author:
Henrik Bettermann
Message:

Use only one primarynavtab.pt pagetemplate and render list item only if link_target is provided.

Provide link_target of EnquiriesTab? and ApplicantsAnonTab? only if principal id is zope.anybody.

File:
1 edited

Legend:

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

    r7231 r7243  
    3030from waeup.sirp.interfaces import (IWAeUPObject, IWAeUPXMLExporter,
    3131                                   IWAeUPXMLImporter, IDataCenter, IUserAccount)
    32 from waeup.sirp.browser.layout import WAeUPPage
     32from waeup.sirp.browser.layout import WAeUPPage, default_primary_nav_template
    3333from waeup.sirp.utils.helpers import get_user_account
    3434
     
    571571    grok.order(1)
    572572    grok.require('waeup.Public')
     573    template = default_primary_nav_template
    573574
    574575    pnav = 0 # This is a kind of id of a tab. If some page provides
     
    600601    grok.order(1)
    601602    grok.require('waeup.Public')
    602     grok.template('primarynavtab')
    603603
    604604    pnav = 0
     
    610610    grok.order(2)
    611611    grok.require('waeup.viewAcademics')
    612     grok.template('primarynavtab')
    613612
    614613    pnav = 1
     
    628627    grok.order(6)
    629628    grok.require('waeup.Anonymous')
    630     grok.template('primarynavtab')
    631629    tab_title = u'Enquiries'
    632630    pnav = 2
    633631
     632    # Also zope.manager has role Anonymous.
     633    # To avoid displaying this tab, we have to check the principal id too.
    634634    @property
    635635    def link_target(self):
    636         return self.view.application_url('enquiries')
     636        if self.request.principal.id == 'zope.anybody':
     637            return self.view.application_url('enquiries')
     638        return
    637639
    638640#
Note: See TracChangeset for help on using the changeset viewer.