Add a qr code to the link of an item or attachment

This commit is contained in:
eikek
2021-08-17 02:15:14 +02:00
parent 2d2f9e3e87
commit 8f23b68587
14 changed files with 307 additions and 41 deletions

View File

@ -42,7 +42,10 @@ import Comp.ItemDetail.Model
, UpdateResult
, ViewMode(..)
, initSelectViewModel
, initShowQrModel
, isEditNotes
, isShowQrAttach
, isShowQrItem
, resultModel
, resultModelCmd
, resultModelCmdSub
@ -66,6 +69,7 @@ import Dict
import Html5.DragDrop as DD
import Http
import Page exposing (Page(..))
import Ports
import Set exposing (Set)
import Throttle
import Time
@ -1607,6 +1611,29 @@ update key flags inav settings msg model =
RestoreItem ->
resultModelCmd ( model, Api.restoreItem flags model.item.id SaveResp )
ToggleShowQrItem id ->
let
sqm =
model.showQrModel
next =
{ sqm | item = not sqm.item }
in
resultModel { model | showQrModel = next }
ToggleShowQrAttach id ->
let
sqm =
model.showQrModel
next =
{ sqm | attach = not sqm.attach }
in
resultModel { model | attachmentDropdownOpen = False, showQrModel = next }
PrintElement id ->
resultModelCmd ( model, Ports.printElement id )
--- Helper