diff options
author | Yorhel <git@yorhel.nl> | 2021-03-07 18:14:46 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2021-03-11 11:07:34 +0100 |
commit | 24fa3ee0bd54f8342345fb785ea87bac59df45d8 (patch) | |
tree | 33ab463c32a71ec203fcda5d9fc37bd048a05e20 /elm/Lib/Autocomplete.elm | |
parent | f0bbc8b2e4f93b5aed098f97f9965f2aa0c215ae (diff) |
Tags: Convert to vndbids + add edit histories
Another commit with changes all across the tree. But at least we have a
tangible improvement now: edit histories for tags.
Diffstat (limited to 'elm/Lib/Autocomplete.elm')
-rw-r--r-- | elm/Lib/Autocomplete.elm | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/elm/Lib/Autocomplete.elm b/elm/Lib/Autocomplete.elm index 61f13caf..b52095ad 100644 --- a/elm/Lib/Autocomplete.elm +++ b/elm/Lib/Autocomplete.elm @@ -94,13 +94,13 @@ boardSource = } -tagtraitStatus i = - case (i.searchable, i.applicable, i.state) of - (_, _, 0) -> b [ class "grayedout" ] [ text " (awaiting approval)" ] - (_, _, 1) -> b [ class "grayedout" ] [ text " (deleted)" ] -- (not returned by the API for now) - (False, False, _) -> b [ class "grayedout" ] [ text " (meta)" ] - (True, False, _) -> b [ class "grayedout" ] [ text " (not applicable)" ] - (False, True, _) -> b [ class "grayedout" ] [ text " (not searchable)" ] +tagStatus i = + case ((i.hidden, i.locked), i.searchable, i.applicable) of + ((True, False), _, _ ) -> b [ class "grayedout" ] [ text " (awaiting approval)" ] + ((True, True ), _, _ ) -> b [ class "grayedout" ] [ text " (deleted)" ] -- (not returned by the API for now) + (_, False, False) -> b [ class "grayedout" ] [ text " (meta)" ] + (_, True, False) -> b [ class "grayedout" ] [ text " (not applicable)" ] + (_, False, True ) -> b [ class "grayedout" ] [ text " (not searchable)" ] _ -> text "" @@ -110,11 +110,21 @@ tagSource = <| \x -> case x of GApi.TagResult e -> Just e _ -> Nothing - , view = \i -> [ text i.name, tagtraitStatus i ] - , key = \i -> String.fromInt i.id + , view = \i -> [ text i.name, tagStatus i ] + , key = \i -> i.id } +traitStatus i = + case (i.searchable, i.applicable, i.state) of + (_, _, 0) -> b [ class "grayedout" ] [ text " (awaiting approval)" ] + (_, _, 1) -> b [ class "grayedout" ] [ text " (deleted)" ] -- (not returned by the API for now) + (False, False, _) -> b [ class "grayedout" ] [ text " (meta)" ] + (True, False, _) -> b [ class "grayedout" ] [ text " (not applicable)" ] + (False, True, _) -> b [ class "grayedout" ] [ text " (not searchable)" ] + _ -> text "" + + traitSource : SourceConfig m GApi.ApiTraitResult traitSource = { source = Endpoint (\s -> GTR.send { search = s }) @@ -126,7 +136,7 @@ traitSource = Nothing -> text "" Just g -> b [ class "grayedout" ] [ text <| g ++ " / " ] , text i.name - , tagtraitStatus i + , traitStatus i ] , key = \i -> String.fromInt i.id } |