Improve document list view

Replace the html table with something that has more vertical space,
but scales better horizontally. On most screens at least 6-8 entries
should be visible at once.
This commit is contained in:
Eike Kettner
2020-05-17 14:01:40 +02:00
parent 8a56cf0801
commit f45b40342c
5 changed files with 208 additions and 13 deletions

View File

@ -7,14 +7,14 @@ module Page.Home.Data exposing
)
import Api.Model.ItemLightList exposing (ItemLightList)
import Comp.ItemList
import Comp.ItemCardList
import Comp.SearchMenu
import Http
type alias Model =
{ searchMenuModel : Comp.SearchMenu.Model
, itemListModel : Comp.ItemList.Model
, itemListModel : Comp.ItemCardList.Model
, searchInProgress : Bool
, viewMode : ViewMode
}
@ -23,7 +23,7 @@ type alias Model =
emptyModel : Model
emptyModel =
{ searchMenuModel = Comp.SearchMenu.emptyModel
, itemListModel = Comp.ItemList.emptyModel
, itemListModel = Comp.ItemCardList.init
, searchInProgress = False
, viewMode = Listing
}
@ -33,7 +33,7 @@ type Msg
= Init
| SearchMenuMsg Comp.SearchMenu.Msg
| ResetSearch
| ItemListMsg Comp.ItemList.Msg
| ItemCardListMsg Comp.ItemCardList.Msg
| ItemSearchResp (Result Http.Error ItemLightList)
| DoSearch
@ -47,10 +47,10 @@ itemNav : String -> Model -> { prev : Maybe String, next : Maybe String }
itemNav id model =
let
prev =
Comp.ItemList.prevItem model.itemListModel id
Comp.ItemCardList.prevItem model.itemListModel id
next =
Comp.ItemList.nextItem model.itemListModel id
Comp.ItemCardList.nextItem model.itemListModel id
in
{ prev = Maybe.map .id prev
, next = Maybe.map .id next