only show gitlab signup/login links if gitlab oauth is turned on
Этот коммит содержится в:
@@ -90,6 +90,17 @@ module.exports = React.createClass({
|
||||
focusEmail = true;
|
||||
}
|
||||
|
||||
var auth_services = JSON.parse(this.props.authServices);
|
||||
|
||||
var login_message;
|
||||
if (auth_services.indexOf("gitlab") >= 0) {
|
||||
login_message = (
|
||||
<div className="form-group form-group--small">
|
||||
<span><a href={"/"+teamName+"/login/gitlab"}>{"Log in with GitLab"}</a></span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="signup-team__container">
|
||||
<div>
|
||||
@@ -112,9 +123,7 @@ module.exports = React.createClass({
|
||||
<div className="form-group">
|
||||
<button type="submit" className="btn btn-primary">Sign in</button>
|
||||
</div>
|
||||
<div className="form-group form-group--small">
|
||||
<span><a href={"/"+teamName+"/login/gitlab"}>{"Log in with GitLab"}</a></span>
|
||||
</div>
|
||||
{ login_message }
|
||||
<div className="form-group form-group--small">
|
||||
<span><a href="/find_team">{"Find other " + strings.TeamPlural}</a></span>
|
||||
</div>
|
||||
|
||||
@@ -103,7 +103,7 @@ module.exports = React.createClass({
|
||||
|
||||
var yourEmailIs = this.state.user.email == "" ? "" : <span>Your email address is { this.state.user.email }. </span>
|
||||
|
||||
var email =
|
||||
var email = (
|
||||
<div className={ this.state.original_email == "" ? "" : "hidden"} >
|
||||
<label className="control-label">Email</label>
|
||||
<div className={ email_error ? "form-group has-error" : "form-group" }>
|
||||
@@ -111,6 +111,16 @@ module.exports = React.createClass({
|
||||
{ email_error }
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
var auth_services = JSON.parse(this.props.authServices);
|
||||
|
||||
var signup_message;
|
||||
if (auth_services.indexOf("gitlab") >= 0) {
|
||||
signup_message = <p>{"Choose your username and password for the " + this.props.teamDisplayName + " " + strings.Team} <a href={"/"+this.props.teamName+"/signup/gitlab"+window.location.search}>{"or sign up with GitLab."}</a></p>;
|
||||
} else {
|
||||
signup_message = <p>{"Choose your username and password for the " + this.props.teamDisplayName + " " + strings.Team + "."}</p>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
@@ -119,7 +129,7 @@ module.exports = React.createClass({
|
||||
<div className="form-group form-group--small">
|
||||
<span></span>
|
||||
</div>
|
||||
<p>{"Choose your username and password for the " + this.props.teamDisplayName + " " + strings.Team} <a href={"/"+this.props.teamName+"/signup/gitlab"+window.location.search}>{"or sign up with GitLab."}</a></p>
|
||||
{ signup_message }
|
||||
<p>Your username can be made of lowercase letters and numbers.</p>
|
||||
<label className="control-label">Username</label>
|
||||
<div className={ name_error ? "form-group has-error" : "form-group" }>
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
var Login = require('../components/login.jsx');
|
||||
|
||||
global.window.setup_login_page = function(teamDisplayName, teamName) {
|
||||
global.window.setup_login_page = function(team_display_name, team_name, auth_services) {
|
||||
React.render(
|
||||
<Login teamDisplayName={teamDisplayName} teamName={teamName}/>,
|
||||
<Login teamDisplayName={team_display_name} teamName={team_name} authServices={auth_services} />,
|
||||
document.getElementById('login')
|
||||
);
|
||||
};
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
var SignupUserComplete =require('../components/signup_user_complete.jsx');
|
||||
|
||||
global.window.setup_signup_user_complete_page = function(email, name, ui_name, id, data, hash) {
|
||||
global.window.setup_signup_user_complete_page = function(email, name, ui_name, id, data, hash, auth_services) {
|
||||
React.render(
|
||||
<SignupUserComplete teamId={id} teamName={name} teamDisplayName={ui_name} email={email} hash={hash} data={data} />,
|
||||
<SignupUserComplete teamId={id} teamName={name} teamDisplayName={ui_name} email={email} hash={hash} data={data} authServices={auth_services} />,
|
||||
document.getElementById('signup-user-complete')
|
||||
);
|
||||
};
|
||||
|
||||
Ссылка в новой задаче
Block a user