Development

Changeset 13826

You must first sign up to be able to contribute.

Changeset 13826

Show
Ignore:
Timestamp:
12/07/08 22:51:43 (5 years ago)
Author:
boutell
Message:

0.6: suggested stylesheet, compact login/logout prompts for use on
all pages, safer names for CSS classes and ids

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfApplyPlugin/trunk/README

    r13802 r13826  
    1 sfApply plugin 
    2 ============== 
     1# sfApply plugin # 
    32 
    43Most public sites have similar needs where user registration is 
     
    1615taking over the account too easily. 
    1716 
    18 Requirements 
    19 ============ 
     17## Requirements ## 
    2018 
    2119You need: 
     
    2826follow shortly. 
    2927 
    30 Installation 
    31 ============ 
     28## Installation ## 
    3229 
    3330Read the sfGuardPlugin documentation first! Set up that plugin before 
     
    127124in your application. 
    128125 
    129 Customizing Emails 
    130 ================== 
     126## Customizing Emails ## 
    131127 
    132128sfApply sends out email messages inviting users to verify their 
     
    148144looking at alternate solutions for 1.2. 
    149145 
    150 Extending sfApply 
    151 ================= 
     146## Displaying Login and Logout Prompts on Every Page ## 
     147 
     148You probably have pages on which logging in is optional. It's nice to 
     149display a login prompt directly on these pages. If you want to do that, 
     150try including my login/logout prompt template from your 
     151`apps/frontend/templates/layout.php` file: 
     152 
     153    <?php include_partial('sfApply/login') ?> 
     154 
     155If you are using the provided stylesheet, the login prompt will 
     156be floated at the far right, so you'll want to emit this code 
     157before anything that should appear to the left of the prompt. 
     158 
     159When the user is already logged in, the login prompt is  
     160automatically replaced by a logout prompt. 
     161 
     162## Using the Suggested Stylesheet ## 
     163 
     164sfApply comes with a stylesheet. You don't have to use it. If you do, 
     165you'll get reasonable styles for the sfApply pages as well as a 
     166reasonably good-looking style for the sfGuardPlugin login page.  
     167 
     168If you wish to use my stylesheet directly, first make sure you have a  
     169symbolic link from `web/sfApplyPlugin` to `plugins/sfApplyPlugin/web`. Then add 
     170the stylesheet to your view.yml file: 
     171 
     172      stylesheets:    [main, /sfApplyPlugin/css/login-apply] 
     173 
     174In the long run, you'll probably want to borrow from it rather than 
     175using it directly. 
     176 
     177## Extending sfApply ## 
    152178 
    153179"But I need the user's birthdate!" Of course you do. Every application 
     
    168194  additional information to the profile when an account 
    169195  is first created: 
     196 
    170197        function populateProfileSettings($profile) 
    171198        { 
     
    175202          return parent::populateProfileSettings($profile); 
    176203        } 
     204 
    1772057. Extend `updateProfileSettings` in exactly the same way. The 
    178206difference is that `updateProfileSettings` is called when the 
     
    186214returns false. 
    187215 
    188 Credits 
    189 ======= 
     216## Credits ## 
    190217 
    191218sfApplyPlugin was written by Tom Boutell. He can be contacted 
     
    194221further information about his work. 
    195222 
    196 Changelog 
    197 ========= 
    198  
    199 Version 0.51 corrects Markdown errors in the documentation. There 
    200 are no code changes. 
    201  
     223## Changelog ## 
     224 
     225### Version 0.6 ### 
     226 
     227Version 0.6 adds the optional sfApply/_login.php template, which provides 
     228an easy way to insert a login prompt on every page. I realized I was 
     229using this code in two sites and that others would likely want to  
     230do the same thing. Just include it in your layout template. 
     231 
     232Version 0.6 also adds a suggested stylesheet. Use it or not as you 
     233see fit. In addition to styling the apply and reset pages, it also 
     234styles the standard sfGuardUser login page.  
     235 
     236Version 0.6 renames all of the CSS classes and ids emitted by sfApplyPlugin 
     237in order to avoid potential conflicts with your own CSS elements. 
     238 
     239### Version 0.53 ### 
     240 
     241Version 0.53 corrected Markdown errors in the documentation. There 
     242were no code changes from version 0.5, which was the first  
     243public release. 
     244 
  • plugins/sfApplyPlugin/trunk/modules/sfApply/templates/applyAfter.php

    r13802 r13826  
    1 <p class="apply_notice"> 
     1<div class="sf_apply_notice"> 
     2<p> 
    23Thank you for applying for an account. You will receive a verification 
    34email shortly. If you do not see that email, please be sure to check  
    45your "spam" or "bulk" folder. 
    56</p> 
     7<p> 
    68<?php echo button_to("Continue", "@homepage") ?> 
     9</p> 
     10</div> 
  • plugins/sfApplyPlugin/trunk/modules/sfApply/templates/applySuccess.php

    r13802 r13826  
     1<?php 
     2  // Override the login slot so that we don't get a login prompt on the 
     3  // apply page. The user can cancel if they want to do that, and it 
     4  // prevents problems with validation and fillin. 0.6 
     5?> 
     6<?php slot('login') ?> 
     7<?php end_slot() ?> 
    18<?php use_helper('Validation') ?> 
    2 <?php echo form_tag('sfApply/apply', array('name' => 'sfApplyApply', 'id' => 'sfApplyApply')) ?> 
    3 <div class="apply_row"> 
     9<?php echo form_tag('sfApply/apply', array('name' => 'sf_apply_apply', 'id' => 'sf_apply_apply')) ?> 
     10<div class="sf_apply_row"> 
    411<label for="username">Username: </label> 
    5 <div class="apply_row_content"> 
     12<div class="sf_apply_row_content"> 
    613<?php echo form_error('username') ?> 
    714<?php echo input_tag('username', '', array("maxlength" => 16)) ?> 
    815</div> 
    916</div> 
    10 <div class="apply_row"> 
     17<div class="sf_apply_row"> 
    1118<label for="fullname">Full Name: </label> 
    12 <div class="apply_row_content"> 
     19<div class="sf_apply_row_content"> 
    1320<?php echo form_error('fullname') ?> 
    1421<?php echo input_tag('fullname') ?> 
    1522</div> 
    1623</div> 
    17 <div class="apply_row"> 
     24<div class="sf_apply_row"> 
    1825<label for="email">Email: </label> 
    19 <div class="apply_row_content"> 
     26<div class="sf_apply_row_content"> 
    2027<?php echo form_error('email') ?> 
    2128<?php echo input_tag('email') ?> 
    2229</div> 
    2330</div> 
    24 <div class="apply_row"> 
     31<div class="sf_apply_row"> 
    2532<label for="email2">Confirm Email: </label> 
    26 <div class="apply_row_content"> 
     33<div class="sf_apply_row_content"> 
    2734<?php echo input_tag('email2') ?> 
    2835</div> 
    2936</div> 
    30 <div class="apply_row"> 
     37<div class="sf_apply_row"> 
    3138<?php echo form_error('password') ?> 
    3239<label for="password">Desired Password:</label> 
    33 <div class="apply_row_content"> 
     40<div class="sf_apply_row_content"> 
    3441<?php echo input_password_tag('password') ?> 
    3542</div> 
    3643</div> 
    37 <div class="apply_row"> 
     44<div class="sf_apply_row"> 
    3845<label for="password2">Confirm Password:</label> 
    39 <div class="apply_row_content"> 
     46<div class="sf_apply_row_content"> 
    4047<?php echo input_password_tag('password2') ?> 
    4148</div> 
    4249</div> 
    43 <div class="apply_submit_row"> 
     50<div class="sf_apply_submit_row"> 
    4451<label></label> 
    4552<?php echo submit_tag('Create My Account') ?> or  
  • plugins/sfApplyPlugin/trunk/modules/sfApply/templates/confirmInvalid.php

    r13802 r13826  
    1 <div class="apply-notice"> 
     1<div class="sf_apply_notice"> 
    22<p> 
    33That confirmation code is invalid.  
  • plugins/sfApplyPlugin/trunk/modules/sfApply/templates/confirmSuccess.php

    r13802 r13826  
    1 <p class="apply_notice"> 
     1<div class="sf_apply_notice"> 
     2<p> 
    23Thank you for confirming your account! You are now logged into the site. 
    34</p> 
     
    56<?php echo button_to("Continue", "@homepage") ?> 
    67</p> 
     8</div> 
  • plugins/sfApplyPlugin/trunk/modules/sfApply/templates/resetAfter.php

    r13802 r13826  
    1 <div class="apply-notice"> 
     1<div class="sf_apply_notice"> 
    22<p> 
    33Your password has been successfully reset. You are now logged 
  • plugins/sfApplyPlugin/trunk/modules/sfApply/templates/resetRequestAfter.php

    r13802 r13826  
    1 <div class="apply-notice"> 
     1<div class="sf_apply_notice"> 
    22<p> 
    33For security reasons, a confirmation message has been sent to  
  • plugins/sfApplyPlugin/trunk/modules/sfApply/templates/resetRequestSuccess.php

    r13802 r13826  
     1<?php slot('login') ?> 
     2<?php end_slot() ?> 
    13<?php use_helper('Validation') ?> 
    2 <?php echo form_tag('sfApply/resetRequest', array('name' => 'sfApplyResetRequest', 'id' => 'sfApplyResetRequest')) ?> 
     4<?php echo form_tag('sfApply/resetRequest', array('name' => 'sf_apply_reset_request', 'id' => 'sf_apply_reset_request')) ?> 
    35<p> 
    46Forgot your password? No problem! Just enter your username and 
     
    79account. 
    810</p> 
    9 <div class="apply_row"> 
     11<div class="sf_apply_row"> 
    1012<label for="username">Username: </label> 
    11 <div class="apply_row_content"> 
     13<div class="sf_apply_row_content"> 
    1214<?php echo form_error('username') ?> 
    1315<?php echo input_tag('username') ?> 
    1416</div> 
    1517</div> 
    16 <div class="apply_submit_row"> 
     18<div class="sf_apply_submit_row"> 
    1719<label></label> 
    1820<?php echo submit_tag('Reset My Password') ?>, or  
  • plugins/sfApplyPlugin/trunk/modules/sfApply/templates/resetSuccess.php

    r13802 r13826  
     1<?php slot('login') ?> 
     2<?php end_slot() ?> 
    13<?php use_helper('Validation') ?> 
    2 <?php echo form_tag('sfApply/reset', array('name' => 'sfApplyReset', 'id' => 'sfApplyReset')) ?> 
    3 <div class="apply-notice"> 
     4<?php echo form_tag('sfApply/reset', array('name' => 'sfApplyReset', 'id' => 'sf_apply_reset')) ?> 
     5<div class="sf_apply_notice"> 
    46<p> 
    57Thanks for confirming your email address. You may now change your 
     
    79</p> 
    810</div> 
    9 <div class="apply_row"> 
     11<div class="sf_apply_row"> 
    1012<?php echo form_error('password') ?> 
    1113<label for="password">Desired New Password:</label> 
    12 <div class="apply_row_content"> 
     14<div class="sf_apply_row_content"> 
    1315<?php echo input_password_tag('password') ?> 
    1416</div> 
    1517</div> 
    16 <div class="apply_row"> 
     18<div class="sf_apply_row"> 
    1719<label for="password2">Confirm New Password:</label> 
    18 <div class="apply_row_content"> 
     20<div class="sf_apply_row_content"> 
    1921<?php echo input_password_tag('password2') ?> 
    2022</div> 
    2123</div> 
    22 <div class="apply_submit_row"> 
     24<div class="sf_apply_submit_row"> 
    2325<label></label> 
    2426<?php echo submit_tag('Reset My Password') ?>, or  
  • plugins/sfApplyPlugin/trunk/modules/sfApply/templates/settingsSuccess.php

    r13802 r13826  
    11<?php use_helper('Validation') ?> 
    2 <?php echo form_tag('sfApply/settings', array('name' => 'sfApplySettings', 'id' => 'sfApplySettings')) ?> 
    3 <div class="apply_row"> 
     2<h2 class="sf_apply_heading">Account Settings</h2> 
     3<?php echo form_tag('sfApply/settings', array('name' => 'sf_apply_settings', 'id' => 'sf_apply_settings')) ?> 
     4<div class="sf_apply_row"> 
    45<label for="fullname">Full Name: </label> 
    5 <div class="apply_row_content"> 
     6<div class="sf_apply_row_content"> 
    67<?php echo form_error('fullname') ?> 
    78<?php echo input_tag('fullname', $sf_user->getGuardUser()->getProfile()->getFullname()) ?> 
     
    1112<?php echo button_to('Cancel', '@homepage') ?> 
    1213</form> 
    13 <?php echo form_tag('sfApply/resetRequest', array('name' => 'sfApplyResetRequest', 'id' => 'sfApplyResetRequest')) ?> 
     14<?php echo form_tag('sfApply/resetRequest', array('name' => 'sf_apply_reset_request', 'id' => 'sf_apply_reset_request')) ?> 
    1415<p> 
    1516Click the button below to change your password. For security reasons, you  
  • plugins/sfApplyPlugin/trunk/modules/sfApply/validate/apply.yml

    r13802 r13826  
    22  enabled: true 
    33  param: 
    4     name: sfApplyApply 
     4    name: sf_apply_apply 
    55 
    66fields: 
  • plugins/sfApplyPlugin/trunk/modules/sfApply/validate/settings.yml

    r13802 r13826  
    22  enabled: true 
    33  param: 
    4     name: sfApplySettings 
     4    name: sf_apply_settings 
    55 
    66fields: 
  • plugins/sfApplyPlugin/trunk/package.xml

    r13802 r13826  
    1414 <time>16:09:13</time> 
    1515 <version> 
    16   <release>0.5.1</release> 
    17   <api>0.5.0</api> 
     16  <release>0.6.0</release> 
     17  <api>0.6.0</api> 
    1818 </version> 
    1919 <stability>