From c6fb95912bb481791c1ca370a46a4da9c05d05ad Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Wed, 8 Jul 2015 11:50:10 -0400
Subject: Changing the way we mattermost handles URLs. team.domain.com becomes
 domain.com/team. Renaming team.Name to team.DisplayName and team.Domain to
 team.Name. So: team.Name -> url safe name. team.DisplayName -> nice name for
 users

---
 web/react/components/sidebar_header.jsx | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

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

diff --git a/web/react/components/sidebar_header.jsx b/web/react/components/sidebar_header.jsx
index 45c9ca629..bab2897b6 100644
--- a/web/react/components/sidebar_header.jsx
+++ b/web/react/components/sidebar_header.jsx
@@ -61,19 +61,15 @@ var NavbarDropdown = React.createClass({
 
         var teams = [];
 
+        teams.push(<li className="divider" key="div"></li>);
         if (this.state.teams.length > 1) {
             for (var i = 0; i < this.state.teams.length; i++) {
-                var domain = this.state.teams[i];
+                var teamName = this.state.teams[i];
 
-                if (domain == utils.getSubDomain())
-                    continue;
-
-                if (teams.length == 0)
-                    teams.push(<li className="divider" key="div"></li>);
-
-                teams.push(<li key={ domain }><a href={window.location.protocol + "//" + domain + "." + utils.getDomainWithOutSub() }>Switch to { domain }</a></li>);
+                teams.push(<li key={ teamName }><a href={window.location.origin + "/" + teamName }>Switch to { teamName }</a></li>);
             }
         }
+        teams.push(<li><a href={window.location.origin + "/signup_team" }>Create a New Team</a></li>);
 
         return (
             <ul className="nav navbar-nav navbar-right">
@@ -110,19 +106,21 @@ module.exports = React.createClass({
     },
 
     render: function() {
-        var me = UserStore.getCurrentUser();
-
+        var teamDisplayName = this.props.teamDisplayName ? this.props.teamDisplayName : config.SiteName;
+        var me = UserStore.getCurrentUser()
         if (!me) {
             return null;
         }
 
         return (
             <div className="team__header theme">
-                <img className="user__picture" src={"/api/v1/users/" + me.id + "/image?time=" + me.update_at} />
-                <div className="header__info">
-                    <div className="user__name">{'@' + me.username}</div>
-                    <a className="team__name" href="/channels/town-square">{this.props.teamName}</a>
-                </div>
+                <a className="settings_link" href="#" data-toggle="modal" data-target="#user_settings1">
+                    <img className="user__picture" src={"/api/v1/users/" + me.id + "/image?time=" + me.update_at} />
+                    <div className="header__info">
+                        <div className="user__name">{ '@' + me.username}</div>
+                        <div className="team__name">{ teamDisplayName }</div>
+                    </div>
+                </a>
                 <NavbarDropdown teamType={this.props.teamType} />
             </div>
         );
-- 
cgit v1.2.3-1-g7c22

