mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Display item notes in card view if configured
The user can set a maximum length of the item notes to display in each card. If set to 0, it is hidden.
This commit is contained in:
@ -16,6 +16,8 @@ type alias Config =
|
||||
, docspellAssetPath : String
|
||||
, integrationEnabled : Bool
|
||||
, fullTextSearchEnabled : Bool
|
||||
, maxPageSize : Int
|
||||
, maxNoteLength : Int
|
||||
}
|
||||
|
||||
|
||||
|
@ -26,6 +26,7 @@ type alias StoredUiSettings =
|
||||
{ itemSearchPageSize : Maybe Int
|
||||
, tagCategoryColors : List ( String, String )
|
||||
, nativePdfPreview : Bool
|
||||
, itemSearchNoteLength : Maybe Int
|
||||
}
|
||||
|
||||
|
||||
@ -40,6 +41,7 @@ type alias UiSettings =
|
||||
{ itemSearchPageSize : Int
|
||||
, tagCategoryColors : Dict String Color
|
||||
, nativePdfPreview : Bool
|
||||
, itemSearchNoteLength : Int
|
||||
}
|
||||
|
||||
|
||||
@ -48,6 +50,7 @@ defaults =
|
||||
{ itemSearchPageSize = 60
|
||||
, tagCategoryColors = Dict.empty
|
||||
, nativePdfPreview = False
|
||||
, itemSearchNoteLength = 0
|
||||
}
|
||||
|
||||
|
||||
@ -64,6 +67,8 @@ merge given fallback =
|
||||
)
|
||||
fallback.tagCategoryColors
|
||||
, nativePdfPreview = given.nativePdfPreview
|
||||
, itemSearchNoteLength =
|
||||
choose given.itemSearchNoteLength fallback.itemSearchNoteLength
|
||||
}
|
||||
|
||||
|
||||
@ -79,6 +84,7 @@ toStoredUiSettings settings =
|
||||
Dict.map (\_ -> Data.Color.toString) settings.tagCategoryColors
|
||||
|> Dict.toList
|
||||
, nativePdfPreview = settings.nativePdfPreview
|
||||
, itemSearchNoteLength = Just settings.itemSearchNoteLength
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user