Changeset 13055 for main/waeup.kofa/trunk
- Timestamp:
- 16 Jun 2015, 11:28:07 (10 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r13032 r13055 4 4 1.3.2.dev0 (unreleased) 5 5 ======================= 6 7 * Rename student views which are not layout-aware and thus not pages. 6 8 7 9 * Register KofaSourceOrderedMultiSelectWidget for IterableSource and -
main/waeup.kofa/trunk/docs/source/userdocs/students/browser.rst
r13054 r13055 25 25 users, students and applicants do see a single-column theme with 26 26 only a static top navigation bar. Students can navigate to the 27 various display form pages of their record by pulling down the 'My Data'28 in the navigation bar.27 various display form pages of their record by pulling down the 'My 28 Data' in the navigation bar. 29 29 30 30 Officers see a double-column theme after logging in. The left column … … 58 58 are called display, edit or add form pages respectively. Kofa is 59 59 using the `Zope Formlib`_ package to auto-generate these forms. 60 61 60 62 61 .. note:: -
main/waeup.kofa/trunk/src/waeup/kofa/browser/layout.py
r11437 r13055 167 167 grok.baseclass() 168 168 169 class KofaForm(UtilityView,Form): 169 class KofaPage(UtilityView,Page): 170 """A megrok.layout page with additional methods. 171 """ 172 grok.baseclass() 173 174 class KofaFormPage(UtilityView,Form): 170 175 """A megrok.layout.Form with additional methods. 171 176 """ … … 173 178 174 179 def setUpWidgets(self,ignore_request=False): 175 super(KofaForm ,self).setUpWidgets(ignore_request)180 super(KofaFormPage,self).setUpWidgets(ignore_request) 176 181 # Width parameters will be overridden by Bootstrap 177 182 # so we have to set the css class 178 183 if self.widgets.get('body'): 179 184 self.widgets['body'].height = 10 180 181 class KofaPage(UtilityView,Page):182 """A megrok.layout page with additional methods.183 """184 grok.baseclass()185 185 186 186 class KofaDisplayFormPage(UtilityView,DisplayForm): -
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r13010 r13055 44 44 from waeup.kofa.utils.helpers import html2dict 45 45 from waeup.kofa.browser.layout import ( 46 KofaPage, KofaForm , KofaEditFormPage, KofaAddFormPage,46 KofaPage, KofaFormPage, KofaEditFormPage, KofaAddFormPage, 47 47 KofaDisplayFormPage, NullValidator) 48 48 from waeup.kofa.browser.interfaces import ( … … 415 415 # 416 416 417 class ContactAdminForm (KofaForm):417 class ContactAdminFormPage(KofaFormPage): 418 418 grok.name('contactadmin') 419 419 #grok.context(IUniversity) … … 424 424 425 425 def update(self): 426 super(ContactAdminForm , self).update()426 super(ContactAdminFormPage, self).update() 427 427 self.form_fields.get('body').field.default = None 428 428 return … … 461 461 return 462 462 463 class EnquiriesForm (ContactAdminForm):463 class EnquiriesFormPage(ContactAdminFormPage): 464 464 """Captcha'd page to let anonymous send emails to the administrator. 465 465 """ … … 471 471 472 472 def update(self): 473 super(EnquiriesForm , self).update()473 super(EnquiriesFormPage, self).update() 474 474 # Handle captcha 475 475 self.captcha = getUtility(ICaptchaManager).getCaptcha() … … 843 843 return 844 844 845 class ContactUserForm (ContactAdminForm):845 class ContactUserFormPage(ContactAdminFormPage): 846 846 grok.name('contactuser') 847 847 grok.context(IUserAccount) … … 2431 2431 return 2432 2432 2433 class ChangePasswordRequestPage(KofaForm ):2433 class ChangePasswordRequestPage(KofaFormPage): 2434 2434 """Captcha'd page for all kind of users to request a password change. 2435 2435 """ -
main/waeup.kofa/trunk/src/waeup/kofa/documents/browser.py
r12456 r13055 39 39 from waeup.kofa.browser.layout import ( 40 40 KofaPage, KofaEditFormPage, KofaAddFormPage, KofaDisplayFormPage, 41 KofaForm,NullValidator, jsaction, action, UtilityView)41 NullValidator, jsaction, action, UtilityView) 42 42 from waeup.kofa.widgets.datewidget import ( 43 43 FriendlyDateWidget, FriendlyDateDisplayWidget, -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r13050 r13055 36 36 from waeup.kofa.browser.layout import ( 37 37 KofaPage, KofaEditFormPage, KofaAddFormPage, KofaDisplayFormPage, 38 KofaForm, NullValidator, 39 jsaction, action, UtilityView) 38 NullValidator, jsaction, action, UtilityView) 40 39 from waeup.kofa.browser.breadcrumbs import Breadcrumb 41 from waeup.kofa.browser.pages import ContactAdminForm , ExportCSVView, doll_up40 from waeup.kofa.browser.pages import ContactAdminFormPage, ExportCSVView, doll_up 42 41 from waeup.kofa.browser.interfaces import ICaptchaManager 43 42 from waeup.kofa.hostels.hostel import NOT_OCCUPIED … … 445 444 return form_fields 446 445 447 class ContactStudentForm (ContactAdminForm):446 class ContactStudentFormPage(ContactAdminFormPage): 448 447 grok.context(IStudent) 449 448 grok.name('contactstudent') … … 453 452 454 453 def update(self, subject=u'', body=u''): 455 super(ContactStudentForm , self).update()454 super(ContactStudentFormPage, self).update() 456 455 self.form_fields.get('subject').field.default = subject 457 456 self.form_fields.get('body').field.default = body … … 483 482 return 484 483 485 class ExportPDFAdmissionSlip Page(UtilityView, grok.View):484 class ExportPDFAdmissionSlip(UtilityView, grok.View): 486 485 """Deliver a PDF Admission slip. 487 486 """ … … 586 585 return 587 586 588 class StudentActivate Page(UtilityView, grok.View):587 class StudentActivateView(UtilityView, grok.View): 589 588 """ Activate student account 590 589 """ … … 605 604 return 606 605 607 class StudentDeactivate Page(UtilityView, grok.View):606 class StudentDeactivateView(UtilityView, grok.View): 608 607 """ Deactivate student account 609 608 """ … … 748 747 return 749 748 750 class StudentClear Page(UtilityView, grok.View):749 class StudentClearView(UtilityView, grok.View): 751 750 """ Clear student by clearance officer 752 751 """ … … 1034 1033 1035 1034 class StudentTranscriptRequestPage(KofaPage): 1036 """ Page to transcript by student1035 """ Page to request transcript by student 1037 1036 """ 1038 1037 grok.context(IStudent) … … 1198 1197 'a':self.context.student.display_fullname}) 1199 1198 1200 class ExportPDFTranscript Page(UtilityView, grok.View):1199 class ExportPDFTranscriptSlip(UtilityView, grok.View): 1201 1200 """Deliver a PDF slip of the context. 1202 1201 """ … … 1217 1216 self.redirect(self.url(self.context)) 1218 1217 return 1219 super(ExportPDFTranscript Page, self).update()1218 super(ExportPDFTranscriptSlip, self).update() 1220 1219 self.semester_dict = getUtility(IKofaUtils).SEMESTER_DICT 1221 1220 self.level_dict = level_dict(self.context) … … 1347 1346 'b':level_title}) 1348 1347 1349 class ExportPDFCourseRegistrationSlip Page(UtilityView, grok.View):1348 class ExportPDFCourseRegistrationSlip(UtilityView, grok.View): 1350 1349 """Deliver a PDF slip of the context. 1351 1350 """ … … 1505 1504 return 1506 1505 1507 class ValidateCourses Page(UtilityView, grok.View):1506 class ValidateCoursesView(UtilityView, grok.View): 1508 1507 """ Validate course list by course adviser 1509 1508 """ … … 1531 1530 return 1532 1531 1533 class RejectCourses Page(UtilityView, grok.View):1532 class RejectCoursesView(UtilityView, grok.View): 1534 1533 """ Reject course list by course adviser 1535 1534 """ … … 1845 1844 'b':self.context.p_id}) 1846 1845 1847 class OnlinePaymentApprove Page(UtilityView, grok.View):1846 class OnlinePaymentApproveView(UtilityView, grok.View): 1848 1847 """ Callback view 1849 1848 """ … … 1870 1869 return 1871 1870 1872 class OnlinePaymentFakeApprove Page(OnlinePaymentApprovePage):1871 class OnlinePaymentFakeApproveView(OnlinePaymentApproveView): 1873 1872 """ Approval view for students. 1874 1873 … … 1876 1875 must be neutralized in custom pages! 1877 1876 """ 1878 1879 1877 grok.name('fake_approve') 1880 1878 grok.require('waeup.payStudent') 1881 1879 1882 class ExportPDFPaymentSlip Page(UtilityView, grok.View):1880 class ExportPDFPaymentSlip(UtilityView, grok.View): 1883 1881 """Deliver a PDF slip of the context. 1884 1882 """ … … 2146 2144 mapping = {'a':self.context.getSessionString()}) 2147 2145 2148 class ExportPDFBedTicketSlip Page(UtilityView, grok.View):2146 class ExportPDFBedTicketSlip(UtilityView, grok.View): 2149 2147 """Deliver a PDF slip of the context. 2150 2148 """ … … 2184 2182 omit_fields=self.omit_fields) 2185 2183 2186 class BedTicketRelocation Page(UtilityView, grok.View):2184 class BedTicketRelocationView(UtilityView, grok.View): 2187 2185 """ Callback view 2188 2186 """ … … 3033 3031 return list(set(hitlist)) 3034 3032 3035 class ClearAllStudentsInDepartment Page(UtilityView, grok.View):3033 class ClearAllStudentsInDepartmentView(UtilityView, grok.View): 3036 3034 """ Clear all students of a department in state 'clearance requested'. 3037 3035 """ -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r13050 r13055 944 944 logcontent = open(logfile).read() 945 945 self.assertTrue( 946 'zope.mgr - students.browser.OnlinePaymentApprove Page'946 'zope.mgr - students.browser.OnlinePaymentApproveView ' 947 947 '- K1000000 - schoolfee payment approved' 948 948 in logcontent) … … 1079 1079 logcontent = open(logfile).read() 1080 1080 self.assertTrue( 1081 'zope.mgr - students.browser.OnlinePaymentApprove Page'1081 'zope.mgr - students.browser.OnlinePaymentApproveView ' 1082 1082 '- K1000000 - schoolfee payment approved' 1083 1083 in logcontent) … … 1246 1246 # Relocation is properly logged 1247 1247 logcontent = open(logfile).read() 1248 self.assertTrue('zope.mgr - students.browser.BedTicketRelocation Page'1248 self.assertTrue('zope.mgr - students.browser.BedTicketRelocationView ' 1249 1249 '- K1000000 - relocated: hall-1_A_101_B' in logcontent) 1250 1250 # The payment object still shows the original payment item … … 1942 1942 self.app['datacenter'].storage, 'logs', 'students.log') 1943 1943 logcontent = open(logfile).read() 1944 self.assertTrue('zope.mgr - students.browser.StudentDeactivate Page- '1944 self.assertTrue('zope.mgr - students.browser.StudentDeactivateView - ' 1945 1945 'K1000000 - account deactivated' in logcontent) 1946 self.assertTrue('zope.mgr - students.browser.StudentActivate Page- '1946 self.assertTrue('zope.mgr - students.browser.StudentActivateView - ' 1947 1947 'K1000000 - account activated' in logcontent) 1948 1948
Note: See TracChangeset for help on using the changeset viewer.