change form template to output flatter HTML

This commit is contained in:
Felix Hamann 2019-02-17 11:29:34 +01:00
parent a5659aa737
commit 780e96320c

View File

@ -3,31 +3,22 @@ $newline never
$case formLayout
$of FormDBTablePagesize
$forall view <- fieldViews
$if fvId view == "form-section-noinput"
<label .form-group__label>
<h3 .form-section-title>
^{fvInput view}
$else
<label .form-group__label.label-pagesize for=#{fvId view}>#{fvLabel view}
^{fvInput view}
<label .form-group__label.label-pagesize for=#{fvId view}>#{fvLabel view}
^{fvInput view}
$of _
$forall view <- fieldViews
$# TODO: add class 'form-group--submit' if this is the submit-button view
<div .form-group :fvRequired view:.form-group--required :not $ fvRequired view:.form-group--optional :isJust $ fvErrors view:.form-group--has-error>
$if fvId view == "form-section-noinput"
<label .form-group__label>
<h3 .form-section-title>
^{fvLabel view}
$maybe hint <- fvTooltip view
<div .form-group__hint>^{hint}
$else
$if fvId view == "form-section-noinput"
<h3 .form-section-title>
^{fvLabel view}
$else
<div .form-group :fvRequired view:.form-group--required :not $ fvRequired view:.form-group--optional :isJust $ fvErrors view:.form-group--has-error>
$if not (Blaze.null $ fvLabel view)
<label .form-group__label for=#{fvId view}>
#{fvLabel view}
$maybe hint <- fvTooltip view
<div .form-group__hint>^{hint}
$# TODO: check that error display works as intended
$maybe err <- fvErrors view
<div .form-error>#{err}
<div .form-group__input>
^{fvInput view}
$# TODO: check that error display works as intended
$maybe err <- fvErrors view
<div .form-error>#{err}