summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-02-28 13:08:12 +0100
committerYorhel <git@yorhel.nl>2020-02-28 13:08:12 +0100
commit21c6963e2747990c0b7a0c82f3209a6942650d50 (patch)
treeb7e05ba1ce98dbea00a1e27f1d20e934425fb663
parentccc121634fec7d7aa3a36564eeab2330e543e970 (diff)
Elm/form styling: Use buttons instead of links for "remove" action
-rw-r--r--data/style.css3
-rw-r--r--elm/Lib/ExtLinks.elm2
-rw-r--r--elm/ReleaseEdit/General.elm12
-rw-r--r--elm/StaffEdit/Main.elm2
4 files changed, 12 insertions, 7 deletions
diff --git a/data/style.css b/data/style.css
index 6c0ae675..74def53c 100644
--- a/data/style.css
+++ b/data/style.css
@@ -172,7 +172,7 @@ table.formtable { margin: 0 20px 20px 20px; }
table.formtable td { padding: 0; }
table.formtable tr.newfield > td { padding-top: 5px; }
table.formtable tr.newpart td { padding-top: 20px; font-weight: bold; }
-table.formtable td table td { padding-right: 15px }
+table.formtable td table td { padding: 1px 15px 1px 0px }
table.formtable td table { margin-bottom: 5px }
/* Format checkboxes and radio buttons as if they were normal links with unicode icons.
@@ -218,6 +218,7 @@ fieldset.submit .textpreview { margin: 0 auto }
/* .compact input elements are smaller and can be embedded in tables/inline text
* .stealth input elements pretend to be just regular text, but turn into visibile input elements on mouse-over */
.compact input.text, .compact select { margin: -2px -1px; padding: 1px 0 }
+.compact input.submit { margin: -2px -1px; padding: 1px 3px }
.stealth input, .stealth select { font: inherit; background: none; border: 1px solid transparent; -moz-appearance: none; -webkit-appearance: none; appearance: none }
.stealth input:hover, .stealth input:focus,
.stealth select:hover, .stealth select:focus { border: 1px solid $secborder$; background: $secbg$ }
diff --git a/elm/Lib/ExtLinks.elm b/elm/Lib/ExtLinks.elm
index a701039e..a86c3634 100644
--- a/elm/Lib/ExtLinks.elm
+++ b/elm/Lib/ExtLinks.elm
@@ -92,7 +92,7 @@ view model = Html.form [ onSubmit Enter ]
in tr []
[ td [] [ a [ href <| pre ++ val ++ suf, target "_blank" ] [ text s.name ] ]
, td [] [ b [ class "grayedout" ] [ text pre ], text val, b [ class "grayedout" ] [ text suf ] ]
- , td [] [ a [ href "#", onClickD (Del s.del i) ] [ text "remove" ] ]
+ , td [] [ inputButton "remove" (Del s.del i) [] ]
]
) (s.links model.links)
) model.sites
diff --git a/elm/ReleaseEdit/General.elm b/elm/ReleaseEdit/General.elm
index 446639d6..e543584c 100644
--- a/elm/ReleaseEdit/General.elm
+++ b/elm/ReleaseEdit/General.elm
@@ -173,6 +173,7 @@ update msg model =
Nothing -> nm
in ({ model | engine = nmod }, c)
ExtLinks m -> mod { model | extlinks = EL.update m model.extlinks }
+
VNDel i -> mod { model | vn = delidx i model.vn }
VNSearch m ->
let (nm, c, res) = A.update vnConfig m model.vnAdd
@@ -182,7 +183,8 @@ update msg model =
if List.any (\vn -> vn.vid == v.id) model.vn
then ({ model | vnAdd = nm }, c)
else ({ model | vnAdd = A.clear nm "", vn = model.vn ++ [{ vid = v.id, title = v.title}] }, c)
- ProdDel i -> mod { model | vn = delidx i model.vn }
+
+ ProdDel i -> mod { model | prod = delidx i model.prod }
ProdRole i (d,p) -> mod { model | prod = modidx i (\e -> { e | developer = d, publisher = p }) model.prod }
ProdSearch m ->
let (nm, c, res) = A.update producerConfig m model.prodAdd
@@ -251,7 +253,7 @@ view model =
tr []
[ td [] [ inputSelect "" m.medium (MediaType i) [] <| List.map (\(a,b,_) -> (a,b)) GT.media ]
, td [] [ if q then inputSelect "" m.qty (MediaQty i) [ style "width" "100px" ] <| List.map (\a -> (a,String.fromInt a)) <| List.range 1 20 else text "" ]
- , td [] [ a [ href "#", onClickD (MediaDel i) ] [ text "remove" ] ]
+ , td [] [ inputButton "remove" (MediaDel i) [] ]
]
) model.media
, if hasDuplicates (List.map (\m -> (m.medium, m.qty)) model.media)
@@ -282,6 +284,7 @@ view model =
]
, formField "catalog::Catalog number" [ inputText "catalog" model.catalog Catalog GRE.valCatalog ]
, formField "website::Website" [ inputText "website" model.website Website (style "width" "500px" :: GRE.valWebsite) ]
+ , tr [ class "newpart" ] [ td [ colspan 2 ] [] ]
, formField "External Links" [ Html.map ExtLinks (EL.view model.extlinks) ]
, tr [ class "newpart" ] [ td [ colspan 2 ] [ text "Database relations" ] ]
@@ -290,17 +293,18 @@ view model =
else table [] <| List.indexedMap (\i v -> tr []
[ td [ style "text-align" "right" ] [ b [ class "grayedout" ] [ text <| "v" ++ String.fromInt v.vid ++ ":" ] ]
, td [] [ a [ href <| "/v" ++ String.fromInt v.vid ] [ text v.title ] ]
- , td [] [ a [ href "#", onClickD (VNDel i) ] [ text "remove" ] ]
+ , td [] [ inputButton "remove" (VNDel i) [] ]
]
) model.vn
, A.view vnConfig model.vnAdd [placeholder "Add visual novel..."]
]
+ , tr [ class "newpart" ] [ td [ colspan 2 ] [] ]
, formField "Producers"
[ table [ class "compact" ] <| List.indexedMap (\i p -> tr []
[ td [ style "text-align" "right" ] [ b [ class "grayedout" ] [ text <| "p" ++ String.fromInt p.pid ++ ":" ] ]
, td [] [ a [ href <| "/p" ++ String.fromInt p.pid ] [ text p.name ] ]
, td [] [ inputSelect "" (p.developer, p.publisher) (ProdRole i) [style "width" "100px"] [((True,False), "Developer"), ((False,True), "Publisher"), ((True,True), "Both")] ]
- , td [] [ a [ href "#", onClickD (ProdDel i) ] [ text "remove" ] ]
+ , td [] [ inputButton "remove" (ProdDel i) [] ]
]
) model.prod
, A.view producerConfig model.prodAdd [placeholder "Add producer..."]
diff --git a/elm/StaffEdit/Main.elm b/elm/StaffEdit/Main.elm
index 41044d5c..57f258ef 100644
--- a/elm/StaffEdit/Main.elm
+++ b/elm/StaffEdit/Main.elm
@@ -170,7 +170,7 @@ view model =
, td [ class "tc_add" ]
[ if model.aid == e.aid then b [ class "grayedout" ] [ text " primary" ]
else if e.inuse then b [ class "grayedout" ] [ text " referenced" ]
- else a [ onClick (AliasDel n) ] [ text " remove" ]
+ else inputButton "remove" (AliasDel n) []
]
]