mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 01:25:17 +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
@ -47,11 +47,11 @@ let MediaContainer = React.createClass({
|
||||
return (
|
||||
<div>
|
||||
<MediaPlayer
|
||||
mimetype={mimetype}
|
||||
preview={thumbnail}
|
||||
url={this.props.content.digital_work.url}
|
||||
extraData={extraData}
|
||||
encodingStatus={this.props.content.digital_work.isEncoding} />
|
||||
mimetype={mimetype}
|
||||
preview={thumbnail}
|
||||
url={this.props.content.digital_work.url}
|
||||
extraData={extraData}
|
||||
encodingStatus={this.props.content.digital_work.isEncoding} />
|
||||
<p className="text-center">
|
||||
<AclProxy
|
||||
aclObject={this.props.content.acl}
|
||||
|
@ -6,6 +6,8 @@ import PieceActions from '../../actions/piece_actions';
|
||||
import PieceStore from '../../stores/piece_store';
|
||||
|
||||
import Piece from './piece';
|
||||
import CollapsibleParagraph from './../ascribe_collapsible/collapsible_paragraph';
|
||||
import FurtherDetails from './further_details';
|
||||
|
||||
import AppConstants from '../../constants/application_constants';
|
||||
|
||||
@ -46,7 +48,21 @@ let PieceContainer = React.createClass({
|
||||
return (
|
||||
<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 {
|
||||
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="row">
|
||||
<div className="col-xs-12 wp-landing-wrapper">
|
||||
<h1>Sluice Art Prize 2015</h1>
|
||||
<h1>Sluice_screens ↄc Prize 2015</h1>
|
||||
<p>
|
||||
This is the submission page for sluice art fair price 2015.
|
||||
This is the submission page for Sluice_screens ↄc Prize 2015.
|
||||
</p>
|
||||
<ButtonGroup className="enter" bsSize="large" vertical block>
|
||||
<ButtonLink to="signup">
|
||||
Signup to the prize
|
||||
Signup to submit
|
||||
</ButtonLink>
|
||||
|
||||
<p>
|
||||
or, already an ascribe user?
|
||||
</p>
|
||||
<ButtonLink to="login">
|
||||
Login with ascribe
|
||||
Login to submit
|
||||
</ButtonLink>
|
||||
</ButtonGroup>
|
||||
</div>
|
||||
|
@ -32,7 +32,7 @@ let SignupContainer = React.createClass({
|
||||
return (
|
||||
<div className="ascribe-login-wrapper">
|
||||
<SignupForm
|
||||
headerMessage="Sign up to the prize"
|
||||
headerMessage="Create account for submission"
|
||||
submitMessage="Sign up"
|
||||
handleSuccess={this.handleSuccess} />
|
||||
</div>
|
||||
|
@ -9,7 +9,7 @@ import SignupContainer from './components/signup_container';
|
||||
import PasswordResetContainer from '../../../components/password_reset_container';
|
||||
import PrizeRegisterPiece from './components/register_piece';
|
||||
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 SettingsContainer from '../../../components/settings_container';
|
||||
|
||||
@ -29,7 +29,7 @@ function getRoutes(commonRoutes) {
|
||||
<Route name="password_reset" path="password_reset" handler={PasswordResetContainer} />
|
||||
<Route name="register_piece" path="register_piece" handler={PrizeRegisterPiece} />
|
||||
<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="settings" path="settings" handler={SettingsContainer} />
|
||||
</Route>
|
||||
|
Loading…
Reference in New Issue
Block a user