mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-02 13:32:51 +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.Attributes exposing (..)
|
||||
import Html.Events exposing (onInput)
|
||||
import Markdown
|
||||
|
||||
|
||||
type alias Model =
|
||||
@ -87,7 +95,12 @@ update msg model =
|
||||
|
||||
|
||||
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
|
||||
[ classList
|
||||
[ ( classes, True )
|
||||
@ -103,6 +116,14 @@ view nval classes model =
|
||||
, onInput SetValue
|
||||
]
|
||||
[]
|
||||
, span
|
||||
[ classList
|
||||
[ ( "small-info", True )
|
||||
, ( "hidden invisible", info == "" )
|
||||
]
|
||||
]
|
||||
[ Markdown.toHtml [] info
|
||||
]
|
||||
, div
|
||||
[ classList
|
||||
[ ( "ui pointing red basic label", True )
|
||||
|
@ -481,7 +481,9 @@ view extraClasses model =
|
||||
]
|
||||
]
|
||||
, 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"
|
||||
model.remindDaysModel
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user