Changeset 8629


Ignore:
Timestamp:
5 Jun 2012, 14:25:40 (13 years ago)
Author:
Henrik Bettermann
Message:

In some custom packages we need to display login credentials on landing pages after registration. Make provisions in base package for that.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
2 edited

Legend:

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

    r8627 r8629  
    10031003        return
    10041004
     1005    def _redirect(self, email, password, applicant_id):
     1006        # Forward only email to landing page in base package.
     1007        self.redirect(self.url(self.context, 'registration_complete',
     1008            data = dict(email=email)))
     1009        return
     1010
    10051011    @action(_('Get login credentials'), style='primary')
    10061012    def register(self, **data):
     
    10571063        if kofa_utils.sendCredentials(IUserAccount(applicant),
    10581064            password, login_url, msg):
    1059             self.redirect(self.url(self.context, 'registration_complete',
    1060                                    data = dict(email=applicant.email)))
    1061             return
     1065            email_sent = applicant.email
    10621066        else:
    1063             self.flash(_('Email could not been sent. Please retry later.'))
     1067            email_sent = None
     1068        self._redirect(email=email_sent, password=password,
     1069            applicant_id=applicant.applicant_id)
    10641070        return
    10651071
    10661072class ApplicantRegistrationEmailSent(KofaPage):
    10671073    """Landing page after successful registration.
     1074
    10681075    """
    10691076    grok.name('registration_complete')
     
    10721079    label = _('Your registration was successful.')
    10731080
    1074     def update(self, email=None):
     1081    def update(self, email=None, applicant_id=None, password=None):
    10751082        self.email = email
    1076         return
     1083        self.password = password
     1084        self.applicant_id = applicant_id
     1085        return
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantregemailsent.pt

    r7811 r8629  
    1 <div i18n:domain="waeup.kofa">
    2   <p>
     1<tal:only_email condition = "not: view/password" i18n:domain="waeup.kofa">
     2  <p tal:condition = "view/email">
    33    <span i18n:translate=""> An email with your user name and password
    44    has been sent to
     
    66    <span tal:replace="view/email">user@foo.baz</span>.
    77  </p>
    8   <p i18n:translate="">
     8  <p tal:condition = "view/email" i18n:translate="">
    99    Please check your email account to proceed.
     10  </p>
     11  <p tal:condition = "not: view/email" i18n:translate="">
     12    Email could not been sent. Please retry later.
    1013  </p>
    1114  <p  i18n:translate="">
    1215    Thanks for using Kofa!
    1316  </p>
    14 </div>
     17</tal:only_email>
     18
     19<tal:credentials condition = "view/password" i18n:domain="waeup.kofa">
     20  <h3 i18n:translate="">Your login credentials are:</h3>
     21  <table class="bordered-table span6">
     22    <tr>
     23      <td i18n:translate="">User Name:</td>
     24      <td tal:content="view/applicant_id">ID</td>
     25    <tr>
     26    <tr>
     27      <td i18n:translate="">Password:</td>
     28      <td tal:content="view/password">PASSWORD</td>
     29    <tr>
     30  </table>
     31  <p i18n:translate="">
     32    Print this page and proceed to the
     33    <a tal:attributes="href python: view.url(layout.site, 'login')">login form</a>.
     34    Please note that passwords are case-sensitive,
     35    <br />when entering your credentials, and keep your password secret!
     36  </p>
     37  <p tal:condition = "view/email">
     38    <span i18n:translate=""> An email with your user name and password
     39    has been sent to
     40    </span>
     41    <span tal:replace="view/email">user@foo.baz</span>.
     42  </p>
     43  <p  i18n:translate="">
     44    Thanks for using Kofa!
     45  </p>
     46</tal:credentials>
Note: See TracChangeset for help on using the changeset viewer.