mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 10:58:26 +00:00
Use a single place to create values for bool custom fields
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
module Util.CustomField exposing
|
||||
( nameOrLabel
|
||||
( boolValue
|
||||
, nameOrLabel
|
||||
, renderValue
|
||||
, renderValue2
|
||||
)
|
||||
@ -12,6 +13,17 @@ import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick)
|
||||
|
||||
|
||||
{-| This is how the server wants the value to a bool custom field
|
||||
-}
|
||||
boolValue : Bool -> String
|
||||
boolValue b =
|
||||
if b then
|
||||
"true"
|
||||
|
||||
else
|
||||
"false"
|
||||
|
||||
|
||||
nameOrLabel : { r | name : String, label : Maybe String } -> String
|
||||
nameOrLabel fv =
|
||||
Maybe.withDefault fv.name fv.label
|
||||
|
Reference in New Issue
Block a user