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 search receive =
Http2.authPost
{ url = flags.config.baseUrl ++ "/api/v1/sec/item/search"
{ url = flags.config.baseUrl ++ "/api/v1/sec/item/searchWithTags"
, account = getAccount flags
, body = Http.jsonBody (Api.Model.ItemSearch.encode search)
, expect = Http.expectJson receive Api.Model.ItemLightList.decoder

View File

@ -162,7 +162,7 @@ viewItem item =
, Util.String.underscoreToSpace item.name
|> text
]
, span [ class "meta" ]
, div [ class "meta" ]
[ div
[ classList
[ ( "ui ribbon label", True )
@ -173,11 +173,35 @@ viewItem item =
[ i [ class "exclamation icon" ] []
, text " New"
]
, span
[ classList
[ ( "right floated", not isConfirmed )
]
]
, span [ class "right floated meta" ]
[ 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 "ui horizontal list" ]
[ div

View File

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