mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-06 15:15:58 +00:00
Add info text to int field
This commit is contained in:
parent
84e0ebf1a2
commit
06d2c9ecba
@ -1,8 +1,16 @@
|
|||||||
module Comp.IntField exposing (Model, Msg, init, update, view)
|
module Comp.IntField exposing
|
||||||
|
( Model
|
||||||
|
, Msg
|
||||||
|
, init
|
||||||
|
, update
|
||||||
|
, view
|
||||||
|
, viewWithInfo
|
||||||
|
)
|
||||||
|
|
||||||
import Html exposing (..)
|
import Html exposing (..)
|
||||||
import Html.Attributes exposing (..)
|
import Html.Attributes exposing (..)
|
||||||
import Html.Events exposing (onInput)
|
import Html.Events exposing (onInput)
|
||||||
|
import Markdown
|
||||||
|
|
||||||
|
|
||||||
type alias Model =
|
type alias Model =
|
||||||
@ -87,7 +95,12 @@ update msg model =
|
|||||||
|
|
||||||
|
|
||||||
view : Maybe Int -> String -> Model -> Html Msg
|
view : Maybe Int -> String -> Model -> Html Msg
|
||||||
view nval classes model =
|
view =
|
||||||
|
viewWithInfo ""
|
||||||
|
|
||||||
|
|
||||||
|
viewWithInfo : String -> Maybe Int -> String -> Model -> Html Msg
|
||||||
|
viewWithInfo info nval classes model =
|
||||||
div
|
div
|
||||||
[ classList
|
[ classList
|
||||||
[ ( classes, True )
|
[ ( classes, True )
|
||||||
@ -103,6 +116,14 @@ view nval classes model =
|
|||||||
, onInput SetValue
|
, onInput SetValue
|
||||||
]
|
]
|
||||||
[]
|
[]
|
||||||
|
, span
|
||||||
|
[ classList
|
||||||
|
[ ( "small-info", True )
|
||||||
|
, ( "hidden invisible", info == "" )
|
||||||
|
]
|
||||||
|
]
|
||||||
|
[ Markdown.toHtml [] info
|
||||||
|
]
|
||||||
, div
|
, div
|
||||||
[ classList
|
[ classList
|
||||||
[ ( "ui pointing red basic label", True )
|
[ ( "ui pointing red basic label", True )
|
||||||
|
@ -481,7 +481,9 @@ view extraClasses model =
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
, Html.map RemindDaysMsg
|
, Html.map RemindDaysMsg
|
||||||
(Comp.IntField.view model.remindDays
|
(Comp.IntField.viewWithInfo
|
||||||
|
"Select items with a due date *lower than* `today+remindDays`"
|
||||||
|
model.remindDays
|
||||||
"required field"
|
"required field"
|
||||||
model.remindDaysModel
|
model.remindDaysModel
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user