- Timestamp:
- 30 Apr 2011, 13:57:08 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/browser
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
r5989 r5999 166 166 provided 'Edit faculty' button: 167 167 168 >>> browser.getLink(' Editfaculty').click()168 >>> browser.getLink('Manage faculty').click() 169 169 170 170 Let's set a new title and save the form: 171 171 172 >>> browser.getControl(name='form.title').value = "My testfaculty"172 >>> browser.getControl(name='form.title').value = "My renamed faculty" 173 173 >>> browser.getControl(name='form.actions.save').click() 174 174 175 Clicking 'Save' we will stay on the settings form. So we can change 176 the department again. This time we will return to the overview page 177 afterwards: 178 179 >>> browser.getControl(name='form.title').value = "My renamed faculty" 180 >>> ctrl = browser.getControl("Save and return") 181 >>> ctrl.click() 182 183 If we go to the settings page and click ``Cancel`` nothing will be 184 changed: 185 186 >>> browser.getLink('Edit faculty').click() 187 >>> browser.getControl(name='form.title').value = "Blah" 188 >>> browser.getControl('Cancel').click() 189 190 Our faculty was indeed renamed to ``My renamed faculty`` and not to 191 ``Blah``: 175 Our faculty was indeed renamed to ``My renamed faculty``: 192 176 193 177 >>> browser.open('http://localhost/myuniversity/faculties') -
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r5996 r5999 16 16 from zope import schema 17 17 from waeup.sirp.browser.resources import warning 18 from waeup.sirp.browser.resources import datepicker, tabs 18 19 try: 19 20 from zope.authentication.interfaces import ( … … 906 907 grok.name('index') 907 908 pnav = 1 908 label = 'Departments'909 909 910 910 @property 911 911 def title(self): 912 912 return self.context.longtitle() 913 914 @property 915 def label(self): 916 return 'Departments' 913 917 914 918 #def update(self, code=None, edit=None, delete=None): … … 927 931 grok.name('add') 928 932 grok.require('waeup.manageUniversity') 929 title = 'Add department' 930 label = '' 933 label = 'Add department' 931 934 form_fields = grok.AutoFields(IDepartmentAdd) 932 935 pnav = 1 936 937 @property 938 def title(self): 939 return self.context.longtitle() 933 940 934 941 @grok.action('Add department') … … 946 953 'in the database') 947 954 return 948 self.redirect(self.url(self.context ))955 self.redirect(self.url(self.context, u'@@manage')) 949 956 950 957 @grok.action('Cancel') 951 958 def cancel(self, **data): 952 self.redirect(self.url(self.context)) 959 self.redirect(self.url(self.context)) 953 960 954 961 class ManageFacultyFormPage(WAeUPEditFormPage): … … 958 965 grok.name('manage') 959 966 grok.require('waeup.manageUniversity') 960 title = 'Edit faculty' 961 pnav = 1 967 grok.template('facultymanagepage') 968 pnav = 1 969 taboneactions = ['Save','Save and return','Cancel'] 970 tabtwoactions = ['Add department', 'Remove selected','Cancel'] 962 971 963 972 form_fields = grok.AutoFields(IFaculty) 973 974 @property 975 def label(self): 976 return 'Manage faculty' 977 978 @property 979 def title(self): 980 return self.context.longtitle() 981 982 def update(self): 983 tabs.need() 984 #warning.need() 985 return super(ManageFacultyFormPage, self).update() 964 986 965 987 @grok.action('Save') … … 967 989 self.applyData(self.context, **data) 968 990 return 969 970 @grok.action('Save and return') 971 def saveAndReturn(self, **data): 972 self.applyData(self.context, **data) 973 self.redirect(self.url(self.context)) 974 return 975 991 992 # ToDo: Show warning message before deletion 993 @grok.action('Remove selected') 994 def delDepartments(self, **data): 995 form = self.request.form 996 child_id = form['val_id'] 997 if not isinstance(child_id, list): 998 child_id = [child_id] 999 deleted = [] 1000 for id in child_id: 1001 try: 1002 del self.context[id] 1003 deleted.append(id) 1004 except: 1005 self.flash('Could not delete %s: %s: %s' % ( 1006 id, sys.exc_info()[0], sys.exc_info()[1])) 1007 if len(deleted): 1008 self.flash('Successfully removed: %s' % ', '.join(deleted)) 1009 return 1010 1011 @grok.action('Add department', validator=NullValidator) 1012 def addDepartment(self, **data): 1013 self.redirect(self.url(self.context, '@@add')) 1014 return 1015 976 1016 @grok.action('Cancel', validator=NullValidator) 977 1017 def cancel(self, **data): … … 980 1020 981 1021 982 class RemoveDepartmentFormPage(RemoveFormPage):983 """ Remove Department Page984 """985 grok.context(IFaculty)986 title = "Remove department"987 pnav = 11022 #class RemoveDepartmentFormPage(RemoveFormPage): 1023 # """ Remove Department Page 1024 # """ 1025 # grok.context(IFaculty) 1026 # title = "Remove department" 1027 # pnav = 1 988 1028 989 1029 … … 1006 1046 def update(self): 1007 1047 yui.tabview.need() 1008 1009 1048 if 'delcourse' in self.request.form: 1010 1049 code = self.request.form['code'] -
main/waeup.sirp/trunk/src/waeup/sirp/browser/static/waeuptheme-gray1.css
r5405 r5999 4 4 want to do more complex operations. */ 5 5 6 a, table td a { 7 text-decoration: none; 8 } 9 10 a:hover { 11 text-decoration: underline; 12 } 13 6 14 .breadcrumbs { 7 15 background-color: #fff; 8 16 padding: 0.3em; 9 margin-bottom: 0.8em 17 margin-bottom: 0.8em; 18 } 19 20 .breadcrumbs a { 21 text-decoration: none; 22 } 23 24 .breadcrumbs a:hover { 25 text-decoration: underline; 10 26 } 11 27 … … 76 92 } 77 93 94 .yui-button a:hover { 95 text-decoration: none; 96 } 97 98 78 99 .actionbar { 79 100 margin-top: -10px; … … 82 103 } 83 104 105 /* jquery-ui customizations */ 106 107 .ui-tabs { 108 padding-bottom: 0em; 109 padding-left: 0em; 110 padding-right: 0em; 111 padding-top: 0em; 112 position: relative; 113 } 114 115 .ui-corner-all { 116 -moz-border-radius:0px; 117 } 118 119 .ui-tabs .ui-tabs-nav { 120 margin: 0; 121 padding-left: 0.2em; 122 padding-right: 0.2em; 123 padding-bottom: 0; 124 padding-top: 0; 125 126 } 127 128 .ui-tabs .ui-tabs-nav li { 129 float: center; 130 margin-left: 6px; 131 margin-right: 0.2em; 132 margin-top: 0; 133 padding-left: 0; 134 padding-right: 0; 135 padding-top: 0; 136 position: relative; 137 top: 1px; 138 white-space: nowrap; 139 140 } 141 142 .ui-tabs .ui-tabs-nav li a { 143 float: center; 144 padding-bottom: 0.5em; 145 padding-left: 1em; 146 padding-right: 1em; 147 padding-top: 0.5em; 148 text-decoration: none; 149 } 150 151 .ui-tabs .ui-tabs-nav li a:hover { 152 text-decoration: underline; 153 } 154 155 .ui-tabs .ui-tabs-nav li.ui-tabs-selected { 156 margin-bottom: 0px; 157 padding-bottom: 0px; 158 background: #FFF; 159 border-width: 0px; 160 padding-top: 0px; 161 margin-top: 0px; 162 } 163 164 165 .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { 166 color: #FFF; 167 } 168 169 .ui-state-active a:link, .ui-state-active a:visited { 170 color: #000; 171 } 172 173 .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { 174 175 border-width: 0px; 176 background-color: #456; 177 background-image: none; 178 font-weight: normal; 179 } 180 181 .ui-widget { 182 font-family: Verdana,Arial,sans-serif; 183 font-size: 100%; 184 } 185 186 .ui-widget-header { 187 background-color: #456; 188 background-image: None; 189 border-color: #456; 190 border-style: solid; 191 border-width:0px; 192 } 193 194 .ui-helper-reset { 195 font-size: 90%; 196 line-height: 1; 197 } 198 199 .ui-widget-content { 200 background-color: #FFFFFF; 201 background-image: none; 202 border-bottom-style: solid; 203 border-bottom-width: 1px; 204 border-top-style: solid; 205 border-top-width: 0px; 206 border-color: #456; 207 } 208 209 .ui-widget-content a { 210 color: #456; 211 } -
main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/login.pt
r5403 r5999 3 3 4 4 <a href="@@loginstaff"> 5 <img tal:attributes="src static/login.png" />Staff Login5 Staff Login 6 6 </a> 7 7 <br /> 8 8 <a href="@@loginstudent"> 9 <img tal:attributes="src static/login.png" />Student Login9 Student Login 10 10 </a> 11 11 </div> -
main/waeup.sirp/trunk/src/waeup/sirp/browser/viewlets.py
r5977 r5999 316 316 grok.context(IFaculty) 317 317 grok.view(FacultyPage) 318 text = ' Editfaculty'318 text = 'Manage faculty' 319 319 320 320 class ManageDepartmentActionButton(ManageActionButton): … … 361 361 text = 'Add faculty' 362 362 363 class AddDepartmentActionButton(AddActionButton):364 grok.context(IFaculty)365 grok.view(FacultyPage)366 text = 'Add department'363 #class AddDepartmentActionButton(AddActionButton): 364 # grok.context(IFaculty) 365 # grok.view(FacultyPage) 366 # text = 'Add department' 367 367 368 368 class AddCertificateActionButton(AddActionButton): … … 397 397 text = 'Remove faculty' 398 398 399 class RemoveDepartmentActionButton(RemoveActionButton):400 grok.context(IFaculty)401 grok.view(FacultyPage)402 text = 'Remove department'403 399 #class RemoveDepartmentActionButton(RemoveActionButton): 400 # grok.context(IFaculty) 401 # grok.view(FacultyPage) 402 # text = 'Remove department' 403 404 404 405 405 #
Note: See TracChangeset for help on using the changeset viewer.