Changeset 7368


Ignore:
Timestamp:
18 Dec 2011, 08:16:16 (13 years ago)
Author:
Henrik Bettermann
Message:

Change label and title of registration page.

Check if application has started or ended.

Rename login icon.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
3 edited
1 moved

Legend:

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

    r7365 r7368  
    305305    text = 'Manage applicants container'
    306306
     307class ApplicantRegisterActionButton(ManageActionButton):
     308    grok.order(2)
     309    grok.context(IApplicantsContainer)
     310    grok.view(ApplicantsContainerPage)
     311    grok.require('waeup.Anonymous')
     312    icon = 'actionicon_login.png'
     313    text = 'Register for application'
     314    target = 'register'
     315
    307316class ApplicantsContainerManageFormPage(SIRPEditFormPage):
    308317    grok.context(IApplicantsContainer)
     
    408417        'firstname', 'middlename', 'lastname',
    409418        'email', 'phone')
    410     title = 'Applicants'
    411419    label = 'Add applicant'
    412420    pnav = 3
     
    10961104    grok.require('waeup.Public')
    10971105    grok.template('applicantregister')
    1098     label = 'Applicant Registration'
    1099     title = label
    11001106    form_fields = grok.AutoFields(IApplicantEdit).select(
    11011107        'firstname', 'middlename', 'lastname', 'email', 'phone')
    11021108    form_fields['phone'].custom_widget = PhoneWidget
    11031109
     1110    @property
     1111    def title(self):
     1112        return "Applicants Container: %s" % self.context.title
     1113
     1114    @property
     1115    def label(self):
     1116        return "Register for %s Application" % self.context.title
     1117
    11041118    def update(self):
    1105         # handle captcha
     1119        # Check if application has started ...
     1120        if not self.context.startdate or self.context.startdate > date.today():
     1121            self.flash('Application has not yet started.')
     1122            self.redirect(self.url(self.context))
     1123            return
     1124        # ... or ended
     1125        if not self.context.enddate or self.context.enddate < date.today():
     1126            self.flash('Application has ended.')
     1127            self.redirect(self.url(self.context))
     1128            return
     1129        # Handle captcha
    11061130        self.captcha = getUtility(ICaptchaManager).getCaptcha()
    11071131        self.captcha_result = self.captcha.verify(self.request)
     
    11091133        return
    11101134
    1111     @grok.action('Register')
     1135    @grok.action('Send login credentials')
    11121136    def register(self, **data):
    11131137        if not self.captcha_result.is_valid:
     
    11321156            pwd,login_url,email_to,subject)
    11331157        if success:
    1134             self.flash('An email with your user name and password' +
     1158            self.flash('An email with your user name and password ' +
    11351159                'has been sent to %s.' % email_to)
    11361160        else:
  • main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantregister.pt

    r7365 r7368  
    5050    </tbody>
    5151  </table>
    52 
     52  <p> An account will be created for you and an email with your login credentials
     53  will be sent to the address provided.
     54  </p>
    5355  <div class="actionButtons" tal:condition="view/availableActions">
    5456    <input tal:repeat="action view/actions"
     
    5658           />
    5759  </div>
    58 
    59 
    6060</form>
  • main/waeup.sirp/trunk/src/waeup/sirp/utils/utils.py

    r7365 r7368  
    7777%s
    7878Student Registration and Information Portal of
    79 %s
     79%s.
    8080
    81 Your user name is: %s
    82 Your password is: %s
     81Your user name: %s
     82Your password: %s
    8383Login page: %s
    8484
Note: See TracChangeset for help on using the changeset viewer.