Copy/paste form together

This commit is contained in:
Eike Kettner
2020-04-19 23:46:46 +02:00
parent ad772c0c25
commit 9b30542974
8 changed files with 275 additions and 36 deletions

View File

@ -25,7 +25,7 @@ import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onCheck, onInput)
import Http
import Util.Maybe
import Util.Tag
import Util.Update
@ -56,8 +56,8 @@ type alias Model =
emptyModel : Model
emptyModel =
{ tagInclModel = makeTagModel
, tagExclModel = makeTagModel
{ tagInclModel = Util.Tag.makeDropdownModel
, tagExclModel = Util.Tag.makeDropdownModel
, directionModel =
Comp.Dropdown.makeSingleList
{ makeOption =
@ -130,23 +130,6 @@ type Msg
| ResetForm
makeTagModel : Comp.Dropdown.Model Tag
makeTagModel =
Comp.Dropdown.makeModel
{ multiple = True
, searchable = \n -> n > 4
, makeOption = \tag -> { value = tag.id, text = tag.name }
, labelColor =
\tag ->
if Util.Maybe.nonEmpty tag.category then
"basic blue"
else
""
, placeholder = "Choose a tag"
}
getDirection : Model -> Maybe Direction
getDirection model =
let