From 6b7438b52fdaabe46cb298af1b325c3d8ece1af4 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 29 Jan 2016 13:48:12 -0300 Subject: PLT-7: Refactoring frontend (chunk 6) - Authorize - Signup Team Confirm - Footer --- web/react/components/authorize.jsx | 95 +++++++++++++++------------- web/react/components/signup_team_confirm.jsx | 42 ++++++++++++ web/react/pages/signup_team_confirm.jsx | 67 ++++++++++++++++++++ web/static/i18n/en.json | 6 +- web/static/i18n/es.json | 2 + web/templates/authorize.html | 18 +----- web/templates/footer.html | 8 +-- web/templates/signup_team_confirm.html | 9 ++- web/web.go | 5 ++ 9 files changed, 182 insertions(+), 70 deletions(-) create mode 100644 web/react/components/signup_team_confirm.jsx create mode 100644 web/react/pages/signup_team_confirm.jsx (limited to 'web') diff --git a/web/react/components/authorize.jsx b/web/react/components/authorize.jsx index 90cbe3289..4a4985268 100644 --- a/web/react/components/authorize.jsx +++ b/web/react/components/authorize.jsx @@ -3,7 +3,7 @@ import * as Client from '../utils/client.jsx'; -import {FormattedMessage} from 'mm-intl'; +import {FormattedMessage, FormattedHTMLMessage} from 'mm-intl'; export default class Authorize extends React.Component { constructor(props) { @@ -35,58 +35,67 @@ export default class Authorize extends React.Component { } render() { return ( -
-
-

- -

-
); diff --git a/web/react/components/signup_team_confirm.jsx b/web/react/components/signup_team_confirm.jsx new file mode 100644 index 000000000..84f8e34aa --- /dev/null +++ b/web/react/components/signup_team_confirm.jsx @@ -0,0 +1,42 @@ +/** + * Created by enahum on 1/29/16. + */ +// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +import {FormattedMessage, FormattedHTMLMessage} from 'mm-intl'; + +export default class SignupTeamConfirm extends React.Component { + constructor(props) { + super(props); + } + + render() { + return ( +
+

+ +

+

+ +

+
+ ); + } +} + +SignupTeamConfirm.defaultProps = { + email: '' +}; +SignupTeamConfirm.propTypes = { + email: React.PropTypes.string +}; diff --git a/web/react/pages/signup_team_confirm.jsx b/web/react/pages/signup_team_confirm.jsx new file mode 100644 index 000000000..335be6a49 --- /dev/null +++ b/web/react/pages/signup_team_confirm.jsx @@ -0,0 +1,67 @@ +/** + * Created by enahum on 1/29/16. + */ +// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +import SignupTeamConfirm from '../components/signup_team_confirm.jsx'; +import * as Client from '../utils/client.jsx'; + +var IntlProvider = ReactIntl.IntlProvider; + +class Root extends React.Component { + constructor() { + super(); + this.state = { + translations: null, + loaded: false + }; + } + + static propTypes() { + return { + map: React.PropTypes.object.isRequired + }; + } + + componentWillMount() { + Client.getTranslations( + this.props.map.Locale, + (data) => { + this.setState({ + translations: data, + loaded: true + }); + }, + () => { + this.setState({ + loaded: true + }); + } + ); + } + + render() { + if (!this.state.loaded) { + return
; + } + + return ( + + + + ); + } +} + +global.window.setup_signup_team_confirm_page = function setup(props) { + ReactDOM.render( + , + document.getElementById('signup-team-confirm') + ); +}; \ No newline at end of file diff --git a/web/static/i18n/en.json b/web/static/i18n/en.json index 1a82660fd..45000a890 100644 --- a/web/static/i18n/en.json +++ b/web/static/i18n/en.json @@ -397,8 +397,8 @@ "admin.user_item.makeInactive": "Make Inactive", "admin.user_item.resetPwd": "Reset Password", "authorize.title": "An application would like to connect to your {teamName} account", - "authorize.app": "The app {appName} would like the ability to access and modify your basic information.", - "authorize.access": "Allow {appName} access?", + "authorize.app": "The app {appName} would like the ability to access and modify your basic information.", + "authorize.access": "Allow {appName} access?", "authorize.deny": "Deny", "authorize.allow": "Allow", "claim.account.noEmail": "No email specified", @@ -470,6 +470,8 @@ "password_send.description": "To reset your password, enter the email address you used to sign up for {teamName}.", "password_send.reset": "Reset my password", "signup_team_complete.completed": "You've already completed the signup process for this invitation or this invitation has expired.", + "signup_team_confirm.title": "Sign up Complete", + "signup_team_confirm.checkEmail": "Please check your email: {email}
Your email contains a link to set up your team", "signup_team.noTeams": "There are no teams include in the Team Directory and team creation has been disabled.", "signup_team.choose": "Choose a Team", "signup_team.createTeam": "Or Create a Team", diff --git a/web/static/i18n/es.json b/web/static/i18n/es.json index d54c99535..48412510d 100644 --- a/web/static/i18n/es.json +++ b/web/static/i18n/es.json @@ -484,6 +484,8 @@ "signup_team.noTeams": "No hay equipos en el Directorio de Equipos y la creación de equipos ha sido deshabilitada.", "signup_team.none": "No se ha habilitado ningún método para creación de equipos. Por favor contacta a un administrador de sistema para solicitar acceso.", "signup_team_complete.completed": "Ya haz completado el proceso de entrada para esta invitación, o esta invitación ya ha expirado.", + "signup_team_confirm.checkEmail": "Por favor revisa tu correo electrónico: {email}
Se ha enviado un correo con un enlace para configurar tu equipo", + "signup_team_confirm.title": "Registro Completado", "signup_user_completed.choosePwd": "Escoge tu contraseña", "signup_user_completed.chooseUser": "Escoge tu nombre de usuario", "signup_user_completed.create": "Crea una Cuenta", diff --git a/web/templates/authorize.html b/web/templates/authorize.html index 430291676..0fa36b0ab 100644 --- a/web/templates/authorize.html +++ b/web/templates/authorize.html @@ -2,24 +2,10 @@ {{template "head" . }} -
-
-
-
- -
-
An application would like to connect to your {{.Props.TeamName}} account.
-
-

The app {{.Props.AppName}} would like the ability to access Mattermost on your behalf.

-

Allow {{.Props.AppName}} access?

-
- - -
-
+
diff --git a/web/templates/footer.html b/web/templates/footer.html index 60dd5a40e..5b11328fb 100644 --- a/web/templates/footer.html +++ b/web/templates/footer.html @@ -5,10 +5,10 @@
{{end}} diff --git a/web/web.go b/web/web.go index beb0eff06..efe0e6b13 100644 --- a/web/web.go +++ b/web/web.go @@ -54,6 +54,11 @@ func (me *HtmlTemplatePage) Render(c *api.Context, w http.ResponseWriter) { me.Props["Locale"] = me.Locale me.SessionTokenIndex = c.SessionTokenIndex + me.ClientCfg["FooterHelp"] = c.T("web.footer.help") + me.ClientCfg["FooterTerms"] = c.T("web.footer.terms") + me.ClientCfg["FooterPrivacy"] = c.T("web.footer.privacy") + me.ClientCfg["FooterAbout"] = c.T("web.footer.about") + if err := Templates.ExecuteTemplate(w, me.TemplateName, me); err != nil { c.SetUnknownError(me.TemplateName, err.Error()) } -- cgit v1.2.3-1-g7c22 From edc0e3868790f12920543a6bd9fa96aa4ca3b4ed Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 29 Jan 2016 13:56:33 -0300 Subject: Remove author --- web/react/components/signup_team_confirm.jsx | 3 --- web/react/pages/signup_team_confirm.jsx | 3 --- 2 files changed, 6 deletions(-) (limited to 'web') diff --git a/web/react/components/signup_team_confirm.jsx b/web/react/components/signup_team_confirm.jsx index 84f8e34aa..de83285db 100644 --- a/web/react/components/signup_team_confirm.jsx +++ b/web/react/components/signup_team_confirm.jsx @@ -1,6 +1,3 @@ -/** - * Created by enahum on 1/29/16. - */ // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. diff --git a/web/react/pages/signup_team_confirm.jsx b/web/react/pages/signup_team_confirm.jsx index 335be6a49..9a536c92e 100644 --- a/web/react/pages/signup_team_confirm.jsx +++ b/web/react/pages/signup_team_confirm.jsx @@ -1,6 +1,3 @@ -/** - * Created by enahum on 1/29/16. - */ // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -- cgit v1.2.3-1-g7c22