mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Remove code from old ui
This commit is contained in:
@ -102,7 +102,7 @@ makeCustomFieldLink :
|
|||||||
-> (LinkTarget -> msg)
|
-> (LinkTarget -> msg)
|
||||||
-> Html msg
|
-> Html msg
|
||||||
makeCustomFieldLink cv classes tagger =
|
makeCustomFieldLink cv classes tagger =
|
||||||
Util.CustomField.renderValue1
|
Util.CustomField.renderValue2
|
||||||
classes
|
classes
|
||||||
(tagger (LinkCustomField cv) |> Just)
|
(tagger (LinkCustomField cv) |> Just)
|
||||||
cv
|
cv
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
module Util.CustomField exposing
|
module Util.CustomField exposing
|
||||||
( nameOrLabel
|
( nameOrLabel
|
||||||
, renderValue
|
, renderValue
|
||||||
, renderValue1
|
|
||||||
, renderValue2
|
, renderValue2
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -20,43 +19,7 @@ nameOrLabel fv =
|
|||||||
|
|
||||||
renderValue : String -> ItemFieldValue -> Html msg
|
renderValue : String -> ItemFieldValue -> Html msg
|
||||||
renderValue classes cv =
|
renderValue classes cv =
|
||||||
renderValue1 [ ( classes, True ) ] Nothing cv
|
renderValue2 [ ( classes, True ) ] Nothing cv
|
||||||
|
|
||||||
|
|
||||||
renderValue1 : List ( String, Bool ) -> Maybe msg -> ItemFieldValue -> Html msg
|
|
||||||
renderValue1 classes tagger cv =
|
|
||||||
let
|
|
||||||
renderBool =
|
|
||||||
if cv.value == "true" then
|
|
||||||
i [ class "check icon" ] []
|
|
||||||
|
|
||||||
else
|
|
||||||
i [ class "minus icon" ] []
|
|
||||||
|
|
||||||
el : List (Html msg) -> Html msg
|
|
||||||
el =
|
|
||||||
case tagger of
|
|
||||||
Just t ->
|
|
||||||
a
|
|
||||||
[ classList classes
|
|
||||||
, onClick t
|
|
||||||
, href "#"
|
|
||||||
]
|
|
||||||
|
|
||||||
Nothing ->
|
|
||||||
div [ classList classes ]
|
|
||||||
in
|
|
||||||
el
|
|
||||||
[ Icons.customFieldTypeIconString "" cv.ftype
|
|
||||||
, nameOrLabel cv |> text
|
|
||||||
, div [ class "detail" ]
|
|
||||||
[ if Data.CustomFieldType.fromString cv.ftype == Just Data.CustomFieldType.Boolean then
|
|
||||||
renderBool
|
|
||||||
|
|
||||||
else
|
|
||||||
text cv.value
|
|
||||||
]
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
renderValue2 : List ( String, Bool ) -> Maybe msg -> ItemFieldValue -> Html msg
|
renderValue2 : List ( String, Bool ) -> Maybe msg -> ItemFieldValue -> Html msg
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
module Util.Html exposing
|
module Util.Html exposing
|
||||||
( KeyCode(..)
|
( KeyCode(..)
|
||||||
, checkbox
|
|
||||||
, checkbox2
|
, checkbox2
|
||||||
, classActive
|
, classActive
|
||||||
, intToKeyCode
|
, intToKeyCode
|
||||||
@ -22,25 +21,6 @@ import Html.Events exposing (keyCode, on, preventDefaultOn)
|
|||||||
import Json.Decode as D
|
import Json.Decode as D
|
||||||
|
|
||||||
|
|
||||||
checkboxChecked : Html msg
|
|
||||||
checkboxChecked =
|
|
||||||
i [ class "ui check square outline icon" ] []
|
|
||||||
|
|
||||||
|
|
||||||
checkboxUnchecked : Html msg
|
|
||||||
checkboxUnchecked =
|
|
||||||
i [ class "ui square outline icon" ] []
|
|
||||||
|
|
||||||
|
|
||||||
checkbox : Bool -> Html msg
|
|
||||||
checkbox flag =
|
|
||||||
if flag then
|
|
||||||
checkboxChecked
|
|
||||||
|
|
||||||
else
|
|
||||||
checkboxUnchecked
|
|
||||||
|
|
||||||
|
|
||||||
checkbox2 : Bool -> Html msg
|
checkbox2 : Bool -> Html msg
|
||||||
checkbox2 flag =
|
checkbox2 flag =
|
||||||
if flag then
|
if flag then
|
||||||
|
Reference in New Issue
Block a user