mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Initial version.
Features: - Upload PDF files let them analyze - Manage meta data and items - See processing in webapp
This commit is contained in:
41
modules/webapp/src/main/elm/Data/ContactType.elm
Normal file
41
modules/webapp/src/main/elm/Data/ContactType.elm
Normal file
@ -0,0 +1,41 @@
|
||||
module Data.ContactType exposing (..)
|
||||
|
||||
type ContactType
|
||||
= Phone
|
||||
| Mobile
|
||||
| Fax
|
||||
| Email
|
||||
| Docspell
|
||||
| Website
|
||||
|
||||
|
||||
fromString: String -> Maybe ContactType
|
||||
fromString str =
|
||||
case String.toLower str of
|
||||
"phone" -> Just Phone
|
||||
"mobile" -> Just Mobile
|
||||
"fax" -> Just Fax
|
||||
"email" -> Just Email
|
||||
"docspell" -> Just Docspell
|
||||
"website" -> Just Website
|
||||
_ -> Nothing
|
||||
|
||||
toString: ContactType -> String
|
||||
toString ct =
|
||||
case ct of
|
||||
Phone -> "Phone"
|
||||
Mobile -> "Mobile"
|
||||
Fax -> "Fax"
|
||||
Email -> "Email"
|
||||
Docspell -> "Docspell"
|
||||
Website -> "Website"
|
||||
|
||||
all: List ContactType
|
||||
all =
|
||||
[ Mobile
|
||||
, Phone
|
||||
, Email
|
||||
, Website
|
||||
, Fax
|
||||
, Docspell
|
||||
]
|
45
modules/webapp/src/main/elm/Data/Direction.elm
Normal file
45
modules/webapp/src/main/elm/Data/Direction.elm
Normal file
@ -0,0 +1,45 @@
|
||||
module Data.Direction exposing (..)
|
||||
|
||||
type Direction
|
||||
= Incoming
|
||||
| Outgoing
|
||||
|
||||
fromString: String -> Maybe Direction
|
||||
fromString str =
|
||||
case String.toLower str of
|
||||
"outgoing" -> Just Outgoing
|
||||
"incoming" -> Just Incoming
|
||||
_ -> Nothing
|
||||
|
||||
all: List Direction
|
||||
all =
|
||||
[ Incoming
|
||||
, Outgoing
|
||||
]
|
||||
|
||||
toString: Direction -> String
|
||||
toString dir =
|
||||
case dir of
|
||||
Incoming -> "Incoming"
|
||||
Outgoing -> "Outgoing"
|
||||
|
||||
icon: Direction -> String
|
||||
icon dir =
|
||||
case dir of
|
||||
Incoming -> "level down alternate icon"
|
||||
Outgoing -> "level up alternate icon"
|
||||
|
||||
unknownIcon: String
|
||||
unknownIcon =
|
||||
"question circle outline icon"
|
||||
|
||||
iconFromString: String -> String
|
||||
iconFromString dir =
|
||||
fromString dir
|
||||
|> Maybe.map icon
|
||||
|> Maybe.withDefault unknownIcon
|
||||
|
||||
iconFromMaybe: Maybe String -> String
|
||||
iconFromMaybe ms =
|
||||
Maybe.map iconFromString ms
|
||||
|> Maybe.withDefault unknownIcon
|
@ -5,6 +5,7 @@ import Api.Model.AuthResult exposing (AuthResult)
|
||||
type alias Config =
|
||||
{ appName: String
|
||||
, baseUrl: String
|
||||
, signupMode: String
|
||||
}
|
||||
|
||||
type alias Flags =
|
||||
@ -20,3 +21,7 @@ getToken flags =
|
||||
withAccount: Flags -> AuthResult -> Flags
|
||||
withAccount flags acc =
|
||||
{ flags | account = Just acc }
|
||||
|
||||
withoutAccount: Flags -> Flags
|
||||
withoutAccount flags =
|
||||
{ flags | account = Nothing }
|
||||
|
27
modules/webapp/src/main/elm/Data/Language.elm
Normal file
27
modules/webapp/src/main/elm/Data/Language.elm
Normal file
@ -0,0 +1,27 @@
|
||||
module Data.Language exposing (..)
|
||||
|
||||
type Language
|
||||
= German
|
||||
| English
|
||||
|
||||
fromString: String -> Maybe Language
|
||||
fromString str =
|
||||
if str == "deu" || str == "de" || str == "german" then Just German
|
||||
else if str == "eng" || str == "en" || str == "english" then Just English
|
||||
else Nothing
|
||||
|
||||
toIso3: Language -> String
|
||||
toIso3 lang =
|
||||
case lang of
|
||||
German -> "deu"
|
||||
English -> "eng"
|
||||
|
||||
toName: Language -> String
|
||||
toName lang =
|
||||
case lang of
|
||||
German -> "German"
|
||||
English -> "English"
|
||||
|
||||
all: List Language
|
||||
all =
|
||||
[ German, English ]
|
25
modules/webapp/src/main/elm/Data/Priority.elm
Normal file
25
modules/webapp/src/main/elm/Data/Priority.elm
Normal file
@ -0,0 +1,25 @@
|
||||
module Data.Priority exposing (..)
|
||||
|
||||
type Priority
|
||||
= High
|
||||
| Low
|
||||
|
||||
fromString: String -> Maybe Priority
|
||||
fromString str =
|
||||
let
|
||||
s = String.toLower str
|
||||
in
|
||||
case s of
|
||||
"low" -> Just Low
|
||||
"high" -> Just High
|
||||
_ -> Nothing
|
||||
|
||||
toName: Priority -> String
|
||||
toName lang =
|
||||
case lang of
|
||||
Low -> "Low"
|
||||
High-> "High"
|
||||
|
||||
all: List Priority
|
||||
all =
|
||||
[ Low, High ]
|
24
modules/webapp/src/main/elm/Data/SourceState.elm
Normal file
24
modules/webapp/src/main/elm/Data/SourceState.elm
Normal file
@ -0,0 +1,24 @@
|
||||
module Data.SourceState exposing (..)
|
||||
|
||||
type SourceState
|
||||
= Active
|
||||
| Disabled
|
||||
|
||||
fromString: String -> Maybe SourceState
|
||||
fromString str =
|
||||
case String.toLower str of
|
||||
"active" -> Just Active
|
||||
"disabled" -> Just Disabled
|
||||
_ -> Nothing
|
||||
|
||||
all: List SourceState
|
||||
all =
|
||||
[ Active
|
||||
, Disabled
|
||||
]
|
||||
|
||||
toString: SourceState -> String
|
||||
toString dir =
|
||||
case dir of
|
||||
Active -> "Active"
|
||||
Disabled -> "Disabled"
|
24
modules/webapp/src/main/elm/Data/UserState.elm
Normal file
24
modules/webapp/src/main/elm/Data/UserState.elm
Normal file
@ -0,0 +1,24 @@
|
||||
module Data.UserState exposing (..)
|
||||
|
||||
type UserState
|
||||
= Active
|
||||
| Disabled
|
||||
|
||||
fromString: String -> Maybe UserState
|
||||
fromString str =
|
||||
case String.toLower str of
|
||||
"active" -> Just Active
|
||||
"disabled" -> Just Disabled
|
||||
_ -> Nothing
|
||||
|
||||
all: List UserState
|
||||
all =
|
||||
[ Active
|
||||
, Disabled
|
||||
]
|
||||
|
||||
toString: UserState -> String
|
||||
toString dir =
|
||||
case dir of
|
||||
Active -> "Active"
|
||||
Disabled -> "Disabled"
|
Reference in New Issue
Block a user