Changeset 393


Ignore:
Timestamp:
Jun 12, 2004, 5:15:14 PM (18 years ago)
Author:
kake
Message:

Fix bugs with URLs and <title> in category/locale index.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/OpenGuides.pm

    r392 r393  
    384384            my $name = ucfirst($args{type}) . " $args{value}" ;
    385385            my $url = $self->config->{_}->{script_name}
     386                      . "?"
    386387                      . ucfirst( $args{type} )
    387388                      . "_"
  • trunk/t/53_show_index.t

    r392 r393  
    33use Config::Tiny;
    44use OpenGuides;
    5 use Test::More tests => 4;
     5use Test::More tests => 6;
    66
    77eval { require DBD::SQLite; };
     
    99
    1010SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 4
     11    skip "DBD::SQLite not installed - no database to test with", 6
    1212      unless $have_sqlite;
    1313
     
    4848    };
    4949    is( $@, "", "->show_index doesn't die" );
     50    like( $output, qr|wiki.cgi\?Test_Page|,
     51          "...and includes correct links" );
     52    unlike( $output, qr|<title>\s*-|, "...sets <title> correctly" );
     53
    5054    $output = $guide->show_index(
    5155                                  type          => "category",
  • trunk/templates/header.tt

    r392 r393  
    33<head>
    44  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    5   [% IF (node_name == 'category index' || node_name == 'locale index') %]
    6   <title>Index of "[% criterion.name %]" - [% site_name %]</title>
     5  [% IF page_title %]
     6    <title>[% page_title %]</title>
    77  [% ELSE %]
    8   <title>[% node_name %] - [% site_name %]</title>
     8    <title>[% node_name %] - [% site_name %]</title>
    99  [% END %]
    1010  [% IF contact_email %]
  • trunk/templates/site_index.tt

    r392 r393  
    1 [% INCLUDE header.tt %]
     1[% INCLUDE header.tt page_title = "Index of $criterion.name - $site_name" %]
    22[% INCLUDE banner.tt %]
    33<div id="content">
  • trunk/wiki.cgi

    r392 r393  
    7777        my @nodes = $wiki->list_all_nodes();
    7878        $node = $nodes[int(rand(scalar(@nodes) + 1)) + 1];
    79         $guide->redirect_to_node($node);
     79        print $guide->redirect_to_node($node);
    8080        exit 0;
    8181    } elsif ($action eq 'find_within_distance') {
     
    330330
    331331    if ($written) {
    332         $guide->redirect_to_node($node);
     332        print $guide->redirect_to_node($node);
    333333    } else {
    334334        my %node_data = $wiki->retrieve_node($node);
Note: See TracChangeset for help on using the changeset viewer.