mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-06 15:15:58 +00:00
Make source a quick link on card and detail
This commit is contained in:
parent
63535408c9
commit
38ae7a9027
@ -263,13 +263,11 @@ metaDataContent settings item =
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
, div [ class "right floated meta" ]
|
, div [ class "right floated meta" ]
|
||||||
[ div [ class "ui horizontal list" ]
|
[ div [ class "ui horizontal link list" ]
|
||||||
[ div
|
[ Comp.LinkTarget.makeSourceLink
|
||||||
[ class "item"
|
[ ( "item", True ) ]
|
||||||
, title "Source"
|
SetLinkTarget
|
||||||
]
|
(IT.render IT.source item)
|
||||||
[ IT.render IT.source item |> text
|
|
||||||
]
|
|
||||||
, div
|
, div
|
||||||
[ classList
|
[ classList
|
||||||
[ ( "item", True )
|
[ ( "item", True )
|
||||||
|
@ -38,7 +38,6 @@ import Html.Events exposing (onCheck, onClick, onInput)
|
|||||||
import Markdown
|
import Markdown
|
||||||
import Page exposing (Page(..))
|
import Page exposing (Page(..))
|
||||||
import Set
|
import Set
|
||||||
import Util.CustomField
|
|
||||||
import Util.File exposing (makeFileId)
|
import Util.File exposing (makeFileId)
|
||||||
import Util.Folder
|
import Util.Folder
|
||||||
import Util.List
|
import Util.List
|
||||||
@ -560,7 +559,8 @@ renderItemInfo settings model =
|
|||||||
[ class "item"
|
[ class "item"
|
||||||
, title "Source"
|
, title "Source"
|
||||||
]
|
]
|
||||||
[ text model.item.source
|
[ Icons.sourceIcon ""
|
||||||
|
, Comp.LinkTarget.makeSourceLink [] SetLinkTarget model.item.source
|
||||||
]
|
]
|
||||||
, True
|
, True
|
||||||
)
|
)
|
||||||
|
@ -4,6 +4,7 @@ module Comp.LinkTarget exposing
|
|||||||
, makeCorrLink
|
, makeCorrLink
|
||||||
, makeCustomFieldLink
|
, makeCustomFieldLink
|
||||||
, makeFolderLink
|
, makeFolderLink
|
||||||
|
, makeSourceLink
|
||||||
, makeTagLink
|
, makeTagLink
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -23,6 +24,7 @@ type LinkTarget
|
|||||||
| LinkFolder IdName
|
| LinkFolder IdName
|
||||||
| LinkTag IdName
|
| LinkTag IdName
|
||||||
| LinkCustomField ItemFieldValue
|
| LinkCustomField ItemFieldValue
|
||||||
|
| LinkSource String
|
||||||
| LinkNone
|
| LinkNone
|
||||||
|
|
||||||
|
|
||||||
@ -90,6 +92,15 @@ makeCustomFieldLink cv classes tagger =
|
|||||||
cv
|
cv
|
||||||
|
|
||||||
|
|
||||||
|
makeSourceLink :
|
||||||
|
List ( String, Bool )
|
||||||
|
-> (LinkTarget -> msg)
|
||||||
|
-> String
|
||||||
|
-> Html msg
|
||||||
|
makeSourceLink classes tagger str =
|
||||||
|
makeLink classes (.name >> LinkSource >> tagger) (IdName "" str)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Helpers
|
--- Helpers
|
||||||
|
|
||||||
|
@ -358,6 +358,7 @@ type Msg
|
|||||||
| SetCustomField ItemFieldValue
|
| SetCustomField ItemFieldValue
|
||||||
| CustomFieldMsg Comp.CustomFieldMultiInput.Msg
|
| CustomFieldMsg Comp.CustomFieldMultiInput.Msg
|
||||||
| SetSource String
|
| SetSource String
|
||||||
|
| ResetToSource String
|
||||||
| GetStatsResp (Result Http.Error SearchStats)
|
| GetStatsResp (Result Http.Error SearchStats)
|
||||||
| GetAllTagsResp (Result Http.Error SearchStats)
|
| GetAllTagsResp (Result Http.Error SearchStats)
|
||||||
|
|
||||||
@ -877,6 +878,9 @@ updateDrop ddm flags settings msg model =
|
|||||||
, dragDrop = DD.DragDropData ddm Nothing
|
, dragDrop = DD.DragDropData ddm Nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ResetToSource str ->
|
||||||
|
resetAndSet (SetSource str)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- View
|
-- View
|
||||||
|
@ -716,6 +716,9 @@ linkTargetMsg linkTarget =
|
|||||||
Comp.LinkTarget.LinkCustomField id ->
|
Comp.LinkTarget.LinkCustomField id ->
|
||||||
Just <| SearchMenuMsg (Comp.SearchMenu.SetCustomField id)
|
Just <| SearchMenuMsg (Comp.SearchMenu.SetCustomField id)
|
||||||
|
|
||||||
|
Comp.LinkTarget.LinkSource str ->
|
||||||
|
Just <| SearchMenuMsg (Comp.SearchMenu.ResetToSource str)
|
||||||
|
|
||||||
|
|
||||||
doSearchMore : Flags -> UiSettings -> Model -> ( Model, Cmd Msg )
|
doSearchMore : Flags -> UiSettings -> Model -> ( Model, Cmd Msg )
|
||||||
doSearchMore flags settings model =
|
doSearchMore flags settings model =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user