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