From 9c7073a422e8042443cf88b267fe0ddbd5e98bbc Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Wed, 1 Jun 2016 12:12:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=BD=D0=B5=D0=B4=D1=80=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B8=D0=BC=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BE=D1=82=20router=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5=D0=BD=D1=82=D0=B0=20?= =?UTF-8?q?RulesPage=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20?= =?UTF-8?q?=D1=82=D0=B0=D0=B9=D1=82=D0=BB=20=D0=B4=D0=BB=D1=8F=20=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=8B=20=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB=20=D0=9F=D1=80=D0=BE=D0=B1=D1=80=D0=BE=D1=88?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D1=83=D0=BD=D0=BA=D1=82=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D0=BB=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B5=D0=B4=D1=83=D0=BF=D1=80=D0=B5=D0=B6=D0=B4=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BE=20=D0=BD=D0=B8=D0=BA=D0=B5=20=D0=BD=D0=B0?= =?UTF-8?q?=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=84=D0=B8=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/profile/Profile.intl.json | 3 +- src/components/profile/Profile.jsx | 14 ++++++++- src/components/profile/profile.scss | 10 ++++++ src/i18n/en.json | 4 ++- src/i18n/ru.json | 4 ++- src/pages/rules/RulesPage.intl.json | 2 ++ src/pages/rules/RulesPage.jsx | 39 ++++++++++++++++-------- 7 files changed, 60 insertions(+), 16 deletions(-) diff --git a/src/components/profile/Profile.intl.json b/src/components/profile/Profile.intl.json index e4639cc..19f1e69 100644 --- a/src/components/profile/Profile.intl.json +++ b/src/components/profile/Profile.intl.json @@ -3,7 +3,8 @@ "personalData": "Personal data", "accountDescription": "Ely.by account allows you to get access to many Minecraft resources. Please, take care of your account safety. Use secure password and change it regularly.", "preferencesDescription": "Here you can change the key preferences of your account. Please note that all actions must be confirmed by entering a password.", - "mojangPriorityWarning": "A Mojang account with the same nickname was found. According to project rules, account owner has the right to demand the restoration of control over nickname.", + "mojangPriorityWarning": "A Mojang account with the same nickname was found. According to {rules}, account owner has the right to demand the restoration of control over nickname.", + "projectRules": "project rules", "oldHashingAlgoWarning": "Your was hashed with an old hashing algorithm.
Please, change password.", "changedAt": "Changed {at}", "disabled": "Disabled", diff --git a/src/components/profile/Profile.jsx b/src/components/profile/Profile.jsx index a979fea..817917a 100644 --- a/src/components/profile/Profile.jsx +++ b/src/components/profile/Profile.jsx @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import { FormattedMessage as Message, FormattedRelative as Relative, FormattedHTMLMessage as HTMLMessage } from 'react-intl'; +import { Link } from 'react-router'; import Helmet from 'react-helmet'; import { userShape } from 'components/user/User'; @@ -12,6 +13,8 @@ import styles from './profile.scss'; import profileForm from './profileForm.scss'; import messages from './Profile.intl.json'; +import RulesPage from 'pages/rules/RulesPage'; + export default class Profile extends Component { static displayName = 'Profile'; static propTypes = { @@ -55,7 +58,16 @@ export default class Profile extends Component { label={} value={user.username} warningMessage={user.hasMojangUsernameCollision ? ( - + + + + ) + }} /> ) : ''} /> diff --git a/src/components/profile/profile.scss b/src/components/profile/profile.scss index f1fb5c4..38e3c0b 100644 --- a/src/components/profile/profile.scss +++ b/src/components/profile/profile.scss @@ -95,6 +95,16 @@ $formColumnWidth: 416px; color: $red; font-size: 11px; line-height: 1.2; + + a { + color: $red; + border-bottom: 1px dashed transparent; + transition: .25s; + + &:hover { + border-bottom-color: lighter($red); + } + } } .uuid { diff --git a/src/i18n/en.json b/src/i18n/en.json index b2d00a9..fb28eed 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -104,7 +104,7 @@ "components.profile.changeUsername.changeUsernameWarning": "Be careful: if you playing on the server with nickname binding, then after changing nickname you may lose all your progress.", "components.profile.changedAt": "Changed {at}", "components.profile.disabled": "Disabled", - "components.profile.mojangPriorityWarning": "A Mojang account with the same nickname was found. According to project rules, account owner has the right to demand the restoration of control over nickname.", + "components.profile.mojangPriorityWarning": "A Mojang account with the same nickname was found. According to {rules}, account owner has the right to demand the restoration of control over nickname.", "components.profile.nickname": "Nickname", "components.profile.oldHashingAlgoWarning": "Your was hashed with an old hashing algorithm.
Please, change password.", "components.profile.password": "Password", @@ -112,6 +112,7 @@ "components.profile.passwordRequestForm.title": "Confirm your action", "components.profile.personalData": "Personal data", "components.profile.preferencesDescription": "Here you can change the key preferences of your account. Please note that all actions must be confirmed by entering a password.", + "components.profile.projectRules": "project rules", "components.profile.twoFactorAuth": "Two factor auth", "components.userbar.logout": "Logout", "components.userbar.register": "Join", @@ -134,6 +135,7 @@ "pages.rules.mainProvision3": "Ely.by is side project, that has nothing to do with Mojang and Microsoft companies. We don't provide support to Minecraft premium accounts, and we have nothing to do with servers that use or don't use our services.", "pages.rules.mainProvision4": "The registration of the users account at server is free. Account creation Ely.by is only possible at that page {link}.", "pages.rules.mainProvisions": "Main provisions", + "pages.rules.title": "Site rules", "services.accountAlreadyActivated": "This account is already activated", "services.accountNotActivated": "The account is not activated", "services.doYouWantRequestKey": "Do you want to request a new key?", diff --git a/src/i18n/ru.json b/src/i18n/ru.json index 5db4948..ad75201 100644 --- a/src/i18n/ru.json +++ b/src/i18n/ru.json @@ -104,7 +104,7 @@ "components.profile.changeUsername.changeUsernameWarning": "Будьте внимательны: если вы играли на сервере с привязкой по нику, то после смены ника вы можете утратить весь свой прогресс.", "components.profile.changedAt": "Изменен {at}", "components.profile.disabled": "Не включена", - "components.profile.mojangPriorityWarning": "Найден аккаунт Mojang с таким же ником и, по правилам проекта, его владелец вправе потребовать восстановления контроля над ником.", + "components.profile.mojangPriorityWarning": "Найден аккаунт Mojang с таким же ником и, по {rules}, его владелец вправе потребовать восстановления контроля над ником.", "components.profile.nickname": "Ник", "components.profile.oldHashingAlgoWarning": "Для пароля применяется старый алгоритм хэширования
Пожалуйста, смените пароль.", "components.profile.password": "Пароль", @@ -112,6 +112,7 @@ "components.profile.passwordRequestForm.title": "Confirm your action", "components.profile.personalData": "Персональные данные", "components.profile.preferencesDescription": "Здесь вы можете сменить ключевые параметры вашего аккаунта. Обратите внимание, что для всех действий необходимо подтверждение при помощи ввода пароля.", + "components.profile.projectRules": "правилам проекта", "components.profile.twoFactorAuth": "Двухфакторная аутентификация", "components.userbar.logout": "Выход", "components.userbar.register": "Регистрация", @@ -134,6 +135,7 @@ "pages.rules.mainProvision3": "Ely.by является сторонней разработкой, не имеющей никакого отношения к компаниям Mojang и Microsoft. Мы не оказываем поддержки по премиум аккаунтам Minecraft, а также никак не связаны с игровыми серверами, использующими или не использующими наши сервисы.", "pages.rules.mainProvision4": "Регистрация пользовательского аккаунта на сервисе бесплатна. Создание аккаунта Ely.by возможно только на странице {link}.", "pages.rules.mainProvisions": "Основные положения", + "pages.rules.title": "Правила сайта", "services.accountAlreadyActivated": "Этот аккаунт уже активирован", "services.accountNotActivated": "Аккаунт не активирован", "services.doYouWantRequestKey": "Не хотите отправить новый код?", diff --git a/src/pages/rules/RulesPage.intl.json b/src/pages/rules/RulesPage.intl.json index b5c49ab..47938d6 100644 --- a/src/pages/rules/RulesPage.intl.json +++ b/src/pages/rules/RulesPage.intl.json @@ -1,4 +1,6 @@ { + "title" : "Site rules", + "mainProvisions": "Main provisions", "mainProvision1": "{name} service was created for the organization of safety access to Ely.by's users accounts, his partners and any side project that wish to use one of the our's services", "mainProvision2": "We (here and in the next points) - Ely.by project developers team that make creating qualitative services for Minecraft community.", diff --git a/src/pages/rules/RulesPage.jsx b/src/pages/rules/RulesPage.jsx index 177d538..a5e85c3 100644 --- a/src/pages/rules/RulesPage.jsx +++ b/src/pages/rules/RulesPage.jsx @@ -1,7 +1,8 @@ import React, { Component, PropTypes } from 'react'; -import { Link, browserHistory } from 'react-router'; +import { Link } from 'react-router'; import { FormattedMessage as Message } from 'react-intl'; +import Helmet from 'react-helmet'; import { FooterMenu } from 'components/footerMenu'; @@ -64,6 +65,13 @@ export default class RulesPage extends Component { }) }; + static contextTypes = { + router: PropTypes.shape({ + createLocation: PropTypes.func.required, + replace: PropTypes.func.required + }).isRequired + }; + render() { let {hash} = this.props.location; if (hash) { @@ -72,14 +80,20 @@ export default class RulesPage extends Component { return (
+ + {(pageTitle) => ( + + )} + +
{rules.map((block, sectionIndex) => (

{block.title}

@@ -94,11 +108,11 @@ export default class RulesPage extends Component { {block.items.map((item, ruleIndex) => (
  • {item}
  • @@ -116,17 +130,18 @@ export default class RulesPage extends Component { } onRuleClick(event) { - const id = event.currentTarget.id; - const newLocation = browserHistory.createLocation({...location, hash: `#${id}`}); - browserHistory.replace(newLocation); + const {id} = event.currentTarget; + const {router} = this.context; + const newLocation = router.createLocation({...location, hash: `#${id}`}); + router.replace(newLocation); } - getTitleHash(sectionIndex) { + static getTitleHash(sectionIndex) { return `rule-${sectionIndex + 1}`; } - getRuleHash(sectionIndex, ruleIndex) { - return `rule-${sectionIndex + 1}-${ruleIndex + 1}`; + static getRuleHash(sectionIndex, ruleIndex) { + return `${RulesPage.getTitleHash(sectionIndex)}-${ruleIndex + 1}`; } }