mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 09:35:10 +01:00
Merge branch 'AD-499-whitelabel-prize-with-sluice-as-k' of bitbucket.org:ascribe/onion into AD-499-whitelabel-prize-with-sluice-as-k
Conflicts: js/components/ascribe_detail/media_container.js
This commit is contained in:
commit
3ad7763577
@ -6,6 +6,8 @@ import PieceActions from '../../actions/piece_actions';
|
|||||||
import PieceStore from '../../stores/piece_store';
|
import PieceStore from '../../stores/piece_store';
|
||||||
|
|
||||||
import Piece from './piece';
|
import Piece from './piece';
|
||||||
|
import CollapsibleParagraph from './../ascribe_collapsible/collapsible_paragraph';
|
||||||
|
import FurtherDetails from './further_details';
|
||||||
|
|
||||||
import AppConstants from '../../constants/application_constants';
|
import AppConstants from '../../constants/application_constants';
|
||||||
|
|
||||||
@ -46,7 +48,21 @@ let PieceContainer = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<Piece
|
<Piece
|
||||||
piece={this.state.piece}
|
piece={this.state.piece}
|
||||||
loadPiece={this.loadPiece}/>
|
loadPiece={this.loadPiece}>
|
||||||
|
<CollapsibleParagraph
|
||||||
|
title="Further Details"
|
||||||
|
show={this.state.piece.acl.acl_edit
|
||||||
|
|| Object.keys(this.state.piece.extra_data).length > 0
|
||||||
|
|| this.state.piece.other_data !== null}
|
||||||
|
defaultExpanded={true}>
|
||||||
|
<FurtherDetails
|
||||||
|
editable={this.state.piece.acl.acl_edit}
|
||||||
|
pieceId={this.state.piece.id}
|
||||||
|
extraData={this.state.piece.extra_data}
|
||||||
|
otherData={this.state.piece.other_data}
|
||||||
|
handleSuccess={this.loadPiece}/>
|
||||||
|
</CollapsibleParagraph>
|
||||||
|
</Piece>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
|
@ -0,0 +1,85 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import PieceActions from '../../../../../actions/piece_actions';
|
||||||
|
import PieceStore from '../../../../../stores/piece_store';
|
||||||
|
|
||||||
|
import Piece from '../../../../../components/ascribe_detail/piece';
|
||||||
|
|
||||||
|
import AppConstants from '../../../../../constants/application_constants';
|
||||||
|
|
||||||
|
import Form from '../../../../../components/ascribe_forms/form';
|
||||||
|
import Property from '../../../../../components/ascribe_forms/property';
|
||||||
|
import InputTextAreaToggable from '../../../../../components/ascribe_forms/input_textarea_toggable';
|
||||||
|
import CollapsibleParagraph from '../../../../../components/ascribe_collapsible/collapsible_paragraph';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the component that implements resource/data specific functionality
|
||||||
|
*/
|
||||||
|
let PieceContainer = React.createClass({
|
||||||
|
getInitialState() {
|
||||||
|
return PieceStore.getState();
|
||||||
|
},
|
||||||
|
|
||||||
|
onChange(state) {
|
||||||
|
this.setState(state);
|
||||||
|
},
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
PieceStore.listen(this.onChange);
|
||||||
|
PieceActions.fetchOne(this.props.params.pieceId);
|
||||||
|
},
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
// Every time we're leaving the piece detail page,
|
||||||
|
// just reset the piece that is saved in the piece store
|
||||||
|
// as it will otherwise display wrong/old data once the user loads
|
||||||
|
// the piece detail a second time
|
||||||
|
PieceActions.updatePiece({});
|
||||||
|
|
||||||
|
PieceStore.unlisten(this.onChange);
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
loadPiece() {
|
||||||
|
PieceActions.fetchOne(this.props.params.pieceId);
|
||||||
|
},
|
||||||
|
|
||||||
|
render() {
|
||||||
|
if('title' in this.state.piece) {
|
||||||
|
return (
|
||||||
|
<Piece
|
||||||
|
piece={this.state.piece}
|
||||||
|
loadPiece={this.loadPiece}>
|
||||||
|
<CollapsibleParagraph
|
||||||
|
title="Prize Details"
|
||||||
|
show={true}
|
||||||
|
defaultExpanded={true}>
|
||||||
|
<Form
|
||||||
|
ref='form'>
|
||||||
|
<Property
|
||||||
|
name='test'
|
||||||
|
label='test'
|
||||||
|
editable={false}>
|
||||||
|
<InputTextAreaToggable
|
||||||
|
rows={1}
|
||||||
|
editable={false}
|
||||||
|
defaultValue='test'/>
|
||||||
|
</Property>
|
||||||
|
<hr />
|
||||||
|
</Form>
|
||||||
|
</CollapsibleParagraph>
|
||||||
|
</Piece>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<div className="fullpage-spinner">
|
||||||
|
<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_medium.gif'} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export default PieceContainer;
|
@ -14,20 +14,20 @@ let Landing = React.createClass({
|
|||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-xs-12 wp-landing-wrapper">
|
<div className="col-xs-12 wp-landing-wrapper">
|
||||||
<h1>Sluice Art Prize 2015</h1>
|
<h1>Sluice_screens ↄc Prize 2015</h1>
|
||||||
<p>
|
<p>
|
||||||
This is the submission page for sluice art fair price 2015.
|
This is the submission page for Sluice_screens ↄc Prize 2015.
|
||||||
</p>
|
</p>
|
||||||
<ButtonGroup className="enter" bsSize="large" vertical block>
|
<ButtonGroup className="enter" bsSize="large" vertical block>
|
||||||
<ButtonLink to="signup">
|
<ButtonLink to="signup">
|
||||||
Signup to the prize
|
Signup to submit
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
or, already an ascribe user?
|
or, already an ascribe user?
|
||||||
</p>
|
</p>
|
||||||
<ButtonLink to="login">
|
<ButtonLink to="login">
|
||||||
Login with ascribe
|
Login to submit
|
||||||
</ButtonLink>
|
</ButtonLink>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</div>
|
</div>
|
||||||
|
@ -32,7 +32,7 @@ let SignupContainer = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<div className="ascribe-login-wrapper">
|
<div className="ascribe-login-wrapper">
|
||||||
<SignupForm
|
<SignupForm
|
||||||
headerMessage="Sign up to the prize"
|
headerMessage="Create account for submission"
|
||||||
submitMessage="Sign up"
|
submitMessage="Sign up"
|
||||||
handleSuccess={this.handleSuccess} />
|
handleSuccess={this.handleSuccess} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,7 +9,7 @@ import SignupContainer from './components/signup_container';
|
|||||||
import PasswordResetContainer from '../../../components/password_reset_container';
|
import PasswordResetContainer from '../../../components/password_reset_container';
|
||||||
import PrizeRegisterPiece from './components/register_piece';
|
import PrizeRegisterPiece from './components/register_piece';
|
||||||
import PrizePieceList from './components/piece_list';
|
import PrizePieceList from './components/piece_list';
|
||||||
import PieceContainer from '../../ascribe_detail/piece_container';
|
import PrizePieceContainer from './components/ascribe_detail/piece_container';
|
||||||
import EditionContainer from '../../ascribe_detail/edition_container';
|
import EditionContainer from '../../ascribe_detail/edition_container';
|
||||||
import SettingsContainer from '../../../components/settings_container';
|
import SettingsContainer from '../../../components/settings_container';
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ function getRoutes(commonRoutes) {
|
|||||||
<Route name="password_reset" path="password_reset" handler={PasswordResetContainer} />
|
<Route name="password_reset" path="password_reset" handler={PasswordResetContainer} />
|
||||||
<Route name="register_piece" path="register_piece" handler={PrizeRegisterPiece} />
|
<Route name="register_piece" path="register_piece" handler={PrizeRegisterPiece} />
|
||||||
<Route name="pieces" path="collection" handler={PrizePieceList} />
|
<Route name="pieces" path="collection" handler={PrizePieceList} />
|
||||||
<Route name="piece" path="pieces/:pieceId" handler={PieceContainer} />
|
<Route name="piece" path="pieces/:pieceId" handler={PrizePieceContainer} />
|
||||||
<Route name="edition" path="editions/:editionId" handler={EditionContainer} />
|
<Route name="edition" path="editions/:editionId" handler={EditionContainer} />
|
||||||
<Route name="settings" path="settings" handler={SettingsContainer} />
|
<Route name="settings" path="settings" handler={SettingsContainer} />
|
||||||
</Route>
|
</Route>
|
||||||
|
Loading…
Reference in New Issue
Block a user