- Timestamp:
- 12 Jan 2012, 11:43:29 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/branches/henrik-bootstrap/src/waeup/sirp/students/browser.py
r7451 r7453 36 36 SIRPPage, SIRPEditFormPage, SIRPAddFormPage, SIRPDisplayFormPage, 37 37 ContactAdminForm, SIRPForm) 38 from waeup.sirp.browser.interfaces import ICaptchaManager 38 from waeup.sirp.browser.interfaces import ICaptchaManager, IBreadcrumbIgnorable 39 39 from waeup.sirp.browser.breadcrumbs import Breadcrumb 40 40 from waeup.sirp.browser.resources import datepicker, datatable, tabs, warning … … 64 64 from waeup.sirp.applicants.interfaces import IApplicantBaseData 65 65 from waeup.sirp.hostels.hostel import NOT_OCCUPIED 66 from waeup.sirp.utils.helpers import get_current_principal 66 67 67 68 def write_log_message(view, message): … … 96 97 grok.context(IStudentsContainer) 97 98 title = 'Students' 99 #grok.implements(IBreadcrumbIgnorable) 100 101 @property 102 def target(self): 103 user = get_current_principal() 104 #import pdb; pdb.set_trace() 105 if getattr(user, 'user_type', None) == 'student': 106 return None 107 return self.viewname 98 108 99 109 class StudentBreadcrumb(Breadcrumb): … … 131 141 grok.context(IStudentAccommodation) 132 142 title = 'Accommodation' 133 134 #@property135 #def target(self):136 # prm = get_principal_role_manager()137 # principal = get_current_principal()138 # roles = [x[0] for x in prm.getRolesForPrincipal(principal.id)]139 # if 'waeup.Student' in roles:140 # return 'index'141 # else:142 # return 'manage'143 143 144 144 class BedTicketBreadcrumb(Breadcrumb):
Note: See TracChangeset for help on using the changeset viewer.