Changeset 7243
- Timestamp:
- 1 Dec 2011, 10:11:59 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 3 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r7240 r7243 234 234 grok.order(3) 235 235 grok.require('waeup.viewApplicationsTab') 236 grok.template('primarynavtab')237 236 pnav = 3 238 237 tab_title = u'Applicants' … … 252 251 253 252 # Also zope.manager has role Anonymous. 254 # To avoid displaying this tab, uncomment the following. 255 #def tab_title(self): 256 # userid = self.request.principal.id 257 # if userid != 'zope.anybody': 258 # tt = u'' 259 # else: 260 # tt = u'Application' 261 # return tt 253 # To avoid displaying this tab, we have to check the principal id too. 254 @property 255 def link_target(self): 256 if self.request.principal.id == 'zope.anybody': 257 return self.view.application_url('applicants') 258 return 262 259 263 260 class MyApplicationDataTab(PrimaryStudentNavTab): … … 266 263 grok.order(3) 267 264 grok.require('waeup.viewMyApplicationDataTab') 268 grok.template('primarynavtab')269 265 pnav = 3 270 266 tab_title = u'My Data' -
main/waeup.sirp/trunk/src/waeup/sirp/browser/layout.py
r7240 r7243 44 44 default_waeup_edit_template.__grok_name__ = 'default_waeup_edit_form' 45 45 46 default_primary_nav_template = grokcore.view.PageTemplateFile( 47 os.path.join('templates', 'primarynavtab.pt')) 48 default_primary_nav_template.__grok_name__ = 'default_primary_nav' 49 46 50 47 51 def NullValidator(*args, **kw): -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/primarynavtab.pt
r4789 r7243 1 <li tal:attributes="class viewlet/active" >1 <li tal:attributes="class viewlet/active" tal:condition="viewlet/link_target"> 2 2 <a href="#" 3 3 tal:attributes="href viewlet/link_target" -
main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py
r7231 r7243 30 30 from waeup.sirp.interfaces import (IWAeUPObject, IWAeUPXMLExporter, 31 31 IWAeUPXMLImporter, IDataCenter, IUserAccount) 32 from waeup.sirp.browser.layout import WAeUPPage 32 from waeup.sirp.browser.layout import WAeUPPage, default_primary_nav_template 33 33 from waeup.sirp.utils.helpers import get_user_account 34 34 … … 571 571 grok.order(1) 572 572 grok.require('waeup.Public') 573 template = default_primary_nav_template 573 574 574 575 pnav = 0 # This is a kind of id of a tab. If some page provides … … 600 601 grok.order(1) 601 602 grok.require('waeup.Public') 602 grok.template('primarynavtab')603 603 604 604 pnav = 0 … … 610 610 grok.order(2) 611 611 grok.require('waeup.viewAcademics') 612 grok.template('primarynavtab')613 612 614 613 pnav = 1 … … 628 627 grok.order(6) 629 628 grok.require('waeup.Anonymous') 630 grok.template('primarynavtab')631 629 tab_title = u'Enquiries' 632 630 pnav = 2 633 631 632 # Also zope.manager has role Anonymous. 633 # To avoid displaying this tab, we have to check the principal id too. 634 634 @property 635 635 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 637 639 638 640 # -
main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser.py
r7195 r7243 28 28 from waeup.sirp.browser.breadcrumbs import Breadcrumb 29 29 from waeup.sirp.browser.resources import datepicker, datatable, tabs, toggleall 30 from waeup.sirp.browser.layout import default_primary_nav_template 31 from waeup.sirp.browser.pages import delSubobjects 30 32 from waeup.sirp.browser.viewlets import ( 31 33 ManageActionButton, PrimaryNavTab, AddActionButton) … … 34 36 FriendlyDateWidget, FriendlyDateDisplayWidget, 35 37 FriendlyDatetimeDisplayWidget) 36 from waeup.sirp.browser.pages import delSubobjects37 38 from waeup.sirp.authentication import get_principal_role_manager 38 39 from waeup.sirp.hostels.container import HostelsContainer … … 68 69 grok.order(5) 69 70 grok.require('waeup.viewHostels') 70 grok.template('primarynavtab') 71 71 template = default_primary_nav_template 72 72 pnav = 5 73 73 tab_title = u'Hostels' -
main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py
r7240 r7243 25 25 from waeup.sirp.browser import DEFAULT_IMAGE_PATH 26 26 from waeup.sirp.browser.viewlets import PrimaryNavTab 27 from waeup.sirp.browser.layout import default_primary_nav_template 27 28 from waeup.sirp.students.browser import ( 28 29 StudentClearanceDisplayFormPage, StudentClearanceManageFormPage, … … 164 165 grok.order(4) 165 166 grok.require('waeup.viewStudentsTab') 166 grok.template('primarynavtab')167 167 168 168 pnav = 4 … … 183 183 grok.baseclass() 184 184 grok.viewletmanager(PrimaryStudentNavManager) 185 grok.template('primarynavtab')185 template = default_primary_nav_template 186 186 grok.order(1) 187 187 grok.require('waeup.Authenticated')
Note: See TracChangeset for help on using the changeset viewer.