Author: nick Date: 2006-08-24 17:43:30 +0100 (Thu, 24 Aug 2006) New Revision: 844
Added: trunk/templates/common_categories.tt trunk/templates/common_locales.tt Modified: trunk/MANIFEST trunk/README.CSS trunk/lib/OpenGuides.pm trunk/templates/node.tt Log: Support the optional common categories and locales. Closes #134
Modified: trunk/MANIFEST =================================================================== --- trunk/MANIFEST 2006-08-24 16:08:03 UTC (rev 843) +++ trunk/MANIFEST 2006-08-24 16:43:30 UTC (rev 844) @@ -30,6 +30,8 @@ templates/admin_home.tt templates/backlink_results.tt templates/banner.tt +templates/common_categories.tt +templates/common_locales.tt templates/delete_confirm.tt templates/delete_done.tt templates/delete_password_wrong.tt
Modified: trunk/README.CSS =================================================================== --- trunk/README.CSS 2006-08-24 16:08:03 UTC (rev 843) +++ trunk/README.CSS 2006-08-24 16:43:30 UTC (rev 844) @@ -157,6 +157,42 @@ Used in: display_metadata.tt Purpose: To display the image for a node
+div#common_navigation + Used in: node.tt + Purpose: Hold the common locales and categories, if enabled + +div#common_categories + Used in: common_categories.tt + Purpose: Hold the common categories, if enabled +h3#common_categories_title + Used in: common_categories.tt + Purpose: Title for the common categories +ul#common_categories_list + Used in: common_categories.tt + Purpose: Parent list for the common categories +li.common_category + Used in: common_categories.tt + Purpose: A common category +a.common_category_link + Used in: common_categories.tt + Purpose: A link to a common category + +div#common_locales + Used in: common_locales.tt + Purpose: Hold the common locales, if enabled +h3#common_locales_title + Used in: common_locales.tt + Purpose: Title for the common locales +ul#common_locales_list + Used in: common_locales.tt + Purpose: Parent list for the common locales +li.common_locale + Used in: common_locales.tt + Purpose: A common locale +a.common_locale_link + Used in: common_locales.tt + Purpose: A link to a common locale + input#address Used in: edit_conflict.tt, edit_form.tt Purpose: An input field for the address of the node
Modified: trunk/lib/OpenGuides.pm =================================================================== --- trunk/lib/OpenGuides.pm 2006-08-24 16:08:03 UTC (rev 843) +++ trunk/lib/OpenGuides.pm 2006-08-24 16:43:30 UTC (rev 844) @@ -208,6 +208,14 @@ wgs84_lat => $wgs84_lat );
+ # Should we include a standard list of categories or locales? + if ($config->enable_common_categories || $config->enable_common_locales) { + $tt_vars{common_catloc} = 1; + $tt_vars{common_categories} = $config->enable_common_categories; + $tt_vars{common_locales} = $config->enable_common_locales; + $tt_vars{catloc_link} = $config->script_url . "?id="; + } + if ( $raw =~ /^#REDIRECT\s+(.+?)\s*$/ ) { my $redirect = $1; # Strip off enclosing [[ ]] in case this is an extended link.
Added: trunk/templates/common_categories.tt =================================================================== --- trunk/templates/common_categories.tt 2006-08-24 16:08:03 UTC (rev 843) +++ trunk/templates/common_categories.tt 2006-08-24 16:43:30 UTC (rev 844) @@ -0,0 +1,8 @@ +<div id="common_categories"> + <h3 id="common_categories_title">Categories</h3> + <ul id="common_categories_list"> + [% FOREACH cat = [ 'Cafes', 'Coffee Shops', 'Pubs', 'Restaurants', 'Supermarkets', 'Cinemas', 'Theatres' ] %] + <li class="common_category"><a class="common_category_link" href="[% catloc_link %][% cat %]">[% cat %]</a></li> + [% END %] + </ul> +</div>
Added: trunk/templates/common_locales.tt =================================================================== --- trunk/templates/common_locales.tt 2006-08-24 16:08:03 UTC (rev 843) +++ trunk/templates/common_locales.tt 2006-08-24 16:43:30 UTC (rev 844) @@ -0,0 +1,8 @@ +<div id="common_locales"> + <h3 id="common_locales_title">Locales</h3> + <ul id="common_locales_list"> + [% FOREACH loc = [ 'North', 'South', 'East', 'West', 'Central' ] %] + <li class="common_locale"><a class="common_locale_link" href="[% catloc_link %][% loc %]">[% loc %]</a></li> + [% END %] + </ul> +</div>
Modified: trunk/templates/node.tt =================================================================== --- trunk/templates/node.tt 2006-08-24 16:08:03 UTC (rev 843) +++ trunk/templates/node.tt 2006-08-24 16:43:30 UTC (rev 844) @@ -142,4 +142,16 @@ </div> [% END %] </div> + +[% IF common_catloc %] +<div id="common_navigation"> + [% IF common_categories %] + [% INCLUDE common_categories.tt %] + [% END %] + [% IF common_locales %] + [% INCLUDE common_locales.tt %] + [% END %] +</div> +[% END %] + [% INCLUDE footer.tt %]
openguides-commits@lists.openguides.org