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 (parent:
d91598a
)
word edit: multiinput styling for configured columns
author
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 13 Jun 2020 11:02:38 +0000
(13:02 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Tue, 20 Oct 2020 20:49:11 +0000
(22:49 +0200)
writer.plp
patch
|
blob
|
history
diff --git
a/writer.plp
b/writer.plp
index d7167548f948991bf55aef311fd87ac7f86f7325..3f9ed98bc647c1e7b2a909a6f920c3fdf8568c93 100644
(file)
--- a/
writer.plp
+++ b/
writer.plp
@@
-31,6
+31,7
@@
form > ul > li > label + * {
width: 40em;
}
width: 40em;
}
+.multiinput,
input,select {
box-sizing: border-box;
flex-grow: 1;
input,select {
box-sizing: border-box;
flex-grow: 1;
@@
-305,18
+306,19
@@
package Shiar_Sheet::FormRow {
);
}
else {
);
}
else {
+ my $multiple = ref $val eq 'ARRAY' || $attr->{-multiple};
return (
(map {
sprintf('<label for="%s">%s</label>', $col, $_)
} $attr->{-label} // ()),
return (
(map {
sprintf('<label for="%s">%s</label>', $col, $_)
} $attr->{-label} // ()),
-
ref $val ne 'ARRAY' ? () : '<span class="inline multiinput">'
,
+
$multiple ? '<span class="inline multiinput">' : ()
,
(map {
sprintf('<input name="%s" value="%s" />', $col, EscapeHTML($_))
} ref $val eq 'ARRAY' ? @{$val} : ()),
sprintf('<input id="%s" name="%1$s" value="%s"%s />',
(map {
sprintf('<input name="%s" value="%s" />', $col, EscapeHTML($_))
} ref $val eq 'ARRAY' ? @{$val} : ()),
sprintf('<input id="%s" name="%1$s" value="%s"%s />',
- $col,
ref $val eq 'ARRAY'
? '' : EscapeHTML($val), $html
+ $col,
$multiple
? '' : EscapeHTML($val), $html
),
),
-
ref $val ne 'ARRAY' ? () : '</span>'
,
+
$multiple ? '</span>' : ()
,
(map {
sprintf '<img id="%spreview" src="/%s" alt="%s"%s />',
$col, $_, $row->{form}, $col eq 'source' ? ' hidden' : '';
(map {
sprintf '<img id="%spreview" src="/%s" alt="%s"%s />',
$col, $_, $row->{form}, $col eq 'source' ? ' hidden' : '';