Changeset 1086

Show
Ignore:
Timestamp:
06/17/07 03:15:31 (16 months ago)
Author:
ilmari
Message:

r22807@vesla: ilmari | 2007-06-17 02:04:48 +0100
Move the common categories/locales navbar display decision into the templates (fixes #214)

Location:
trunk
Files:
1 added
1 removed
6 modified

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/Changes

    r1085 r1086  
    2323        The "Look for nearby geocaches" preference and link now actually work 
    2424          (#216). 
     25        Move the common categories/locales navbar display decision into the 
     26          templates (#214). 
    2527 
    26280.60    13 May 2007 
  • trunk/lib/OpenGuides.pm

    r1070 r1086  
    259259           && $self->get_cookie( "display_google_maps" ) ) { 
    260260        $tt_vars{display_google_maps} = 1; 
    261     } 
    262  
    263     # Should we include a standard list of categories or locales? 
    264     if ($config->enable_common_categories || $config->enable_common_locales) { 
    265         $tt_vars{common_catloc} = 1; 
    266         $tt_vars{common_categories} = $config->enable_common_categories; 
    267         $tt_vars{common_locales} = $config->enable_common_locales; 
    268         $tt_vars{catloc_link} = $config->script_url . $config->script_name 
    269                                 . "?id="; 
    270261    } 
    271262 
     
    671662    } 
    672663    $tt_vars{not_editable} = 1; 
    673     if ($config->enable_common_categories || $config->enable_common_locales) { 
    674         $tt_vars{common_catloc} = 1; 
    675         $tt_vars{common_categories} = $config->enable_common_categories; 
    676         $tt_vars{common_locales} = $config->enable_common_locales; 
    677         $tt_vars{catloc_link} = $config->script_url . $config->script_name 
    678                                 . "?id="; 
    679     } 
    680664    $tt_vars{recent_changes} = \%recent_changes; 
    681665    my %processing_args = ( 
  • trunk/newpage.cgi

    r1045 r1086  
    3131 
    3232sub show_form { 
    33     my %tt_vars = ( 
    34                     not_editable     => 1, 
    35                     not_deletable    => 1, 
    36                     deter_robots     => 1, 
    37                     disallowed_chars => \@badchars, 
    38                     pagename         => $pagename, 
    39                   ); 
    40     if ($config->enable_common_categories || $config->enable_common_locales) { 
    41         $tt_vars{common_catloc} = 1; 
    42         $tt_vars{common_categories} = $config->enable_common_categories; 
    43         $tt_vars{common_locales} = $config->enable_common_locales; 
    44         $tt_vars{catloc_link} = $config->script_url . $config->script_name 
    45                                 . "?id="; 
    46     } 
    4733    print OpenGuides::Template->output( wiki     => $wiki, 
    4834                                        config   => $config, 
    4935                                        template => "newpage.tt", 
    50                                         vars     => \%tt_vars, 
     36                                        vars     => { 
     37                                            not_editable     => 1, 
     38                                            not_deletable    => 1, 
     39                                            deter_robots     => 1, 
     40                                            disallowed_chars => \@badchars, 
     41                                            pagename         => $pagename } 
    5142    ); 
    5243} 
  • trunk/templates/navbar_categories.tt

    r988 r1086  
    1 [% IF common_categories %] 
     1[% IF config.enable_common_categories %] 
    22  <div id="navbar_categories"> 
    33    <div class="navbar_group_title">Categories:</div> 
     
    55      [% FOREACH cat = [ 'Cafes', 'Coffee Shops', 'Pubs', 'Restaurants', 
    66                         'Supermarkets', 'Cinemas', 'Theatres' ] %] 
    7         <li><a href="[% catloc_link %]Category_[% cat %]">[% cat %]</a></li> 
     7        <li><a href="[% config.script_url _ config.script_name %]?id=Category_[% cat %]">[% cat %]</a></li> 
    88      [% END %] 
    99    </ul> 
  • trunk/templates/navbar_locales.tt

    r988 r1086  
    1 [% IF common_locales %] 
     1[% IF config.enable_common_locales %] 
    22  <div id="navbar_locales"> 
    33    <div class="navbar_group_title">Locales:</div> 
    44    <ul class="navbar_group"> 
    55      [% FOREACH loc = [ 'North', 'South', 'East', 'West', 'Central' ] %] 
    6         <li><a href="[% catloc_link %]Locale_[% loc %]">[% loc %]</a></li> 
     6        <li><a href="[% config.script_url _ config.script_name %]?id=Locale_[% loc %]">[% loc %]</a></li> 
    77      [% END %] 
    88    </ul>