Changeset 7114 for main/waeup.sirp/trunk


Ignore:
Timestamp:
15 Nov 2011, 11:13:38 (13 years ago)
Author:
Henrik Bettermann
Message:

Don't use a general StudentBaseEditFormPage? for students, use dedicated forms instead for password editing and file upload. The files upload page is only used for the passport picture in the base package.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py

    r7108 r7114  
    14481448# Pages for students only
    14491449
    1450 class StudentBaseEditActionButton(ManageActionButton):
     1450class StudentPasswordActionButton(ManageActionButton):
    14511451    grok.order(1)
    14521452    grok.context(IStudent)
    14531453    grok.view(StudentBaseDisplayFormPage)
    14541454    grok.require('waeup.handleStudent')
     1455    icon = 'actionicon_key.png'
    14551456    text = 'Change password'
    1456     target = 'bedit'
     1457    target = 'change_password'
     1458
     1459class StudentPassportActionButton(ManageActionButton):
     1460    grok.order(1)
     1461    grok.context(IStudent)
     1462    grok.view(StudentBaseDisplayFormPage)
     1463    grok.require('waeup.handleStudent')
     1464    icon = 'actionicon_portrait.png'
     1465    text = 'Change portrait'
     1466    target = 'change_portrait'
    14571467
    14581468class StudentPasswordSetting(grok.Adapter):
     
    14811491    password = property(getPassword, setPassword)
    14821492
    1483 class StudentBaseEditFormPage(WAeUPEditFormPage):
    1484     """ View to edit student base data by student
    1485     """
    1486     grok.context(IStudent)
    1487     grok.name('bedit')
    1488     grok.require('waeup.handleStudent')
    1489     #form_fields = grok.AutoFields(IStudentBaseEdit).omit(
    1490     #    'student_id', 'reg_number', 'matric_number')
     1493class StudentPasswordFormPage(WAeUPEditFormPage):
     1494    """ View to edit the password by student
     1495    """
     1496    grok.context(IStudent)
     1497    grok.name('change_password')
     1498    grok.require('waeup.handleStudent')
    14911499    form_fields = grok.AutoFields(IStudentPasswordSetting)
    14921500    grok.template('baseeditpage')
     
    14961504
    14971505    def update(self):
    1498         super(StudentBaseEditFormPage, self).update()
     1506        super(StudentPasswordFormPage, self).update()
    14991507        self.wf_info = IWorkflowInfo(self.context)
    15001508        return
     
    15241532        return
    15251533
     1534class StudentFilesUploadPage(WAeUPPage):
     1535    """ View to upload files by student
     1536    """
     1537    grok.context(IStudent)
     1538    grok.name('change_portrait')
     1539    grok.require('waeup.handleStudent')
     1540    grok.template('filesuploadpage')
     1541    label = 'Upload portrait'
     1542    title = 'Base Data'
     1543    pnav = 4
     1544
    15261545class StudentClearanceStartActionButton(ManageActionButton):
    15271546    grok.order(1)
  • main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py

    r7096 r7114  
    6565    """Data needed for password setting.
    6666    """
    67     name = schema.TextLine(
    68         title = u'Full Name',
    69         default = u'Nobody',
    70         required = True,
    71         readonly = True
    72         )
    7367
    7468    password = schema.Password(
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_authentication.py

    r6818 r7114  
    55## $Id$
    66##
    7 ## Copyright (C) 2011 Uli Fouquet
     7## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
    88## This program is free software; you can redistribute it and/or modify
    99## it under the terms of the GNU General Public License as published by
     
    173173        self.assertRaises(
    174174            Unauthorized,
    175             self.browser.open, self.student_path + '/bedit')
     175            self.browser.open, self.student_path + '/change_password')
    176176        return
  • main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py

    r7112 r7114  
    1010    StudentClearanceDisplayFormPage, StudentClearanceManageFormPage,
    1111    write_log_message, StudentBaseManageFormPage, StudentBaseDisplayFormPage,
    12     StudentBaseEditFormPage)
     12    StudentFilesUploadPage)
    1313from waeup.sirp.students.interfaces import IStudent, IStudentClearance
    1414
     
    325325    """Passport upload viewlet for students.
    326326    """
    327     grok.view(StudentBaseEditFormPage)
     327    grok.view(StudentFilesUploadPage)
    328328    grok.require('waeup.handleStudent')
    329329
Note: See TracChangeset for help on using the changeset viewer.