Changeset 1243


Ignore:
Timestamp:
Oct 22, 2008, 1:35:20 PM (13 years ago)
Author:
Dominic Hargreaves
Message:

Don't add delete links unless the user requests (fixes #159 - thanks bob)

Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Changes

    r1240 r1243  
    1919        Add the ability to whitelist hosts who can change moderated nodes
    2020          without explicit moderation (#203)
     21        Don't add delete links unless the user requests (#159)
    2122
    22230.63    16 August 2008
  • trunk/MANIFEST

    r1240 r1243  
    147147t/79_host_blacklist.t
    148148t/81_node_moderate_whitelist.t
     149t/83_show_delete_to_admins_only.t
     150t/84_navbar_admin.t
    149151t/85_universal_edit_link.t
    150152t/templates/15_test.tt
  • trunk/t/41_deletion.t

    r1042 r1243  
    33use OpenGuides::Template;
    44use OpenGuides::Test;
     5use OpenGuides::CGI;
    56use Test::More tests => 3;
    67
     
    2021        "doesn't offer page deletion link by default" );
    2122$config->enable_page_deletion( "y" );
     23    # set is_admin to 1
     24my $cookie = OpenGuides::CGI->make_prefs_cookie(
     25    config                     => $config,
     26    username                   => "bob",
     27    include_geocache_link      => 1,
     28    preview_above_edit_box     => 1,
     29    omit_help_links            => 1,
     30    show_minor_edits_in_rc     => 1,
     31    default_edit_type          => "tidying",
     32    cookie_expires             => "never",
     33    track_recent_changes_views => 1,
     34    is_admin => 1,
     35);
     36$ENV{HTTP_COOKIE} = $cookie;
     37
    2238$output = OpenGuides::Template->output(
    2339    wiki     => $wiki,
     
    2642);
    2743like( $output, qr/action=delete/,
    28       "...but does when enable_page_deletion is set to 'y'" );
     44      "...but does when enable_page_deletion is set to 'y' and is_admin is 1" );
    2945$config->enable_page_deletion( 1 );
    3046$output = OpenGuides::Template->output(
     
    3450);
    3551like( $output, qr/action=delete/,
    36       "...and when enable_page_deletion is set to '1'" );
     52      "...and when enable_page_deletion is set to '1' and is_admin is 1" );
  • trunk/templates/footer.tt

    r1204 r1243  
    1212<div id="footer">
    1313  [% BLOCK delete_link %]
    14     [% IF enable_page_deletion AND NOT not_deletable %]
     14    [% IF enable_page_deletion AND is_admin AND NOT not_deletable %]
    1515      <div id="footer_delete_link">
    1616        <a href="[% full_cgi_url %]?id=[% node_param %];action=delete">Delete page</a> (admins only)
  • trunk/templates/navbar_this_page.tt

    r1008 r1243  
    99      [% END %]
    1010      <li><a href="[% full_cgi_url %]?id=[% node_param %];format=rdf">RDF/XML version</a></li>
    11       [% IF enable_page_deletion %]
     11      [% IF enable_page_deletion and is_admin %]
    1212        <li><a href="[% full_cgi_url %]?id=[% node_param %];action=delete">Delete (admin only)</a></li>
    1313      [% END %]
  • trunk/templates/node_history.tt

    r909 r1243  
    5555        &nbsp;&nbsp;<i>([% revision.comment %])</i>
    5656      [% END %]
    57       [% IF enable_page_deletion %]
     57      [% IF enable_page_deletion AND is_admin %]
    5858        &nbsp;&nbsp;<small>[<a href="[% full_cgi_url %]?id=[% node_param %];version=[% revision.version %];action=delete">delete</a>]</small>
    5959      [% END %]
Note: See TracChangeset for help on using the changeset viewer.