diff --git a/client/src/app-components/language-selector.js b/client/src/app-components/language-selector.js index 14ab8012..cacb0d8e 100644 --- a/client/src/app-components/language-selector.js +++ b/client/src/app-components/language-selector.js @@ -3,6 +3,7 @@ import {connect} from 'react-redux'; import classNames from 'classnames'; import languageList from 'data/language-list'; +import i18n from 'lib-app/i18n'; import DropDown from 'core-components/drop-down'; const languageCodes = Object.keys(languageList); @@ -10,13 +11,15 @@ const languageCodes = Object.keys(languageList); class LanguageSelector extends React.Component { static propTypes = { value: React.PropTypes.oneOf(languageCodes), - type: React.PropTypes.oneOf(['allowed', 'supported']), + type: React.PropTypes.oneOf(['allowed', 'supported', 'custom']), + customList: React.PropTypes.array, allowedLanguages: React.PropTypes.array, supportedLanguages: React.PropTypes.array }; static defaultProps = { type: 'allowed', + customList: ['en'], allowedLanguages: languageCodes, supportedLanguages: languageCodes }; @@ -75,7 +78,14 @@ class LanguageSelector extends React.Component { } getLanguageList() { - return (this.props.type === 'supported') ? this.props.supportedLanguages : this.props.allowedLanguages; + switch(this.props.type) { + case 'supported': + return this.props.supportedLanguages; + case 'allowed': + return this.props.supportedLanguages; + case 'custom': + return this.props.customList; + } } } diff --git a/client/src/app-components/toggle-button.scss b/client/src/app-components/toggle-button.scss index 4711e8fe..6006ae56 100644 --- a/client/src/app-components/toggle-button.scss +++ b/client/src/app-components/toggle-button.scss @@ -6,4 +6,5 @@ padding: 2px; border-radius: 4px; text-align: center; + user-select: none; } \ No newline at end of file diff --git a/client/src/app/admin/panel/settings/admin-panel-system-preferences.js b/client/src/app/admin/panel/settings/admin-panel-system-preferences.js index 03ed99a7..dac728dc 100644 --- a/client/src/app/admin/panel/settings/admin-panel-system-preferences.js +++ b/client/src/app/admin/panel/settings/admin-panel-system-preferences.js @@ -1,5 +1,10 @@ import React from 'react'; import _ from 'lodash'; + +import API from 'lib-app/api-call'; +import i18n from 'lib-app/i18n'; +import LanguageSelector from 'app-components/language-selector'; +import ToggleButton from 'app-components/toggle-button'; import languageList from 'data/language-list'; import Form from 'core-components/form'; @@ -8,11 +13,9 @@ import Header from 'core-components/header'; import SubmitButton from 'core-components/submit-button'; import Button from 'core-components/button'; import Message from 'core-components/message'; +import InfoTooltip from 'core-components/info-tooltip'; -import API from 'lib-app/api-call'; -import i18n from 'lib-app/i18n'; -import LanguageSelector from 'app-components/language-selector'; -import ToggleButton from 'app-components/toggle-button'; +const languageKeys = Object.keys(languageList); class AdminPanelSystemPreferences extends React.Component { @@ -20,7 +23,7 @@ class AdminPanelSystemPreferences extends React.Component { loading: true, message: null, values: { - 'maintenance': false + maintenance: false } }; @@ -31,12 +34,12 @@ class AdminPanelSystemPreferences extends React.Component { render() { return (