1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 09:35:10 +01:00

add licences for cc

This commit is contained in:
Tim Daubenschütz 2015-07-15 11:28:53 +02:00
parent ea871f3d1d
commit e3e8f088c7
4 changed files with 30 additions and 17 deletions

View File

@ -13,6 +13,9 @@ import CreateEditionsForm from '../ascribe_forms/create_editions_form';
import PieceListActions from '../../actions/piece_list_actions'; import PieceListActions from '../../actions/piece_list_actions';
import PieceListStore from '../../stores/piece_list_store'; import PieceListStore from '../../stores/piece_list_store';
import WhitelabelStore from '../../stores/whitelabel_store';
import WhitelabelActions from '../../actions/whitelabel_actions';
import EditionListActions from '../../actions/edition_list_actions'; import EditionListActions from '../../actions/edition_list_actions';
import GlobalNotificationModel from '../../models/global_notification_model'; import GlobalNotificationModel from '../../models/global_notification_model';
@ -40,16 +43,19 @@ let AccordionListItem = React.createClass({
{ {
showCreateEditionsDialog: false showCreateEditionsDialog: false
}, },
PieceListStore.getState() PieceListStore.getState(),
WhitelabelStore.getState()
); );
}, },
componentDidMount() { componentDidMount() {
PieceListStore.listen(this.onChange); PieceListStore.listen(this.onChange);
WhitelabelStore.listen(this.onChange);
}, },
componentWillUnmount() { componentWillUnmount() {
PieceListStore.unlisten(this.onChange); PieceListStore.unlisten(this.onChange);
WhitelabelStore.unlisten(this.onChange);
}, },
onChange(state) { onChange(state) {
@ -111,6 +117,17 @@ let AccordionListItem = React.createClass({
} }
}, },
getLicences() {
// convert this to acl_view_licences later
if(this.state.whitelabel.name === 'Creative Commons France') {
return (
<a href={this.props.content.license_type.url} target="_blank" className="pull-right">
{getLangText('%s license', this.props.content.license_type.code)}
</a>
);
}
},
render() { render() {
let linkData; let linkData;
@ -173,6 +190,7 @@ let AccordionListItem = React.createClass({
{getLangText('Submitted to prize')} <span className="glyphicon glyphicon-ok" aria-hidden="true"></span> {getLangText('Submitted to prize')} <span className="glyphicon glyphicon-ok" aria-hidden="true"></span>
</button> </button>
</AclProxy> </AclProxy>
{this.getLicences()}
</div> </div>
</div> </div>
<span style={{'clear': 'both'}}></span> <span style={{'clear': 'both'}}></span>

View File

@ -58,12 +58,9 @@ let SignupForm = React.createClass({
}, },
handleSuccess(response){ handleSuccess(response){
let notification = new GlobalNotificationModel(getLangText('Sign up successful'), 'success', 50000);
let notificationText = getLangText('Sign up successful');
let notification = new GlobalNotificationModel(notificationText, 'success', 50000);
GlobalNotificationActions.appendGlobalNotification(notification); GlobalNotificationActions.appendGlobalNotification(notification);
this.props.handleSuccess(getLangText('We sent an email to your address') + ' ' + response.user.email + this.props.handleSuccess(getLangText('We sent an email to your address') + ' ' + response.user.email + ', ' + getLangText('please confirm') + '.');
', ' + getLangText('please confirm') + '.');
}, },
getFormData(){ getFormData(){

View File

@ -2,9 +2,6 @@
import React from 'react'; import React from 'react';
import SignupForm from './ascribe_forms/form_signup'; import SignupForm from './ascribe_forms/form_signup';
import Property from './ascribe_forms/property';
import { getLangText } from '../utils/lang_utils';
let SignupContainer = React.createClass({ let SignupContainer = React.createClass({

View File

@ -28,15 +28,16 @@ let SignupContainer = React.createClass({
</div> </div>
</div> </div>
); );
} else {
return (
<div className="ascribe-login-wrapper">
<SignupForm
headerMessage="Sign up to the prize"
submitMessage="Sign up"
handleSuccess={this.handleSuccess} />
</div>
);
} }
return (
<div className="ascribe-login-wrapper">
<SignupForm
headerMessage="Sign up to the prize"
submitMessage="Sign up"
handleSuccess={this.handleSuccess} />
</div>
);
} }
}); });