mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-04-04 18:39:33 +00:00
Externalize strings in new-invite page
This commit is contained in:
parent
db6198673b
commit
12cad398ac
@ -142,7 +142,7 @@ mainContent model =
|
||||
viewUpload mid model
|
||||
|
||||
NewInvitePage ->
|
||||
viewNewInvite model
|
||||
viewNewInvite texts model
|
||||
|
||||
ItemDetailPage id ->
|
||||
viewItemDetail id model
|
||||
@ -467,12 +467,12 @@ viewRegister texts model =
|
||||
]
|
||||
|
||||
|
||||
viewNewInvite : Model -> List (Html Msg)
|
||||
viewNewInvite model =
|
||||
viewNewInvite : Messages -> Model -> List (Html Msg)
|
||||
viewNewInvite texts model =
|
||||
[ Html.map NewInviteMsg
|
||||
(NewInvite.viewSidebar model.sidebarVisible model.flags model.uiSettings model.newInviteModel)
|
||||
, Html.map NewInviteMsg
|
||||
(NewInvite.viewContent model.flags model.uiSettings model.newInviteModel)
|
||||
(NewInvite.viewContent texts.newInvite model.flags model.uiSettings model.newInviteModel)
|
||||
]
|
||||
|
||||
|
||||
|
33
modules/webapp/src/main/elm/Messages/NewInvitePage.elm
Normal file
33
modules/webapp/src/main/elm/Messages/NewInvitePage.elm
Normal file
@ -0,0 +1,33 @@
|
||||
module Messages.NewInvitePage exposing (..)
|
||||
|
||||
import Messages.Basics
|
||||
|
||||
|
||||
type alias Texts =
|
||||
{ basics : Messages.Basics.Texts
|
||||
, createNewInvitations : String
|
||||
, invitationKey : String
|
||||
, password : String
|
||||
, reset : String
|
||||
, inviteInfo : String
|
||||
}
|
||||
|
||||
|
||||
gb : Texts
|
||||
gb =
|
||||
{ basics = Messages.Basics.gb
|
||||
, createNewInvitations = "Create new invitations"
|
||||
, invitationKey = "Invitation Key"
|
||||
, password = "Password"
|
||||
, reset = "Reset"
|
||||
, inviteInfo =
|
||||
"""Docspell requires an invite when signing up. You can
|
||||
create these invites here and send them to friends so
|
||||
they can signup with docspell.
|
||||
|
||||
Each invite can only be used once. You'll need to
|
||||
create one key for each person you want to invite.
|
||||
|
||||
Creating an invite requires providing the password
|
||||
from the configuration."""
|
||||
}
|
@ -5,6 +5,8 @@ import Data.UiSettings exposing (UiSettings)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick, onInput, onSubmit)
|
||||
import Markdown
|
||||
import Messages.NewInvitePage exposing (Texts)
|
||||
import Page.NewInvite.Data exposing (..)
|
||||
import Styles as S
|
||||
|
||||
@ -18,15 +20,15 @@ viewSidebar _ _ _ _ =
|
||||
[]
|
||||
|
||||
|
||||
viewContent : Flags -> UiSettings -> Model -> Html Msg
|
||||
viewContent flags _ model =
|
||||
viewContent : Texts -> Flags -> UiSettings -> Model -> Html Msg
|
||||
viewContent texts flags _ model =
|
||||
div
|
||||
[ id "content"
|
||||
, class "flex flex-col md:w-3/5 px-2"
|
||||
, class S.content
|
||||
]
|
||||
[ h1 [ class S.header1 ] [ text "Create new invitations" ]
|
||||
, inviteMessage flags
|
||||
[ h1 [ class S.header1 ] [ text texts.createNewInvitations ]
|
||||
, inviteMessage texts flags
|
||||
, div [ class " py-2 mt-6 rounded" ]
|
||||
[ Html.form
|
||||
[ action "#"
|
||||
@ -38,7 +40,7 @@ viewContent flags _ model =
|
||||
[ for "invitekey"
|
||||
, class "mb-1 text-xs sm:text-sm tracking-wide "
|
||||
]
|
||||
[ text "Invitation key"
|
||||
[ text texts.invitationKey
|
||||
]
|
||||
, div [ class "relative" ]
|
||||
[ div [ class "inline-flex items-center justify-center absolute left-0 top-0 h-full w-10 text-gray-400 dark:text-bluegray-400 " ]
|
||||
@ -53,7 +55,7 @@ viewContent flags _ model =
|
||||
, value model.password
|
||||
, autofocus True
|
||||
, class ("pl-10 pr-4 py-2 rounded-lg" ++ S.textInput)
|
||||
, placeholder "Password"
|
||||
, placeholder texts.password
|
||||
]
|
||||
[]
|
||||
]
|
||||
@ -64,25 +66,25 @@ viewContent flags _ model =
|
||||
[ type_ "submit"
|
||||
, class (S.primaryButton ++ "inline-flex")
|
||||
]
|
||||
[ text "Submit"
|
||||
[ text texts.basics.submit
|
||||
]
|
||||
, a
|
||||
[ class S.secondaryButton
|
||||
, href "#"
|
||||
, onClick Reset
|
||||
]
|
||||
[ text "Reset"
|
||||
[ text texts.reset
|
||||
]
|
||||
]
|
||||
]
|
||||
, resultMessage model
|
||||
, resultMessage texts model
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
resultMessage : Model -> Html Msg
|
||||
resultMessage model =
|
||||
resultMessage : Texts -> Model -> Html Msg
|
||||
resultMessage texts model =
|
||||
div
|
||||
[ classList
|
||||
[ ( S.errorMessage, isFailed model.result )
|
||||
@ -98,7 +100,7 @@ resultMessage model =
|
||||
div [ class "" ]
|
||||
[ p []
|
||||
[ text r.message
|
||||
, text " Invitation Key:"
|
||||
, text (" " ++ texts.invitationKey ++ ":")
|
||||
]
|
||||
, pre [ class "text-center font-mono mt-4" ]
|
||||
[ Maybe.withDefault "" r.key |> text
|
||||
@ -110,28 +112,13 @@ resultMessage model =
|
||||
]
|
||||
|
||||
|
||||
inviteMessage : Flags -> Html Msg
|
||||
inviteMessage flags =
|
||||
inviteMessage : Texts -> Flags -> Html Msg
|
||||
inviteMessage texts flags =
|
||||
div
|
||||
[ class (S.message ++ "text-sm")
|
||||
, classList
|
||||
[ ( "hidden", flags.config.signupMode /= "invite" )
|
||||
]
|
||||
]
|
||||
[ p []
|
||||
[ text
|
||||
"""Docspell requires an invite when signing up. You can
|
||||
create these invites here and send them to friends so
|
||||
they can signup with docspell."""
|
||||
]
|
||||
, p []
|
||||
[ text
|
||||
"""Each invite can only be used once. You'll need to
|
||||
create one key for each person you want to invite."""
|
||||
]
|
||||
, p []
|
||||
[ text
|
||||
"""Creating an invite requires providing the password
|
||||
from the configuration."""
|
||||
]
|
||||
[ Markdown.toHtml [] texts.inviteInfo
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user