1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 09:23:13 +01:00

Merge pull request #154 from ascribe/fix-getlangtext

Fix missing cases of getLangText
This commit is contained in:
Tim Daubenschütz 2016-02-09 09:25:49 +01:00
commit 8b0f27a17d
13 changed files with 67 additions and 61 deletions

View File

@ -25,11 +25,11 @@ let UnConsignRequestButton = React.createClass({
<ModalWrapper
trigger={
<Button bsStyle="danger" className="btn-delete pull-center" bsSize="small" type="submit">
REQUEST UNCONSIGN
{getLangText('REQUEST UNCONSIGN')}
</Button>
}
handleSuccess={handleSuccess}
title='Request to Un-Consign'>
title={getLangText('Request to Un-Consign')}>
<UnConsignRequestForm
url={ApiUrls.ownership_unconsigns_request}
id={{'bitcoin_id': edition.bitcoin_id}}

View File

@ -112,7 +112,7 @@ let Edition = React.createClass({
</CollapsibleParagraph>
<CollapsibleParagraph
title="Notes"
title={getLangText('Notes')}
show={!!(currentUser.username || edition.acl.acl_edit || edition.public_note)}>
<Note
id={() => {return {'bitcoin_id': edition.bitcoin_id}; }}

View File

@ -65,7 +65,7 @@ let FurtherDetails = React.createClass({
<Col md={12} className="ascribe-edition-personal-note">
<PieceExtraDataForm
name='artist_contact_info'
title='Artist Contact Info'
title={getLangText('Artist Contact Info')}
convertLinks
editable={editable}
extraData={extraData}
@ -73,14 +73,14 @@ let FurtherDetails = React.createClass({
pieceId={pieceId} />
<PieceExtraDataForm
name='display_instructions'
title='Display Instructions'
title={getLangText('Display Instructions')}
editable={editable}
extraData={extraData}
handleSuccess={this.showNotification}
pieceId={pieceId} />
<PieceExtraDataForm
name='technology_details'
title='Technology Details'
title={getLangText('Technology Details')}
editable={editable}
extraData={extraData}
handleSuccess={this.showNotification}

View File

@ -224,7 +224,7 @@ let Form = React.createClass({
<Button
className="btn btn-danger btn-delete btn-sm ascribe-margin-1px"
type="reset">
CANCEL
{getLangText('CANCEL')}
</Button>
</p>
</div>

View File

@ -54,8 +54,7 @@ let SendContractAgreementForm = React.createClass({
},
handleSubmitSuccess() {
let notification = 'Contract agreement sent';
notification = new GlobalNotificationModel(notification, 'success', 10000);
const notification = new GlobalNotificationModel(getLangText('Contract agreement sent'), 'success', 10000);
GlobalNotificationActions.appendGlobalNotification(notification);
this.history.push('/collection');
@ -89,13 +88,14 @@ let SendContractAgreementForm = React.createClass({
);
})}
</select>
</Property>);
</Property>
);
}
return null;
},
render() {
if (this.state.contractList && this.state.contractList.length > 0) {
if (this.state.contractList && this.state.contractList.length) {
return (
<Form
className="ascribe-form-bordered ascribe-form-wrapper"
@ -139,16 +139,15 @@ let SendContractAgreementForm = React.createClass({
</Property>
</Form>
);
}
return (
<div>
} else {
return (
<p className="text-center">
{getLangText('No contracts uploaded yet, please go to the ')}
<a href="contract_settings">{getLangText('contract settings page')}</a>
{getLangText(' and create them.')}
</p>
</div>
);
);
}
}
});

View File

@ -43,7 +43,7 @@ let ShareForm = React.createClass({
<Button
className="btn btn-default btn-sm ascribe-margin-1px"
type="submit">
SHARE
{getLangText('SHARE')}
</Button>
</p>
</div>}

View File

@ -57,7 +57,7 @@ let APISettings = React.createClass({
},
getApplications(){
let content = <AscribeSpinner color='dark-blue' size='lg'/>;
let content = <AscribeSpinner color='dark-blue' size='lg' />;
if (this.state.applications.length > -1) {
content = this.state.applications.map(function(app, i) {
@ -107,12 +107,12 @@ let APISettings = React.createClass({
<input
type="text"
placeholder={getLangText('Enter the name of your app')}
required/>
required />
</Property>
<hr />
</Form>
<pre>
Usage: curl &lt;url&gt; -H 'Authorization: Bearer &lt;token&gt;'
{getLangText('Usage:')} curl &lt;url&gt; -H 'Authorization: Bearer &lt;token&gt;'
</pre>
{this.getApplications()}
</CollapsibleParagraph>

View File

@ -131,13 +131,13 @@ let WebhookSettings = React.createClass({
defaultExpanded={this.props.defaultExpanded}>
<div>
<p>
Webhooks allow external services to receive notifications from ascribe.
Currently we support webhook notifications when someone transfers, consigns, loans or shares
(by email) a work to you.
{getLangText('Webhooks allow external services to receive notifications from ascribe. ' +
'Currently we support webhook notifications when someone transfers, consigns, ' +
'loans or shares (by email) a work to you.')}
</p>
<p>
To get started, simply choose the prefered action that you want to be notified upon and supply
a target url.
{getLangText('To get started, simply choose the prefered action that you want to be ' +
'notified upon and supply a target url.')}
</p>
</div>
<AclProxy show={this.state.webhookEvents && this.state.webhookEvents.length > 0}>

View File

@ -126,7 +126,7 @@ let PasswordResetForm = React.createClass({
handleSuccess() {
this.history.push('/collection');
const notification = new GlobalNotificationModel(getLangText('password successfully updated'), 'success', 10000);
const notification = new GlobalNotificationModel(getLangText('Password successfully updated'), 'success', 10000);
GlobalNotificationActions.appendGlobalNotification(notification);
},

View File

@ -3,6 +3,17 @@
import React from 'react';
import { Route, IndexRoute } from 'react-router';
import { ProxyHandler, AuthRedirect } from '../../../components/ascribe_routes/proxy_handler';
import { AuthPrizeRoleRedirect } from './portfolioreview/components/pr_routes/pr_proxy_handler';
// General components
import EditionContainer from '../../ascribe_detail/edition_container';
import LogoutContainer from '../../logout_container';
import PasswordResetContainer from '../../password_reset_container';
import CoaVerifyContainer from '../../coa_verify_container';
import ErrorNotFoundPage from '../../error_not_found_page';
import SPApp from './simple_prize/prize_app';
import SPLanding from './simple_prize/components/prize_landing';
import SPLoginContainer from './simple_prize/components/prize_login_container';
import SPSignupContainer from './simple_prize/components/prize_signup_container';
@ -10,7 +21,6 @@ import SPRegisterPiece from './simple_prize/components/prize_register_piece';
import SPPieceList from './simple_prize/components/prize_piece_list';
import SPPieceContainer from './simple_prize/components/ascribe_detail/prize_piece_container';
import SPSettingsContainer from './simple_prize/components/prize_settings_container';
import SPApp from './simple_prize/prize_app';
import SluicePieceContainer from './sluice/components/sluice_detail/sluice_piece_container';
@ -18,14 +28,7 @@ import PRApp from './portfolioreview/pr_app';
import PRLanding from './portfolioreview/components/pr_landing';
import PRRegisterPiece from './portfolioreview/components/pr_register_piece';
import EditionContainer from '../../ascribe_detail/edition_container';
import LogoutContainer from '../../logout_container';
import PasswordResetContainer from '../../password_reset_container';
import CoaVerifyContainer from '../../coa_verify_container';
import ErrorNotFoundPage from '../../error_not_found_page';
import { ProxyHandler, AuthRedirect } from '../../../components/ascribe_routes/proxy_handler';
import { AuthPrizeRoleRedirect } from './portfolioreview/components/pr_routes/pr_proxy_handler';
import { getLangText } from '../../../utils/lang_utils';
const ROUTES = {
@ -57,12 +60,12 @@ const ROUTES = {
<Route
path='register_piece'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPRegisterPiece)}
headerTitle='+ NEW WORK'
headerTitle={getLangText('+ NEW WORK')}
hideFooter />
<Route
path='collection'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPPieceList)}
headerTitle='COLLECTION'
headerTitle={getLangText('COLLECTION')}
hideFooter />
<Route
path='pieces/:pieceId'
@ -94,7 +97,7 @@ const ROUTES = {
<Route
path='collection'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPPieceList)}
headerTitle='SUBMISSIONS'
headerTitle={getLangText('SUBMISSIONS')}
hideFooter />
<Route
path='login'

View File

@ -66,7 +66,7 @@ let PrizeSettings = React.createClass({
render() {
return (
<CollapsibleParagraph
title={'Prize Settings for ' + this.state.prize.name}
title={getLangText('Prize Settings for ') + this.state.prize.name}
defaultExpanded={true}>
<Form >
<Property

View File

@ -3,7 +3,9 @@
import React from 'react';
import { Route, IndexRoute } from 'react-router';
// general components
import { ProxyHandler, AuthRedirect } from '../../../components/ascribe_routes/proxy_handler';
// General components
import CoaVerifyContainer from '../../../components/coa_verify_container';
import LoginContainer from '../../../components/login_container';
import LogoutContainer from '../../../components/logout_container';
@ -44,10 +46,10 @@ import PollineLanding from './components/polline/polline_landing';
import ArtcityLanding from './components/artcity/artcity_landing';
import { ProxyHandler, AuthRedirect } from '../../../components/ascribe_routes/proxy_handler';
import WalletApp from './wallet_app';
import { getLangText } from '../../../utils/lang_utils';
let ROUTES = {
'cyland': (
@ -82,13 +84,13 @@ let ROUTES = {
<Route
path='register_piece'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(CylandRegisterPiece)}
headerTitle='+ NEW WORK'
headerTitle={getLangText('+ NEW WORK')}
aclName='acl_wallet_submit'
hideFooter />
<Route
path='collection'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(CylandPieceList)}
headerTitle='COLLECTION'
headerTitle={getLangText('COLLECTION')}
disableOn='noPieces'
hideFooter />
<Route
@ -138,12 +140,12 @@ let ROUTES = {
<Route
path='register_piece'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(CCRegisterPiece)}
headerTitle='+ NEW WORK'
headerTitle={getLangText('+ NEW WORK')}
hideFooter />
<Route
path='collection'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(PieceList)}
headerTitle='COLLECTION'
headerTitle={getLangText('COLLECTION')}
disableOn='noPieces'
hideFooter />
<Route
@ -196,19 +198,19 @@ let ROUTES = {
<Route
path='request_loan'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SendContractAgreementForm)}
headerTitle='SEND NEW CONTRACT'
headerTitle={getLangText('SEND NEW CONTRACT')}
aclName='acl_create_contractagreement'
hideFooter />
<Route
path='register_piece'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(IkonotvRegisterPiece)}
headerTitle='+ NEW WORK'
headerTitle={getLangText('+ NEW WORK')}
aclName='acl_wallet_submit'
hideFooter />
<Route
path='collection'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(IkonotvPieceList)}
headerTitle='COLLECTION'
headerTitle={getLangText('COLLECTION')}
disableOn='noPieces'
hideFooter />
<Route
@ -265,13 +267,13 @@ let ROUTES = {
<Route
path='register_piece'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(MarketRegisterPiece)}
headerTitle='+ NEW WORK'
headerTitle={getLangText('+ NEW WORK')}
aclName='acl_wallet_submit'
hideFooter />
<Route
path='collection'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(MarketPieceList)}
headerTitle='COLLECTION'
headerTitle={getLangText('COLLECTION')}
disableOn='noPieces'
hideFooter />
<Route
@ -323,13 +325,13 @@ let ROUTES = {
<Route
path='register_piece'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(MarketRegisterPiece)}
headerTitle='+ NEW WORK'
headerTitle={getLangText('+ NEW WORK')}
aclName='acl_wallet_submit'
hideFooter />
<Route
path='collection'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(Vivi23PieceList)}
headerTitle='COLLECTION'
headerTitle={getLangText('COLLECTION')}
disableOn='noPieces'
hideFooter />
<Route
@ -374,12 +376,12 @@ let ROUTES = {
<Route
path='register_piece'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(MarketRegisterPiece)}
headerTitle='+ NEW WORK'
headerTitle={getLangText('+ NEW WORK')}
aclName='acl_wallet_submit' />
<Route
path='collection'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(MarketPieceList)}
headerTitle='COLLECTION'
headerTitle={getLangText('COLLECTION')}
disableOn='noPieces' />
<Route path='pieces/:pieceId' component={MarketPieceContainer} />
<Route path='editions/:editionId' component={MarketEditionContainer} />
@ -411,12 +413,12 @@ let ROUTES = {
<Route
path='register_piece'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(MarketRegisterPiece)}
headerTitle='+ NEW WORK'
headerTitle={getLangText('+ NEW WORK')}
aclName='acl_wallet_submit' />
<Route
path='collection'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(MarketPieceList)}
headerTitle='COLLECTION'
headerTitle={getLangText('COLLECTION')}
disableOn='noPieces' />
<Route path='pieces/:pieceId' component={MarketPieceContainer} />
<Route path='editions/:editionId' component={MarketEditionContainer} />

View File

@ -27,6 +27,8 @@ import RegisterPiece from './components/register_piece';
import { ProxyHandler, AuthRedirect } from './components/ascribe_routes/proxy_handler';
import { getLangText } from './utils/lang_utils';
const COMMON_ROUTES = (
<Route path='/' component={AscribeApp}>
@ -36,11 +38,11 @@ const COMMON_ROUTES = (
<Route
path='register_piece'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(RegisterPiece)}
headerTitle='+ NEW WORK' />
headerTitle={getLangText('+ NEW WORK')} />
<Route
path='collection'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(PieceList)}
headerTitle='COLLECTION'
headerTitle={getLangText('COLLECTION')}
disableOn='noPieces' />
<Route
path='signup'