Changeset 937

Show
Ignore:
Timestamp:
03/14/07 23:30:34 (21 months ago)
Author:
kake
Message:

Let people add name of copyright holder, licence URL, and info page URL for node images (ticket #179).

Location:
trunk
Files:
1 added
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/Build.PL

    r936 r937  
    340340                      "node.tt", 
    341341                      "node_history.tt", 
     342                      "node_image_fields.tt", 
    342343                      "node_photo_notes.tt", 
    343344                      "openguides_information_boxes.tt", 
  • trunk/Changes

    r936 r937  
    1111        Add some extra test utilities to OpenGuides::Test 
    1212        Allow Guide admins to control the content of autocreated nodes (#47). 
     13        Let people add name of copyright holder, licence URL, and info page 
     14          URL for node images (#179). 
    1315        Write tests for and fix: 
    1416          #48 (Edit conflict page erroneously converts lat/lon to os_x, os_y). 
  • trunk/MANIFEST

    r928 r937  
    5353templates/node.tt 
    5454templates/node_history.tt 
     55templates/node_image_fields.tt 
    5556templates/node_photo_notes.tt 
    5657templates/openguides_information_boxes.tt 
  • trunk/README.CSS

    r928 r937  
    157157    Used in: display_metadata.tt 
    158158    Purpose: To display the image for a node 
     159div#node_image_copyright 
     160    Used in: display_metadata.tt 
     161    Purpose: To display the name of the copyright holder of a node image, and 
     162             optionally a link to the licence we're using it under. 
    159163 
    160164div#common_navigation 
  • trunk/lib/OpenGuides/Template.pm

    r928 r937  
    326326    ); 
    327327 
    328     my $node_image = $args{metadata} ? $metadata{node_image}[0] 
    329                                      : $q->param("node_image"); 
    330     if ($config->enable_node_image && $node_image) { 
    331         $vars{node_image} = $node_image; 
     328    if ($config->enable_node_image ) { 
     329        foreach my $key ( qw( node_image node_image_licence node_image_url 
     330                              node_image_copyright ) ) { 
     331            my $value = $args{metadata} ? $metadata{$key}[0] 
     332                                        : $q->param( $key ); 
     333            $vars{$key} = $value if $value; 
     334        } 
    332335    } 
    333336 
  • trunk/lib/OpenGuides/Test.pm

    r935 r937  
    168168You can supply values for the following keys: C<content>, 
    169169C<categories>, C<locales>, C<os_x>, C<os_y>, C<osie_x>, C<osie_y>, 
    170 C<latitude>, C<longitude>, C<summary>.  You should supply them exactly as they 
    171 would come from a CGI form, eg lines in a textarea are separated by C<\r\n>. 
     170C<latitude>, C<longitude>, C<summary>, C<node_image>, C<node_image_licence>, 
     171C<node_image_copyright>, C<node_image_url>.  You should supply them exactly 
     172as they would come from a CGI form, eg lines in a textarea are separated 
     173by C<\r\n>. 
    172174 
    173175=cut 
     
    182184    $q->param( -name => "categories", -value => $args{categories} || "" ); 
    183185    $q->param( -name => "locales", -value => $args{locales} || "" ); 
     186    $q->param( -name => "node_image", -value => $args{node_image} || "" ); 
     187    $q->param( -name => "node_image_licence", 
     188               -value => $args{node_image_licence} || "" ); 
     189    $q->param( -name => "node_image_copyright", 
     190               -value => $args{node_image_copyright} || "" ); 
     191    $q->param( -name => "node_image_url", 
     192               -value => $args{node_image_url} || "" ); 
    184193    $q->param( -name => "phone", -value => "" ); 
    185194    $q->param( -name => "fax", -value => "" ); 
  • trunk/templates/display_metadata.tt

    r885 r937  
    77[% IF node_image %] 
    88  <div id="node_image_box"> 
    9     [% IF website %]<a href="[% website %]">[% END %] 
    10       <img id="node_image" src="[% node_image %]" alt="Picture of [% node_name %]" /> 
    11     [% IF website %]</a>[% END %] 
     9    [% IF node_image_url %]<a href="[% node_image_url %]">[% END %] 
     10    <img id="node_image" src="[% node_image %]" 
     11         alt="Picture of [% node_name %]" /> 
     12    [% IF node_image_url %]</a>[% END %] 
     13    [% IF node_image_copyright %] 
     14      <div id="node_image_copyright"> 
     15        [% IF node_image_licence %] 
     16          <a href="[% node_image_licence %]">&copy; 
     17            [% node_image_copyright %]</a> 
     18        [% ELSE %] 
     19          &copy; [% node_image_copyright %] 
     20        [% END %] 
     21      </div> 
     22    [% END %] 
    1223  </div> 
    1324[% ELSE %] 
     
    1526[% END %] 
    1627 
    17   <!--- For the vcard ---> 
     28  <!-- For the vcard --> 
    1829  <span class="fn" style="display:none">[% node_name %]</span> 
    1930[% IF phone OR fax OR address OR postcode OR formatted_website_text 
  • trunk/templates/edit_form.tt

    r935 r937  
    8989          <legend>Metadata (optional)</legend> 
    9090          <table summary="Form for entering metadata about the subject of this node"> 
    91 [% IF config.enable_node_image %] 
    92             <tr> 
    93               <td class="label"><label for="node_image">URL to node Image:</label></td> 
    94               <td> 
    95                 <input type="text" size="50" id="node_image" name="node_image" value="[% node_image %]" /> 
    96                 [% INCLUDE node_photo_notes.tt %] 
    97               </td> 
    98               [% IF conflict %] 
    99                 <td>[% CGI.escapeHTML(new_node_image) %]</td> 
    100               [% END %] 
    101             </tr> 
    102 [% END %] 
     91            [% IF config.enable_node_image %] 
     92              [% INCLUDE node_image_fields.tt %] 
     93            [% END %] 
     94 
    10395            <tr> 
    10496              <td class="label"><label for="phone">Phone:</label></td>