Changeset 609


Ignore:
Timestamp:
Jan 5, 2005, 8:23:38 PM (17 years ago)
Author:
kake
Message:

Make default city/country be blank.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Changes

    r608 r609  
    55        Allow for external URLs for Text Formatting help.
    66        Home node recent changes box now flags new entries.
     7        Made default city and country be blank; specify them if you want them.
    78
    890.46    21 December 2004
  • trunk/lib/OpenGuides/Config.pm

    r608 r609  
    6969                     home_name => "Home",
    7070                     site_desc => "A default configuration of OpenGuides",
    71                      default_city => "London",
    72                      default_country => "United Kingdom",
     71                     default_city => "",
     72                     default_country => "",
    7373                     default_language => "en",
    7474                     formatting_rules_node => "Text Formatting Examples",
  • trunk/lib/OpenGuides/RDF.pm

    r608 r609  
    212212    $rdf .= "    <dc:subject>$_</dc:subject>\n"             foreach @{$catrefs};
    213213    $rdf .= "\n    <!-- address and geospatial data -->\n";
    214     $rdf .= "    <city>$city</city>"                        if $is_geospatial;
     214    $rdf .= "    <city>$city</city>" if $city && $is_geospatial;
    215215    $rdf .= "    <postalCode>$postcode</postalCode>\n"      if $postcode;
    216     $rdf .= "    <country>$country</country>\n"             if $is_geospatial;
     216    $rdf .= "    <country>$country</country>\n" if $country && $is_geospatial;
    217217    $rdf .= "    <foaf:based_near><wn:Neighborhood><foaf:name>$_</foaf:name></wn:Neighborhood></foaf:based_near>\n"   foreach @locales;
    218218
  • trunk/t/21_rdf.t

    r608 r609  
    11use CGI::Wiki::Setup::SQLite;
     2use OpenGuides;
    23use OpenGuides::Config;
    34use OpenGuides::RDF;
    45use OpenGuides::Utils;
     6use OpenGuides::Test;
    57use URI::Escape;
    6 use Test::More tests => 22;
     8use Test::More tests => 24;
    79
    810eval { require DBD::SQLite; };
     
    1012
    1113SKIP: {
    12     skip "DBD::SQLite not installed - no database to test with", 22
     14    skip "DBD::SQLite not installed - no database to test with", 24
    1315      unless $have_sqlite;
    1416
     
    101103    unlike( $rdfxml, qr|<dc:date>1970|, "hasn't defaulted to the epoch" );
    102104
     105    # Check that default city and country can be set to blank.
     106    $config = OpenGuides::Test->make_basic_config;
     107    $config->default_city( "" );
     108    $config->default_country( "" );
     109    my $guide = OpenGuides->new( config => $config );
     110    OpenGuides::Test->write_data(
     111                                  guide => $guide,
     112                                  node  => "Star Tavern",
     113                                  latitude => 51.498,
     114                                  longitude => -0.154,
     115                                );
     116    $rdf_writer = OpenGuides::RDF->new( wiki => $guide->wiki, config => $config );
     117    $rdfxml = $rdf_writer->emit_rdfxml( node => "Star Tavern" );
     118    unlike( $rdfxml, qr|<city>|, "no city in RDF when no default city" );
     119    unlike( $rdfxml, qr|<country>|, "...same for country" );
     120
    103121    # Now test that there's a nice failsafe where a node doesn't exist.
    104122    $rdfxml = eval { $rdf_writer->emit_rdfxml( node => "I Do Not Exist" ); };
Note: See TracChangeset for help on using the changeset viewer.