diff options
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/prettydate.pm | 1 | ||||
-rw-r--r-- | IkiWiki/Plugin/typography.pm | 1 | ||||
-rw-r--r-- | IkiWiki/Plugin/websetup.pm | 25 |
3 files changed, 25 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/prettydate.pm b/IkiWiki/Plugin/prettydate.pm index db5a94f41..dd1e096b4 100644 --- a/IkiWiki/Plugin/prettydate.pm +++ b/IkiWiki/Plugin/prettydate.pm @@ -50,6 +50,7 @@ sub getsetup () { #{{{ type => "string", example => '%X, %B %o, %Y', description => "format to use to display date", + advanced => 1, safe => 1, rebuild => 1, }, diff --git a/IkiWiki/Plugin/typography.pm b/IkiWiki/Plugin/typography.pm index 6229e6c33..3964d266d 100644 --- a/IkiWiki/Plugin/typography.pm +++ b/IkiWiki/Plugin/typography.pm @@ -28,6 +28,7 @@ sub getsetup () { #{{{ type => "string", example => "3", description => "Text::Typography attributes value", + advanced => 1, safe => 1, rebuild => 1, }, diff --git a/IkiWiki/Plugin/websetup.pm b/IkiWiki/Plugin/websetup.pm index bfc238dc3..061ce0873 100644 --- a/IkiWiki/Plugin/websetup.pm +++ b/IkiWiki/Plugin/websetup.pm @@ -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 - 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'; @@ -228,7 +230,26 @@ sub showform ($$) { #{{{ 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 { |