Changeset 909 for LATMOS-Accounts-Web


Ignore:
Timestamp:
02/24/12 09:50:44 (12 years ago)
Author:
nanardon
Message:
  • each attribute can be now documented from configuration
Location:
LATMOS-Accounts-Web
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrForms.pm

    r902 r909  
    217217        $self->escape($label || $attr), 
    218218    ); 
     219} 
     220 
     221sub attr_hint { 
     222    my ($self, $attr) = @_; 
     223    LATMOS::Accounts::Web->config->{attrs} ||= {}; 
     224    if (my $attr_config = LATMOS::Accounts::Web->config->{attrs}{$attr}) { 
     225        return $attr_config->{hint} || ''; 
     226    } 
     227    return; 
    219228} 
    220229 
  • LATMOS-Accounts-Web/root/html/create/default.tt

    r861 r909  
    66<input type="hidden" name="step" value="[% ochelper.step | html %]"> 
    77[% IF ochelper.name.ask %] 
    8 <tr><td>Nom de l'objet:</td> 
     8<tr><th>Nom de l'objet:</th> 
    99<td><input id="_name" type="text" name="_name" value="[% ochelper.name.content | html %]"> 
    1010[% c.prototype.observe_field( '_name', { 
     
    1818[% END %] 
    1919[% FOREACH attr = ochelper.ask %] 
    20 <tr><td>[% form.attr_label(attr) %]</td> 
     20<tr> 
     21<th> 
     22    [% form.attr_label(attr) %] 
     23    [% IF form.attr_hint(attr) %] 
     24    <span 
     25        title="[% form.attr_hint(attr) | html %]" 
     26        class="hint">?</span> 
     27    [% END %] 
     28</th> 
    2129<td>[% form.attr_field(attr) %]</td></tr> 
    2230[% END %] 
  • LATMOS-Accounts-Web/root/html/includes/form.tt

    r861 r909  
    11<!-- $Id$ --> 
     2 
    23<div id="oform" class="oform"> 
    34[% attributes = form.attributes() %] 
     
    1112</th></tr> 
    1213[% END %] 
    13 <tr><th>[% form.attr_label(attr) %]</th><td>[% form.attr_field(attr) %]</td> 
     14<tr> 
     15    <th> 
     16        [% form.attr_label(attr) %] 
     17        [% IF form.attr_hint(attr) %] 
     18        <span 
     19            title="[% form.attr_hint(attr) | html %]" 
     20            class="hint">?</span> 
     21        [% END %] 
     22    </th> 
     23    <td>[% form.attr_field(attr) %]</td> 
     24</tr> 
    1425[% IF loop.last %] 
    1526[% IF form.write_attributes %] 
  • LATMOS-Accounts-Web/root/html/users/address_form.tt

    r861 r909  
    11<!-- $Id$ --> 
    22<table border="1"> 
     3 
     4[% FOREACH attrs IN [ 'site', 'description', 'isMainAddress', 
     5    'physicalDeliveryOfficeName', 'telephoneNumber' ] %] 
    36<tr> 
    4     <th>[% form.attr_label('site') %]</th> 
    5     <td>[% form.attr_field('site') %]</td> 
     7    <th> 
     8        [% form.attr_label(attrs) %] 
     9 
     10        [% IF form.attr_hint(attrs) %] 
     11        <span 
     12            title="[% form.attr_hint(attrs) | html %]" 
     13            class="hint">?</span> 
     14        [% END %] 
     15 
     16    </th> 
     17    <td>[% form.attr_field(attrs) %]</td> 
    618</tr> 
    7 <tr> 
    8     <th>[% form.attr_label('description') %]</th> 
    9     <td>[% form.attr_field('description') %]</td> 
    10 </tr> 
    11 <tr> 
    12     <th>[% form.attr_label('isMainAddress') %]</th> 
    13     <td>[% form.attr_field('isMainAddress') %]</td> 
    14 </tr> 
    15 <tr> 
    16     <th>[% form.attr_label('physicalDeliveryOfficeName') %]</th> 
    17     <td>[% form.attr_field('physicalDeliveryOfficeName') %]</td> 
    18 </tr> 
    19 <tr> 
    20     <th>[% form.attr_label('telephoneNumber') %]</th> 
    21     <td>[% form.attr_field('telephoneNumber') %]</td> 
    22 </tr> 
     19[% END %] 
     20 
    2321[% IF NOT c.req.param('add_addr') %] 
    2422<tr> 
    25     <th>[% form.attr_label('exported') %]</th> 
     23    <th> 
     24        [% form.attr_label('exported') %] 
     25 
     26        [% IF form.attr_hint('exported') %] 
     27        <span 
     28            title="[% form.attr_hint('exported') | html %]" 
     29            class="hint">?</span> 
     30        [% END %] 
     31    </th> 
    2632    <td>[% form.attr_field('exported', 'checkbox') %]</td> 
    2733</tr> 
     
    2935<input type="hidden" value="1" name="exported"> 
    3036[% END %] 
     37 
    3138[% IF address.get_c_field('site') %] 
    3239[% fieldtype = 'label' %] 
     
    3542    Les champs suivants ne sont à remplir que si le site n'est pas précisé 
    3643</td></tr> 
     44 
     45[% FOREACH attrs IN [ 'streetAddress', 'postOfficeBox', 'postalCode', 'l', 'st', 
     46    'facsimileTelephoneNumber', 'co' ] %] 
    3747<tr> 
    38     <tr><th>[% form.attr_label('streetAddress') %]</th> 
    39     <td>[% form.attr_field('streetAddress', fieldtype) %]</td> 
     48    <th> 
     49        [% form.attr_label(attrs) %] 
     50        [% IF form.attr_hint(attrs) %] 
     51        <span 
     52            title="[% form.attr_hint(attrs) | html %]" 
     53            class="hint">?</span> 
     54        [% END %] 
     55    </th> 
     56    <td>[% form.attr_field(attrs, fieldtype) %]</td> 
    4057</tr> 
    41 <tr> 
    42     <tr><th>[% form.attr_label('postOfficeBox') %]</th> 
    43     <td>[% form.attr_field('postOfficeBox', fieldtype) %]</td> 
    44 </tr> 
    45 <tr> 
    46     <tr><th>[% form.attr_label('postalCode') %]</th> 
    47     <td>[% form.attr_field('postalCode', fieldtype) %]</td> 
    48 </tr> 
    49 <tr> 
    50     <tr><th>[% form.attr_label('l') %]</th> 
    51     <td>[% form.attr_field('l', fieldtype) %]</td> 
    52 </tr> 
    53 <tr> 
    54     <tr><th>[% form.attr_label('st') %]</th> 
    55     <td>[% form.attr_field('st', fieldtype) %]</td> 
    56 </tr> 
    57 <tr> 
    58     <tr><th>[% form.attr_label('facsimileTelephoneNumber') %]</th> 
    59     <td>[% form.attr_field('facsimileTelephoneNumber', fieldtype) %]</td> 
    60 </tr> 
    61 <tr> 
    62     <tr><th>[% form.attr_label('co') %]</th> 
    63     <td>[% form.attr_field('co', fieldtype) %]</td> 
    64 </tr> 
     58[% END %] 
     59 
    6560[% IF form.write_attributes %] 
    6661<tr> 
  • LATMOS-Accounts-Web/root/static/style.css

    r861 r909  
    193193} 
    194194 
     195span.hint { 
     196    /* 
     197     * width:  2em; 
     198     * height: 2em; 
     199    */ 
     200    vertical-align: super; 
     201} 
     202 
    195203div#login { 
    196204    margin-top: 1em; 
Note: See TracChangeset for help on using the changeset viewer.