Ui improvements

- don't show custom fields in edit menu if there are none. This
reduces load of ui elements. The first custom field must be created in
manage-data page.

- Add more validation to the money type
This commit is contained in:
Eike Kettner
2020-11-22 13:25:24 +01:00
parent ff30ed5558
commit bb19e02c66
4 changed files with 85 additions and 26 deletions

View File

@ -729,6 +729,10 @@ renderEditForm settings model =
else
span [ class "invisible hidden" ] []
showCustomFields =
fieldVisible Data.Fields.CustomFields
&& Comp.CustomFieldMultiInput.nonEmpty model.customFieldsModel
customFieldSettings =
Comp.CustomFieldMultiInput.ViewSettings True "field"
in
@ -777,14 +781,20 @@ item visible. This message will disappear then.
"""
]
]
, optional [ Data.Fields.CustomFields ] <|
, if showCustomFields then
h4 [ class "ui dividing header" ]
[ Icons.customFieldIcon ""
, text "Custom Fields"
]
, optional [ Data.Fields.CustomFields ] <|
else
span [ class "hidden invisible" ] []
, if showCustomFields then
Html.map CustomFieldMsg
(Comp.CustomFieldMultiInput.view customFieldSettings model.customFieldsModel)
else
span [ class "hidden invisible" ] []
, optional [ Data.Fields.DueDate, Data.Fields.Date ] <|
h4 [ class "ui dividing header" ]
[ Icons.itemDatesIcon ""