Show tags in item list view

Also set default page size down to 60.
This commit is contained in:
Eike Kettner 2020-06-07 15:43:46 +02:00
parent 1d2a6e6caa
commit 5b2b2eceb3
3 changed files with 29 additions and 5 deletions

View File

@ -1029,7 +1029,7 @@ moveAttachmentBefore flags itemId data receive =
itemSearch : Flags -> ItemSearch -> (Result Http.Error ItemLightList -> msg) -> Cmd msg itemSearch : Flags -> ItemSearch -> (Result Http.Error ItemLightList -> msg) -> Cmd msg
itemSearch flags search receive = itemSearch flags search receive =
Http2.authPost Http2.authPost
{ url = flags.config.baseUrl ++ "/api/v1/sec/item/search" { url = flags.config.baseUrl ++ "/api/v1/sec/item/searchWithTags"
, account = getAccount flags , account = getAccount flags
, body = Http.jsonBody (Api.Model.ItemSearch.encode search) , body = Http.jsonBody (Api.Model.ItemSearch.encode search)
, expect = Http.expectJson receive Api.Model.ItemLightList.decoder , expect = Http.expectJson receive Api.Model.ItemLightList.decoder

View File

@ -162,7 +162,7 @@ viewItem item =
, Util.String.underscoreToSpace item.name , Util.String.underscoreToSpace item.name
|> text |> text
] ]
, span [ class "meta" ] , div [ class "meta" ]
[ div [ div
[ classList [ classList
[ ( "ui ribbon label", True ) [ ( "ui ribbon label", True )
@ -173,11 +173,35 @@ viewItem item =
[ i [ class "exclamation icon" ] [] [ i [ class "exclamation icon" ] []
, text " New" , text " New"
] ]
, span
[ classList
[ ( "right floated", not isConfirmed )
]
] ]
, span [ class "right floated meta" ]
[ Util.Time.formatDate item.date |> text [ Util.Time.formatDate item.date |> text
] ]
] ]
, div [ class "meta description" ]
[ div
[ classList
[ ( "ui right floated tiny labels", True )
, ( "invisible hidden", item.tags == [] )
]
]
(List.map
(\tag ->
div
[ classList
[ ( "ui basic label", True )
, ( "blue", tag.category /= Nothing )
]
]
[ text tag.name ]
)
item.tags
)
]
]
, div [ class "content" ] , div [ class "content" ]
[ div [ class "ui horizontal list" ] [ div [ class "ui horizontal list" ]
[ div [ div

View File

@ -36,7 +36,7 @@ type alias UiSettings =
defaults : UiSettings defaults : UiSettings
defaults = defaults =
{ itemSearchPageSize = 90 { itemSearchPageSize = 60
} }