forked from lix-project/hydra
Preserve whitespace in string inputs
This commit is contained in:
parent
9334b84d6f
commit
a2b27c7cf2
|
@ -183,7 +183,7 @@ sub nixExprPathFromParams {
|
||||||
|
|
||||||
sub checkInputValue {
|
sub checkInputValue {
|
||||||
my ($c, $name, $type, $value) = @_;
|
my ($c, $name, $type, $value) = @_;
|
||||||
$value = trim $value;
|
$value = trim $value unless $type eq "string";
|
||||||
|
|
||||||
error($c, "The value ‘$value’ of input ‘$name’ is not a Boolean (‘true’ or ‘false’).") if
|
error($c, "The value ‘$value’ of input ‘$name’ is not a Boolean (‘true’ or ‘false’).") if
|
||||||
$type eq "boolean" && !($value eq "true" || $value eq "false");
|
$type eq "boolean" && !($value eq "true" || $value eq "false");
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
[% FOREACH alt IN input.search_related('jobsetinputalts', {}, { order_by => 'altnr' }) %]
|
[% FOREACH alt IN input.search_related('jobsetinputalts', {}, { order_by => 'altnr' }) %]
|
||||||
<tt class="inputalt">
|
<tt class="inputalt">
|
||||||
[% IF input.type == "string" %]
|
[% IF input.type == "string" %]
|
||||||
"[% HTML.escape(alt.value) %]"
|
"<span class="keep-whitespace">[% HTML.escape(alt.value) %]</span>"
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
[% HTML.escape(alt.value) %]
|
[% HTML.escape(alt.value) %]
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
|
@ -111,3 +111,7 @@ td.nowrap {
|
||||||
.star:hover {
|
.star:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span.keep-whitespace {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
Loading…
Reference in a new issue