mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-04-13 01: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
|
viewUpload mid model
|
||||||
|
|
||||||
NewInvitePage ->
|
NewInvitePage ->
|
||||||
viewNewInvite model
|
viewNewInvite texts model
|
||||||
|
|
||||||
ItemDetailPage id ->
|
ItemDetailPage id ->
|
||||||
viewItemDetail id model
|
viewItemDetail id model
|
||||||
@ -467,12 +467,12 @@ viewRegister texts model =
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
viewNewInvite : Model -> List (Html Msg)
|
viewNewInvite : Messages -> Model -> List (Html Msg)
|
||||||
viewNewInvite model =
|
viewNewInvite texts model =
|
||||||
[ Html.map NewInviteMsg
|
[ Html.map NewInviteMsg
|
||||||
(NewInvite.viewSidebar model.sidebarVisible model.flags model.uiSettings model.newInviteModel)
|
(NewInvite.viewSidebar model.sidebarVisible model.flags model.uiSettings model.newInviteModel)
|
||||||
, Html.map NewInviteMsg
|
, 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 exposing (..)
|
||||||
import Html.Attributes exposing (..)
|
import Html.Attributes exposing (..)
|
||||||
import Html.Events exposing (onClick, onInput, onSubmit)
|
import Html.Events exposing (onClick, onInput, onSubmit)
|
||||||
|
import Markdown
|
||||||
|
import Messages.NewInvitePage exposing (Texts)
|
||||||
import Page.NewInvite.Data exposing (..)
|
import Page.NewInvite.Data exposing (..)
|
||||||
import Styles as S
|
import Styles as S
|
||||||
|
|
||||||
@ -18,15 +20,15 @@ viewSidebar _ _ _ _ =
|
|||||||
[]
|
[]
|
||||||
|
|
||||||
|
|
||||||
viewContent : Flags -> UiSettings -> Model -> Html Msg
|
viewContent : Texts -> Flags -> UiSettings -> Model -> Html Msg
|
||||||
viewContent flags _ model =
|
viewContent texts flags _ model =
|
||||||
div
|
div
|
||||||
[ id "content"
|
[ id "content"
|
||||||
, class "flex flex-col md:w-3/5 px-2"
|
, class "flex flex-col md:w-3/5 px-2"
|
||||||
, class S.content
|
, class S.content
|
||||||
]
|
]
|
||||||
[ h1 [ class S.header1 ] [ text "Create new invitations" ]
|
[ h1 [ class S.header1 ] [ text texts.createNewInvitations ]
|
||||||
, inviteMessage flags
|
, inviteMessage texts flags
|
||||||
, div [ class " py-2 mt-6 rounded" ]
|
, div [ class " py-2 mt-6 rounded" ]
|
||||||
[ Html.form
|
[ Html.form
|
||||||
[ action "#"
|
[ action "#"
|
||||||
@ -38,7 +40,7 @@ viewContent flags _ model =
|
|||||||
[ for "invitekey"
|
[ for "invitekey"
|
||||||
, class "mb-1 text-xs sm:text-sm tracking-wide "
|
, class "mb-1 text-xs sm:text-sm tracking-wide "
|
||||||
]
|
]
|
||||||
[ text "Invitation key"
|
[ text texts.invitationKey
|
||||||
]
|
]
|
||||||
, div [ class "relative" ]
|
, 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 " ]
|
[ 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
|
, value model.password
|
||||||
, autofocus True
|
, autofocus True
|
||||||
, class ("pl-10 pr-4 py-2 rounded-lg" ++ S.textInput)
|
, 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"
|
[ type_ "submit"
|
||||||
, class (S.primaryButton ++ "inline-flex")
|
, class (S.primaryButton ++ "inline-flex")
|
||||||
]
|
]
|
||||||
[ text "Submit"
|
[ text texts.basics.submit
|
||||||
]
|
]
|
||||||
, a
|
, a
|
||||||
[ class S.secondaryButton
|
[ class S.secondaryButton
|
||||||
, href "#"
|
, href "#"
|
||||||
, onClick Reset
|
, onClick Reset
|
||||||
]
|
]
|
||||||
[ text "Reset"
|
[ text texts.reset
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
, resultMessage model
|
, resultMessage texts model
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
resultMessage : Model -> Html Msg
|
resultMessage : Texts -> Model -> Html Msg
|
||||||
resultMessage model =
|
resultMessage texts model =
|
||||||
div
|
div
|
||||||
[ classList
|
[ classList
|
||||||
[ ( S.errorMessage, isFailed model.result )
|
[ ( S.errorMessage, isFailed model.result )
|
||||||
@ -98,7 +100,7 @@ resultMessage model =
|
|||||||
div [ class "" ]
|
div [ class "" ]
|
||||||
[ p []
|
[ p []
|
||||||
[ text r.message
|
[ text r.message
|
||||||
, text " Invitation Key:"
|
, text (" " ++ texts.invitationKey ++ ":")
|
||||||
]
|
]
|
||||||
, pre [ class "text-center font-mono mt-4" ]
|
, pre [ class "text-center font-mono mt-4" ]
|
||||||
[ Maybe.withDefault "" r.key |> text
|
[ Maybe.withDefault "" r.key |> text
|
||||||
@ -110,28 +112,13 @@ resultMessage model =
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
inviteMessage : Flags -> Html Msg
|
inviteMessage : Texts -> Flags -> Html Msg
|
||||||
inviteMessage flags =
|
inviteMessage texts flags =
|
||||||
div
|
div
|
||||||
[ class (S.message ++ "text-sm")
|
[ class (S.message ++ "text-sm")
|
||||||
, classList
|
, classList
|
||||||
[ ( "hidden", flags.config.signupMode /= "invite" )
|
[ ( "hidden", flags.config.signupMode /= "invite" )
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
[ p []
|
[ Markdown.toHtml [] texts.inviteInfo
|
||||||
[ 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."""
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user