Changeset 309
- Timestamp:
- 12/29/03 14:29:25 (5 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 1 removed
- 11 modified
-
Build.PL (modified) (3 diffs)
-
Changes (modified) (1 diff)
-
INSTALL (modified) (1 diff)
-
MANIFEST (modified) (1 diff)
-
PREREQUISITES (modified) (2 diffs)
-
examples/london.css (added)
-
examples/vegan-oxford.css (added)
-
examples/wiki.css (deleted)
-
lib/OpenGuides.pm (modified) (1 diff)
-
lib/OpenGuides/Template.pm (modified) (3 diffs)
-
t/15_template.t (modified) (2 diffs)
-
t/41_deletion.t (added)
-
t/templates/15_test.tt (modified) (1 diff)
-
templates/footer.tt (modified) (1 diff)
-
wiki.cgi (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Build.PL
r303 r309 43 43 variable => "indexing_directory", 44 44 default => "/usr/lib/cgi-bin/openguides/indexes/" 45 }, 46 { question => "Do you want to enable page deletion?", 47 variable => "enable_page_deletion", 48 default => "n", 49 type => "y_n" 45 50 }, 46 51 { question => "What's the URL of the wiki's stylesheet?", … … 160 165 unless ( $skip_config ) { 161 166 if ( $type eq "y_n" ) { 162 $def = $def ? "y" : "n"; 167 # may be stored as true/false integer value 168 if ( $def =~ /^\d+$/ ) { 169 $def = $def ? "y" : "n"; 170 } 163 171 $val = Module::Build->y_n("\n$qu ", $def); 164 172 } else { … … 194 202 ##### 195 203 ##### When updating the prereqs PLEASE REMEMBER to update PREREQUISITES. 204 ##### Ivor, this means you too. 196 205 ##### 197 206 -
trunk/Changes
r308 r309 1 0.30 2 Added method for adminds to delete nodes. 3 Major overhaul of templates. Added numerous style hooks and replaced 4 Oxford Guide stylesheet in examples/ with generic wiki.css that 5 takes advantage of them. Added new banner template for page 6 headers. Also ensured presence of navigation bar is consistent. 1 0.30 29 December 2003 2 Added method to allow admins to delete nodes. You will need to 3 explicitly enable this option in your wiki.conf, since it brings 4 with it the risk of accidental data loss. 5 Major overhaul of templates - added numerous style hooks. See 6 examples/ for two stylesheet designs that take advantage of these. 7 Added new banner template for page headers. Also ensured presence 8 of navigation bar is consistent. 7 9 *** INCOMPATIBLE CHANGE: *** The navbar class in the stylesheet 8 10 has been renamed to, unsurprisingly, "navbar", for consistency 9 (from "toolbar"). You are advised to create a duplicate wiki.cgi10 that reads its data from your database but its stylesheet and11 templates from the new ones in order to test them *before*12 deploying them.11 (from "toolbar"). *** YOU WILL NEED TO REWRITE YOUR STYLESHEET. *** 12 You are advised to create a duplicate wiki.cgi that reads its data 13 from your database but its stylesheet and templates from the new 14 ones in order to test them *before* deploying them. 13 15 Added "FAQ", "How To Get Started" and "Wiki Etiquette" to the 14 16 navigation, under "Help" - these won't exist unless you create them -
trunk/INSTALL
r292 r309 92 92 93 93 94 "Do you want to enable page deletion?" 95 96 The default is to disable page deletion. If you choose to enable the 97 page deletion mechanism then you will need to add a password to your 98 wiki.conf using a line such as 99 admin_pass = putyourpasswordhere 100 Users who know this password will be able to delete unwanted pages - 101 along with all their history - from your wiki. 102 *** USE WITH CAUTION. DELETED PAGES CANNOT BE RECOVERED. *** 103 104 94 105 "What's the URL of the wiki's stylesheet?" 95 106 96 Supplying an answer to this question is optional. There is anexample97 stylesheet in the examples/ directory - note that thiswill not be107 Supplying an answer to this question is optional. There are example 108 stylesheets in the examples/ directory - note that these will not be 98 109 automatically installed. 99 110 -
trunk/MANIFEST
r295 r309 57 57 t/31_supersearch.t 58 58 t/32_supersearch_simple_metadata.t 59 t/41_deletion.t 59 60 t/51_diff.t 60 61 t/61_bug_textareas.t -
trunk/PREREQUISITES
r282 r309 9 9 CGI::Wiki::Formatter::UseMod (version 0.09 or later) 10 10 CGI::Wiki::Plugin::Categoriser 11 CGI::Wiki::Plugin::Diff 11 12 CGI::Wiki::Plugin::GeoCache 12 13 CGI::Wiki::Plugin::Locator::UK (version 0.06 or later) … … 30 31 Time::Piece 31 32 URI::Escape 32 VCS::Lite (version 0.04 or later) -
trunk/lib/OpenGuides.pm
r298 r309 4 4 use vars qw( $VERSION ); 5 5 6 $VERSION = '0.30 _01';6 $VERSION = '0.30'; 7 7 8 8 =head1 NAME -
trunk/lib/OpenGuides/Template.pm
r280 r309 73 73 =item * C<full_cgi_url> 74 74 75 =item * C<enable_page_deletion> (gets set to true or false - defaults to false) 76 75 77 =item * C<contact_email> 76 78 … … 123 125 $formatting_rules_link = $script_url . $script_name . "?" 124 126 . uri_escape($args{wiki}->formatter->node_name_to_node_param($formatting_rules_node)); 127 } 128 129 my $enable_page_deletion = 0; 130 if ( $config->{_}->{enable_page_deletion} 131 and ( lc($config->{_}->{enable_page_deletion}) eq "y" 132 or $config->{_}->{enable_page_deletion} eq "1" ) 133 ) { 134 $enable_page_deletion = 1; 125 135 } 126 136 … … 136 146 formatting_rules_node => $formatting_rules_node, 137 147 openguides_version => $OpenGuides::VERSION, 148 enable_page_deletion => $enable_page_deletion, 138 149 }; 139 150 -
trunk/t/15_template.t
r226 r309 1 1 use strict; 2 use Test::More tests => 2 3;2 use Test::More tests => 28; 3 3 use Config::Tiny; 4 4 use Cwd; … … 150 150 like( $output, qr/OMIT FORMATTING LINK: fish/, 151 151 "explicitly supplied TT vars override cookie ones" ); 152 153 # Test that enable_page_deletion is set correctly in various circumstances. 154 $config = Config::Tiny->new; 155 $config->{_}->{template_path} = cwd . "/t/templates"; 156 $config->{_}->{site_name} = "Test Site"; 157 158 $output = OpenGuides::Template->output( 159 wiki => $fake_wiki, 160 config => $config, 161 template => "15_test.tt", 162 ); 163 like( $output, qr/ENABLE PAGE DELETION: 0/, 164 "enable_page_deletion var set correctly when not specified in conf" ); 165 166 $config->{_}->{enable_page_deletion} = "n"; 167 $output = OpenGuides::Template->output( 168 wiki => $fake_wiki, 169 config => $config, 170 template => "15_test.tt", 171 ); 172 like( $output, qr/ENABLE PAGE DELETION: 0/, 173 "enable_page_deletion var set correctly when set to 'n' in conf" ); 174 175 $config->{_}->{enable_page_deletion} = "y"; 176 $output = OpenGuides::Template->output( 177 wiki => $fake_wiki, 178 config => $config, 179 template => "15_test.tt", 180 ); 181 like( $output, qr/ENABLE PAGE DELETION: 1/, 182 "enable_page_deletion var set correctly when set to 'y' in conf" ); 183 184 $config->{_}->{enable_page_deletion} = 0; 185 $output = OpenGuides::Template->output( 186 wiki => $fake_wiki, 187 config => $config, 188 template => "15_test.tt", 189 ); 190 like( $output, qr/ENABLE PAGE DELETION: 0/, 191 "enable_page_deletion var set correctly when set to '0' in conf" ); 192 193 $config->{_}->{enable_page_deletion} = 1; 194 $output = OpenGuides::Template->output( 195 wiki => $fake_wiki, 196 config => $config, 197 template => "15_test.tt", 198 ); 199 like( $output, qr/ENABLE PAGE DELETION: 1/, 200 "enable_page_deletion var set correctly when set to '1' in conf" ); -
trunk/t/templates/15_test.tt
r226 r309 16 16 FORMATTING RULES LINK: [% formatting_rules_link %] 17 17 OMIT FORMATTING LINK: [% omit_formatting_link %] 18 19 ENABLE PAGE DELETION: [% enable_page_deletion %] -
trunk/templates/footer.tt
r307 r309 7 7 </div> 8 8 <div id="footer"> 9 <p> 10 <a href="[% full_cgi_url %]?id=[% node_param %];action=delete">Delete page</a> (admins only) 11 </p> 9 [% IF enable_page_deletion %] 10 <p> 11 <a href="[% full_cgi_url %]?id=[% node_param %];action=delete">Delete page</a> (admins only) 12 </p> 13 [% END %] 12 14 <p> 13 15 This wiki powered by <a -
trunk/wiki.cgi
r308 r309 5 5 6 6 use vars qw( $VERSION ); 7 $VERSION = '0.30 _02';7 $VERSION = '0.30'; 8 8 9 9 use CGI qw/:standard/; … … 106 106 origin_param => $formatter->node_name_to_node_param($node), 107 107 limit => "$metres metres" } ); 108 } elsif ($action eq 'delete') { 108 } elsif ( $action eq 'delete' 109 and ( lc($config->{_}->{enable_page_deletion}) eq "y" 110 or $config->{_}->{enable_page_deletion} eq "1" ) 111 ) { 109 112 delete_node($node); 110 113 } elsif ($action eq 'userstats') {
