From a2b27c7cf2f1b3f733e55a747dab3a910bb00229 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 13 Aug 2014 17:25:08 +0200 Subject: [PATCH] Preserve whitespace in string inputs --- src/lib/Hydra/Controller/Jobset.pm | 2 +- src/root/jobset.tt | 2 +- src/root/static/css/hydra.css | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/Hydra/Controller/Jobset.pm b/src/lib/Hydra/Controller/Jobset.pm index d126efff..0c53a1cf 100644 --- a/src/lib/Hydra/Controller/Jobset.pm +++ b/src/lib/Hydra/Controller/Jobset.pm @@ -183,7 +183,7 @@ sub nixExprPathFromParams { sub checkInputValue { 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 $type eq "boolean" && !($value eq "true" || $value eq "false"); diff --git a/src/root/jobset.tt b/src/root/jobset.tt index 063cfd15..e07cbb6e 100644 --- a/src/root/jobset.tt +++ b/src/root/jobset.tt @@ -15,7 +15,7 @@ [% FOREACH alt IN input.search_related('jobsetinputalts', {}, { order_by => 'altnr' }) %] [% IF input.type == "string" %] - "[% HTML.escape(alt.value) %]" + "[% HTML.escape(alt.value) %]" [% ELSE %] [% HTML.escape(alt.value) %] [% END %] diff --git a/src/root/static/css/hydra.css b/src/root/static/css/hydra.css index 59ef91c1..8e3e5a97 100644 --- a/src/root/static/css/hydra.css +++ b/src/root/static/css/hydra.css @@ -111,3 +111,7 @@ td.nowrap { .star:hover { cursor: pointer; } + +span.keep-whitespace { + white-space: pre-wrap; +} \ No newline at end of file