1
0
mirror of https://github.com/ascribe/onion.git synced 2025-02-14 21:10:27 +01:00

cyland submit button and form WIP

cyland footers
This commit is contained in:
diminator 2015-08-18 09:42:28 +02:00
parent fc82c866fb
commit f77f1d1d5d
4 changed files with 105 additions and 24 deletions

View File

@ -4,7 +4,7 @@ import React from 'react';
import Router from 'react-router';
import Hero from './components/prize_hero';
import Header from '../../header';
// import Footer from '../../footer';
import Footer from '../../footer';
import GlobalNotification from '../../global_notification';
let RouteHandler = Router.RouteHandler;
@ -28,6 +28,7 @@ let PrizeApp = React.createClass({
</div>
<GlobalNotification />
<div id="modal" className="container"></div>
<Footer />
</div>
);
}

View File

@ -4,11 +4,11 @@ import React from 'react';
import classNames from 'classnames';
import ModalWrapper from '../../../../../ascribe_modal/modal_wrapper';
import PieceSubmitToPrizeForm from '../../../../../ascribe_forms/form_submit_to_prize';
import CylandPieceSubmitForm from '../ascribe_forms/cyland_form_submit';
import { getLangText } from '../../../../../../utils/lang_utils';
let SubmitToPrizeButton = React.createClass({
let CylandSubmitButton = React.createClass({
propTypes: {
className: React.PropTypes.string,
handleSuccess: React.PropTypes.func,
@ -16,24 +16,12 @@ let SubmitToPrizeButton = React.createClass({
},
getSubmitButton() {
if (this.props.piece.prize) {
return (
<button
disabled
className="btn btn-default btn-xs pull-right">
{getLangText('Submitted to prize')} <span className="glyphicon glyphicon-ok"
aria-hidden="true"></span>
</button>
);
}
else {
return (
<button
className={classNames('btn', 'btn-default', 'btn-xs', this.props.className)}>
{getLangText('Submit to Cyland')}
</button>
);
}
},
render() {
@ -41,8 +29,8 @@ let SubmitToPrizeButton = React.createClass({
<ModalWrapper
trigger={this.getSubmitButton()}
handleSuccess={this.props.handleSuccess}
title={getLangText('Submit to prize')}>
<PieceSubmitToPrizeForm
title={getLangText('Submit to Cyland')}>
<CylandPieceSubmitForm
piece={this.props.piece}
handleSuccess={this.props.handleSuccess}/>
</ModalWrapper>
@ -51,4 +39,4 @@ let SubmitToPrizeButton = React.createClass({
}
});
export default SubmitToPrizeButton;
export default CylandSubmitButton;

View File

@ -0,0 +1,89 @@
'use strict';
import React from 'react';
import Form from '../../../../../ascribe_forms/form';
import Property from '../../../../../ascribe_forms/property';
import InputTextAreaToggable from '../../../../../ascribe_forms/input_textarea_toggable';
import InputCheckbox from '../../../../../ascribe_forms/input_checkbox';
import Alert from 'react-bootstrap/lib/Alert';
import AppConstants from '../../../../../../constants/application_constants';
import ApiUrls from '../../../../../../constants/api_urls';
import { getLangText } from '../../../../../../utils/lang_utils.js';
import requests from '../../../../../../utils/requests';
let CylandPieceSubmitForm = React.createClass({
propTypes: {
piece: React.PropTypes.object,
handleSuccess: React.PropTypes.func
},
render() {
//return (
// <Form
// ref='form'
// url={requests.prepareUrl(ApiUrls.piece_submit_to_prize, {piece_id: this.props.piece.id})}
// handleSuccess={this.props.handleSuccess}
// buttons={
// <div className="modal-footer">
// <p className="pull-right">
// <button
// className="btn btn-default btn-sm ascribe-margin-1px"
// type="submit">
// {getLangText('SUBMIT TO PRIZE')}
// </button>
// </p>
// </div>}
// spinner={
// <div className="modal-footer">
// <img src={AppConstants.baseUrl + 'static/img/ascribe_animated_small.gif'} />
// </div>}>
// <Property
// name='artist_statement'
// label={getLangText('Artist statement')}
// editable={true}>
// <InputTextAreaToggable
// rows={1}
// editable={true}
// placeholder={getLangText('Enter your statement')}
// required="required"/>
// </Property>
// <Property
// name='work_description'
// label={getLangText('Work description')}
// editable={true}>
// <InputTextAreaToggable
// rows={1}
// editable={true}
// placeholder={getLangText('Enter the description for your work')}
// required="required"/>
// </Property>
// <Property
// name="terms"
// className="ascribe-settings-property-collapsible-toggle"
// style={{paddingBottom: 0}}>
// <InputCheckbox>
// <span>
// {' ' + getLangText('I agree to the Terms of Service the art price') + ' '}
// (<a href="https://s3-us-west-2.amazonaws.com/ascribe0/whitelabel/sluice/terms.pdf" target="_blank" style={{fontSize: '0.9em', color: 'rgba(0,0,0,0.7)'}}>
// {getLangText('read')}
// </a>)
// </span>
// </InputCheckbox>
// </Property>
// <Alert bsStyle='warning'>
// <p>{getLangText('Are you sure you want to submit to the prize?')}</p>
// <p>{getLangText('This is an irrevocable action%s', '.')}</p>
// </Alert>
// </Form>
//);
return null;
}
});
export default CylandPieceSubmitForm;

View File

@ -3,6 +3,8 @@
import React from 'react';
import Router from 'react-router';
import Header from '../../header';
import Footer from '../../footer';
import GlobalNotification from '../../global_notification';
let RouteHandler = Router.RouteHandler;
@ -15,6 +17,7 @@ let WalletApp = React.createClass({
<RouteHandler />
<GlobalNotification />
<div id="modal" className="container"></div>
<Footer />
</div>
);
}