Этот коммит содержится в:
Asaad Mahmood
2016-03-24 18:12:57 +05:00
родитель 0abd7116c5
Коммит d64c75ae4a
7 изменённых файлов: 333 добавлений и 297 удалений

Просмотреть файл

@@ -1,8 +1,11 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
import $ from 'jquery';
import AdminSidebarHeader from './admin_sidebar_header.jsx'; import AdminSidebarHeader from './admin_sidebar_header.jsx';
import SelectTeamModal from './select_team_modal.jsx'; import SelectTeamModal from './select_team_modal.jsx';
import * as Utils from 'utils/utils.jsx';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -27,6 +30,12 @@ export default class AdminSidebar extends React.Component {
}; };
} }
componentDidUpdate() {
if (!Utils.isMobile()) {
$('.sidebar--left .nav-pills__container').perfectScrollbar();
}
}
handleClick(name, teamId, e) { handleClick(name, teamId, e) {
e.preventDefault(); e.preventDefault();
this.props.selectTab(name, teamId); this.props.selectTab(name, teamId);
@@ -242,244 +251,242 @@ export default class AdminSidebar extends React.Component {
return ( return (
<div className='sidebar--left sidebar--collapsable'> <div className='sidebar--left sidebar--collapsable'>
<div> <AdminSidebarHeader/>
<AdminSidebarHeader/> <div className='nav-pills__container'>
<div className='nav-pills__container'> <ul className='nav nav-pills nav-stacked'>
<ul className='nav nav-pills nav-stacked'> <li>
<li> <ul className='nav nav__sub-menu'>
<ul className='nav nav__sub-menu'> <li>
<li> <h4>
<h4> <span className='icon fa fa-gear'></span>
<span className='icon fa fa-gear'></span> <span>
<span>
<FormattedMessage
id='admin.sidebar.reports'
defaultMessage='SITE REPORTS'
/>
</span>
</h4>
</li>
</ul>
<ul className='nav nav__sub-menu padded'>
<li>
<a
href='#'
className={this.isSelected('system_analytics')}
onClick={this.handleClick.bind(this, 'system_analytics', null)}
>
<FormattedMessage <FormattedMessage
id='admin.sidebar.view_statistics' id='admin.sidebar.reports'
defaultMessage='View Statistics' defaultMessage='SITE REPORTS'
/> />
</a> </span>
</li> </h4>
</ul> </li>
<ul className='nav nav__sub-menu'> </ul>
<li> <ul className='nav nav__sub-menu padded'>
<h4> <li>
<span className='icon fa fa-gear'></span> <a
<span> href='#'
<FormattedMessage className={this.isSelected('system_analytics')}
id='admin.sidebar.settings' onClick={this.handleClick.bind(this, 'system_analytics', null)}
defaultMessage='SETTINGS' >
/> <FormattedMessage
</span> id='admin.sidebar.view_statistics'
</h4> defaultMessage='View Statistics'
</li> />
</ul> </a>
<ul className='nav nav__sub-menu padded'> </li>
<li> </ul>
<a <ul className='nav nav__sub-menu'>
href='#' <li>
className={this.isSelected('service_settings')} <h4>
onClick={this.handleClick.bind(this, 'service_settings', null)} <span className='icon fa fa-gear'></span>
> <span>
<FormattedMessage <FormattedMessage
id='admin.sidebar.service' id='admin.sidebar.settings'
defaultMessage='Service Settings' defaultMessage='SETTINGS'
/> />
</a> </span>
</li> </h4>
<li> </li>
<a </ul>
href='#' <ul className='nav nav__sub-menu padded'>
className={this.isSelected('team_settings')} <li>
onClick={this.handleClick.bind(this, 'team_settings', null)} <a
> href='#'
className={this.isSelected('service_settings')}
onClick={this.handleClick.bind(this, 'service_settings', null)}
>
<FormattedMessage
id='admin.sidebar.service'
defaultMessage='Service Settings'
/>
</a>
</li>
<li>
<a
href='#'
className={this.isSelected('team_settings')}
onClick={this.handleClick.bind(this, 'team_settings', null)}
>
<FormattedMessage
id='admin.sidebar.team'
defaultMessage='Team Settings'
/>
</a>
</li>
<li>
<a
href='#'
className={this.isSelected('sql_settings')}
onClick={this.handleClick.bind(this, 'sql_settings', null)}
>
<FormattedMessage
id='admin.sidebar.sql'
defaultMessage='SQL Settings'
/>
</a>
</li>
<li>
<a
href='#'
className={this.isSelected('email_settings')}
onClick={this.handleClick.bind(this, 'email_settings', null)}
>
<FormattedMessage
id='admin.sidebar.email'
defaultMessage='Email Settings'
/>
</a>
</li>
<li>
<a
href='#'
className={this.isSelected('image_settings')}
onClick={this.handleClick.bind(this, 'image_settings', null)}
>
<FormattedMessage
id='admin.sidebar.file'
defaultMessage='File Settings'
/>
</a>
</li>
<li>
<a
href='#'
className={this.isSelected('log_settings')}
onClick={this.handleClick.bind(this, 'log_settings', null)}
>
<FormattedMessage
id='admin.sidebar.log'
defaultMessage='Log Settings'
/>
</a>
</li>
<li>
<a
href='#'
className={this.isSelected('rate_settings')}
onClick={this.handleClick.bind(this, 'rate_settings', null)}
>
<FormattedMessage
id='admin.sidebar.rate_limit'
defaultMessage='Rate Limit Settings'
/>
</a>
</li>
<li>
<a
href='#'
className={this.isSelected('privacy_settings')}
onClick={this.handleClick.bind(this, 'privacy_settings', null)}
>
<FormattedMessage
id='admin.sidebar.privacy'
defaultMessage='Privacy Settings'
/>
</a>
</li>
<li>
<a
href='#'
className={this.isSelected('gitlab_settings')}
onClick={this.handleClick.bind(this, 'gitlab_settings', null)}
>
<FormattedMessage
id='admin.sidebar.gitlab'
defaultMessage='GitLab Settings'
/>
</a>
</li>
{ldapSettings}
{complianceSettings}
<li>
<a
href='#'
className={this.isSelected('legal_and_support_settings')}
onClick={this.handleClick.bind(this, 'legal_and_support_settings', null)}
>
<FormattedMessage
id='admin.sidebar.support'
defaultMessage='Legal and Support Settings'
/>
</a>
</li>
</ul>
<ul className='nav nav__sub-menu'>
<li>
<h4>
<span className='icon fa fa-gear'></span>
<span>
<FormattedMessage <FormattedMessage
id='admin.sidebar.team' id='admin.sidebar.teams'
defaultMessage='Team Settings' defaultMessage='TEAMS ({count})'
values={{
count: count
}}
/> />
</a> </span>
</li> <span className='menu-icon--right'>
<li> <OverlayTrigger
<a delayShow={1000}
href='#' placement='top'
className={this.isSelected('sql_settings')} overlay={addTeamTooltip}
onClick={this.handleClick.bind(this, 'sql_settings', null)} >
> <a
href='#'
onClick={this.showTeamSelect}
>
<i
className='fa fa-plus'
></i>
</a>
</OverlayTrigger>
</span>
</h4>
</li>
</ul>
<ul className='nav nav__sub-menu padded'>
<li>
{teams}
</li>
</ul>
<ul className='nav nav__sub-menu'>
<li>
<h4>
<span className='icon fa fa-gear'></span>
<span>
<FormattedMessage <FormattedMessage
id='admin.sidebar.sql' id='admin.sidebar.other'
defaultMessage='SQL Settings' defaultMessage='OTHER'
/> />
</a> </span>
</li> </h4>
<li> </li>
<a </ul>
href='#' <ul className='nav nav__sub-menu padded'>
className={this.isSelected('email_settings')} {licenseSettings}
onClick={this.handleClick.bind(this, 'email_settings', null)} {audits}
> <li>
<FormattedMessage <a
id='admin.sidebar.email' href='#'
defaultMessage='Email Settings' className={this.isSelected('logs')}
/> onClick={this.handleClick.bind(this, 'logs', null)}
</a> >
</li> <FormattedMessage
<li> id='admin.sidebar.logs'
<a defaultMessage='Logs'
href='#' />
className={this.isSelected('image_settings')} </a>
onClick={this.handleClick.bind(this, 'image_settings', null)} </li>
> </ul>
<FormattedMessage </li>
id='admin.sidebar.file' </ul>
defaultMessage='File Settings'
/>
</a>
</li>
<li>
<a
href='#'
className={this.isSelected('log_settings')}
onClick={this.handleClick.bind(this, 'log_settings', null)}
>
<FormattedMessage
id='admin.sidebar.log'
defaultMessage='Log Settings'
/>
</a>
</li>
<li>
<a
href='#'
className={this.isSelected('rate_settings')}
onClick={this.handleClick.bind(this, 'rate_settings', null)}
>
<FormattedMessage
id='admin.sidebar.rate_limit'
defaultMessage='Rate Limit Settings'
/>
</a>
</li>
<li>
<a
href='#'
className={this.isSelected('privacy_settings')}
onClick={this.handleClick.bind(this, 'privacy_settings', null)}
>
<FormattedMessage
id='admin.sidebar.privacy'
defaultMessage='Privacy Settings'
/>
</a>
</li>
<li>
<a
href='#'
className={this.isSelected('gitlab_settings')}
onClick={this.handleClick.bind(this, 'gitlab_settings', null)}
>
<FormattedMessage
id='admin.sidebar.gitlab'
defaultMessage='GitLab Settings'
/>
</a>
</li>
{ldapSettings}
{complianceSettings}
<li>
<a
href='#'
className={this.isSelected('legal_and_support_settings')}
onClick={this.handleClick.bind(this, 'legal_and_support_settings', null)}
>
<FormattedMessage
id='admin.sidebar.support'
defaultMessage='Legal and Support Settings'
/>
</a>
</li>
</ul>
<ul className='nav nav__sub-menu'>
<li>
<h4>
<span className='icon fa fa-gear'></span>
<span>
<FormattedMessage
id='admin.sidebar.teams'
defaultMessage='TEAMS ({count})'
values={{
count: count
}}
/>
</span>
<span className='menu-icon--right'>
<OverlayTrigger
delayShow={1000}
placement='top'
overlay={addTeamTooltip}
>
<a
href='#'
onClick={this.showTeamSelect}
>
<i
className='fa fa-plus'
></i>
</a>
</OverlayTrigger>
</span>
</h4>
</li>
</ul>
<ul className='nav nav__sub-menu padded'>
<li>
{teams}
</li>
</ul>
<ul className='nav nav__sub-menu'>
<li>
<h4>
<span className='icon fa fa-gear'></span>
<span>
<FormattedMessage
id='admin.sidebar.other'
defaultMessage='OTHER'
/>
</span>
</h4>
</li>
</ul>
<ul className='nav nav__sub-menu padded'>
{licenseSettings}
{audits}
<li>
<a
href='#'
className={this.isSelected('logs')}
onClick={this.handleClick.bind(this, 'logs', null)}
>
<FormattedMessage
id='admin.sidebar.logs'
defaultMessage='Logs'
/>
</a>
</li>
</ul>
</li>
</ul>
</div>
</div> </div>
<SelectTeamModal <SelectTeamModal

Просмотреть файл

@@ -54,6 +54,7 @@ export default class RhsThread extends React.Component {
if ($('.post-right__scroll')[0]) { if ($('.post-right__scroll')[0]) {
$('.post-right__scroll').scrollTop($('.post-right__scroll')[0].scrollHeight); $('.post-right__scroll').scrollTop($('.post-right__scroll')[0].scrollHeight);
} }
$('.sidebar--right .post-right__scroll').perfectScrollbar('update');
this.resize(); this.resize();
} }
componentWillUnmount() { componentWillUnmount() {

Просмотреть файл

@@ -184,6 +184,7 @@ class SearchBar extends React.Component {
onUserInput={this.handleUserInput} onUserInput={this.handleUserInput}
listComponent={SearchSuggestionList} listComponent={SearchSuggestionList}
providers={this.suggestionProviders} providers={this.suggestionProviders}
type='search'
/> />
{isSearching} {isSearching}
<Popover <Popover

Просмотреть файл

@@ -139,6 +139,14 @@ export default class SuggestionBox extends React.Component {
{...newProps} {...newProps}
/> />
); );
} else if (this.props.type === 'search') {
textbox = (
<input
ref='textbox'
type='search'
{...newProps}
/>
);
} else if (this.props.type === 'textarea') { } else if (this.props.type === 'textarea') {
textbox = ( textbox = (
<TextareaAutosize <TextareaAutosize
@@ -166,7 +174,7 @@ SuggestionBox.defaultProps = {
SuggestionBox.propTypes = { SuggestionBox.propTypes = {
listComponent: React.PropTypes.func.isRequired, listComponent: React.PropTypes.func.isRequired,
type: React.PropTypes.oneOf(['input', 'textarea']).isRequired, type: React.PropTypes.oneOf(['input', 'textarea', 'search']).isRequired,
value: React.PropTypes.string.isRequired, value: React.PropTypes.string.isRequired,
onUserInput: React.PropTypes.func, onUserInput: React.PropTypes.func,
providers: React.PropTypes.arrayOf(React.PropTypes.object), providers: React.PropTypes.arrayOf(React.PropTypes.object),

Просмотреть файл

@@ -15,6 +15,16 @@
} }
} }
&.btn-danger {
color: $white;
&:hover,
&:focus,
&:active {
color: $white;
}
}
&.btn-inactive { &.btn-inactive {
background: $light-gray; background: $light-gray;
border-color: transparent; border-color: transparent;

Просмотреть файл

@@ -6,17 +6,19 @@
} }
} }
.search-bar__container { .sidebar--right {
@include flex(0 0 56px); &.move--left {
padding: 12px 8px 0 0; .search-bar__container {
.sidebar--right {
&.move--left & {
padding-right: 42px; padding-right: 42px;
} }
} }
} }
.search-bar__container {
@include flex(0 0 56px);
padding: 12px 8px 0 0;
}
.glyphicon-refresh-animate { .glyphicon-refresh-animate {
@include animation(spin .7s infinite linear); @include animation(spin .7s infinite linear);
} }
@@ -95,7 +97,7 @@
} }
.glyphicon-refresh-animate { .glyphicon-refresh-animate {
color: $dark-gray; @include opacity(0.5);
position: absolute; position: absolute;
right: 27px; right: 27px;
top: 27px; top: 27px;

Просмотреть файл

@@ -14,23 +14,23 @@
.post { .post {
.post__dropdown { .post__dropdown {
display: inline-block;
height: 20px;
line-height: 9px; line-height: 9px;
text-align: center;
text-decoration: none; text-decoration: none;
width: 20px; width: 20px;
display: inline-block;
text-align: center;
height: 20px;
&:after { &:after {
font-size: 20px;
content: '...'; content: '...';
font-size: 20px;
top: -3px; top: -3px;
} }
} }
.comment-icon__container { .comment-icon__container {
visibility: visible;
display: none; display: none;
visibility: visible;
&.icon--show { &.icon--show {
display: inline-block; display: inline-block;
@@ -57,8 +57,8 @@
} }
.post__reply { .post__reply {
margin-right: 20px;
float: right; float: right;
margin-right: 20px;
svg { svg {
top: 1px; top: 1px;
@@ -97,15 +97,15 @@
width: 40px; width: 40px;
img { img {
width: 32px;
height: 32px; height: 32px;
width: 32px;
} }
} }
} }
.post-image__column { .post-image__column {
width: 200px;
height: 95px; height: 95px;
width: 200px;
} }
.textarea-wrapper { .textarea-wrapper {
@@ -114,6 +114,7 @@
display: none; display: none;
} }
} }
.form-control { .form-control {
&.min-height { &.min-height {
min-height: 100px; min-height: 100px;
@@ -132,6 +133,7 @@
.tip-overlay { .tip-overlay {
&.tip-overlay--chat { &.tip-overlay--chat {
margin-left: 10px; margin-left: 10px;
.arrow { .arrow {
left: 32px; left: 32px;
} }
@@ -142,20 +144,21 @@
display: block; display: block;
.file-details__preview { .file-details__preview {
display: block; border-bottom: 1px solid #dddddd;
width: 100%;
height: 150px;
border-right: none; border-right: none;
border-bottom: 1px solid #ddd; display: block;
height: 150px;
width: 100%;
img { img {
width: 64px;
height: 64px; height: 64px;
width: 64px;
} }
} }
.file-details { .file-details {
width: 100%;
height: auto; height: auto;
width: 100%;
} }
} }
@@ -165,9 +168,9 @@
.modal-direct-channels { .modal-direct-channels {
.member-count { .member-count {
display: block;
float: none; float: none;
margin-top: 10px; margin-top: 10px;
display: block;
} }
} }
@@ -181,9 +184,9 @@
} }
.overlay__circle { .overlay__circle {
width: 300px;
height: 300px; height: 300px;
margin: -150px 0 0 -150px; margin: -150px 0 0 -150px;
width: 300px;
} }
.overlay__files { .overlay__files {
@@ -212,9 +215,9 @@
} }
.signup-team__container { .signup-team__container {
padding: 30px 0;
margin-bottom: 30px;
font-size: .9em; font-size: .9em;
margin-bottom: 30px;
padding: 30px 0;
.signup-team__name { .signup-team__name {
font-size: 2em; font-size: 2em;
@@ -240,8 +243,8 @@
.modal { .modal {
.info__label { .info__label {
text-align: left;
padding-bottom: 5px; padding-bottom: 5px;
text-align: left;
} }
.modal-header { .modal-header {
@@ -250,8 +253,8 @@
} }
button.close { button.close {
font-weight: normal;
font-size: 27px; font-size: 27px;
font-weight: normal;
} }
.modal-title { .modal-title {
@@ -262,9 +265,9 @@
.btn { .btn {
&.btn-primary { &.btn-primary {
display: block; display: block;
float: none;
margin: 10px 0 6px; margin: 10px 0 6px;
width: 100%; width: 100%;
float: none;
} }
} }
} }
@@ -304,8 +307,8 @@
z-index: 5; z-index: 5;
.modal-title { .modal-title {
width: 100%;
text-align: center; text-align: center;
width: 100%;
} }
} }
@@ -323,6 +326,7 @@
.settings-table { .settings-table {
padding: 0; padding: 0;
.nav { .nav {
position: relative; position: relative;
top: auto; top: auto;
@@ -339,6 +343,7 @@
top: 14px; top: 14px;
right: 0; right: 0;
padding-right: 0; padding-right: 0;
.fa { .fa {
display: inline-block; display: inline-block;
} }
@@ -347,6 +352,7 @@
&.minimize-settings { &.minimize-settings {
padding: 0; padding: 0;
display: none; display: none;
.user-settings { .user-settings {
padding: 70px 20px 30px; padding: 70px 20px 30px;
} }
@@ -360,10 +366,10 @@
.nav { .nav {
> li { > li {
> a { > a {
border-top: 1px solid #ddd; border-top: 1px solid #dddddd;
font-size: 1.1em; font-size: 1.1em;
line-height: 2.7; line-height: 2.7;
color: #555; color: #555555;
.glyphicon { .glyphicon {
margin-left: 7px; margin-left: 7px;
@@ -438,25 +444,24 @@
} }
.file-preview__remove { .file-preview__remove {
width: 28px; @include alpha-property(background, $black, .5);
height: 28px; height: 28px;
left: auto; left: auto;
right: 0; right: 0;
top: 0;
background: #444;
background: rgba(#000, .5);
text-align: center; text-align: center;
top: 0;
width: 28px;
&:after { &:after {
display: none; display: none;
} }
i { i {
line-height: 29px;
top: auto;
right: auto;
position: relative;
font-size: 16px; font-size: 16px;
line-height: 29px;
position: relative;
right: auto;
top: auto;
} }
} }
@@ -467,10 +472,10 @@
margin: 0 -15px; margin: 0 -15px;
.dropdown__icon { .dropdown__icon {
width: 4px;
height: 16px;
@include background-size(100% 100%); @include background-size(100% 100%);
display: inline-block; display: inline-block;
height: 16px;
width: 4px;
} }
} }
@@ -502,10 +507,11 @@
.footer-pane { .footer-pane {
.footer-link { .footer-link {
padding: 0;
width: 100%;
text-align: right;
line-height: 1.7; line-height: 1.7;
padding: 0;
text-align: right;
width: 100%;
&.copyright { &.copyright {
width: 100%; width: 100%;
} }
@@ -517,10 +523,10 @@
} }
.search-bar__container { .search-bar__container {
padding: 0;
@include flex(0 0 44px); @include flex(0 0 44px);
background: $primary-color; background: $primary-color;
color: #fff; color: $white;
padding: 0;
&.focused { &.focused {
.sidebar__collapse { .sidebar__collapse {
@@ -534,40 +540,40 @@
} }
.search__clear { .search__clear {
@include translateX(0px); @include translateX(0);
} }
} }
.search__form { .search__form {
border: none;
@include translateX(0px);
padding: 7px 20px 0 49px;
height: 45px;
position: relative;
@include single-transition(all, .2s, linear); @include single-transition(all, .2s, linear);
@include translateX(0);
border: none;
height: 45px;
padding: 7px 20px 0 49px;
position: relative;
.glyphicon-refresh-animate { .glyphicon-refresh-animate {
color: $black;
right: 33px; right: 33px;
top: 15px; top: 15px;
color: #fff;
color: rgba(255,255,255,.5);
} }
.form-control { .form-control {
border: none;
padding: 0 10px 0 31px;
background: rgba(black, .2);
@include border-radius(3px); @include border-radius(3px);
color: #444; background: $white;
background: #fff; border: none;
color: $dark-gray;
padding: 0 10px 0 31px;
} }
} }
} }
.sidebar--menu { .sidebar--menu {
@include single-transition(transform, .5s, ease); @include single-transition(transform, .5s, ease);
@include translate3d(290px, 0, 0); @include translate3d(290px, 0, 0);
width: 290px;
border: none; border: none;
display: block; display: block;
width: 290px;
&.move--left { &.move--left {
@include translate3d(0, 0, 0); @include translate3d(0, 0, 0);
@@ -627,7 +633,7 @@
ul { ul {
clear: both; clear: both;
background: #fff; background: #ffffff;
border-radius: 3px; border-radius: 3px;
top: 5px; top: 5px;
position: relative; position: relative;
@@ -795,6 +801,7 @@
} }
} }
} }
.activity-log__table { .activity-log__table {
> div { > div {
display: block; display: block;
@@ -805,8 +812,8 @@
} }
.activity-log__action { .activity-log__action {
text-align: left;
margin-top: 10px; margin-top: 10px;
text-align: left;
} }
} }
} }
@@ -816,8 +823,8 @@
.settings-modal { .settings-modal {
.settings-table { .settings-table {
.security-links { .security-links {
margin-bottom: 10px;
display: block; display: block;
margin-bottom: 10px;
&:last-child { &:last-child {
margin-bottom: 0; margin-bottom: 0;
@@ -850,11 +857,11 @@
.member-drop, .member-drop,
.member-role { .member-role {
position: relative; margin: 0 0 0 44px;
margin: 0px 0 0 44px;
padding: 5px 0; padding: 5px 0;
top: 0; position: relative;
right: 0; right: 0;
top: 0;
} }
.open > .dropdown-menu { .open > .dropdown-menu {