mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-06 15:15:58 +00:00
Reformatted changed source files with elm-format
This commit is contained in:
parent
decae84aec
commit
dd743cf273
@ -610,8 +610,11 @@ deleteAttachment flags attachId receive =
|
|||||||
, expect = Http.expectJson receive Api.Model.BasicResult.decoder
|
, expect = Http.expectJson receive Api.Model.BasicResult.decoder
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Delete Attachments
|
--- Delete Attachments
|
||||||
|
|
||||||
|
|
||||||
deleteAttachments :
|
deleteAttachments :
|
||||||
Flags
|
Flags
|
||||||
-> Set String
|
-> Set String
|
||||||
@ -626,6 +629,7 @@ deleteAttachments flags attachIds receive =
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Attachment Metadata
|
--- Attachment Metadata
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,19 +111,23 @@ type alias Model =
|
|||||||
, viewMode : ViewMode
|
, viewMode : ViewMode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type ViewMode
|
type ViewMode
|
||||||
= SimpleView
|
= SimpleView
|
||||||
| SelectView SelectViewModel
|
| SelectView SelectViewModel
|
||||||
|
|
||||||
|
|
||||||
type alias SelectViewModel =
|
type alias SelectViewModel =
|
||||||
{ ids : Set String
|
{ ids : Set String
|
||||||
, action : SelectActionMode
|
, action : SelectActionMode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type SelectActionMode
|
type SelectActionMode
|
||||||
= NoneAction
|
= NoneAction
|
||||||
| DeleteSelected
|
| DeleteSelected
|
||||||
|
|
||||||
|
|
||||||
type NotesField
|
type NotesField
|
||||||
= ViewNotes
|
= ViewNotes
|
||||||
| EditNotes Comp.MarkdownInput.Model
|
| EditNotes Comp.MarkdownInput.Model
|
||||||
@ -204,6 +208,7 @@ emptyModel =
|
|||||||
, viewMode = SimpleView
|
, viewMode = SimpleView
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
initSelectViewModel : SelectViewModel
|
initSelectViewModel : SelectViewModel
|
||||||
initSelectViewModel =
|
initSelectViewModel =
|
||||||
{ ids = Set.empty
|
{ ids = Set.empty
|
||||||
|
@ -114,6 +114,7 @@ attachHeader texts settings model _ attach =
|
|||||||
case model.viewMode of
|
case model.viewMode of
|
||||||
SelectView _ ->
|
SelectView _ ->
|
||||||
True
|
True
|
||||||
|
|
||||||
_ ->
|
_ ->
|
||||||
False
|
False
|
||||||
|
|
||||||
@ -121,6 +122,7 @@ attachHeader texts settings model _ attach =
|
|||||||
case model.viewMode of
|
case model.viewMode of
|
||||||
SelectView _ ->
|
SelectView _ ->
|
||||||
texts.exitSelectMode
|
texts.exitSelectMode
|
||||||
|
|
||||||
_ ->
|
_ ->
|
||||||
texts.selectModeTitle
|
texts.selectModeTitle
|
||||||
|
|
||||||
@ -163,11 +165,12 @@ attachHeader texts settings model _ attach =
|
|||||||
[ i [ class "fa fa-eye font-thin" ] []
|
[ i [ class "fa fa-eye font-thin" ] []
|
||||||
]
|
]
|
||||||
, a
|
, a
|
||||||
[ classList [ (S.secondaryBasicButton ++ " text-sm", True)
|
[ classList
|
||||||
, ( "bg-gray-200 dark:bg-bluegray-600", selectView )
|
[ ( S.secondaryBasicButton ++ " text-sm", True )
|
||||||
, ( "hidden", not selectPossible )
|
, ( "bg-gray-200 dark:bg-bluegray-600", selectView )
|
||||||
, ( "ml-2", True )
|
, ( "hidden", not selectPossible )
|
||||||
]
|
, ( "ml-2", True )
|
||||||
|
]
|
||||||
, href "#"
|
, href "#"
|
||||||
, title selectToggleText
|
, title selectToggleText
|
||||||
, onClick ToggleSelectView
|
, onClick ToggleSelectView
|
||||||
@ -175,11 +178,12 @@ attachHeader texts settings model _ attach =
|
|||||||
[ i [ class "fa fa-tasks" ] []
|
[ i [ class "fa fa-tasks" ] []
|
||||||
]
|
]
|
||||||
, a
|
, a
|
||||||
[ classList [ ( S.deleteButton, True )
|
[ classList
|
||||||
, ( "disabled", noAttachmentsSelected )
|
[ ( S.deleteButton, True )
|
||||||
, ( "hidden", not selectPossible || not selectView )
|
, ( "disabled", noAttachmentsSelected )
|
||||||
, ( "ml-2", True )
|
, ( "hidden", not selectPossible || not selectView )
|
||||||
]
|
, ( "ml-2", True )
|
||||||
|
]
|
||||||
, href "#"
|
, href "#"
|
||||||
, title texts.deleteAttachments
|
, title texts.deleteAttachments
|
||||||
, onClick RequestDeleteSelected
|
, onClick RequestDeleteSelected
|
||||||
@ -356,8 +360,10 @@ menuItem texts model pos attach =
|
|||||||
SelectView svm ->
|
SelectView svm ->
|
||||||
if Set.member attach.id svm.ids then
|
if Set.member attach.id svm.ids then
|
||||||
"fa fa-check-circle ml-1"
|
"fa fa-check-circle ml-1"
|
||||||
|
|
||||||
else
|
else
|
||||||
"fa fa-circle ml-1"
|
"fa fa-circle ml-1"
|
||||||
|
|
||||||
_ ->
|
_ ->
|
||||||
"fa fa-check-circle ml-1"
|
"fa fa-check-circle ml-1"
|
||||||
|
|
||||||
@ -365,16 +371,17 @@ menuItem texts model pos attach =
|
|||||||
case model.viewMode of
|
case model.viewMode of
|
||||||
SelectView _ ->
|
SelectView _ ->
|
||||||
True
|
True
|
||||||
|
|
||||||
_ ->
|
_ ->
|
||||||
model.visibleAttach == pos
|
model.visibleAttach == pos
|
||||||
|
|
||||||
msg =
|
msg =
|
||||||
case model.viewMode of
|
case model.viewMode of
|
||||||
SelectView _ ->
|
SelectView _ ->
|
||||||
(ToggleAttachment attach.id)
|
ToggleAttachment attach.id
|
||||||
_ ->
|
|
||||||
(SetActiveAttachment pos)
|
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
SetActiveAttachment pos
|
||||||
in
|
in
|
||||||
a
|
a
|
||||||
([ classList <|
|
([ classList <|
|
||||||
|
@ -24,7 +24,7 @@ import Comp.Dropdown exposing (isDropdownChangeMsg)
|
|||||||
import Comp.Dropzone
|
import Comp.Dropzone
|
||||||
import Comp.EquipmentForm
|
import Comp.EquipmentForm
|
||||||
import Comp.ItemDetail.FieldTabState as FTabState
|
import Comp.ItemDetail.FieldTabState as FTabState
|
||||||
import Comp.ItemDetail.Model exposing (AttachmentRename, Model, Msg(..), NotesField(..), SaveNameState(..), SelectActionMode(..), UpdateResult, isEditNotes, resultModel, resultModelCmd, resultModelCmdSub)
|
import Comp.ItemDetail.Model exposing (AttachmentRename, Model, Msg(..), NotesField(..), SaveNameState(..), SelectActionMode(..), UpdateResult, ViewMode(..), initSelectViewModel, isEditNotes, resultModel, resultModelCmd, resultModelCmdSub)
|
||||||
import Comp.ItemMail
|
import Comp.ItemMail
|
||||||
import Comp.KeyInput
|
import Comp.KeyInput
|
||||||
import Comp.LinkTarget
|
import Comp.LinkTarget
|
||||||
@ -44,7 +44,6 @@ import Dict
|
|||||||
import Html5.DragDrop as DD
|
import Html5.DragDrop as DD
|
||||||
import Http
|
import Http
|
||||||
import Page exposing (Page(..))
|
import Page exposing (Page(..))
|
||||||
import Comp.ItemDetail.Model exposing (ViewMode(..), initSelectViewModel)
|
|
||||||
import Set exposing (Set)
|
import Set exposing (Set)
|
||||||
import Throttle
|
import Throttle
|
||||||
import Time
|
import Time
|
||||||
@ -275,11 +274,13 @@ update key flags inav settings msg model =
|
|||||||
svm_ =
|
svm_ =
|
||||||
if Set.member id svm.ids then
|
if Set.member id svm.ids then
|
||||||
{ svm | ids = Set.remove id svm.ids }
|
{ svm | ids = Set.remove id svm.ids }
|
||||||
|
|
||||||
else
|
else
|
||||||
{ svm | ids = Set.insert id svm.ids }
|
{ svm | ids = Set.insert id svm.ids }
|
||||||
in
|
in
|
||||||
resultModel
|
resultModel
|
||||||
{ model | viewMode = SelectView svm_ }
|
{ model | viewMode = SelectView svm_ }
|
||||||
|
|
||||||
_ ->
|
_ ->
|
||||||
resultModel model
|
resultModel model
|
||||||
|
|
||||||
@ -1404,10 +1405,11 @@ update key flags inav settings msg model =
|
|||||||
withSub ( model_, Cmd.none )
|
withSub ( model_, Cmd.none )
|
||||||
|
|
||||||
ToggleAttachMenu ->
|
ToggleAttachMenu ->
|
||||||
resultModel { model
|
resultModel
|
||||||
| attachMenuOpen = not model.attachMenuOpen
|
{ model
|
||||||
, viewMode = SimpleView
|
| attachMenuOpen = not model.attachMenuOpen
|
||||||
}
|
, viewMode = SimpleView
|
||||||
|
}
|
||||||
|
|
||||||
UiSettingsUpdated ->
|
UiSettingsUpdated ->
|
||||||
let
|
let
|
||||||
|
@ -17,7 +17,7 @@ type alias Texts =
|
|||||||
, deleteThisFile : String
|
, deleteThisFile : String
|
||||||
, selectModeTitle : String
|
, selectModeTitle : String
|
||||||
, exitSelectMode : String
|
, exitSelectMode : String
|
||||||
, deleteAttachments: String
|
, deleteAttachments : String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user