]> sipb.mit.edu Git - ikiwiki.git/commitdiff
add advanced and basic modes
authorJoey Hess <joey@kodama.kitenet.net>
Sun, 3 Aug 2008 18:57:24 +0000 (14:57 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Sun, 3 Aug 2008 18:57:24 +0000 (14:57 -0400)
IkiWiki.pm
IkiWiki/Plugin/prettydate.pm
IkiWiki/Plugin/typography.pm
IkiWiki/Plugin/websetup.pm
doc/plugins/write.mdwn
po/ikiwiki.pot

index 51e683bb48af411b9430681c5e3041873a63fb0f..2139aa7d13b775f1fa60f60f02c995732fe216b9 100644 (file)
@@ -137,6 +137,7 @@ sub getsetup () { #{{{
                type => "string",
                default => "$installdir/share/ikiwiki/templates",
                description => "location of template files",
                type => "string",
                default => "$installdir/share/ikiwiki/templates",
                description => "location of template files",
+               advanced => 1,
                safe => 0, # path
                rebuild => 1,
        },
                safe => 0, # path
                rebuild => 1,
        },
@@ -144,6 +145,7 @@ sub getsetup () { #{{{
                type => "string",
                default => "$installdir/share/ikiwiki/basewiki",
                description => "base wiki source location",
                type => "string",
                default => "$installdir/share/ikiwiki/basewiki",
                description => "base wiki source location",
+               advanced => 1,
                safe => 0, # path
                rebuild => 0,
        },
                safe => 0, # path
                rebuild => 0,
        },
@@ -214,6 +216,7 @@ sub getsetup () { #{{{
                type => "string",
                default => '%c',
                description => "strftime format string to display date",
                type => "string",
                default => '%c',
                description => "strftime format string to display date",
+               advanced => 1,
                safe => 1,
                rebuild => 1,
        },
                safe => 1,
                rebuild => 1,
        },
@@ -222,6 +225,7 @@ sub getsetup () { #{{{
                default => undef,
                example => "en_US.UTF-8",
                description => "UTF-8 locale to use",
                default => undef,
                example => "en_US.UTF-8",
                description => "UTF-8 locale to use",
+               advanced => 1,
                safe => 0,
                rebuild => 1,
        },
                safe => 0,
                rebuild => 1,
        },
@@ -229,6 +233,7 @@ sub getsetup () { #{{{
                type => "boolean",
                default => 0,
                description => "only send cookies over SSL connections?",
                type => "boolean",
                default => 0,
                description => "only send cookies over SSL connections?",
+               advanced => 1,
                safe => 1,
                rebuild => 0,
        },
                safe => 1,
                rebuild => 0,
        },
@@ -251,6 +256,7 @@ sub getsetup () { #{{{
                type => "boolean",
                default => 0,
                description => "attempt to hardlink source files? (optimisation for large files)",
                type => "boolean",
                default => 0,
                description => "attempt to hardlink source files? (optimisation for large files)",
+               advanced => 1,
                safe => 0, # paranoia
                rebuild => 0,
        },
                safe => 0, # paranoia
                rebuild => 0,
        },
@@ -259,6 +265,7 @@ sub getsetup () { #{{{
                description => "",
                example => "022",
                description => "force ikiwiki to use a particular umask",
                description => "",
                example => "022",
                description => "force ikiwiki to use a particular umask",
+               advanced => 1,
                safe => 0, # paranoia
                rebuild => 0,
        },
                safe => 0, # paranoia
                rebuild => 0,
        },
@@ -267,6 +274,7 @@ sub getsetup () { #{{{
                default => "",
                example => "$ENV{HOME}/.ikiwiki/",
                description => "extra library and plugin directory",
                default => "",
                example => "$ENV{HOME}/.ikiwiki/",
                description => "extra library and plugin directory",
+               advanced => 1,
                safe => 0, # directory
                rebuild => 0,
        },
                safe => 0, # directory
                rebuild => 0,
        },
@@ -282,6 +290,7 @@ sub getsetup () { #{{{
                default => undef,
                example => '\.wav$',
                description => "regexp of source files to ignore",
                default => undef,
                example => '\.wav$',
                description => "regexp of source files to ignore",
+               advanced => 1,
                safe => 0, # regexp
                rebuild => 1,
        },
                safe => 0, # regexp
                rebuild => 1,
        },
index db5a94f413b567de7c73f2cb93ac90e1d9697461..dd1e096b40438b66e8111ac5c3c447f41f11e81d 100644 (file)
@@ -50,6 +50,7 @@ sub getsetup () { #{{{
                        type => "string",
                        example => '%X, %B %o, %Y',
                        description => "format to use to display date",
                        type => "string",
                        example => '%X, %B %o, %Y',
                        description => "format to use to display date",
+                       advanced => 1,
                        safe => 1,
                        rebuild => 1,
                },
                        safe => 1,
                        rebuild => 1,
                },
index 6229e6c33258b9d6a12a43c8957cb5facbcb3739..3964d266ddaeccb28a11e3f0854dc700b674ec6f 100644 (file)
@@ -28,6 +28,7 @@ sub getsetup () { #{{{
                        type => "string",
                        example => "3",
                        description => "Text::Typography attributes value",
                        type => "string",
                        example => "3",
                        description => "Text::Typography attributes value",
+                       advanced => 1,
                        safe => 1,
                        rebuild => 1,
                },
                        safe => 1,
                        rebuild => 1,
                },
index bfc238dc35443116b37999f89aaea6c8d21f7194..061ce08735d17220802e1d6855f72ab51d284cbf 100644 (file)
@@ -73,7 +73,9 @@ sub showfields ($$$@) { #{{{
                # XXX hashes not handled yet
                next if ref $config{$key} && ref $config{$key} eq 'HASH' || ref $info{example} eq 'HASH';
                # maybe skip unsafe settings
                # XXX hashes not handled yet
                next if ref $config{$key} && ref $config{$key} eq 'HASH' || ref $info{example} eq 'HASH';
                # maybe skip unsafe settings
-               next if ! $info{safe} && ! $config{websetup_show_unsafe};
+               next if ! $info{safe} && ! ($config{websetup_show_unsafe} && $config{websetup_advanced});
+               # maybe skip advanced settings
+               next if $info{advanced} && ! $config{websetup_advanced};
                # these are handled specially, so don't show
                next if $key eq 'add_plugins' || $key eq 'disable_plugins';
                
                # these are handled specially, so don't show
                next if $key eq 'add_plugins' || $key eq 'disable_plugins';
                
@@ -228,7 +230,26 @@ sub showform ($$) { #{{{
                template => {type => 'div'},
                stylesheet => IkiWiki::baseurl()."style.css",
        );
                template => {type => 'div'},
                stylesheet => IkiWiki::baseurl()."style.css",
        );
-       my $buttons=["Save Setup", "Cancel"];
+
+       if ($form->submitted eq 'Basic') {
+               $form->field(name => "showadvanced", type => "hidden", 
+                       value => 0, force => 1);
+       }
+       elsif ($form->submitted eq 'Advanced') {
+               $form->field(name => "showadvanced", type => "hidden", 
+                       value => 1, force => 1);
+       }
+       my $advancedtoggle;
+       if ($form->field("showadvanced")) {
+               $config{websetup_advanced}=1;
+               $advancedtoggle="Basic";
+       }
+       else {
+               $config{websetup_advanced}=0;
+               $advancedtoggle="Advanced";
+       }
+
+       my $buttons=["Save Setup", $advancedtoggle, "Cancel"];
 
        IkiWiki::decode_form_utf8($form);
        IkiWiki::run_hooks(formbuilder_setup => sub {
 
        IkiWiki::decode_form_utf8($form);
        IkiWiki::run_hooks(formbuilder_setup => sub {
index 48a94ec8b131a737769a4baaf7f947c4838ac56d..fc4b778db8b8000a724af77be6e04a5749290e73 100644 (file)
@@ -385,6 +385,7 @@ describing the option. For example:
                        option_foo => {
                                type => "boolean",
                                description => "enable foo",
                        option_foo => {
                                type => "boolean",
                                description => "enable foo",
+                               advanced => 1,
                                safe => 1,
                                rebuild => 1,
                        },
                                safe => 1,
                                rebuild => 1,
                        },
@@ -404,6 +405,8 @@ describing the option. For example:
 * `description` is a short description of the option.
 * `link` is a link to further information about the option. This can either
   be a wikilink, or an url.
 * `description` is a short description of the option.
 * `link` is a link to further information about the option. This can either
   be a wikilink, or an url.
+* `advanced` can be set to true if the option is more suitable for advanced
+  users.
 * `safe` should be false if the option should not be displayed in unsafe
   configuration methods, such as the web interface. Anything that specifies
   a command to run, a path on disk, or a regexp should be marked as unsafe.
 * `safe` should be false if the option should not be displayed in unsafe
   configuration methods, such as the web interface. Anything that specifies
   a command to run, a path on disk, or a regexp should be marked as unsafe.
index 52a49ae9c5d643cceb9670418528150cd33a6378..13db8f04f1746a6511eb32ccd68c77236bf40f1b 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-08-02 15:27-0400\n"
+"POT-Creation-Date: 2008-08-03 14:48-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -71,7 +71,7 @@ msgstr ""
 msgid "You are banned."
 msgstr ""
 
 msgid "You are banned."
 msgstr ""
 
-#: ../IkiWiki/CGI.pm:783 ../IkiWiki/CGI.pm:784 ../IkiWiki.pm:1096
+#: ../IkiWiki/CGI.pm:783 ../IkiWiki/CGI.pm:784 ../IkiWiki.pm:1108
 msgid "Error"
 msgstr ""
 
 msgid "Error"
 msgstr ""
 
@@ -173,20 +173,20 @@ msgstr ""
 msgid "Failed to delete file from S3: "
 msgstr ""
 
 msgid "Failed to delete file from S3: "
 msgstr ""
 
-#: ../IkiWiki/Plugin/attachment.pm:46
+#: ../IkiWiki/Plugin/attachment.pm:42
 #, perl-format
 msgid "there is already a page named %s"
 msgstr ""
 
 #, perl-format
 msgid "there is already a page named %s"
 msgstr ""
 
-#: ../IkiWiki/Plugin/attachment.pm:79
+#: ../IkiWiki/Plugin/attachment.pm:75
 msgid "prohibited by allowed_attachments"
 msgstr ""
 
 msgid "prohibited by allowed_attachments"
 msgstr ""
 
-#: ../IkiWiki/Plugin/attachment.pm:187
+#: ../IkiWiki/Plugin/attachment.pm:183
 msgid "bad attachment filename"
 msgstr ""
 
 msgid "bad attachment filename"
 msgstr ""
 
-#: ../IkiWiki/Plugin/attachment.pm:229
+#: ../IkiWiki/Plugin/attachment.pm:225
 msgid "attachment upload"
 msgstr ""
 
 msgid "attachment upload"
 msgstr ""
 
@@ -311,7 +311,7 @@ msgstr ""
 msgid "failed to run dot"
 msgstr ""
 
 msgid "failed to run dot"
 msgstr ""
 
-#: ../IkiWiki/Plugin/lockedit.pm:43 ../IkiWiki/Plugin/lockedit.pm:57
+#: ../IkiWiki/Plugin/lockedit.pm:42 ../IkiWiki/Plugin/lockedit.pm:56
 #, perl-format
 msgid "%s is locked and cannot be edited"
 msgstr ""
 #, perl-format
 msgid "%s is locked and cannot be edited"
 msgstr ""
@@ -495,15 +495,15 @@ msgstr ""
 msgid "%A night"
 msgstr ""
 
 msgid "%A night"
 msgstr ""
 
-#: ../IkiWiki/Plugin/prettydate.pm:96
+#: ../IkiWiki/Plugin/prettydate.pm:97
 msgid "at teatime on %A"
 msgstr ""
 
 msgid "at teatime on %A"
 msgstr ""
 
-#: ../IkiWiki/Plugin/prettydate.pm:100
+#: ../IkiWiki/Plugin/prettydate.pm:101
 msgid "at midnight"
 msgstr ""
 
 msgid "at midnight"
 msgstr ""
 
-#: ../IkiWiki/Plugin/prettydate.pm:103
+#: ../IkiWiki/Plugin/prettydate.pm:104
 msgid "at noon on %A"
 msgstr ""
 
 msgid "at noon on %A"
 msgstr ""
 
@@ -707,19 +707,39 @@ msgstr ""
 msgid "failed to generate image from code"
 msgstr ""
 
 msgid "failed to generate image from code"
 msgstr ""
 
-#: ../IkiWiki/Plugin/websetup.pm:120
-msgid "you are not logged in as an admin"
+#: ../IkiWiki/Plugin/websetup.pm:85
+msgid "plugin"
 msgstr ""
 
 msgstr ""
 
-#: ../IkiWiki/Plugin/websetup.pm:149
+#: ../IkiWiki/Plugin/websetup.pm:85
 msgid "main"
 msgstr ""
 
 msgid "main"
 msgstr ""
 
-#: ../IkiWiki/Plugin/websetup.pm:158
-msgid "plugin"
+#: ../IkiWiki/Plugin/websetup.pm:170
+msgid ""
+"Note: Disabled options cannot be configured here, but only by editing the "
+"setup file."
+msgstr ""
+
+#: ../IkiWiki/Plugin/websetup.pm:198
+#, perl-format
+msgid "enable %s?"
+msgstr ""
+
+#: ../IkiWiki/Plugin/websetup.pm:212
+msgid "you are not logged in as an admin"
+msgstr ""
+
+#: ../IkiWiki/Plugin/websetup.pm:266
+msgid "other plugins"
+msgstr ""
+
+#: ../IkiWiki/Plugin/websetup.pm:317
+msgid ""
+"The configuration changes shown below require a wiki rebuild to take effect."
 msgstr ""
 
 msgstr ""
 
-#: ../IkiWiki/Plugin/websetup.pm:168
+#: ../IkiWiki/Plugin/websetup.pm:329
 msgid "Setup saved."
 msgstr ""
 
 msgid "Setup saved."
 msgstr ""
 
@@ -827,19 +847,19 @@ msgstr ""
 msgid "refreshing wiki.."
 msgstr ""
 
 msgid "refreshing wiki.."
 msgstr ""
 
-#: ../IkiWiki.pm:417
+#: ../IkiWiki.pm:427
 msgid "Must specify url to wiki with --url when using --cgi"
 msgstr ""
 
 msgid "Must specify url to wiki with --url when using --cgi"
 msgstr ""
 
-#: ../IkiWiki.pm:461
+#: ../IkiWiki.pm:471
 msgid "cannot use multiple rcs plugins"
 msgstr ""
 
 msgid "cannot use multiple rcs plugins"
 msgstr ""
 
-#: ../IkiWiki.pm:1079
+#: ../IkiWiki.pm:1091
 #, perl-format
 msgid "preprocessing loop detected on %s at depth %i"
 msgstr ""
 
 #, perl-format
 msgid "preprocessing loop detected on %s at depth %i"
 msgstr ""
 
-#: ../IkiWiki.pm:1567
+#: ../IkiWiki.pm:1579
 msgid "yes"
 msgstr ""
 msgid "yes"
 msgstr ""