git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
cf90589
)
word edit: delete empty entries if confirmed
author
Mischa POSLAWSKY
<perl@shiar.org>
Sun, 31 May 2020 03:37:46 +0000
(
05:37
+0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 6 Jun 2020 01:49:20 +0000
(
03:49
+0200)
writer.plp
patch
|
blob
|
history
diff --git
a/writer.plp
b/writer.plp
index 4da27053c26ce2096f45be277d56a158539d0906..ba81e8a4d4ee42e1841ae2e0d56d67aa4a379b71 100644
(file)
--- a/
writer.plp
+++ b/
writer.plp
@@
-148,6
+148,19
@@
elsif ($ENV{REQUEST_METHOD} eq 'POST') {{
$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) :