Changeset 5917 for main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
- Timestamp:
- 6 Apr 2011, 09:41:06 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r5524 r5917 125 125 grok.context(IUniversity) 126 126 grok.require('waeup.manageUniversity') 127 title = u'Edit settings'127 title = u'Edit portal settings' 128 128 pnav = 0 129 129 … … 140 140 self.flash('Settings have been saved.') 141 141 return 142 143 142 @grok.action('Cancel', validator=NullValidator) 144 143 def cancel(self, **data): … … 152 151 self.flash('Plugins were updated. See log file for details.') 153 152 self.redirect(self.url(self.context)) 153 return 154 155 class RemoveFormPage(WAeUPPage): 156 grok.require('waeup.manageUniversity') 157 grok.name('remove') 158 grok.template('removesubobjectspage') 159 pnav = 1 160 161 def update(self): 162 form = self.request.form 163 if 'CANCEL' in form.keys(): 164 self.redirect(self.url(self.context)) 165 if not 'REMOVE' in form.keys(): 166 return 167 child_id = form['val_id'] 168 if not isinstance(child_id, list): 169 child_id = [child_id] 170 deleted = [] 171 for id in child_id: 172 try: 173 del self.context[id] 174 deleted.append(id) 175 except: 176 self.flash('Could not delete %s: %s: %s' % ( 177 id, sys.exc_info()[0], sys.exc_info()[1])) 178 if len(deleted): 179 self.flash('Successfully removed: %s' % ', '.join(deleted)) 180 # We have to redirect to let flash messages appear immediately... 181 self.redirect(self.url()) 154 182 return 155 183 … … 221 249 grok.name('add') 222 250 form_fields = grok.AutoFields(IUserAccount) 223 label = ' Add user'251 label = '' 224 252 title = 'Add user' 225 253 … … 318 346 grok.template('contactadminform') 319 347 grok.require('waeup.Public') 320 pnav = 3348 pnav = 2 321 349 322 350 def title(self): … … 839 867 grok.name('add') 840 868 form_fields = grok.AutoFields(IFaculty) 841 label = ' Add a faculty'842 title = 'Add afaculty'869 label = '' 870 title = 'Add faculty' 843 871 pnav = 1 844 872 … … 858 886 return 859 887 self.redirect(self.url(self.context)) 860 861 class ManageFacultyContainerPage(WAeUPPage): 862 """ Manage Page 888 889 @grok.action('Cancel') 890 def cancel(self, **data): 891 self.redirect(self.url(self.context)) 892 893 class RemoveFacultyFormPage(RemoveFormPage): 894 """ Remove Faculty Page 863 895 """ 864 896 grok.context(IFacultyContainer) 865 grok.require('waeup.manageUniversity') 866 grok.template('facultycontainermanagepage') 867 grok.name('manage') 868 title = "Manage Faculties" 869 pnav = 1 870 871 def update(self): 872 form = self.request.form 873 if 'CANCEL' in form.keys(): 874 self.redirect(self.url(self.context)) 875 if not 'DELETE' in form.keys(): 876 return 877 fac_id = form['fac_id'] 878 if not isinstance(fac_id, list): 879 fac_id = [fac_id] 880 deleted = [] 881 for id in fac_id: 882 try: 883 del self.context[id] 884 deleted.append(id) 885 except: 886 self.flash('Could not delete %s: %s: %s' % ( 887 id, sys.exc_info()[0], sys.exc_info()[1])) 888 if len(deleted): 889 self.flash('Successfully deleted: %s' % ', '.join(deleted)) 890 # We have to redirect to let flash messages appear immediately... 891 self.redirect(self.url()) 892 return 897 title = "Remove faculty" 898 pnav = 1 893 899 894 900 # … … 917 923 grok.require('waeup.manageUniversity') 918 924 form_fields = grok.AutoFields(IDepartment) 919 title = 'Add a department' 925 title = 'Add department' 926 label = '' 920 927 pnav = 1 921 928 … … 935 942 return 936 943 self.redirect(self.url(self.context)) 944 945 @grok.action('Cancel') 946 def cancel(self, **data): 947 self.redirect(self.url(self.context)) 937 948 938 949 class ManageFacultyFormPage(WAeUPEditFormPage): … … 961 972 self.redirect(self.url(self.context)) 962 973 return 974 975 976 class RemoveDepartmentFormPage(RemoveFormPage): 977 """ Remove Department Page 978 """ 979 grok.context(IFaculty) 980 title = "Remove department" 981 pnav = 1 982 963 983 964 984 # … … 997 1017 grok.name('manage') 998 1018 grok.require('waeup.manageUniversity') 999 title = u'Edit department settings'1019 title = u'Edit department' 1000 1020 pnav = 1 1001 1021 … … 1112 1132 grok.name('manage') 1113 1133 grok.require('waeup.manageUniversity') 1114 title = u'Edit course settings'1134 title = u'Edit course' 1115 1135 pnav = 1 1116 1136 … … 1296 1316 form_fields = grok.AutoFields(ICertificateCourse) 1297 1317 pnav = 1 1298 title = 'Add acourse'1318 title = 'Add course' 1299 1319 1300 1320 @grok.action('Add course')
Note: See TracChangeset for help on using the changeset viewer.