diff options
author | Yorhel <git@yorhel.nl> | 2022-07-29 21:03:06 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2022-07-29 21:03:14 +0200 |
commit | 61e254baa61bae0c77eebc696afc4a3a90bbd224 (patch) | |
tree | c5554651de93b1a34ab37a713b408aea14ac9be9 /elm | |
parent | 8ca41f27dd034539918104e38c9019eacee10aef (diff) |
AdvSearch: Allow filtering releases where engine is unknown
Diffstat (limited to 'elm')
-rw-r--r-- | elm/AdvSearch/Engine.elm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/elm/AdvSearch/Engine.elm b/elm/AdvSearch/Engine.elm index 2d0df65f..c48bde00 100644 --- a/elm/AdvSearch/Engine.elm +++ b/elm/AdvSearch/Engine.elm @@ -1,7 +1,5 @@ module AdvSearch.Engine exposing (..) --- TODO: Add "unknown" option? (= empty string) - import Html exposing (..) import Html.Attributes exposing (..) import Set @@ -65,7 +63,7 @@ view : Model -> (Html Msg, () -> List (Html Msg)) view model = ( case Set.toList model.sel.sel of [] -> b [ class "grayedout" ] [ text "Engine" ] - [s] -> span [ class "nowrap" ] [ S.lblPrefix model.sel, text s ] + [s] -> span [ class "nowrap" ] [ S.lblPrefix model.sel, text (if s == "" then "Unknown engine" else s) ] l -> span [] [ S.lblPrefix model.sel, text <| "Engines (" ++ String.fromInt (List.length l) ++ ")" ] , \() -> [ div [ class "advheader" ] @@ -74,7 +72,8 @@ view model = ] , ul [] <| List.map (\s -> li [] [ inputButton "X" (Sel (S.Sel s False)) [], text " ", text s ] - ) (Set.toList model.sel.sel) + ) <| List.filter (\x -> x /= "") <| Set.toList model.sel.sel , A.view model.conf model.search [ placeholder "Search..." ] + , label [] [ inputCheck "" (Set.member "" model.sel.sel) (Sel << S.Sel ""), text " Unknown" ] ] ) |