Changeset 1084 for trunk/templates

Show
Ignore:
Timestamp:
06/16/07 22:33:16 (18 months ago)
Author:
ilmari
Message:

Preferences cleanup
- Separate preference defaulting from cookie parsing.
- Remove duplicate preference defaulting from the cgi.
- Use the prefs template variable in the template.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/templates/preferences.tt

    r1053 r1084  
    1414 
    1515    <p> 
    16     [% IF preview_above_edit_box %] 
     16    [% IF prefs.preview_above_edit_box %] 
    1717      <input type="checkbox" id="preview_above" name="preview_above_edit_box" value="1" checked /> 
    1818    [% ELSE %] 
     
    2323 
    2424    <p> 
    25     [% IF include_geocache_link %] 
     25    [% IF prefs.include_geocache_link %] 
    2626      <input type="checkbox" id="geocache" name="include_geocache_link" value="1" checked /> 
    2727    [% ELSE %] 
     
    3232 
    3333    <p> 
    34     [% IF latlong_traditional %] 
     34    [% IF prefs.latlong_traditional %] 
    3535      <input type="checkbox" id="latlong" name="latlong_traditional" value="1" checked /> 
    3636    [% ELSE %] 
     
    4141 
    4242    <p> 
    43     [% IF omit_help_links %] 
     43    [% IF prefs.omit_help_links %] 
    4444      <input type="checkbox" id="omit_help" name="omit_help_links" value="1" checked /> 
    4545    [% ELSE %] 
     
    5050 
    5151    <p> 
    52     [% IF show_minor_edits_in_rc %] 
     52    [% IF prefs.show_minor_edits_in_rc %] 
    5353      <input type="checkbox" id="show_minor" name="show_minor_edits_in_rc" value="1" checked /> 
    5454    [% ELSE %] 
     
    5959 
    6060    <p> 
    61       [% IF track_recent_changes_views %] 
     61      [% IF prefs.track_recent_changes_views %] 
    6262        <input type="checkbox" id="track_recent_changes_views" name="track_recent_changes_views" value="1" checked="1" /> 
    6363      [% ELSE %] 
     
    6969    [% IF gmaps_api_key AND config.show_gmap_in_node_display %] 
    7070      <p> 
    71         [% IF display_google_maps %] 
     71        [% IF prefs.display_google_maps %] 
    7272          <input type="checkbox" id="display_google_maps" name="display_google_maps" value="1" checked="1" /> 
    7373        [% ELSE %] 
     
    8181      <label for="default_edit_type">Default edit type:</label> 
    8282      <select name="default_edit_type" id="default_edit_type"> 
    83         [% IF default_edit_type == 'normal' %] 
     83        [% IF prefs.default_edit_type == 'normal' %] 
    8484          <option value="normal" selected="1">Normal edit</option> 
    8585          <option value="tidying">Minor tidying</option> 
     
    9494      <label for="cookie_expires">Preferences expire:</label> 
    9595      <select name="cookie_expires" id="cookie_expires"> 
    96         [% IF cookie_expires == 'never' %] 
     96        [% IF prefs.cookie_expires == 'never' %] 
    9797          <option value="month">in one month</option> 
    9898          <option value="year">in one year</option> 
    9999          <option value="never" selected="1">never</option> 
    100         [% ELSIF cookie_expires == "year" %] 
     100        [% ELSIF prefs.cookie_expires == "year" %] 
    101101          <option value="month">in one month</option> 
    102102          <option value="year" selected="1">in one year</option> 
     
    121121 
    122122  <p>Preview area shown 
    123     [% IF preview_above_edit_box %] 
     123    [% IF prefs.preview_above_edit_box %] 
    124124      above 
    125125    [% ELSE %] 
     
    133133 
    134134  <p>Latitude and longitude displayed as 
    135     [% IF latlong_traditional %] 
     135    [% IF prefs.latlong_traditional %] 
    136136      degrees and minutes. 
    137137    [% ELSE %] 
     
    141141 
    142142  <p>Help links will 
    143     [% IF omit_help_links %] not [% END %] 
     143    [% IF prefs.omit_help_links %] not [% END %] 
    144144    be included in navbar. 
    145145  </p> 
     
    153153  be tracked.</p> 
    154154 
    155   [% IF gmaps_api_key AND config.show_gmap_in_node_display %] 
     155  [% IF prefs.gmaps_api_key AND config.show_gmap_in_node_display %] 
    156156    <p>Google Maps will 
    157157      [% UNLESS display_google_maps %] not [% END %] 
     
    160160 
    161161  <p>Default edit type set to 
    162     [% IF default_edit_type == 'normal' %] 
     162    [% IF prefs.default_edit_type == 'normal' %] 
    163163      &#8220;Normal edit&#8221;. 
    164164    [% ELSE %] 
     
    168168 
    169169  <p>Your preferences will 
    170     [% IF cookie_expires == 'never' %] 
     170    [% IF prefs.cookie_expires == 'never' %] 
    171171      never expire. 
    172     [% ELSIF cookie_expires == 'year' %] 
     172    [% ELSIF prefs.cookie_expires == 'year' %] 
    173173      expire in one year. 
    174174    [% ELSE %]