Changeset 941
- Timestamp:
- 03/17/07 15:05:27 (21 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 modified
-
Build.PL (modified) (2 diffs)
-
Changes (modified) (1 diff)
-
INSTALL (modified) (1 diff)
-
MANIFEST (modified) (1 diff)
-
README.CSS (modified) (1 diff)
-
lib/OpenGuides.pm (modified) (1 diff)
-
lib/OpenGuides/Config.pm (modified) (5 diffs)
-
t/45_home_recent_changes.t (added)
-
t/51_display_node.t (modified) (1 diff)
-
templates/home_node.tt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Build.PL
r937 r941 41 41 qw(use_plucene enable_page_deletion navbar_on_home_page backlinks_in_title 42 42 moderation_requires_password enable_node_image enable_common_categories 43 enable_common_locales );43 enable_common_locales recent_changes_on_home_page); 44 44 45 45 my $skip_config = Module::Build->y_n("Skip OpenGuides configuration?", "n"); … … 94 94 install_directory template_path custom_template_path script_url 95 95 custom_lib_path use_plucene indexing_directory enable_page_deletion 96 admin_pass stylesheet_url site_name navbar_on_home_page home_name 96 admin_pass stylesheet_url site_name navbar_on_home_page 97 recent_changes_on_home_page home_name 97 98 site_desc default_city default_country contact_email default_language 98 99 formatting_rules_node backlinks_in_title gmaps_api_key centre_long -
trunk/Changes
r937 r941 13 13 Let people add name of copyright holder, licence URL, and info page 14 14 URL for node images (#179). 15 Add config option to omit recent changes from home page. 15 16 Write tests for and fix: 16 17 #48 (Edit conflict page erroneously converts lat/lon to os_x, os_y). -
trunk/INSTALL
r886 r941 149 149 150 150 "Do you want the navigation bar included on the home page?" 151 152 Answer "y" or "n". 153 154 155 "Do you want the ten most recent changes included on the home page?" 151 156 152 157 Answer "y" or "n". -
trunk/MANIFEST
r938 r941 98 98 t/43_preview_edits.t 99 99 t/44_node_image.t 100 t/45_home_recent_changes.t 100 101 t/51_display_node.t 101 102 t/52_display_diffs.t -
trunk/README.CSS
r937 r941 139 139 Purpose: Recent changes summary box on the home node 140 140 141 div#home_page_edit_link 142 Used in: home_node.tt 143 Purpose: "Edit this page" link on the home node - only displayed if neither 144 the navbar or the recent changes box are shown, since both those divs also 145 contain an edit link. 146 141 147 div#search_form 142 148 Used in: footer.tt -
trunk/lib/OpenGuides.pm
r934 r941 285 285 $self->display_recent_changes(%args); 286 286 } elsif ( $id eq $self->config->home_name ) { 287 my @recent = $wiki->list_recent_changes( 288 last_n_changes => 10, 289 metadata_was => { edit_type => "Normal edit" }, 290 ); 291 @recent = map { 292 { 287 if ( $self->config->recent_changes_on_home_page ) { 288 my @recent = $wiki->list_recent_changes( 289 last_n_changes => 10, 290 metadata_was => { edit_type => "Normal edit" }, 291 ); 292 @recent = map { 293 { 293 294 name => CGI->escapeHTML($_->{name}), 294 last_modified => CGI->escapeHTML($_->{last_modified}), 295 last_modified => 296 CGI->escapeHTML($_->{last_modified}), 295 297 version => CGI->escapeHTML($_->{version}), 296 comment => CGI->escapeHTML($_->{metadata}{comment}[0]), 297 username => CGI->escapeHTML($_->{metadata}{username}[0]), 298 comment => 299 CGI->escapeHTML($_->{metadata}{comment}[0]), 300 username => 301 CGI->escapeHTML($_->{metadata}{username}[0]), 298 302 url => $config->script_name . "?" 299 . CGI->escape($wiki->formatter->node_name_to_node_param($_->{name})) 300 } 301 } @recent; 302 $tt_vars{recent_changes} = \@recent; 303 . CGI->escape($wiki->formatter->node_name_to_node_param($_->{name})) 304 } 305 } @recent; 306 $tt_vars{recent_changes} = \@recent; 307 } 303 308 return %tt_vars if $args{return_tt_vars}; 304 309 my $output = $self->process_template( -
trunk/lib/OpenGuides/Config.pm
r911 r941 10 10 script_name install_directory script_url 11 11 custom_lib_path use_plucene indexing_directory enable_page_deletion 12 admin_pass stylesheet_url site_name navbar_on_home_page home_name 12 admin_pass stylesheet_url site_name navbar_on_home_page 13 recent_changes_on_home_page home_name 13 14 site_desc default_city default_country contact_email 14 15 default_language http_charset ping_services … … 79 80 site_name => "Unconfigured OpenGuides site", 80 81 navbar_on_home_page => 1, 82 recent_changes_on_home_page => 1, 81 83 home_name => "Home", 82 84 site_desc => "A default configuration of OpenGuides", … … 152 154 site_name => "What's the site called? (should be unique)", 153 155 navbar_on_home_page => "Do you want the navigation bar included on the home page?", 156 recent_changes_on_home_page => "Do you want the ten most recent " 157 . "changes included on the home page?", 154 158 home_name => "What should the home page of the wiki be called?", 155 159 site_desc => "How would you describe the site?", … … 240 244 =item * navbar_on_home_page (default: true) 241 245 246 =item * recent_changes_on_home_page (default: true) 247 242 248 =item * home_name (default: C<Home>) 243 249 … … 290 296 =head1 COPYRIGHT 291 297 292 Copyright (C) 2004-200 6The OpenGuides Project. All Rights Reserved.298 Copyright (C) 2004-2007 The OpenGuides Project. All Rights Reserved. 293 299 294 300 The OpenGuides distribution is free software; you can redistribute it -
trunk/t/51_display_node.t
r785 r941 38 38 is( $@, "", "->display_node doesn't die" ); 39 39 40 like( $output, qr{\<a.*?\Qhref="alternate.cgi?id=Test_Page;action=edit" >Edit this page</a>\E}, "...and edit link is redirected to source URL" );40 like( $output, qr{\<a.*?\Qhref="alternate.cgi?id=Test_Page;action=edit"\E>Edit\s+this\s+page</a>}, "...and edit link is redirected to source URL" ); 41 41 $config->home_name( "My Home Page" ); 42 42 $output = $guide->display_node( return_output => 1 ); 43 like( $output, qr/My HomePage/, "...and defaults to the home node, and takes notice of what we want to call it" );44 like( $output, qr{\Q<a href="wiki.cgi?action=edit;id=My_Home_Page" >Edit this page</a>\E}, "...and home page has an edit link" );43 like( $output, qr/My\s+Home\s+Page/, "...and defaults to the home node, and takes notice of what we want to call it" ); 44 like( $output, qr{\Q<a href="wiki.cgi?action=edit;id=My_Home_Page"\E>Edit\s+this\s+page</a>}, "...and home page has an edit link" ); 45 45 my %tt_vars = $guide->display_node( return_tt_vars => 1 ); 46 46 ok( defined $tt_vars{recent_changes}, "...and recent_changes is set for the home node even if we have changed its name" ); -
trunk/templates/home_node.tt
r756 r941 24 24 [% END %] 25 25 26 [% IF !navbar_on_home_page AND !config.recent_changes_on_home_page %] 27 <div id="home_page_edit_link"> 28 <a href="[% cgi_url %]?action=edit;id=[% node_param %]">Edit this page</a> 29 </div> 30 [% END %] 31 26 32 <div id="maincontent"> 27 <div id="recent"> 33 [% IF config.recent_changes_on_home_page %] 34 <div id="recent"> 28 35 29 <h3>Ten most <a href="[% cgi_url %]?action=rc">recent changes</a>30 (<a href="[% full_cgi_url %]?action=rc;format=rss">RSS</a>):</h3>36 <h3>Ten most <a href="[% cgi_url %]?action=rc">recent changes</a> 37 (<a href="[% full_cgi_url %]?action=rc;format=rss">RSS</a>):</h3> 31 38 32 <dl> 33 [% FOREACH node = recent_changes %] 34 <dt><a href="[% node.url %]">[% node.name %]</a> 35 [% IF node.version == "1" %] 36 [new] 39 <dl> 40 [% FOREACH node = recent_changes %] 41 <dt><a href="[% node.url %]">[% node.name %]</a> 42 [% IF node.version == "1" %] 43 [new] 44 [% END %] 45 </dt> 46 [% IF node.comment or node.username %] 47 <dd> 48 [% node.comment %] 49 [% IF node.username %] 50 <b><small>([% node.username %])</small></b> 51 [% END %] 52 </dd> 53 [% END %] 54 [% END %] 55 </dl> 56 57 <p><b><a href="[% cgi_url %]?action=edit;id=[% node_param %]">Edit 58 this page</a></b></p> 59 60 </div> 37 61 [% END %] 38 </dt>39 [% IF node.comment or node.username %]40 <dd>41 [% node.comment %]42 [% IF node.username %]43 <b><small>([% node.username %])</small></b>44 [% END %]45 </dd>46 [% END %]47 [% END %]48 </dl>49 62 50 <p><b><a href="[% cgi_url %]?action=edit;id=[% node_param %]">Edit this page</a></b></p> 51 52 </div> 53 [% content %] 63 [% content %] 54 64 55 65 </div>
