Changeset 8685 for main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
- Timestamp:
- 12 Jun 2012, 07:17:01 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
r7833 r8685 38 38 from waeup.kofa.hostels.interfaces import ( 39 39 IHostelsContainer, IHostel, IBed, IBedAllocateStudent) 40 from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget 40 41 41 42 def write_log_message(view, message): … … 105 106 label = _('Accommodation Section') 106 107 pnav = 5 108 form_fields = grok.AutoFields(IHostelsContainer) 109 form_fields[ 110 'startdate'].custom_widget = FriendlyDatetimeDisplayWidget('le') 111 form_fields[ 112 'enddate'].custom_widget = FriendlyDatetimeDisplayWidget('le') 107 113 108 114 class HostelsContainerManageActionButton(ManageActionButton): … … 113 119 text = _('Manage accommodation section') 114 120 115 class HostelsContainerManagePage(Kofa DisplayFormPage):121 class HostelsContainerManagePage(KofaEditFormPage): 116 122 """The manage page for hostel containers. 117 123 """ … … 122 128 pnav = 5 123 129 label = _('Manage accommodation section') 130 form_fields = grok.AutoFields(IHostelsContainer) 131 taboneactions = [_('Save')] 132 tabtwoactions = [_('Add hostel'), _('Remove selected')] 124 133 125 134 def update(self): 135 tabs.need() 136 self.tab1 = self.tab2 = self.tab3 = self.tab4 = '' 137 qs = self.request.get('QUERY_STRING', '') 138 if not qs: 139 qs = 'tab1' 140 setattr(self, qs, 'active') 126 141 warning.need() 142 datatable.need() 127 143 return super(HostelsContainerManagePage, self).update() 128 144 … … 146 162 def addSubunit(self, **data): 147 163 self.redirect(self.url(self.context, 'addhostel')) 164 return 165 166 @action(_('Save'), style='primary') 167 def save(self, **data): 168 self.applyData(self.context, **data) 169 self.flash(_('Settings have been saved.')) 148 170 return 149 171
Note: See TracChangeset for help on using the changeset viewer.