- Timestamp:
- 20 Sep 2012, 08:49:37 (12 years ago)
- Location:
- main/waeup.kofa/branches/uli-zc-async
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/uli-zc-async
- Property svn:mergeinfo changed
-
main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/hostels/browser.py
r9166 r9209 93 93 94 94 def title(self): 95 co = self.context. getBedCoordinates()95 co = self.context.coordinates 96 96 return _('Block ${a}, Room ${b}, Bed ${c}', 97 97 mapping = {'a':co[1], 'b':co[2], 'c':co[3]}) … … 130 130 form_fields = grok.AutoFields(IHostelsContainer) 131 131 taboneactions = [_('Save')] 132 tabtwoactions = [_('Add hostel'), _('Remove selected')] 132 tabtwoactions = [_('Add hostel'), 133 _('Clear all hostels'), 134 _('Remove selected')] 133 135 134 136 def update(self): … … 164 166 return 165 167 168 @jsaction(_('Clear all hostels')) 169 def clearHostels(self, **data): 170 self.context.clearAllHostels() 171 self.flash(_('All hostels cleared.')) 172 write_log_message(self, 'all hostels cleared') 173 self.redirect(self.url(self.context, '@@manage')+'?tab2') 174 return 175 166 176 @action(_('Save'), style='primary') 167 177 def save(self, **data): … … 232 242 tabtwoactions = [_('Update all beds'), 233 243 _('Switch reservation of selected beds'), 234 _('Release selected beds')] 244 _('Release selected beds'), 245 _('Clear hostel')] 235 246 not_occupied = NOT_OCCUPIED 236 247 … … 243 254 tabs.need() 244 255 datatable.need() 256 warning.need() 245 257 self.tab1 = self.tab2 = '' 246 258 qs = self.request.get('QUERY_STRING', '') … … 327 339 return 328 340 341 @jsaction(_('Clear hostel')) 342 def clearHostel(self, **data): 343 self.context.clearHostel() 344 self.flash(_('Hostel cleared.')) 345 write_log_message(self, 'cleared') 346 self.redirect(self.url(self.context, '@@manage')+'?tab2') 347 return 348 329 349 class BedManageFormPage(KofaEditFormPage): 330 350 """ View to edit bed data … … 334 354 grok.require('waeup.manageHostels') 335 355 form_fields = grok.AutoFields(IBedAllocateStudent).omit( 336 'bed_id' ).omit('bed_number').omit('bed_type')356 'bed_id', 'bed_number', 'bed_type') 337 357 label = _('Allocate student') 338 358 pnav = 5
Note: See TracChangeset for help on using the changeset viewer.