From: Mischa POSLAWSKY Date: Sat, 30 May 2020 18:51:20 +0000 (+0200) Subject: word edit: columns declare nested suboptions X-Git-Tag: v1.13~235 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/aaa2eeaf33cba2bb71d03d21bccc5d87c34f0b88 word edit: columns declare nested suboptions --- diff --git a/writer.plp b/writer.plp index ca27e21..0e10582 100644 --- a/writer.plp +++ b/writer.plp @@ -105,20 +105,25 @@ my $db = eval { }); } or Abort('Database error', 501, $@); -my @wordcols = ( +my @wordcols = pairkeys +my %wordcol = ( lang => 'Language', - cat => 'Category', - ref => undef, # included with cat - grade => undef, # " - prio => 'Level', - cover => undef, # included with prio + cat => [{-label => 'Category'}, 'ref'], + ref => {-label => 'Reference'}, + prio => [ + {-label => 'Level', -select => [qw( + essential basic common distinctive rare invisible + )]}, + 'cover', 'grade', + ], + cover => {-label => 'Highlighted', type => 'checkbox'}, + grade => {-label => 'Order', type => 'number'}, form => 'Title', alt => 'Synonyms', wptitle => 'Wikipedia', source => 'Image', thumb => 'Convert options', ); -my @prioenum = qw( essential basic common distinctive rare invisible ); my %langflag = ( nld => "\N{REGIONAL INDICATOR SYMBOL LETTER N}\N{REGIONAL INDICATOR SYMBOL LETTER L}", eng => "\N{REGIONAL INDICATOR SYMBOL LETTER G}\N{REGIONAL INDICATOR SYMBOL LETTER B}", @@ -137,7 +142,7 @@ if (exists $get{copy}) { } elsif ($ENV{REQUEST_METHOD} eq 'POST') {{ my $replace = $row; - $row = {%post{ pairkeys @wordcols }}; + $row = {%post{keys %wordcol}}; $_ = length ? $_ : undef for values %{$row}; eval { @@ -267,20 +272,14 @@ bless $row, 'Shiar_Sheet::FormRow';