} or Abort('Database error', 501, $@);
my %lang = (
- nld => ["\N{REGIONAL INDICATOR SYMBOL LETTER N}\N{REGIONAL INDICATOR SYMBOL LETTER L}", 'dutch'],
- eng => ["\N{REGIONAL INDICATOR SYMBOL LETTER G}\N{REGIONAL INDICATOR SYMBOL LETTER B}", 'english'],
- epo => ['<span style="color:green">★</span>', 'esperanto'],
+ 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 => ['<span style="color:green">★</span>', 'esperanto'],
+ ru => ["\N{REGIONAL INDICATOR SYMBOL LETTER R}\N{REGIONAL INDICATOR SYMBOL LETTER U}", 'русский'],
);
my @wordcols = pairkeys
my %wordcol = (
$row = {%post{keys %wordcol}};
$_ = length ? $_ : undef for values %{$row};
+ if (!$row->{form}) {
+ if ($row->{ref} ne 'delete') {
+ Alert("Empty title",
+ "Confirm removal by setting <em>Reference</em> to <q>delete</q>."
+ );
+ }
+ else {
+ $db->delete(word => $find);
+ Alert("Entry removed");
+ }
+ next;
+ }
+
eval {
my %res = (returning => '*');
my $query = $find ? $db->update(word => $row, $find, \%res) :
sub imagepath {
my ($row, $col) = @_;
return "data/word/org/$row->{id}.jpg" if $col eq 'source';
- return "data/word/eng/$row->{form}.jpg" if $col eq 'thumb';
+ return "data/word/en/$row->{form}.jpg" if $col eq 'thumb';
return;
}
}