- Timestamp:
- 19 May 2011, 20:47:07 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r6110 r6153 2 2 ## browser.py 3 3 ## Login : <uli@pu.smp.net> 4 ## Started on Sun Jun 27 11:03:10 2010 Uli Fouquet 4 ## Started on Sun Jun 27 11:03:10 2010 Uli Fouquet & Henrik Bettermann 5 5 ## $Id$ 6 6 ## … … 29 29 from zope.interface import Invalid 30 30 from zope.securitypolicy.interfaces import IPrincipalRoleManager 31 from zope.traversing.browser import absoluteURL 31 32 32 33 from waeup.sirp.browser import ( … … 36 37 from waeup.sirp.browser.layout import NullValidator 37 38 from waeup.sirp.browser.resources import datepicker, tabs, datatable 38 from waeup.sirp.browser.viewlets import ManageActionButton, PrimaryNavTab 39 from waeup.sirp.browser.viewlets import ( 40 ManageActionButton, PrimaryNavTab, LeftSidebarLink 41 ) 39 42 from waeup.sirp.image.browser.widget import ( 40 43 ThumbnailWidget, EncodingImageFileWidget, … … 49 52 MultiListWidget, MultiListDisplayWidget) 50 53 51 from waeup.sirp.applicants import ResultEntry, Applicant 54 from waeup.sirp.applicants import ResultEntry, Applicant, get_applicant_data 52 55 from waeup.sirp.applicants.interfaces import ( 53 56 IApplicant, IApplicantPrincipal, IApplicantPDEEditData, … … 71 74 grok.context(IApplicantsRoot) 72 75 grok.name('index') 76 grok.require('waeup.Public') 73 77 title = 'Applicants' 74 78 label = 'Application Section' … … 182 186 """ 183 187 grok.context(IApplicantsRoot) 184 title = u'Applica nts'188 title = u'Application Section' 185 189 186 190 class ApplicantsContainerBreadcrumb(Breadcrumb): … … 188 192 """ 189 193 grok.context(IApplicantsContainer) 194 195 class ApplicantBreadcrumb(Breadcrumb): 196 """A breadcrumb for applicants. 197 """ 198 grok.context(IApplicant) 199 200 @property 201 def title(self): 202 """Get a title for a context. 203 """ 204 return self.context.access_code 190 205 191 206 class ApplicantsTab(PrimaryNavTab): 192 """ Faculties-tab in primary navigation.207 """Applicants tab in primary navigation. 193 208 """ 194 209 … … 210 225 grok.context(IApplicantsContainer) 211 226 grok.name('index') 227 grok.require('waeup.Public') 212 228 grok.template('applicantscontainerpage') 213 229 pnav = 3 … … 242 258 form_fields['startdate'].custom_widget = FriendlyDateWidget('le') 243 259 form_fields['enddate'].custom_widget = FriendlyDateWidget('le') 260 grok.require('waeup.manageUniversity') 244 261 245 262 @property … … 283 300 grok.context(IApplicantsContainer) 284 301 grok.name('login') 285 grok.require(' zope.Public')302 grok.require('waeup.Public') 286 303 287 304 @property … … 327 344 self.redirect(self.url(self.context[pin], 'edit')) 328 345 return 346 347 class AccessCodeLink(LeftSidebarLink): 348 grok.order(1) 349 grok.require('waeup.Public') 350 351 def render(self): 352 if not IApplicantPrincipal.providedBy(self.request.principal): 353 return '' 354 access_code = getattr(self.request.principal,'access_code',None) 355 if access_code: 356 applicant_object = get_applicant_data(access_code) 357 url = absoluteURL(applicant_object, self.request) 358 return u'<div class="portlet"><a href="%s">%s</a></div>' % ( 359 url,access_code) 360 return '' 329 361 330 362 class DisplayApplicant(WAeUPDisplayFormPage):
Note: See TracChangeset for help on using the changeset viewer.