Changeset 15972
- Timestamp:
- 31 Jan 2020, 16:16:18 (5 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r15970 r15972 4 4 1.6.1.dev0 (unreleased) 5 5 ======================= 6 7 * Add `AccommodationDisplayFormPage`. 6 8 7 9 * Don't allow students to add former courses in course lists. -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r15970 r15972 2221 2221 omit_fields=self.omit_fields) 2222 2222 2223 class AccommodationDisplayFormPage(KofaDisplayFormPage): 2224 """ Page to view bed tickets. 2225 This manage form page is for both students and students officers. 2226 """ 2227 grok.context(IStudentAccommodation) 2228 grok.name('index') 2229 grok.require('waeup.viewStudent') 2230 form_fields = grok.AutoFields(IStudentAccommodation) 2231 grok.template('accommodationpage') 2232 pnav = 4 2233 with_hostel_selection = True 2234 2235 @property 2236 def label(self): 2237 return _('${a}: Accommodation', 2238 mapping = {'a':self.context.__parent__.display_fullname}) 2239 2240 @property 2241 def desired_hostel(self): 2242 if self.context.desired_hostel == 'no': 2243 return _('No favoured hostel') 2244 if self.context.desired_hostel: 2245 hostel = grok.getSite()['hostels'].get(self.context.desired_hostel) 2246 if hostel is not None: 2247 return hostel.hostel_name 2248 return 2249 2250 def update(self): 2251 if checkPermission('waeup.handleAccommodation', self.context): 2252 self.redirect(self.url(self.context, 'manage')) 2223 2253 2224 2254 class AccommodationManageFormPage(KofaEditFormPage): … … 2228 2258 """ 2229 2259 grok.context(IStudentAccommodation) 2230 grok.name(' index')2260 grok.name('manage') 2231 2261 grok.require('waeup.handleAccommodation') 2232 2262 form_fields = grok.AutoFields(IStudentAccommodation) … … 2482 2512 grok.context(IBedTicket) 2483 2513 grok.name('index') 2484 grok.require('waeup. handleAccommodation')2514 grok.require('waeup.viewStudent') 2485 2515 form_fields = grok.AutoFields(IBedTicket).omit('bed_coordinates') 2486 2516 form_fields['booking_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') … … 2497 2527 grok.context(IBedTicket) 2498 2528 grok.name('bed_allocation_slip.pdf') 2499 grok.require('waeup. handleAccommodation')2529 grok.require('waeup.viewStudent') 2500 2530 form_fields = grok.AutoFields(IBedTicket).omit('bed_coordinates') 2501 2531 form_fields['booking_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r15970 r15972 561 561 self.browser.getLink("Accommodation").click() 562 562 self.assertEqual(self.browser.headers['Status'], '200 Ok') 563 self.assertEqual(self.browser.url, self.acco_path) 563 # We have been redirected to the manage page 564 self.assertEqual(self.browser.url, self.acco_path + '/manage') 564 565 self.browser.open(self.student_path) 565 566 self.browser.getLink("History").click() -
main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
r15843 r15972 131 131 grok.order(7) 132 132 grok.name('studentmanageaccommodationlink') 133 grok.require('waeup. handleAccommodation')133 grok.require('waeup.viewStudent') 134 134 link = 'accommodation' 135 135 text = _(u'Accommodation') … … 549 549 grok.context(IBedTicket) 550 550 grok.view(BedTicketDisplayFormPage) 551 grok.require('waeup. handleAccommodation')551 grok.require('waeup.viewStudent') 552 552 icon = 'actionicon_pdf.png' 553 553 text = _('Download bed allocation slip')
Note: See TracChangeset for help on using the changeset viewer.