Skip to content

Commit

Permalink
WA-104: network type copywrite
Browse files Browse the repository at this point in the history
  • Loading branch information
shrpne committed Apr 15, 2019
1 parent 882247c commit 2d5cfcb
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 24 deletions.
8 changes: 5 additions & 3 deletions assets/variables.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
export const BASE_TITLE_NETWORK = process.env.APP_ENV === 'production' ? '' : 'Testnet ';
export const MAINNET = 'mainnet';
export const TESTNET = 'testnet';
export const NETWORK = process.env.APP_ENV === 'production' ? MAINNET : TESTNET;
export const BASE_TITLE_NETWORK = NETWORK === MAINNET ? '' : 'Testnet ';
export const BASE_TITLE_END = ' — Minter';
export const BASE_TITLE = BASE_TITLE_NETWORK + 'Console' + BASE_TITLE_END;
export const BASE_DESCRIPTION = 'Minter Console is by far the most advanced part of our project that lets you manage all your activities on our test network.';
export const BASE_DESCRIPTION = `Minter Console is by far the most advanced part of our project that lets you manage all your activities on our ${NETWORK === TESTNET ? 'test ': ''}network.`;
export const MINTER_ACCOUNTS_API_URL = process.env.APP_MINTER_ACCOUNTS_URL + '/api/v1/';
export const NETWORK = process.env.APP_ENV === 'production' ? 'mainnet' : 'testnet';
export const COIN_NAME = process.env.APP_ENV === 'production' ? 'BIP' : 'MNT';
export const EXPLORER_URL = process.env.APP_EXPLORER_URL;
export const EXPLORER_API_URL = process.env.APP_EXPLORER_API_URL + '/api/v1/';
Expand Down
6 changes: 4 additions & 2 deletions lang/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default {
'return-link': 'Перейти на главную',
},
index: {
'seo-description': 'Консоль Minter — это самая продвинутая часть нашего проекта, которая позволяет управлять своими действиями в нашей Testnet.',
'seo-description': 'Консоль Minter — это самая продвинутая часть нашего проекта, которая позволяет управлять своими действиями в нашей сети.',
'seo-description-testnet': 'Консоль Minter — это самая продвинутая часть нашего проекта, которая позволяет управлять своими действиями в нашей Testnet.',
'auth-sign-in-title': 'Войти при помощи имени пользователя',
'auth-sign-in-username': 'Имя пользователя',
'auth-sign-in-password': 'Пароль',
Expand Down Expand Up @@ -133,7 +134,8 @@ export default {
'create-title': 'Создание Multisig',
},
wallet: {
'seo-description': 'Проводите транзакции в MNT и других монетах, выпущенных в Minter Testnet. Практически мгновенно и практически без комиссий.',
'seo-description': 'Проводите транзакции в MNT и других монетах, выпущенных в сети Minter. Практически мгновенно и практически без комиссий.',
'seo-description-testnet': 'Проводите транзакции в MNT и других монетах, выпущенных в Minter Testnet. Практически мгновенно и практически без комиссий.',
'send-title': 'Отправка монет',
'address': 'Адрес вашего кошелька',
'balance': 'Баланс кошелька',
Expand Down
16 changes: 14 additions & 2 deletions layouts/_footer.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<script>
import footerLinksData from 'minter-footer-links';
import footerLinksData from '@minterteam/footer-links';
import {NETWORK, MAINNET, TESTNET} from '~/assets/variables';
export default {
// first key not handled by webstorm intelliSense
ideFix: 1,
footerLinkList: footerLinksData,
props: {
containerClass: {
Expand All @@ -14,6 +17,15 @@
return this.$i18n.locale || 'en';
},
},
methods: {
getUrl(link) {
if (NETWORK === MAINNET) {
return link.url;
} else {
return link.urlTestnet || link.url;
}
},
},
};
</script>

Expand All @@ -23,7 +35,7 @@
<img class="footer__logo" src="/img/minter-logo-white.svg" alt="Minter">
<div class="footer__menu">
<div class="footer__menu-item" v-for="link in $options.footerLinkList" :key="link.slug">
<a class="footer__link link--hover" :href="link.url" target="_blank" rel="nofollow noopener">{{ link.title[locale] }}</a>
<a class="footer__link link--hover" :href="getUrl(link)" target="_blank" rel="nofollow noopener">{{ link.title[locale] }}</a>
</div>
</div>
</div>
Expand Down
10 changes: 7 additions & 3 deletions layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
import {shortHashFilter, support} from "~/assets/utils";
import {NETWORK, TESTNET} from '~/assets/variables';
import Snackbar from '~/components/Snackbar';
import Language from '~/layouts/_language';
import Footer from '~/layouts/_footer';
Expand All @@ -21,6 +22,9 @@
const username = this.$store.getters.username;
return username.substr(0, 2) === 'Mx' ? shortHashFilter(username, 4) : username;
},
isTestnet() {
return NETWORK === TESTNET;
},
},
watch: {
'$route'(to, from) {
Expand Down Expand Up @@ -67,7 +71,7 @@
<div class="header__container u-container u-container--large">
<nuxt-link class="header__logo no-link" :to="preferredPath('index')">
<img class="header__logo-image" src="/img/minter-logo-circle.svg" alt="Minter" width="36" height="36">
<div class="header__logo-text">{{ $store.state.sectionName || 'Console' }}</div>
<div class="header__logo-text">{{ $store.state.sectionName || `${this.isTestnet ? 'Testnet ' : '' }Console` }}</div>
</nuxt-link>

<div class="header__controls">
Expand Down Expand Up @@ -172,10 +176,10 @@
<div class="u-container main-content__aside-section">
<ul class="services__list no-list u-grid u-grid--vertical-margin--small">
<li class="u-cell">
<a class="services__link link--hover" href="https://status.minter.network/testnet" target="_blank">Status</a>
<a class="services__link link--hover" :href="`https://status.minter.network${isTestnet ? '/testnet' : ''}`" target="_blank">Status</a>
</li>
<li class="u-cell services__item--next-row">
<a class="services__link link--hover" href="https://testnet.explorer.minter.network" target="_blank">Explorer</a>
<a class="services__link link--hover" :href="`https://${isTestnet ? 'testnet.': ''}explorer.minter.network`" target="_blank">Explorer</a>
</li>
<li class="u-cell">
<a class="services__link link--hover" href="https://minterteam.github.io/minter-go-node-docs/#tag/Node-API" target="_blank">API</a>
Expand Down
8 changes: 7 additions & 1 deletion layouts/nonAuth.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script>
import {NETWORK, TESTNET} from '~/assets/variables';
import Snackbar from '~/components/Snackbar';
import Language from '~/layouts/_language';
import Footer from '~/layouts/_footer';
Expand All @@ -9,6 +10,11 @@
Language,
Footer,
},
computed: {
isTestnet() {
return NETWORK === TESTNET;
},
},
};
</script>

Expand All @@ -18,7 +24,7 @@
<div class="header__container u-container u-container--medium">
<nuxt-link class="header__logo no-link" :to="preferredPath('index')">
<img class="header__logo-image" src="/img/minter-logo-circle.svg" alt="Minter" width="36" height="36">
<div class="header__logo-text">{{ $store.state.sectionName || 'Console' }}</div>
<div class="header__logo-text">{{ $store.state.sectionName || `${this.isTestnet ? 'Testnet ' : '' }Console` }}</div>
</nuxt-link>

<Language/>
Expand Down
11 changes: 6 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@material/list": "^1.1.1",
"@material/menu": "^1.1.1",
"@material/snackbar": "^1.1.1",
"@minterteam/footer-links": "^3.0.0",
"aes-js": "^3.1.2",
"axios": "^0.18.0",
"clipbrd": "^1.0.2",
Expand All @@ -37,7 +38,6 @@
"entity-decode": "^2.0.2",
"js-cookie": "^2.2.0",
"lodash-es": "^4.17.11",
"minter-footer-links": "github:MinterTeam/minter-footer-links#v2.2.0",
"minter-js-org": "^0.3.0",
"minter-js-sdk": "^0.14.1",
"minterjs-tx": "^4.5.0",
Expand Down Expand Up @@ -97,7 +97,12 @@
"node_modules/@nuxtjs/youch/src/resources/**/*"
],
"scripts": [],
"targets": ["macos-x64", "linux-x64", "win-x64", "win-x86"]
"targets": [
"macos-x64",
"linux-x64",
"win-x64",
"win-x86"
]
},
"browserslist": [
"> 0.5%",
Expand Down
10 changes: 7 additions & 3 deletions pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import {mapGetters} from 'vuex';
import getTitle from '~/assets/get-title';
import {NETWORK, TESTNET} from '~/assets/variables';
import AuthSignInForm from "~/components/AuthSignInForm";
import AuthRegisterForm from "~/components/AuthRegisterForm";
import AuthAdvancedForm from "~/components/AuthAdvancedForm";
Expand All @@ -26,7 +27,7 @@
},
head() {
const title = getTitle(null, this.$i18n.locale);
const description = this.$td('Minter Console is by far the most advanced part of our project that lets you manage all your activities on our test network.', 'index.seo-description');
const description = this.$td(`Minter Console is by far the most advanced part of our project that lets you manage all your activities on our ${this.isTestnet ? 'test ' : ''}network.`, this.isTestnet ? 'index.seo-description-testnet' : 'index.seo-description');
const localeSuffix = this.$i18n.locale === 'en' ? '' : '-' + this.$i18n.locale;
return {
Expand Down Expand Up @@ -59,6 +60,9 @@
},
computed: {
...mapGetters(['isAuthorized']),
isTestnet() {
return NETWORK === TESTNET;
},
},
methods: {
Expand Down Expand Up @@ -204,10 +208,10 @@
<p>{{ $td('Keep in mind that even without a Minter account, you still can use the following services and software:', 'index.links-description') }}</p>
<ul class="services__list--horizontal no-list u-grid u-grid--vertical-margin--small">
<li class="services__item u-cell u-cell--1-2 u-cell--small--1-3">
<a class="services__link link--hover" href="https://status.minter.network/testnet" target="_blank">{{ $td('Status', 'index.links-status') }}</a>
<a class="services__link link--hover" :href="`https://status.minter.network${isTestnet ? '/testnet' : ''}`" target="_blank">{{ $td('Status', 'index.links-status') }}</a>
</li>
<li class="services__item u-cell u-cell--1-2 u-cell--small--1-3 services__item--next-row">
<a class="services__link link--hover" href="https://testnet.explorer.minter.network" target="_blank">{{ $td('Explorer', 'index.links-explorer') }}</a>
<a class="services__link link--hover" :href="`https://${isTestnet ? 'testnet.': ''}explorer.minter.network`" target="_blank">{{ $td('Explorer', 'index.links-explorer') }}</a>
</li>
<li class="services__item u-cell u-cell--1-2 u-cell--small--1-3">
<a class="services__link link--hover" href="https://minterteam.github.io/minter-go-node-docs/#tag/Node-API" target="_blank" rel="noopener">API</a>
Expand Down
6 changes: 5 additions & 1 deletion pages/wallet/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import {getAddressTransactionList} from "~/api";
import getTitle from '~/assets/get-title';
import {pretty} from '~/assets/utils';
import {NETWORK, TESTNET} from '~/assets/variables';
import ButtonCopyIcon from '~/components/ButtonCopyIcon';
import CoinSendForm from '~/components/CoinSendForm';
import CoinList from '~/components/CoinList';
Expand Down Expand Up @@ -40,7 +41,7 @@
},
head() {
const title = getTitle(this.$store.state.sectionName, this.$i18n.locale);
const description = this.$td('Transact MNT and other coins issued in the Minter test network. Almost instantly and fee-free.', 'wallet.seo-description');
const description = this.$td(`Transact MNT and other coins issued in the Minter ${this.isTestnet ? 'test ': ''}network. Almost instantly and fee-free.`, this.isTestnet ? 'wallet.seo-description-testnet' : 'wallet.seo-description');
const localeSuffix = this.$i18n.locale === 'en' ? '' : '-' + this.$i18n.locale;
return {
Expand All @@ -65,6 +66,9 @@
'addressUrl',
'baseCoin',
]),
isTestnet() {
return NETWORK === TESTNET;
},
},
mounted() {
balanceInterval = setInterval(() => {
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
// for WebStorm
alias: {
'~': path.resolve(__dirname),
'@': path.resolve(__dirname),
// '@': path.resolve(__dirname),
},
},
};
};

0 comments on commit 2d5cfcb

Please sign in to comment.