Author: kake Date: 2012-05-05 13:14:17 +0100 (Sat, 05 May 2012) New Revision: 1386
Modified: trunk/t/904_leaflet.t trunk/templates/map_index_leaflet.tt Log: Fixed <title> on map index.
Modified: trunk/t/904_leaflet.t =================================================================== --- trunk/t/904_leaflet.t 2012-05-05 11:34:21 UTC (rev 1385) +++ trunk/t/904_leaflet.t 2012-05-05 12:14:17 UTC (rev 1386) @@ -11,8 +11,11 @@ "DBD::SQLite could not be used - no database to test with. ($error)"; }
-plan tests => 23; +eval { require Test::HTML::Content; }; +my $thc = $@ ? 0 : 1;
+plan tests => 25; + my $config = OpenGuides::Test->make_basic_config; $config->static_url( "http://example.com/static" ); my $guide = OpenGuides->new( config => $config ); @@ -173,3 +176,13 @@ "...and no warning about individual things not being on the map" ); unlike( $output, qr/centre_lat/, "...and no attempt to set centre_lat JavaScript variable" ); + +# Check titles when showing map of everything. +$output = $guide->show_index( format => "map", noheaders => 1, + return_output => 1 ); +SKIP: { + skip "Test::HTML::Content not available", 1 unless $thc; + Test::HTML::Content::title_ok( $output, qr/Map of all nodes/, + "<title> correct when showing map of everything" ); +} +like( $output, qr/<h2>Map\s+of\s+all\s+nodes/, "...as is <h2> title" );
Modified: trunk/templates/map_index_leaflet.tt =================================================================== --- trunk/templates/map_index_leaflet.tt 2012-05-05 11:34:21 UTC (rev 1385) +++ trunk/templates/map_index_leaflet.tt 2012-05-05 12:14:17 UTC (rev 1386) @@ -1,6 +1,10 @@ [% USE JSON.Escape %]
-[% page_title = "Map of $criteria_title - $site_name" %] +[% IF criteria %] + [% page_title = "Map of $criteria_title - $site_name" %] +[% ELSE %] + [% page_title = "Map of all nodes - $site_name" %] +[% END %] [% INCLUDE header.tt %] [% INCLUDE banner.tt %]