Changeset 159

Show
Ignore:
Timestamp:
01/10/06 10:27:20
Author:
mylan
Message:

add Creator (Name) required field to discussion_reply_form.cpt form with appropriate validation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qPloneComments/trunk/skins/qplonecomments/discussion_reply_form.cpt

    r158 r159  
    2424        <fieldset> 
    2525            <legend i18n:translate="legend_comment_details">Comment Details</legend> 
     26 
    2627            <input type="hidden" name="Creator" value="" 
    2728                   tal:attributes="value member/getUserName" 
     
    2930 
    3031            <div class="field" 
    31                  tal:condition="python:isForAnonymous  and isAnon"> 
     32                 tal:condition="isForAnonymous"> 
    3233 
    33                 <label for="username" i18n:translate="label_name">Name</label> 
     34                <div class="field" 
     35                     tal:define="error errors/Creator|nothing;" 
     36                     tal:attributes="class python:test(error, 'field error', 'field');"> 
    3437 
    35                 <div class="formHelp" i18n:translate="help_name"> 
    36                 Enter your name for sign comment. Otherwise 'Anonymous user' will be used. 
     38                    <label for="username" i18n:translate="label_name">Name</label> 
     39 
     40                    <span class="fieldRequired" title="Required" 
     41                          tal:condition="isAnon" 
     42                          i18n:attributes="title" 
     43                          i18n:translate="label_required">(Required)</span> 
     44 
     45                    <div class="formHelp" i18n:translate="help_name" 
     46                         tal:condition="isAnon"> 
     47                    Enter your name for sign comment. 
     48                    </div> 
     49 
     50                    <div tal:content="error">Validation error output</div> 
     51 
     52                    <div> 
     53                        <input name="Creator" 
     54                               id="username" 
     55                               value="" alt="Submitter" title="Name" 
     56                               size="40" 
     57                               tabindex="" 
     58                               i18n:attributes="title" 
     59                               tal:attributes="tabindex tabindex/next; 
     60                                               value python:test(isAnon, '', member.getUserName()); 
     61                                               disabled python:test(isAnon, None, 'true')" /> 
     62 
     63                    </div> 
    3764                </div> 
    38  
    39                 <div> 
    40                     <input name="Creator" 
    41                            id="username" 
    42                            value="" alt="Submitter" title="Name" 
    43                            size="40" 
    44                            tabindex="" 
    45                            i18n:attributes="title" 
    46                            tal:attributes="tabindex tabindex/next;" /> 
    47  
    48                 </div> 
    49  
    5065            </div> 
    5166