Merge pull request #1282 from asaadmahmoodspin/ui-improvements

Multiple UI changes
Этот коммит содержится в:
Corey Hulen
2015-11-03 12:48:58 -08:00
родитель 0f3fe79b80 38fd4acebd
Коммит 34c4f77d8c
10 изменённых файлов: 106 добавлений и 53 удалений

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

@@ -83,7 +83,16 @@ export default class SearchResults extends React.Component {
var ctls = null; var ctls = null;
if (noResults) { if (noResults) {
ctls = <div className='sidebar--right__subheader'>No results</div>; ctls =
(
<div className='sidebar--right__subheader'>
<h4>{'NO RESULTS'}</h4>
<ul>
<li>If you're searching a partial phrase (ex. searching "rea", looking for "reach" or "reaction"), append a * to your search term</li>
<li>Due to the volume of results, two letter searches and common words like "this", "a" and "is" won't appear in search results</li>
</ul>
</div>
);
} else { } else {
ctls = results.order.map(function mymap(id) { ctls = results.order.map(function mymap(id) {
var post = results.posts[id]; var post = results.posts[id];

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

@@ -1,10 +1,14 @@
// 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.
var utils = require('../utils/utils.jsx');
export default class SettingsSidebar extends React.Component { export default class SettingsSidebar extends React.Component {
componentDidUpdate() { componentDidUpdate() {
$('.settings-modal').find('.modal-body').scrollTop(0); $('.settings-modal').find('.modal-body').scrollTop(0);
$('.settings-modal').find('.modal-body').perfectScrollbar('update'); $('.settings-modal').find('.modal-body').perfectScrollbar('update');
if (utils.isSafari()) {
$('.settings-modal .settings-links .nav').addClass('absolute');
}
} }
constructor(props) { constructor(props) {
super(props); super(props);

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

@@ -372,29 +372,28 @@ export default class GeneralTab extends React.Component {
const inputs = []; const inputs = [];
inputs.push( inputs.push(
<div <div key='teamInviteSetting'>
key='teamInviteSetting' <div className='row'>
className='form-group' <label className='col-sm-5 control-label'>{'Invite Code'}</label>
> <div className='col-sm-7'>
<label className='col-sm-5 control-label'>{'Invite Code'}</label> <input
<div className='col-sm-7'> className='form-control'
<input type='text'
className='form-control' onChange={this.updateInviteId}
type='text' value={this.state.invite_id}
onChange={this.updateInviteId} maxLength='32'
value={this.state.invite_id} />
maxLength='32' <div className='padding-top x2'>
/> <a
</div> href='#'
<div><br/>{'Your Invite Code is used in the URL sent to people to join your team. Regenerating your Invite Code will invalidate the URLs in previous invitations, unless "Allow anyone to sign-up from login page" is enabled.'}</div> onClick={this.handleGenerateInviteId}
<div className='help-text'> >
<button {'Re-Generate'}
className='btn btn-default' </a>
onClick={this.handleGenerateInviteId} </div>
> </div>
{'Re-Generate'}
</button>
</div> </div>
<div className='setting-list__hint'>{'When allowing open invites this code is used as part of the signup process. Changing this code will invalidate the previous open signup link.'}</div>
</div> </div>
); );
@@ -493,8 +492,11 @@ export default class GeneralTab extends React.Component {
<h3 className='tab-header'>{'General Settings'}</h3> <h3 className='tab-header'>{'General Settings'}</h3>
<div className='divider-dark first'/> <div className='divider-dark first'/>
{nameSection} {nameSection}
<div className='divider-light'/>
{openInviteSection} {openInviteSection}
<div className='divider-light'/>
{teamListingSection} {teamListingSection}
<div className='divider-light'/>
{inviteSection} {inviteSection}
<div className='divider-dark'/> <div className='divider-dark'/>
</div> </div>

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

@@ -35,6 +35,9 @@ export default class TutorialIntroScreens extends React.Component {
preference = PreferenceStore.setPreference(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), newValue); preference = PreferenceStore.setPreference(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), newValue);
AsyncClient.savePreferences([preference]); AsyncClient.savePreferences([preference]);
} }
componentDidMount() {
$('.tutorials__scroll').perfectScrollbar();
}
createScreen() { createScreen() {
switch (this.state.currentScreen) { switch (this.state.currentScreen) {
case 0: case 0:
@@ -130,20 +133,26 @@ export default class TutorialIntroScreens extends React.Component {
); );
} }
render() { render() {
const height = Utils.windowHeight() - 100;
const screen = this.createScreen(); const screen = this.createScreen();
return ( return (
<div className='tutorial-steps__container'> <div
<div className='tutorial__content'> className='tutorials__scroll'
<div className='tutorial__steps'> style={{height}}
{screen} >
<button <div className='tutorial-steps__container'>
className='btn btn-primary' <div className='tutorial__content'>
tabIndex='1' <div className='tutorial__steps'>
onClick={this.handleNext} {screen}
> <button
{'Next'} className='btn btn-primary'
</button> tabIndex='1'
onClick={this.handleNext}
>
{'Next'}
</button>
</div>
</div> </div>
</div> </div>
</div> </div>

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

@@ -59,6 +59,20 @@ export function isTestDomain() {
return false; return false;
} }
export function isChrome() {
if (navigator.userAgent.indexOf('Chrome') > -1) {
return true;
}
return false;
}
export function isSafari() {
if (navigator.userAgent.indexOf('Safari') !== -1 && navigator.userAgent.indexOf('Chrome') === -1) {
return true;
}
return false;
}
export function isInRole(roles, inRole) { export function isInRole(roles, inRole) {
var parts = roles.split(' '); var parts = roles.split(' ');
for (var i = 0; i < parts.length; i++) { for (var i = 0; i < parts.length; i++) {
@@ -500,16 +514,16 @@ export function applyTheme(theme) {
changeCss('#post-create', 'background:' + theme.centerChannelBg, 1); changeCss('#post-create', 'background:' + theme.centerChannelBg, 1);
changeCss('.date-separator .separator__text, .new-separator .separator__text', 'background:' + theme.centerChannelBg, 1); changeCss('.date-separator .separator__text, .new-separator .separator__text', 'background:' + theme.centerChannelBg, 1);
changeCss('.post-image__column .post-image__details', 'background:' + theme.centerChannelBg, 1); changeCss('.post-image__column .post-image__details', 'background:' + theme.centerChannelBg, 1);
changeCss('.sidebar--right, .dropdown-menu, .popover', 'background:' + theme.centerChannelBg, 1); changeCss('.sidebar--right, .dropdown-menu, .popover, .tip-overlay', 'background:' + theme.centerChannelBg, 1);
changeCss('.popover.bottom>.arrow:after', 'border-bottom-color:' + theme.centerChannelBg, 1); changeCss('.popover.bottom>.arrow:after', 'border-bottom-color:' + theme.centerChannelBg, 1);
changeCss('.popover.right>.arrow:after', 'border-right-color:' + theme.centerChannelBg, 1); changeCss('.popover.right>.arrow:after, .tip-overlay.tip-overlay--sidebar .arrow, .tip-overlay.tip-overlay--header .arrow', 'border-right-color:' + theme.centerChannelBg, 1);
changeCss('.popover.left>.arrow:after', 'border-left-color:' + theme.centerChannelBg, 1); changeCss('.popover.left>.arrow:after', 'border-left-color:' + theme.centerChannelBg, 1);
changeCss('.popover.top>.arrow:after', 'border-top-color:' + theme.centerChannelBg, 1); changeCss('.popover.top>.arrow:after, .tip-overlay.tip-overlay--chat .arrow', 'border-top-color:' + theme.centerChannelBg, 1);
changeCss('.search-bar__container .search__form .search-bar, .form-control', 'background:' + theme.centerChannelBg, 1); changeCss('.search-bar__container .search__form .search-bar, .form-control', 'background:' + theme.centerChannelBg, 1);
} }
if (theme.centerChannelColor) { if (theme.centerChannelColor) {
changeCss('.app__content, .post-create__container .post-create-body .btn-file, .post-create__container .post-create-footer .msg-typing, .command-name, .modal .modal-content, .dropdown-menu, .popover, .mentions-name', 'color:' + theme.centerChannelColor, 1); changeCss('.app__content, .post-create__container .post-create-body .btn-file, .post-create__container .post-create-footer .msg-typing, .command-name, .modal .modal-content, .dropdown-menu, .popover, .mentions-name, .tip-overlay', 'color:' + theme.centerChannelColor, 1);
changeCss('#post-create', 'color:' + theme.centerChannelColor, 2); changeCss('#post-create', 'color:' + theme.centerChannelColor, 2);
changeCss('.channel-header__links a', 'fill:' + changeOpacity(theme.centerChannelColor, 0.7), 1); changeCss('.channel-header__links a', 'fill:' + changeOpacity(theme.centerChannelColor, 0.7), 1);
changeCss('.channel-header__links a:hover, .channel-header__links a:active', 'fill:' + theme.centerChannelColor, 2); changeCss('.channel-header__links a:hover, .channel-header__links a:active', 'fill:' + theme.centerChannelColor, 2);
@@ -519,7 +533,7 @@ export function applyTheme(theme) {
changeCss('.dropdown-menu, .popover ', 'box-shadow:' + changeOpacity(theme.centerChannelColor, 0.1) + ' 0px 6px 12px', 3); changeCss('.dropdown-menu, .popover ', 'box-shadow:' + changeOpacity(theme.centerChannelColor, 0.1) + ' 0px 6px 12px', 3);
changeCss('.dropdown-menu, .popover ', '-webkit-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.1) + ' 0px 6px 12px', 2); changeCss('.dropdown-menu, .popover ', '-webkit-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.1) + ' 0px 6px 12px', 2);
changeCss('.dropdown-menu, .popover ', '-moz-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.1) + ' 0px 6px 12px', 1); changeCss('.dropdown-menu, .popover ', '-moz-box-shadow:' + changeOpacity(theme.centerChannelColor, 0.1) + ' 0px 6px 12px', 1);
changeCss('.post-body hr, .loading-screen .loading__content .round', 'background:' + theme.centerChannelColor, 1); changeCss('.post-body hr, .loading-screen .loading__content .round, .tutorial__circles .circle, .tip-overlay .tutorial__circles .circle.active', 'background:' + theme.centerChannelColor, 1);
changeCss('.channel-header .heading', 'color:' + theme.centerChannelColor, 1); changeCss('.channel-header .heading', 'color:' + theme.centerChannelColor, 1);
changeCss('.markdown__table tbody tr:nth-child(2n)', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1); changeCss('.markdown__table tbody tr:nth-child(2n)', 'background:' + changeOpacity(theme.centerChannelColor, 0.07), 1);
changeCss('.channel-header__info>div.dropdown .header-dropdown__icon', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1); changeCss('.channel-header__info>div.dropdown .header-dropdown__icon', 'color:' + changeOpacity(theme.centerChannelColor, 0.8), 1);
@@ -568,7 +582,7 @@ export function applyTheme(theme) {
} }
if (theme.buttonBg) { if (theme.buttonBg) {
changeCss('.btn.btn-primary', 'background:' + theme.buttonBg, 1); changeCss('.btn.btn-primary, .tutorial__circles .circle.active', 'background:' + theme.buttonBg, 1);
changeCss('.btn.btn-primary:hover, .btn.btn-primary:active, .btn.btn-primary:focus', 'background:' + changeColor(theme.buttonBg, -0.25), 1); changeCss('.btn.btn-primary:hover, .btn.btn-primary:active, .btn.btn-primary:focus', 'background:' + changeColor(theme.buttonBg, -0.25), 1);
changeCss('.file-playback-controls', 'color:' + changeColor(theme.buttonBg, -0.25), 1); changeCss('.file-playback-controls', 'color:' + changeColor(theme.buttonBg, -0.25), 1);
} }

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

@@ -133,9 +133,6 @@ a:focus, a:hover {
&.no-resize { &.no-resize {
resize: none; resize: none;
} }
&.min-height {
min-height: 100px;
}
} }
.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {

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

@@ -275,6 +275,14 @@
} }
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.form-control {
&.min-height {
min-height: 100px;
}
}
.gif-div {
max-width: 100%;
}
.tip-div { .tip-div {
left: 15px; left: 15px;
right: auto; right: auto;
@@ -460,7 +468,7 @@
} }
} }
.settings-table { .settings-table {
.nav { .nav, .nav.absolute {
position: relative; position: relative;
top: auto; top: auto;
width: 100%; width: 100%;

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

@@ -72,6 +72,10 @@
position: fixed; position: fixed;
top: 57px; top: 57px;
width: 179px; width: 179px;
&.absolute {
position: absolute;
top: 0;
}
} }
.security-links { .security-links {
margin-right: 20px; margin-right: 20px;

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

@@ -80,13 +80,18 @@
} }
.sidebar--right__subheader { .sidebar--right__subheader {
font-size: 1em; font-size: 1em;
text-transform: uppercase; padding: 1em 1em 0;
color: #999; h4 {
font-weight: 400; font-size: 1em;
color: #888; }
height: 44px; ul {
line-height: 44px; @include opacity(0.7);
padding: 0 1em; padding: 10px 0 0 30px;
}
li {
font-size: 0.95em;
padding-bottom: 10px;
}
} }
} }

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

@@ -146,11 +146,12 @@
text-align: center; text-align: center;
width: 100%; width: 100%;
display: table; display: table;
height: 100%;
.tutorial__content { .tutorial__content {
display: table-cell; display: table-cell;
vertical-align: middle; vertical-align: middle;
padding-bottom: 100px; padding-bottom: 100px;
padding: 0 40px; padding: 20px 40px 40px;
.tutorial__steps { .tutorial__steps {
max-width: 310px; max-width: 310px;
min-height: 420px; min-height: 420px;
@@ -176,7 +177,7 @@
width: 9px; width: 9px;
height: 9px; height: 9px;
@include border-radius(9px); @include border-radius(9px);
@include opacity(0.1); @include opacity(0.2);
background: #000; background: #000;
display: inline-block; display: inline-block;
margin: 0 5px; margin: 0 5px;