Changeset 13055 for main


Ignore:
Timestamp:
16 Jun 2015, 11:28:07 (10 years ago)
Author:
Henrik Bettermann
Message:

Rename student views which are not layout-aware and thus not pages.

Location:
main/waeup.kofa/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r13032 r13055  
    441.3.2.dev0 (unreleased)
    55=======================
     6
     7* Rename student views which are not layout-aware and thus not pages.
    68
    79* Register KofaSourceOrderedMultiSelectWidget for IterableSource and
  • main/waeup.kofa/trunk/docs/source/userdocs/students/browser.rst

    r13054 r13055  
    2525users, students and applicants do see a single-column theme with
    2626only 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.
     27various display form pages of their record by pulling down the 'My
     28Data' in the navigation bar.
    2929
    3030Officers see a double-column theme after logging in. The left column
     
    5858are called display, edit or add form pages respectively. Kofa is
    5959using the `Zope Formlib`_ package to auto-generate these forms.
    60 
    6160
    6261.. note::
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/layout.py

    r11437 r13055  
    167167    grok.baseclass()
    168168
    169 class KofaForm(UtilityView,Form):
     169class KofaPage(UtilityView,Page):
     170    """A megrok.layout page with additional methods.
     171    """
     172    grok.baseclass()
     173
     174class KofaFormPage(UtilityView,Form):
    170175    """A megrok.layout.Form with additional methods.
    171176    """
     
    173178
    174179    def setUpWidgets(self,ignore_request=False):
    175         super(KofaForm,self).setUpWidgets(ignore_request)
     180        super(KofaFormPage,self).setUpWidgets(ignore_request)
    176181        # Width parameters will be overridden by Bootstrap
    177182        # so we have to set the css class
    178183        if self.widgets.get('body'):
    179184            self.widgets['body'].height = 10
    180 
    181 class KofaPage(UtilityView,Page):
    182     """A megrok.layout page with additional methods.
    183     """
    184     grok.baseclass()
    185185
    186186class KofaDisplayFormPage(UtilityView,DisplayForm):
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py

    r13010 r13055  
    4444from waeup.kofa.utils.helpers import html2dict
    4545from waeup.kofa.browser.layout import (
    46     KofaPage, KofaForm, KofaEditFormPage, KofaAddFormPage,
     46    KofaPage, KofaFormPage, KofaEditFormPage, KofaAddFormPage,
    4747    KofaDisplayFormPage, NullValidator)
    4848from waeup.kofa.browser.interfaces import (
     
    415415#
    416416
    417 class ContactAdminForm(KofaForm):
     417class ContactAdminFormPage(KofaFormPage):
    418418    grok.name('contactadmin')
    419419    #grok.context(IUniversity)
     
    424424
    425425    def update(self):
    426         super(ContactAdminForm, self).update()
     426        super(ContactAdminFormPage, self).update()
    427427        self.form_fields.get('body').field.default = None
    428428        return
     
    461461        return
    462462
    463 class EnquiriesForm(ContactAdminForm):
     463class EnquiriesFormPage(ContactAdminFormPage):
    464464    """Captcha'd page to let anonymous send emails to the administrator.
    465465    """
     
    471471
    472472    def update(self):
    473         super(EnquiriesForm, self).update()
     473        super(EnquiriesFormPage, self).update()
    474474        # Handle captcha
    475475        self.captcha = getUtility(ICaptchaManager).getCaptcha()
     
    843843        return
    844844
    845 class ContactUserForm(ContactAdminForm):
     845class ContactUserFormPage(ContactAdminFormPage):
    846846    grok.name('contactuser')
    847847    grok.context(IUserAccount)
     
    24312431        return
    24322432
    2433 class ChangePasswordRequestPage(KofaForm):
     2433class ChangePasswordRequestPage(KofaFormPage):
    24342434    """Captcha'd page for all kind of users to request a password change.
    24352435    """
  • main/waeup.kofa/trunk/src/waeup/kofa/documents/browser.py

    r12456 r13055  
    3939from waeup.kofa.browser.layout import (
    4040    KofaPage, KofaEditFormPage, KofaAddFormPage, KofaDisplayFormPage,
    41     KofaForm, NullValidator, jsaction, action, UtilityView)
     41    NullValidator, jsaction, action, UtilityView)
    4242from waeup.kofa.widgets.datewidget import (
    4343    FriendlyDateWidget, FriendlyDateDisplayWidget,
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r13050 r13055  
    3636from waeup.kofa.browser.layout import (
    3737    KofaPage, KofaEditFormPage, KofaAddFormPage, KofaDisplayFormPage,
    38     KofaForm, NullValidator,
    39     jsaction, action, UtilityView)
     38    NullValidator, jsaction, action, UtilityView)
    4039from waeup.kofa.browser.breadcrumbs import Breadcrumb
    41 from waeup.kofa.browser.pages import ContactAdminForm, ExportCSVView, doll_up
     40from waeup.kofa.browser.pages import ContactAdminFormPage, ExportCSVView, doll_up
    4241from waeup.kofa.browser.interfaces import ICaptchaManager
    4342from waeup.kofa.hostels.hostel import NOT_OCCUPIED
     
    445444        return form_fields
    446445
    447 class ContactStudentForm(ContactAdminForm):
     446class ContactStudentFormPage(ContactAdminFormPage):
    448447    grok.context(IStudent)
    449448    grok.name('contactstudent')
     
    453452
    454453    def update(self, subject=u'', body=u''):
    455         super(ContactStudentForm, self).update()
     454        super(ContactStudentFormPage, self).update()
    456455        self.form_fields.get('subject').field.default = subject
    457456        self.form_fields.get('body').field.default = body
     
    483482        return
    484483
    485 class ExportPDFAdmissionSlipPage(UtilityView, grok.View):
     484class ExportPDFAdmissionSlip(UtilityView, grok.View):
    486485    """Deliver a PDF Admission slip.
    487486    """
     
    586585        return
    587586
    588 class StudentActivatePage(UtilityView, grok.View):
     587class StudentActivateView(UtilityView, grok.View):
    589588    """ Activate student account
    590589    """
     
    605604        return
    606605
    607 class StudentDeactivatePage(UtilityView, grok.View):
     606class StudentDeactivateView(UtilityView, grok.View):
    608607    """ Deactivate student account
    609608    """
     
    748747        return
    749748
    750 class StudentClearPage(UtilityView, grok.View):
     749class StudentClearView(UtilityView, grok.View):
    751750    """ Clear student by clearance officer
    752751    """
     
    10341033
    10351034class StudentTranscriptRequestPage(KofaPage):
    1036     """ Page to transcript by student
     1035    """ Page to request transcript by student
    10371036    """
    10381037    grok.context(IStudent)
     
    11981197            'a':self.context.student.display_fullname})
    11991198
    1200 class ExportPDFTranscriptPage(UtilityView, grok.View):
     1199class ExportPDFTranscriptSlip(UtilityView, grok.View):
    12011200    """Deliver a PDF slip of the context.
    12021201    """
     
    12171216            self.redirect(self.url(self.context))
    12181217            return
    1219         super(ExportPDFTranscriptPage, self).update()
     1218        super(ExportPDFTranscriptSlip, self).update()
    12201219        self.semester_dict = getUtility(IKofaUtils).SEMESTER_DICT
    12211220        self.level_dict = level_dict(self.context)
     
    13471346            'b':level_title})
    13481347
    1349 class ExportPDFCourseRegistrationSlipPage(UtilityView, grok.View):
     1348class ExportPDFCourseRegistrationSlip(UtilityView, grok.View):
    13501349    """Deliver a PDF slip of the context.
    13511350    """
     
    15051504        return
    15061505
    1507 class ValidateCoursesPage(UtilityView, grok.View):
     1506class ValidateCoursesView(UtilityView, grok.View):
    15081507    """ Validate course list by course adviser
    15091508    """
     
    15311530        return
    15321531
    1533 class RejectCoursesPage(UtilityView, grok.View):
     1532class RejectCoursesView(UtilityView, grok.View):
    15341533    """ Reject course list by course adviser
    15351534    """
     
    18451844            'b':self.context.p_id})
    18461845
    1847 class OnlinePaymentApprovePage(UtilityView, grok.View):
     1846class OnlinePaymentApproveView(UtilityView, grok.View):
    18481847    """ Callback view
    18491848    """
     
    18701869        return
    18711870
    1872 class OnlinePaymentFakeApprovePage(OnlinePaymentApprovePage):
     1871class OnlinePaymentFakeApproveView(OnlinePaymentApproveView):
    18731872    """ Approval view for students.
    18741873
     
    18761875    must be neutralized in custom pages!
    18771876    """
    1878 
    18791877    grok.name('fake_approve')
    18801878    grok.require('waeup.payStudent')
    18811879
    1882 class ExportPDFPaymentSlipPage(UtilityView, grok.View):
     1880class ExportPDFPaymentSlip(UtilityView, grok.View):
    18831881    """Deliver a PDF slip of the context.
    18841882    """
     
    21462144            mapping = {'a':self.context.getSessionString()})
    21472145
    2148 class ExportPDFBedTicketSlipPage(UtilityView, grok.View):
     2146class ExportPDFBedTicketSlip(UtilityView, grok.View):
    21492147    """Deliver a PDF slip of the context.
    21502148    """
     
    21842182            omit_fields=self.omit_fields)
    21852183
    2186 class BedTicketRelocationPage(UtilityView, grok.View):
     2184class BedTicketRelocationView(UtilityView, grok.View):
    21872185    """ Callback view
    21882186    """
     
    30333031        return list(set(hitlist))
    30343032
    3035 class ClearAllStudentsInDepartmentPage(UtilityView, grok.View):
     3033class ClearAllStudentsInDepartmentView(UtilityView, grok.View):
    30363034    """ Clear all students of a department in state 'clearance requested'.
    30373035    """
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r13050 r13055  
    944944        logcontent = open(logfile).read()
    945945        self.assertTrue(
    946             'zope.mgr - students.browser.OnlinePaymentApprovePage '
     946            'zope.mgr - students.browser.OnlinePaymentApproveView '
    947947            '- K1000000 - schoolfee payment approved'
    948948            in logcontent)
     
    10791079        logcontent = open(logfile).read()
    10801080        self.assertTrue(
    1081             'zope.mgr - students.browser.OnlinePaymentApprovePage '
     1081            'zope.mgr - students.browser.OnlinePaymentApproveView '
    10821082            '- K1000000 - schoolfee payment approved'
    10831083            in logcontent)
     
    12461246        # Relocation is properly logged
    12471247        logcontent = open(logfile).read()
    1248         self.assertTrue('zope.mgr - students.browser.BedTicketRelocationPage '
     1248        self.assertTrue('zope.mgr - students.browser.BedTicketRelocationView '
    12491249            '- K1000000 - relocated: hall-1_A_101_B' in logcontent)
    12501250        # The payment object still shows the original payment item
     
    19421942            self.app['datacenter'].storage, 'logs', 'students.log')
    19431943        logcontent = open(logfile).read()
    1944         self.assertTrue('zope.mgr - students.browser.StudentDeactivatePage - '
     1944        self.assertTrue('zope.mgr - students.browser.StudentDeactivateView - '
    19451945                        'K1000000 - account deactivated' in logcontent)
    1946         self.assertTrue('zope.mgr - students.browser.StudentActivatePage - '
     1946        self.assertTrue('zope.mgr - students.browser.StudentActivateView - '
    19471947                        'K1000000 - account activated' in logcontent)
    19481948
Note: See TracChangeset for help on using the changeset viewer.