From 56a0a7d1e1fbd9405559a9c6e32962155d9cc562 Mon Sep 17 00:00:00 2001
From: JoramWilander <jwawilander@gmail.com>
Date: Wed, 22 Jul 2015 15:32:39 -0400
Subject: only show gitlab signup/login links if gitlab oauth is turned on

---
 web/react/components/signup_user_complete.jsx | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

(limited to 'web/react/components/signup_user_complete.jsx')

diff --git a/web/react/components/signup_user_complete.jsx b/web/react/components/signup_user_complete.jsx
index 577651b90..dc5ba64aa 100644
--- a/web/react/components/signup_user_complete.jsx
+++ b/web/react/components/signup_user_complete.jsx
@@ -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" }>
-- 
cgit v1.2.3-1-g7c22

