mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 18:38:26 +00:00
Some predefined boxes for a dashboard
This commit is contained in:
@ -11,6 +11,7 @@ module Data.Bookmarks exposing
|
||||
, bookmarksDecoder
|
||||
, empty
|
||||
, exists
|
||||
, findById
|
||||
, sort
|
||||
)
|
||||
|
||||
@ -34,6 +35,12 @@ type alias Bookmarks =
|
||||
List BookmarkedQuery
|
||||
|
||||
|
||||
findById : String -> Bookmarks -> Maybe BookmarkedQuery
|
||||
findById id all =
|
||||
List.filter (\e -> e.id == id) all
|
||||
|> List.head
|
||||
|
||||
|
||||
{-| Checks wether a bookmark of this name already exists.
|
||||
-}
|
||||
exists : String -> Bookmarks -> Bool
|
||||
|
@ -1,10 +1,17 @@
|
||||
module Data.BoxContent exposing (BoxContent(..), MessageData, QueryData, SummaryData)
|
||||
module Data.BoxContent exposing
|
||||
( BoxContent(..)
|
||||
, MessageData
|
||||
, QueryData
|
||||
, SearchQuery(..)
|
||||
, SummaryData
|
||||
, SummaryShow(..)
|
||||
)
|
||||
|
||||
import Data.ItemArrange exposing (ItemArrange)
|
||||
import Data.ItemTemplate exposing (ItemTemplate)
|
||||
|
||||
|
||||
type BoxContent
|
||||
= BoxUpload
|
||||
= BoxUpload (Maybe String)
|
||||
| BoxMessage MessageData
|
||||
| BoxQuery QueryData
|
||||
| BoxSummary SummaryData
|
||||
@ -17,11 +24,25 @@ type alias MessageData =
|
||||
|
||||
|
||||
type alias QueryData =
|
||||
{ query : String
|
||||
, view : ItemArrange
|
||||
{ query : SearchQuery
|
||||
, limit : Int
|
||||
, details : Bool
|
||||
, header : List String
|
||||
, columns : List ItemTemplate
|
||||
}
|
||||
|
||||
|
||||
type alias SummaryData =
|
||||
{ query : String
|
||||
{ query : SearchQuery
|
||||
, show : SummaryShow
|
||||
}
|
||||
|
||||
|
||||
type SummaryShow
|
||||
= SummaryShowFields Bool
|
||||
| SummaryShowGeneral
|
||||
|
||||
|
||||
type SearchQuery
|
||||
= SearchQueryString String
|
||||
| SearchQueryBookmark String
|
||||
|
@ -18,6 +18,7 @@ module Data.UiSettings exposing
|
||||
, defaults
|
||||
, fieldHidden
|
||||
, fieldVisible
|
||||
, getUiLanguage
|
||||
, merge
|
||||
, mergeDefaults
|
||||
, pdfUrl
|
||||
@ -444,6 +445,16 @@ pdfUrl settings flags originalUrl =
|
||||
Data.Pdf.serverUrl originalUrl
|
||||
|
||||
|
||||
getUiLanguage : Flags -> UiSettings -> UiLanguage -> UiLanguage
|
||||
getUiLanguage flags settings default =
|
||||
case flags.account of
|
||||
Just _ ->
|
||||
settings.uiLang
|
||||
|
||||
Nothing ->
|
||||
default
|
||||
|
||||
|
||||
|
||||
--- Helpers
|
||||
|
||||
|
Reference in New Issue
Block a user