mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Add a qr code to the link of an item or attachment
This commit is contained in:
@ -11,8 +11,19 @@ import Api
|
||||
import Api.Model.Attachment exposing (Attachment)
|
||||
import Comp.AttachmentMeta
|
||||
import Comp.ItemDetail.ConfirmModalView
|
||||
import Comp.ItemDetail.Model exposing (Model, Msg(..), NotesField(..), SaveNameState(..), ViewMode(..))
|
||||
import Comp.ItemDetail.Model
|
||||
exposing
|
||||
( Model
|
||||
, Msg(..)
|
||||
, NotesField(..)
|
||||
, SaveNameState(..)
|
||||
, ViewMode(..)
|
||||
, isShowQrAttach
|
||||
)
|
||||
import Comp.ItemDetail.ShowQrCode
|
||||
import Comp.MenuBar as MB
|
||||
import Data.Flags exposing (Flags)
|
||||
import Data.Icons as Icons
|
||||
import Data.UiSettings exposing (UiSettings)
|
||||
import Dict
|
||||
import Html exposing (..)
|
||||
@ -27,8 +38,8 @@ import Util.Size
|
||||
import Util.String
|
||||
|
||||
|
||||
view : Texts -> UiSettings -> Model -> Int -> Attachment -> Html Msg
|
||||
view texts settings model pos attach =
|
||||
view : Texts -> Flags -> UiSettings -> Model -> Int -> Attachment -> Html Msg
|
||||
view texts flags settings model pos attach =
|
||||
let
|
||||
fileUrl =
|
||||
Api.fileURL attach.id
|
||||
@ -61,6 +72,11 @@ view texts settings model pos attach =
|
||||
Nothing ->
|
||||
span [ class "hidden" ] []
|
||||
|
||||
else if isShowQrAttach model.showQrModel then
|
||||
Comp.ItemDetail.ShowQrCode.view1 flags
|
||||
"border-r border-l border-b dark:border-bluegray-600 h-full"
|
||||
(Comp.ItemDetail.ShowQrCode.Attach attach.id)
|
||||
|
||||
else
|
||||
div
|
||||
[ class "flex flex-col relative px-2 pt-2 h-full"
|
||||
@ -269,6 +285,13 @@ attachHeader texts settings model _ attach =
|
||||
, href "#"
|
||||
]
|
||||
}
|
||||
, { icon = Icons.showQr
|
||||
, label = texts.showQrCode
|
||||
, attrs =
|
||||
[ onClick (ToggleShowQrAttach attach.id)
|
||||
, href "#"
|
||||
]
|
||||
}
|
||||
, { icon = "fa fa-trash"
|
||||
, label = texts.deleteThisFile
|
||||
, attrs =
|
||||
|
Reference in New Issue
Block a user