Ticket #18: rt15051.patch

File rt15051.patch, 13.1 KB (added by IVORW@…, 16 years ago)
  • Build.PL

    old new  
    7575   install_directory template_path custom_template_path script_url
    7676   custom_lib_path use_plucene indexing_directory enable_page_deletion
    7777   admin_pass stylesheet_url site_name navbar_on_home_page home_name
    78    site_desc default_city default_country contact_email default_language
     78   site_desc default_town default_city default_county default_state
     79   default_country contact_email default_language
    7980   formatting_rules_node backlinks_in_title
    8081  ) ) {
    8182    my $q_method = $var . "__qu";
  • lib/OpenGuides/Config.pm

    old new  
    88   dbtype dbname dbuser dbpass dbhost script_name install_directory script_url
    99   custom_lib_path use_plucene indexing_directory enable_page_deletion
    1010   admin_pass stylesheet_url site_name navbar_on_home_page home_name
    11    site_desc default_city default_country contact_email default_language
    12    formatting_rules_node formatting_rules_link backlinks_in_title template_path custom_template_path
    13    geo_handler ellipsoid
     11   site_desc default_town default_city default_county default_state default_country
     12   contact_email default_language formatting_rules_node formatting_rules_link
     13   backlinks_in_title template_path custom_template_path geo_handler ellipsoid
    1414);
    1515my @questions = map { $_ . "__qu" } @variables;
    1616OpenGuides::Config->mk_accessors( @variables );
     
    6969                     navbar_on_home_page => 1,
    7070                     home_name => "Home",
    7171                     site_desc => "A default configuration of OpenGuides",
     72                     default_town => "",
    7273                     default_city => "",
     74                     default_county => "",
     75                     default_state => "",
    7376                     default_country => "",
    7477                     default_language => "en",
    7578                     formatting_rules_node => "Text Formatting Examples",
     
    126129        navbar_on_home_page => "Do you want the navigation bar included on the home page?",
    127130        home_name => "What should the home page of the wiki be called?",
    128131        site_desc => "How would you describe the site?",
    129         default_city => "What city is the site based in?",
    130         default_country => "What country is the site based in?",
     132        default_town => "The following 5 questions about the location of your guide will take the responses: NONE - not applicable for this guide, blank - users can enter metadata for individual pages, A value e.g. London to force the same value for the whole guide. Town: ",
     133        default_city => "City: ",
     134        default_county => "County: ",
     135        default_state => "State: ",
     136        default_country => "Country: ",
    131137        contact_email => "Contact email address for the site administrator?",
    132138        default_language => "What language will the site be in? (Please give an ISO language code.)",
    133139        formatting_rules_node => "What's the name of the node or page to use for the text formatting rules link (this is by default an external document, but if you make formatting_rules_link empty, it will be a wiki node instead",
  • lib/OpenGuides/RDF.pm

    old new  
    4747        $node_url;
    4848      }; 
    4949    $self->{site_name}        = $config->site_name;
     50    $self->{default_town}     = $config->default_town     || "";
    5051    $self->{default_city}     = $config->default_city     || "";
     52    $self->{default_county}   = $config->default_county   || "";
     53    $self->{default_state}    = $config->default_state    || "";
    5154    $self->{default_country}  = $config->default_country  || "";
    5255    $self->{site_description} = $config->site_desc        || "";
    53 
     56    $self->{site_version}     = OpenGuides->VERSION;
    5457    $self;
    5558}
    5659
     
    6770    my $opening_hours_text = $node_data{metadata}{opening_hours_text}[0] || '';
    6871    my $address            = $node_data{metadata}{address}[0]            || '';
    6972    my $postcode           = $node_data{metadata}{postcode}[0]           || '';
     73    my $town               = $node_data{metadata}{town}[0]               || $self->{default_town};
    7074    my $city               = $node_data{metadata}{city}[0]               || $self->{default_city};
     75    my $county             = $node_data{metadata}{county}[0]             || $self->{default_county};
     76    my $state              = $node_data{metadata}{state}[0]              || $self->{default_state};
    7177    my $country            = $node_data{metadata}{country}[0]            || $self->{default_country};
    7278    my $latitude           = $node_data{metadata}{latitude}[0]           || '';
    7379    my $longitude          = $node_data{metadata}{longitude}[0]          || '';
    7480    my $version            = $node_data{version};
     81    my $site_version       = $self->{site_version};
    7582    my $username           = $node_data{metadata}{username}[0]           || '';
    7683    my $os_x               = $node_data{metadata}{os_x}[0]               || '';
    7784    my $os_y               = $node_data{metadata}{os_y}[0]               || '';
     
    8188
    8289    # replace any errant characters in data to prevent illegal XML
    8390    foreach ($phone, $fax, $website, $opening_hours_text, $address, $postcode,
    84              $city, $country, $latitude, $longitude, $version, $os_x, $os_y,
    85             @categories, @locales, $summary)
     91             $town, $city, $county, $state, $country, $latitude, $longitude,
     92             $version, $os_x, $os_y, @categories, @locales, $summary)
    8693    {
    8794      if ($_)
    8895      {
     
    150157    {
    151158      $rdf .= "\n    <!-- address and geospatial data -->\n\n";
    152159      $rdf .= "    <address>$address</address>\n"        if $address;
     160      $rdf .= "    <town>$town</town>\n"                 if $town;
    153161      $rdf .= "    <city>$city</city>\n"                 if $city;
     162      $rdf .= "    <county>$county</county>\n"           if $county;
     163      $rdf .= "    <state>$state</state>\n"              if $state;
    154164      $rdf .= "    <postalCode>$postcode</postalCode>\n" if $postcode;
    155165      $rdf .= "    <country>$country</country>\n"        if $country;
    156166
  • lib/OpenGuides/Template.pm

    old new  
    113113
    114114    my $script_name  = $config->script_name;
    115115    my $script_url   = $config->script_url;
     116    my $default_town = $config->default_town;
    116117    my $default_city = $config->default_city;
     118    my $default_county = $config->default_county;
     119    my $default_state = $config->default_state;
     120    my $default_country = $config->default_country;
    117121   
    118122    # Check cookie to see if we need to set the formatting_rules_link.
    119123    my ($formatting_rules_link, $omit_help_links);
     
    152156        openguides_version    => $OpenGuides::VERSION,
    153157        enable_page_deletion  => $enable_page_deletion,
    154158        language              => $config->default_language,
     159        default_town          => $default_town,
    155160        default_city          => $default_city,
     161        default_county        => $default_county,
     162        default_state         => $default_state,
     163        default_country       => $default_country,
    156164    };
    157165
    158166    if ($args{node}) {
  • templates/display_metadata.tt

    old new  
    1919    [% IF address %]
    2020      <li class="address">
    2121        <span class="metadata_label">Address:</span>
    22         [% CGI.escapeHTML(address) %]<!--, [% default_city %] --> [%# uncomment at left to show city %]
     22        [% CGI.escapeHTML(address) %],
     23        [% IF town %]
     24          [% CGI.escapeHTML(town) %],
     25        [% END %]
     26        [% IF city %]
     27          [% CGI.escapeHTML(city) %],
     28        [% END %]
     29        [% IF county %]
     30          [% CGI.escapeHTML(county) %],
     31        [% END %]
     32        [% IF state %]
     33          [% CGI.escapeHTML(state) %],
     34        [% END %]
     35        [% IF country %]
     36          [% CGI.escapeHTML(country) %],
     37        [% END %]
    2338        [% IF map_link %]
    2439          <a href="[% map_link %]">(map of this place)</a>
    2540        [% END %]
  • templates/edit_conflict.tt

    old new  
    6767        <td>[% CGI.escapeHTML(new_hours_text) %]</td>
    6868      </tr>
    6969            <tr>
    70         <td class="label"><label for="address">Address:</label></td>
     70        <td class="label"><label for="address">Street:</label></td>
    7171        <td><input type="text" size="50" id="address" name="address" value="[% stored_address %]"></td>
    7272        <td>[% CGI.escapeHTML(new_address) %]</td>
    7373      </tr>
    7474            <tr>
     75        <td class="label"><label for="town">Town:</label></td>
     76        <td><input type="text" size="50" name="town" value="[% stored_town %]"></td>
     77        <td>[% CGI.escapeHTML(new_town) %]</td>
     78      </tr>
     79            <tr>
     80        <td class="label"><label for="city">City:</label></td>
     81        <td><input type="text" size="50" name="city" value="[% stored_city %]"></td>
     82        <td>[% CGI.escapeHTML(new_city) %]</td>
     83      </tr>
     84            <tr>
     85        <td class="label"><label for="county">County:</label></td>
     86        <td><input type="text" size="50" name="county" value="[% stored_county %]"></td>
     87        <td>[% CGI.escapeHTML(new_county) %]</td>
     88      </tr>
     89            <tr>
     90        <td class="label"><label for="state">State:</label></td>
     91        <td><input type="text" size="50" name="state" value="[% stored_state %]"></td>
     92        <td>[% CGI.escapeHTML(new_state) %]</td>
     93      </tr>
     94            <tr>
     95        <td class="label"><label for="country">Country:</label></td>
     96        <td><input type="text" size="50" name="country" value="[% stored_country %]"></td>
     97        <td>[% CGI.escapeHTML(new_country) %]</td>
     98      </tr>
     99            <tr>
    75100        <td class="label"><label for="postcode">Postcode:</label></td>
    76101        <td><input type="text" size="50" id="postcode" name="postcode" value="[% stored_postcode %]"></td>
    77102        <td>[% CGI.escapeHTML(new_postcode) %]</td>
  • templates/edit_form.tt

    old new  
     1[% USE CGI %]
    12[% INCLUDE header.tt page_title = "Edit $node_name - $site_name" %]
    23<div id="content">
    34
     
    8182              <td><input type="text" size="50" id="hours" name="hours_text" value="[% hours_text %]" /></td>
    8283            </tr>
    8384            <tr>
    84               <td class="label"><label for="address">Address:</label></td>
     85              <td class="label"><label for="address">Street:</label></td>
    8586              <td><input type="text" size="50" id="address" name="address" value="[% address %]" /></td>
    8687            </tr>
     88            [% IF default_town != "NONE" %]
     89              <tr>
     90                <td class="label"><label for="town">Town:</label></td>
     91                [% IF default_town %]
     92                  <td><input type="checkbox" name="town" value="[% default_town %]" checked />
     93                  [% CGI.escapeHTML(default_town) %]</td>
     94                [% ELSE %]
     95                  <td><input type="text" size="50" name="town" value="[% town %]" /></td>
     96                [% END %]
     97              </tr>
     98            [% END %]
     99            [% IF default_city != "NONE" %]
     100              <tr>
     101                <td class="label"><label for="city">City:</label></td>
     102                [% IF default_city %]
     103                  <td><input type="checkbox" name="city" value="[% default_city %]" checked />
     104                  [% CGI.escapeHTML(default_city) %]</td>
     105                [% ELSE %]
     106                  <td><input type="text" size="50" name="city" value="[% city %]" /></td>
     107                [% END %]
     108              </tr>
     109            [% END %]
     110            [% IF default_county != "NONE" %]
     111              <tr>
     112                <td class="label"><label for="county">County:</label></td>
     113                [% IF default_county %]
     114                  <td><input type="checkbox" name="county" value="[% default_county %]" checked />
     115                  [% CGI.escapeHTML(default_county) %]</td>
     116                [% ELSE %]
     117                  <td><input type="text" size="50" name="county" value="[% county %]" /></td>
     118                [% END %]
     119              </tr>
     120            [% END %]
     121            [% IF default_state != "NONE" %]
     122              <tr>
     123                <td class="label"><label for="state">State:</label></td>
     124                [% IF default_state %]
     125                  <td><input type="checkbox" name="state" value="[% default_state %]" checked />
     126                  [% CGI.escapeHTML(default_state) %]</td>
     127                [% ELSE %]
     128                  <td><input type="text" size="50" name="state" value="[% state %]" /></td>
     129                [% END %]
     130              </tr>
     131            [% END %]
     132            [% IF default_country != "NONE" %]
     133              <tr>
     134                <td class="label"><label for="country">Country:</label></td>
     135                [% IF default_country %]
     136                  <td><input type="checkbox" name="country" value="[% default_country %]" checked />
     137                  [% CGI.escapeHTML(default_country) %]</td>
     138                [% ELSE %]
     139                  <td><input type="text" size="50" name="country" value="[% country %]" /></td>
     140                [% END %]
     141              </tr>
     142            [% END %]
    87143            <tr>
    88144              <td class="label"><label for="postcode">Postcode:</label></td>
    89145              <td><input type="text" size="50" id="postcode" name="postcode" value="[% postcode %]" /></td>