mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-04-05 10:59:33 +00:00
Add new checkbox to scan mailbox form
This commit is contained in:
parent
751fa3da5a
commit
0a0dd80bdc
@ -83,6 +83,7 @@ type alias Model =
|
|||||||
, language : Maybe Language
|
, language : Maybe Language
|
||||||
, postHandleAll : Bool
|
, postHandleAll : Bool
|
||||||
, summary : Maybe String
|
, summary : Maybe String
|
||||||
|
, attachmentsOnly : Bool
|
||||||
, openTabs : Set String
|
, openTabs : Set String
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,6 +167,7 @@ type Msg
|
|||||||
| TogglePostHandleAll
|
| TogglePostHandleAll
|
||||||
| ToggleAkkordionTab String
|
| ToggleAkkordionTab String
|
||||||
| SetSummary String
|
| SetSummary String
|
||||||
|
| ToggleAttachmentsOnly
|
||||||
|
|
||||||
|
|
||||||
initWith : Flags -> ScanMailboxSettings -> ( Model, Cmd Msg )
|
initWith : Flags -> ScanMailboxSettings -> ( Model, Cmd Msg )
|
||||||
@ -212,6 +214,7 @@ initWith flags s =
|
|||||||
Comp.FixedDropdown.init Data.Language.all
|
Comp.FixedDropdown.init Data.Language.all
|
||||||
, language = Maybe.andThen Data.Language.fromString s.language
|
, language = Maybe.andThen Data.Language.fromString s.language
|
||||||
, postHandleAll = Maybe.withDefault False s.postHandleAll
|
, postHandleAll = Maybe.withDefault False s.postHandleAll
|
||||||
|
, attachmentsOnly = Maybe.withDefault False s.attachmentsOnly
|
||||||
, summary = s.summary
|
, summary = s.summary
|
||||||
}
|
}
|
||||||
, Cmd.batch
|
, Cmd.batch
|
||||||
@ -260,6 +263,7 @@ init flags =
|
|||||||
, language = Nothing
|
, language = Nothing
|
||||||
, postHandleAll = False
|
, postHandleAll = False
|
||||||
, summary = Nothing
|
, summary = Nothing
|
||||||
|
, attachmentsOnly = False
|
||||||
, openTabs = Set.singleton (tabName TabGeneral)
|
, openTabs = Set.singleton (tabName TabGeneral)
|
||||||
}
|
}
|
||||||
, Cmd.batch
|
, Cmd.batch
|
||||||
@ -327,6 +331,7 @@ makeSettings model =
|
|||||||
, language = Maybe.map Data.Language.toIso3 model.language
|
, language = Maybe.map Data.Language.toIso3 model.language
|
||||||
, postHandleAll = Just model.postHandleAll
|
, postHandleAll = Just model.postHandleAll
|
||||||
, summary = model.summary
|
, summary = model.summary
|
||||||
|
, attachmentsOnly = Just model.attachmentsOnly
|
||||||
}
|
}
|
||||||
in
|
in
|
||||||
Result.map3 make conn schedule_ infolders
|
Result.map3 make conn schedule_ infolders
|
||||||
@ -697,6 +702,12 @@ update flags msg model =
|
|||||||
, Cmd.none
|
, Cmd.none
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ToggleAttachmentsOnly ->
|
||||||
|
( { model | attachmentsOnly = not model.attachmentsOnly }
|
||||||
|
, NoAction
|
||||||
|
, Cmd.none
|
||||||
|
)
|
||||||
|
|
||||||
ToggleAkkordionTab name ->
|
ToggleAkkordionTab name ->
|
||||||
let
|
let
|
||||||
tabs =
|
tabs =
|
||||||
@ -994,6 +1005,18 @@ viewAdditionalFilter2 texts model =
|
|||||||
[ Markdown.toHtml [] texts.fileFilterInfo
|
[ Markdown.toHtml [] texts.fileFilterInfo
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
, div [ class "mb-4" ]
|
||||||
|
[ MB.viewItem <|
|
||||||
|
MB.Checkbox
|
||||||
|
{ id = "scanmail-attachments-only"
|
||||||
|
, value = model.attachmentsOnly
|
||||||
|
, label = texts.attachmentsOnlyLabel
|
||||||
|
, tagger = \_ -> ToggleAttachmentsOnly
|
||||||
|
}
|
||||||
|
, span [ class "opacity-50 text-sm mt-1" ]
|
||||||
|
[ Markdown.toHtml [] texts.attachmentsOnlyInfo
|
||||||
|
]
|
||||||
|
]
|
||||||
, div
|
, div
|
||||||
[ class "mb-4"
|
[ class "mb-4"
|
||||||
]
|
]
|
||||||
|
@ -70,6 +70,8 @@ type alias Texts =
|
|||||||
, connectionMissing : String
|
, connectionMissing : String
|
||||||
, noProcessingFolders : String
|
, noProcessingFolders : String
|
||||||
, invalidCalEvent : String
|
, invalidCalEvent : String
|
||||||
|
, attachmentsOnlyLabel : String
|
||||||
|
, attachmentsOnlyInfo : String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -149,6 +151,8 @@ gb =
|
|||||||
, connectionMissing = "No E-Mail connections configured. Goto E-Mail Settings to add one."
|
, connectionMissing = "No E-Mail connections configured. Goto E-Mail Settings to add one."
|
||||||
, noProcessingFolders = "No processing folders given."
|
, noProcessingFolders = "No processing folders given."
|
||||||
, invalidCalEvent = "The calendar event is not valid."
|
, invalidCalEvent = "The calendar event is not valid."
|
||||||
|
, attachmentsOnlyLabel = "Only import e-mail attachments"
|
||||||
|
, attachmentsOnlyInfo = "Discards the e-mail body and only imports the attachments."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -223,4 +227,6 @@ kann hier ein Wert für alle festgelegt werden. Bei 'Automatisch' wird auf den S
|
|||||||
, connectionMissing = "Keine E-Mail-Verbindung definiert. Gehe zu den E-Mail-Einstellungen und füge eine hinzu."
|
, connectionMissing = "Keine E-Mail-Verbindung definiert. Gehe zu den E-Mail-Einstellungen und füge eine hinzu."
|
||||||
, noProcessingFolders = "Keine Postfachordner ausgewählt."
|
, noProcessingFolders = "Keine Postfachordner ausgewählt."
|
||||||
, invalidCalEvent = "Das Kalenderereignis ist ungültig."
|
, invalidCalEvent = "Das Kalenderereignis ist ungültig."
|
||||||
|
, attachmentsOnlyLabel = "Nur Anhänge importieren"
|
||||||
|
, attachmentsOnlyInfo = "Verwirft den E-Mail Text und importiert nur die Anhänge."
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user