diff options
-rw-r--r-- | api/post.go | 2 | ||||
-rw-r--r-- | model/user.go | 2 | ||||
-rw-r--r-- | web/react/components/more_direct_channels.jsx | 2 | ||||
-rw-r--r-- | web/react/components/post_list.jsx | 12 | ||||
-rw-r--r-- | web/react/components/search_results.jsx | 8 | ||||
-rw-r--r-- | web/react/components/sidebar.jsx | 11 | ||||
-rw-r--r-- | web/react/components/user_settings.jsx | 6 | ||||
-rw-r--r-- | web/react/utils/utils.jsx | 18 | ||||
-rw-r--r-- | web/sass-files/sass/partials/_base.scss | 14 | ||||
-rw-r--r-- | web/sass-files/sass/partials/_mentions.scss | 2 | ||||
-rw-r--r-- | web/templates/channel.html | 2 | ||||
-rw-r--r-- | web/templates/find_team.html | 1 | ||||
-rw-r--r-- | web/templates/home.html | 1 | ||||
-rw-r--r-- | web/templates/login.html | 1 | ||||
-rw-r--r-- | web/templates/password_reset.html | 1 | ||||
-rw-r--r-- | web/templates/signup_team.html | 1 | ||||
-rw-r--r-- | web/templates/signup_team_complete.html | 1 | ||||
-rw-r--r-- | web/templates/signup_team_confirm.html | 1 | ||||
-rw-r--r-- | web/templates/signup_user_complete.html | 1 | ||||
-rw-r--r-- | web/templates/verify.html | 1 | ||||
-rw-r--r-- | web/templates/welcome.html | 1 |
21 files changed, 59 insertions, 30 deletions
diff --git a/api/post.go b/api/post.go index 2d812e8de..650f47062 100644 --- a/api/post.go +++ b/api/post.go @@ -227,7 +227,7 @@ func fireAndForgetNotifications(post *model.Post, teamId, teamUrl string) { channel = result.Data.(*model.Channel) if channel.Type == model.CHANNEL_DIRECT { bodyText = "You have one new message." - subjectText = "New Direct Message" + subjectText = "New Private Message" } else { bodyText = "You have one new mention." subjectText = "New Mention" diff --git a/model/user.go b/model/user.go index 18fbb0d2a..c516fae78 100644 --- a/model/user.go +++ b/model/user.go @@ -16,7 +16,7 @@ const ( ROLE_SYSTEM_ADMIN = "system_admin" ROLE_SYSTEM_SUPPORT = "system_support" USER_AWAY_TIMEOUT = 5 * 60 * 1000 // 5 minutes - USER_OFFLINE_TIMEOUT = 5 * 60 * 1000 // 5 minutes + USER_OFFLINE_TIMEOUT = 1 * 60 * 1000 // 1 minute USER_OFFLINE = "offline" USER_AWAY = "away" USER_ONLINE = "online" diff --git a/web/react/components/more_direct_channels.jsx b/web/react/components/more_direct_channels.jsx index 2785dc8e0..182d8884d 100644 --- a/web/react/components/more_direct_channels.jsx +++ b/web/react/components/more_direct_channels.jsx @@ -49,7 +49,7 @@ module.exports = React.createClass({ <span aria-hidden="true">×</span> <span className="sr-only">Close</span> </button> - <h4 className="modal-title">More Direct Messages</h4> + <h4 className="modal-title">More Private Messages</h4> </div> <div className="modal-body"> <ul className="nav nav-pills nav-stacked"> diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx index e37de8d88..ad8cfa20f 100644 --- a/web/react/components/post_list.jsx +++ b/web/react/components/post_list.jsx @@ -324,13 +324,7 @@ module.exports = React.createClass({ if (order.length > 0 && order.length % Constants.POST_CHUNK_SIZE === 0) { more_messages = <a ref="loadmore" className="more-messages-text theme" href="#" onClick={this.getMorePosts}>Load more messages</a>; } else if (channel.type === 'D') { - var userIds = channel.name.split('__'); - var teammate; - if (userIds.length === 2 && userIds[0] === user_id) { - teammate = UserStore.getProfile(userIds[1]); - } else if (userIds.length === 2 && userIds[1] === user_id) { - teammate = UserStore.getProfile(userIds[0]); - } + var teammate = utils.getDirectTeammate(channel.id) if (teammate) { var teammate_name = teammate.full_name.length > 0 ? teammate.full_name : teammate.username; @@ -342,13 +336,13 @@ module.exports = React.createClass({ <div className="channel-intro-profile"> <strong><UserProfile userId={teammate.id} /></strong> </div> - <p className="channel-intro-text">{"This is the start of your direct message history with " + teammate_name + "." }<br/>{"Direct messages and files shared here are not shown to people outside this area."}</p> + <p className="channel-intro-text">{"This is the start of your private message history with " + teammate_name + "." }<br/>{"Private messages and files shared here are not shown to people outside this area."}</p> </div> ); } else { more_messages = ( <div className="channel-intro"> - <p className="channel-intro-text">{"This is the start of your direct message history with this " + strings.Team + "mate. Direct messages and files shared here are not shown to people outside this area."}</p> + <p className="channel-intro-text">{"This is the start of your private message history with this " + strings.Team + "mate. Private messages and files shared here are not shown to people outside this area."}</p> </div> ); } diff --git a/web/react/components/search_results.jsx b/web/react/components/search_results.jsx index 51aefd3b8..003a38b7e 100644 --- a/web/react/components/search_results.jsx +++ b/web/react/components/search_results.jsx @@ -43,6 +43,7 @@ SearchItem = React.createClass({ e.preventDefault(); var self = this; + client.getPost( this.props.post.channel_id, this.props.post.id, @@ -64,6 +65,11 @@ SearchItem = React.createClass({ dispatchError(err, "getPost"); } ); + + var postChannel = ChannelStore.get(this.props.post.channel_id); + var teammate = postChannel.type === 'D' ? utils.getDirectTeammate(this.props.post.channel_id).username : ""; + + utils.switchChannel(postChannel,teammate); }, render: function() { @@ -73,7 +79,7 @@ SearchItem = React.createClass({ if (channel) { if (channel.type === 'D') { - channelName = "Direct Message"; + channelName = "Private Message"; } else { channelName = channel.display_name; } diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx index 10017c7ee..0e4d38fe0 100644 --- a/web/react/components/sidebar.jsx +++ b/web/react/components/sidebar.jsx @@ -269,13 +269,8 @@ var SidebarLoggedIn = React.createClass({ var channel = ChannelStore.getCurrent(); if (channel) { if (channel.type === 'D') { - userIds = channel.name.split('__'); - if (userIds.length < 2) return; - if (userIds[0] == UserStore.getCurrentId() && UserStore.getProfile(userIds[1])) { - document.title = UserStore.getProfile(userIds[1]).username + " " + document.title.substring(document.title.lastIndexOf("-")); - } else if (userIds[1] == UserStore.getCurrentId() && UserStore.getProfile(userIds[0])) { - document.title = UserStore.getProfile(userIds[0]).username + " " + document.title.substring(document.title.lastIndexOf("-")); - } + var teammate_username = utils.getDirectTeammate(channel.id).username + document.title = teammate_username + " " + document.title.substring(document.title.lastIndexOf("-")); } else { document.title = channel.display_name + " " + document.title.substring(document.title.lastIndexOf("-")) } @@ -414,7 +409,7 @@ var SidebarLoggedIn = React.createClass({ {privateChannelItems} </ul> <ul className="nav nav-pills nav-stacked"> - <li><h4>Direct Messages</h4></li> + <li><h4>Private Messages</h4></li> {directMessageItems} { this.state.hideDirectChannels.length > 0 ? <li><a href="#" data-toggle="modal" className="nav-more" data-target="#more_direct_channels" data-channels={JSON.stringify(this.state.hideDirectChannels)}>{"More ("+this.state.hideDirectChannels.length+")"}</a></li> diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx index add57f147..b4c3747af 100644 --- a/web/react/components/user_settings.jsx +++ b/web/react/components/user_settings.jsx @@ -179,7 +179,7 @@ var NotificationsTab = React.createClass({ </div> <div className="radio"> <label> - <input type="radio" checked={notifyActive[1]} onClick={function(){self.handleNotifyRadio("mention")}}>Only for mentions and direct messages</input> + <input type="radio" checked={notifyActive[1]} onClick={function(){self.handleNotifyRadio("mention")}}>Only for mentions and private messages</input> </label> <br/> </div> @@ -203,7 +203,7 @@ var NotificationsTab = React.createClass({ } else { var describe = ""; if (this.state.notify_level === "mention") { - describe = "Only for mentions and direct messages"; + describe = "Only for mentions and private messages"; } else if (this.state.notify_level === "none") { describe = "Never"; } else { @@ -282,7 +282,7 @@ var NotificationsTab = React.createClass({ <button className={"btn btn-default "+emailActive[0]} onClick={function(){self.handleEmailRadio("true")}}>On</button> <button className={"btn btn-default "+emailActive[1]} onClick={function(){self.handleEmailRadio("false")}}>Off</button> </div> - <div><br/>{"Email notifications are sent for mentions and direct messages after you have been away from " + config.SiteName + " for 5 minutes."}</div> + <div><br/>{"Email notifications are sent for mentions and private messages after you have been away from " + config.SiteName + " for 5 minutes."}</div> </div> ); diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 70a47742f..530166f04 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -2,6 +2,7 @@ // See License.txt for license information. var AppDispatcher = require('../dispatcher/app_dispatcher.jsx'); +var ChannelStore = require('../stores/channel_store.jsx') var UserStore = require('../stores/user_store.jsx'); var Constants = require('../utils/constants.jsx'); var ActionTypes = Constants.ActionTypes; @@ -726,6 +727,23 @@ module.exports.isComment = function(post) { return false; } +module.exports.getDirectTeammate = function(channel_id) { + var userIds = ChannelStore.get(channel_id).name.split('__'); + + if(userIds.length != 2) { + return; + } + + var curUser = UserStore.getCurrentId(); + + for(var idx in userIds) { + if(userIds[idx] === curUser) + delete userIds[idx]; + } + + return UserStore.getProfile(userIds[0]) +} + Image.prototype.load = function(url, progressCallback) { var thisImg = this; var xmlHTTP = new XMLHttpRequest(); diff --git a/web/sass-files/sass/partials/_base.scss b/web/sass-files/sass/partials/_base.scss index 5808aeb44..4fb918bd1 100644 --- a/web/sass-files/sass/partials/_base.scss +++ b/web/sass-files/sass/partials/_base.scss @@ -11,17 +11,21 @@ body { &.white { background: #fff; .inner__wrap { - height: 100%; + > .row.content { + min-height: 100%; + margin-bottom: -89px; + } } - .row.content { - min-height: 100%; - height: auto !important; + } + .inner__wrap { + height: 100%; + > .row.main { height: 100%; - margin-bottom: -89px; } } > .container-fluid { @include clearfix; + height: 100%; position: relative; } } diff --git a/web/sass-files/sass/partials/_mentions.scss b/web/sass-files/sass/partials/_mentions.scss index ee254b546..d6e2ab368 100644 --- a/web/sass-files/sass/partials/_mentions.scss +++ b/web/sass-files/sass/partials/_mentions.scss @@ -9,7 +9,7 @@ .mentions--top { position: absolute; - z-index: 1040; + z-index: 1060; .mentions-box { position:absolute; background-color:#fff; diff --git a/web/templates/channel.html b/web/templates/channel.html index d10ae2304..d96aee3d4 100644 --- a/web/templates/channel.html +++ b/web/templates/channel.html @@ -1,4 +1,6 @@ + {{define "channel"}} +<!DOCTYPE html> <html> {{template "head" . }} <body> diff --git a/web/templates/find_team.html b/web/templates/find_team.html index c731f7a8f..9acf3ac64 100644 --- a/web/templates/find_team.html +++ b/web/templates/find_team.html @@ -1,4 +1,5 @@ {{define "find_team"}} +<!DOCTYPE html> <html> {{template "head" . }} <body class="white"> diff --git a/web/templates/home.html b/web/templates/home.html index 74f7a015b..abf8062f2 100644 --- a/web/templates/home.html +++ b/web/templates/home.html @@ -1,4 +1,5 @@ {{define "home"}} +<!DOCTYPE html> <html> {{template "head" . }} <body> diff --git a/web/templates/login.html b/web/templates/login.html index 1bc5394ab..c107e1ad5 100644 --- a/web/templates/login.html +++ b/web/templates/login.html @@ -1,4 +1,5 @@ {{define "login"}} +<!DOCTYPE html> <html> {{template "head" . }} <body class="white"> diff --git a/web/templates/password_reset.html b/web/templates/password_reset.html index 1c5485e33..8b63556b1 100644 --- a/web/templates/password_reset.html +++ b/web/templates/password_reset.html @@ -1,4 +1,5 @@ {{define "password_reset"}} +<!DOCTYPE html> <html> {{template "head" . }} <body class="white"> diff --git a/web/templates/signup_team.html b/web/templates/signup_team.html index f7e277340..fad332bee 100644 --- a/web/templates/signup_team.html +++ b/web/templates/signup_team.html @@ -1,4 +1,5 @@ {{define "signup_team"}} +<!DOCTYPE html> <html> {{template "head" . }} <body class="white"> diff --git a/web/templates/signup_team_complete.html b/web/templates/signup_team_complete.html index aad521cb3..59f49cdbd 100644 --- a/web/templates/signup_team_complete.html +++ b/web/templates/signup_team_complete.html @@ -1,4 +1,5 @@ {{define "signup_team_complete"}} +<!DOCTYPE html> <html> {{template "head" . }} <body class="white"> diff --git a/web/templates/signup_team_confirm.html b/web/templates/signup_team_confirm.html index a34c39ab6..9e21126da 100644 --- a/web/templates/signup_team_confirm.html +++ b/web/templates/signup_team_confirm.html @@ -1,4 +1,5 @@ {{define "signup_team_confirm"}} +<!DOCTYPE html> <html> {{template "head" . }} <body class="white"> diff --git a/web/templates/signup_user_complete.html b/web/templates/signup_user_complete.html index a6827bc3a..5fe907ba7 100644 --- a/web/templates/signup_user_complete.html +++ b/web/templates/signup_user_complete.html @@ -1,4 +1,5 @@ {{define "signup_user_complete"}} +<!DOCTYPE html> <html> {{template "head" . }} <body class="white"> diff --git a/web/templates/verify.html b/web/templates/verify.html index 60a7990f0..a61964bb3 100644 --- a/web/templates/verify.html +++ b/web/templates/verify.html @@ -1,4 +1,5 @@ {{define "verify"}} +<!DOCTYPE html> <html> {{template "head" . }} <body> diff --git a/web/templates/welcome.html b/web/templates/welcome.html index 27bf4bcaf..bab7a135d 100644 --- a/web/templates/welcome.html +++ b/web/templates/welcome.html @@ -1,4 +1,5 @@ {{define "welcome"}} +<!DOCTYPE html> <html> {{template "head" . }} <body> |