1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +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 <ModalWrapper
trigger={ trigger={
<Button bsStyle="danger" className="btn-delete pull-center" bsSize="small" type="submit"> <Button bsStyle="danger" className="btn-delete pull-center" bsSize="small" type="submit">
REQUEST UNCONSIGN {getLangText('REQUEST UNCONSIGN')}
</Button> </Button>
} }
handleSuccess={handleSuccess} handleSuccess={handleSuccess}
title='Request to Un-Consign'> title={getLangText('Request to Un-Consign')}>
<UnConsignRequestForm <UnConsignRequestForm
url={ApiUrls.ownership_unconsigns_request} url={ApiUrls.ownership_unconsigns_request}
id={{'bitcoin_id': edition.bitcoin_id}} id={{'bitcoin_id': edition.bitcoin_id}}

View File

@ -112,7 +112,7 @@ let Edition = React.createClass({
</CollapsibleParagraph> </CollapsibleParagraph>
<CollapsibleParagraph <CollapsibleParagraph
title="Notes" title={getLangText('Notes')}
show={!!(currentUser.username || edition.acl.acl_edit || edition.public_note)}> show={!!(currentUser.username || edition.acl.acl_edit || edition.public_note)}>
<Note <Note
id={() => {return {'bitcoin_id': edition.bitcoin_id}; }} 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"> <Col md={12} className="ascribe-edition-personal-note">
<PieceExtraDataForm <PieceExtraDataForm
name='artist_contact_info' name='artist_contact_info'
title='Artist Contact Info' title={getLangText('Artist Contact Info')}
convertLinks convertLinks
editable={editable} editable={editable}
extraData={extraData} extraData={extraData}
@ -73,14 +73,14 @@ let FurtherDetails = React.createClass({
pieceId={pieceId} /> pieceId={pieceId} />
<PieceExtraDataForm <PieceExtraDataForm
name='display_instructions' name='display_instructions'
title='Display Instructions' title={getLangText('Display Instructions')}
editable={editable} editable={editable}
extraData={extraData} extraData={extraData}
handleSuccess={this.showNotification} handleSuccess={this.showNotification}
pieceId={pieceId} /> pieceId={pieceId} />
<PieceExtraDataForm <PieceExtraDataForm
name='technology_details' name='technology_details'
title='Technology Details' title={getLangText('Technology Details')}
editable={editable} editable={editable}
extraData={extraData} extraData={extraData}
handleSuccess={this.showNotification} handleSuccess={this.showNotification}

View File

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

View File

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

View File

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

View File

@ -112,7 +112,7 @@ let APISettings = React.createClass({
<hr /> <hr />
</Form> </Form>
<pre> <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> </pre>
{this.getApplications()} {this.getApplications()}
</CollapsibleParagraph> </CollapsibleParagraph>

View File

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

View File

@ -126,7 +126,7 @@ let PasswordResetForm = React.createClass({
handleSuccess() { handleSuccess() {
this.history.push('/collection'); 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); GlobalNotificationActions.appendGlobalNotification(notification);
}, },

View File

@ -3,6 +3,17 @@
import React from 'react'; import React from 'react';
import { Route, IndexRoute } from 'react-router'; 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 SPLanding from './simple_prize/components/prize_landing';
import SPLoginContainer from './simple_prize/components/prize_login_container'; import SPLoginContainer from './simple_prize/components/prize_login_container';
import SPSignupContainer from './simple_prize/components/prize_signup_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 SPPieceList from './simple_prize/components/prize_piece_list';
import SPPieceContainer from './simple_prize/components/ascribe_detail/prize_piece_container'; import SPPieceContainer from './simple_prize/components/ascribe_detail/prize_piece_container';
import SPSettingsContainer from './simple_prize/components/prize_settings_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'; 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 PRLanding from './portfolioreview/components/pr_landing';
import PRRegisterPiece from './portfolioreview/components/pr_register_piece'; import PRRegisterPiece from './portfolioreview/components/pr_register_piece';
import EditionContainer from '../../ascribe_detail/edition_container'; import { getLangText } from '../../../utils/lang_utils';
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';
const ROUTES = { const ROUTES = {
@ -57,12 +60,12 @@ const ROUTES = {
<Route <Route
path='register_piece' path='register_piece'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPRegisterPiece)} component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPRegisterPiece)}
headerTitle='+ NEW WORK' headerTitle={getLangText('+ NEW WORK')}
hideFooter /> hideFooter />
<Route <Route
path='collection' path='collection'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPPieceList)} component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPPieceList)}
headerTitle='COLLECTION' headerTitle={getLangText('COLLECTION')}
hideFooter /> hideFooter />
<Route <Route
path='pieces/:pieceId' path='pieces/:pieceId'
@ -94,7 +97,7 @@ const ROUTES = {
<Route <Route
path='collection' path='collection'
component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPPieceList)} component={ProxyHandler(AuthRedirect({to: '/login', when: 'loggedOut'}))(SPPieceList)}
headerTitle='SUBMISSIONS' headerTitle={getLangText('SUBMISSIONS')}
hideFooter /> hideFooter />
<Route <Route
path='login' path='login'

View File

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

View File

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