X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/52fd7eff6b7c5bc47fc33313154f1632d8ccf3a1..2304fc9d1a391372a6714502fb769c9d1a5ed182:/word/edit.plp diff --git a/word/edit.plp b/word/edit.plp index f755f25..0f212b8 100644 --- a/word/edit.plp +++ b/word/edit.plp @@ -10,6 +10,8 @@ Html({ raw => <<'EOT', + + EOT }); @@ -72,6 +74,7 @@ my $user = eval { }; my %lang = ( + '' => ['(reference)'], nl => ["\N{REGIONAL INDICATOR SYMBOL LETTER N}\N{REGIONAL INDICATOR SYMBOL LETTER L}", 'nederlands'], en => ["\N{REGIONAL INDICATOR SYMBOL LETTER G}\N{REGIONAL INDICATOR SYMBOL LETTER B}", 'english'], eo => [qq'\N{BLACK STAR}', 'esperanto'], @@ -89,7 +92,9 @@ my %wordcol = ( prio => [ {-label => 'Level', -select => sub { my ($row) = @_; - my @enum = qw[ essential basic common distinctive optional invisible ]; + my @enum = qw[ + essential ubiquitous basic common distinctive specialised rare invisible + ]; return { ('' => 'parent') x (defined $row->{ref}), map { $_ => $enum[$_] } 0 .. $#enum @@ -106,8 +111,9 @@ my %wordcol = ( return "data/word/org/$_[0]->{id}.jpg"; }}, convert => {-label => 'Convert options', -json => 'image', -multiple => 1, -src => sub { - return "data/word/en/$_[0]->{id}.jpg"; + return "data/word/32/$_[0]->{id}.jpg"; }}, + crop32 => {-label => 'Crop 3:2', -json => 'image'}, story => {-label => 'Story', type => 'textarea', hidden => 'hidden'}, ); @@ -158,7 +164,7 @@ elsif (defined $post{form}) {{ my $imagecol = $row->{image}; # backup image subcolumns ref $_ eq 'HASH' and $_ = encode_json($_) for values %{$row}; - if (!$row->{form}) { + if (!$row->{form} and $row->{lang}) { if ($row->{ref} ne 'delete') { Alert("Empty title", "Confirm removal by setting Reference to delete." @@ -215,7 +221,7 @@ elsif (defined $post{form}) {{ $reimage++ if $fields{rethumb}; # force refresh if ($reimage) { eval { - $image->convert($wordcol{convert}->{-src}->($row), $imagecol->{convert}); + $image->generate($wordcol{convert}->{-src}->($row), $imagecol); } or do { my ($warn, @details) = ref $@ ? @{$@} : $@; Alert([ "Thumbnail image not generated", $warn ], @details); @@ -223,9 +229,9 @@ elsif (defined $post{form}) {{ } }} else { - $row->{lang} //= $user->{editlang}->[0]; + $row->{lang} //= $user->{editlang}->[0] unless exists $row->{lang}; $row->{$_} = $get{$_} for keys %get; - $row->{prio} = defined $row->{ref} ? undef : 1 unless exists $row->{prio}; + $row->{prio} = defined $row->{ref} ? undef : 4 unless exists $row->{prio}; } eval { @@ -322,6 +328,10 @@ while (my $ref = $children->hash) { + + <: }