mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-05 22:55:58 +00:00
Make link to original file enabled if files are different
This commit is contained in:
parent
957073fe62
commit
1f431c3222
@ -40,6 +40,7 @@ import Http
|
|||||||
import Markdown
|
import Markdown
|
||||||
import Page exposing (Page(..))
|
import Page exposing (Page(..))
|
||||||
import Util.Http
|
import Util.Http
|
||||||
|
import Util.List
|
||||||
import Util.Maybe
|
import Util.Maybe
|
||||||
import Util.Size
|
import Util.Size
|
||||||
import Util.String
|
import Util.String
|
||||||
@ -1176,8 +1177,23 @@ renderAttachmentView model pos attach =
|
|||||||
]
|
]
|
||||||
, div [ class "right menu" ]
|
, div [ class "right menu" ]
|
||||||
[ a
|
[ a
|
||||||
[ class "item"
|
[ classList
|
||||||
, title "Goto Original file"
|
[ ( "item", True )
|
||||||
|
, ( "disabled", not attach.converted )
|
||||||
|
]
|
||||||
|
, title
|
||||||
|
(if attach.converted then
|
||||||
|
case Util.List.find (\s -> s.id == attach.id) model.item.sources of
|
||||||
|
Just src ->
|
||||||
|
"Goto original: "
|
||||||
|
++ Maybe.withDefault "<noname>" src.name
|
||||||
|
|
||||||
|
Nothing ->
|
||||||
|
"Goto original file"
|
||||||
|
|
||||||
|
else
|
||||||
|
"This is the original file"
|
||||||
|
)
|
||||||
, href (fileUrl ++ "/original")
|
, href (fileUrl ++ "/original")
|
||||||
, target "_new"
|
, target "_new"
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user