Changeset 683


Ignore:
Timestamp:
Oct 9, 2005, 11:51:40 PM (16 years ago)
Author:
Earle Martin
Message:

new "summary" metadata field

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Changes

    r682 r683  
    110.51
     2        New "summary" metadata field for one-line summaries of nodes.
     3        Add "summary" field to RDF as dc:description.
    24        Add "address" field that had got missed out from the RDF.
    35        Replace underscores in node names in redirection message with spaces.
  • trunk/lib/OpenGuides.pm

    r682 r683  
    734734    }
    735735   
    736     foreach my $var ( qw( username comment edit_type ) ) {
     736    foreach my $var ( qw( summary username comment edit_type ) ) {
    737737        $metadata{$var} = $q->param($var) || "";
    738738    }
  • trunk/lib/OpenGuides/RDF.pm

    r682 r683  
    7878    my $catrefs            = $node_data{metadata}{category};
    7979    my @locales            = @{ $node_data{metadata}{locale} || [] };
     80    my $summary            = $node_data{metadata}{summary}[0]            || '';
    8081
    8182    # replace any errant characters in data to prevent illegal XML
     
    140141  <$objType rdf:ID="obj" dc:title="$node_name">
    141142};
     143    $rdf .= "    <dc:description>$summary</dc:description>\n" if $summary;
     144
    142145    $rdf .= "\n    <!-- categories -->\n\n" if $catrefs;
    143146    $rdf .= "    <dc:subject>$_</dc:subject>\n" foreach @{$catrefs};
  • trunk/lib/OpenGuides/Template.pm

    r682 r683  
    282282    my $hours_text = $args{metadata} ? $metadata{opening_hours_text}[0]
    283283                                    : $q->param("hours_text");
     284
     285    my $summary = $args{metadata} ? $metadata{summary}[0]
     286                                  : $q->param("summary");
     287                                 
    284288    my %vars = (
    285289        categories             => \@categories,
     
    288292        locale                 => \@loclist,
    289293        formatted_website_text => $formatted_website_text,
    290         hours_text             => $hours_text
     294        hours_text             => $hours_text,
     295        summary                => $summary,
    291296    );
    292297
    293298    if ( $args{metadata} ) {
    294299        foreach my $var ( qw( phone fax address postcode os_x os_y osie_x
    295                               osie_y latitude longitude map_link website) ) {
     300                              osie_y latitude longitude map_link website
     301                              summary) ) {
    296302            $vars{$var} = $metadata{$var}[0];
    297303        }
     
    333339        }
    334340    } else {
    335         foreach my $var ( qw( phone fax address postcode map_link website) ) {
     341        foreach my $var ( qw( phone fax address postcode map_link website summary) ) {
    336342            $vars{$var} = $q->param($var);
    337343        }
  • trunk/t/21_rdf.t

    r682 r683  
    66use OpenGuides::Test;
    77use URI::Escape;
    8 use Test::More tests => 25;
     8use Test::More tests => 26;
    99
    1010eval { require DBD::SQLite; };
     
    5858                         opening_hours_text => "test hours",
    5959                         latitude           => "51.524193",
    60                          longitude          => "-0.114436"
     60                         longitude          => "-0.114436",
     61       summary            => "a nice pub",
    6162                       }
    6263    );
     
    99100    like( $rdfxml, qr|<geo:lat>51.524193</geo:lat>|, "latitude" );
    100101    like( $rdfxml, qr|<geo:long>-0.114436</geo:long>|, "longitude" );
     102    like( $rdfxml, qr|<dc:description>a nice pub</dc:description>|, "summary (description)" );
    101103
    102104    like( $rdfxml, qr|<dc:date>|, "date element included" );
  • trunk/templates/edit_form.tt

    r682 r683  
    5959          <legend>Metadata (optional)</legend>
    6060          <table summary="Form for entering metadata about the subject of this node">
     61            <tr>
     62              <td class="label" colspan="2"><label for="summary">One-line summary of this node:</label></td>
     63            </tr>
     64            <tr>
     65              <td colspan="2"><input type="text" size="50" id="summary" name="summary" value="[% summary %]" /></td>
     66            </tr>
    6167            <tr>
    6268              <td class="label"><label for="phone">Phone:</label></td>
Note: See TracChangeset for help on using the changeset viewer.