1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-03 18:35:09 +01:00

Merge pull request #72 from ascribe/AD-1506-cyland-loan-later-button

AD-1506 Cyland loan later button
This commit is contained in:
Brett Sun 2015-12-16 14:24:54 +01:00
commit 5e46fb5c17
10 changed files with 64 additions and 34 deletions

View File

@ -52,7 +52,7 @@ let AccordionListItemEditionWidget = React.createClass({
toggleTable() {
let pieceId = this.props.piece.id;
let isEditionListOpen = this.state.isEditionListOpenForPieceId[pieceId] ? this.state.isEditionListOpenForPieceId[pieceId].show : false;
if(isEditionListOpen) {
EditionListActions.toggleEditionList(pieceId);
} else {
@ -68,7 +68,7 @@ let AccordionListItemEditionWidget = React.createClass({
getGlyphicon() {
let pieceId = this.props.piece.id;
let isEditionListOpen = this.state.isEditionListOpenForPieceId[pieceId] ? this.state.isEditionListOpenForPieceId[pieceId].show : false;
if(isEditionListOpen) {
// this is the loading feedback for the editions
// button.
@ -118,7 +118,7 @@ let AccordionListItemEditionWidget = React.createClass({
<button
disabled
title={getLangText('All editions for this have been deleted already.')}
className={classNames('btn', 'btn-default', 'btn-secondary', 'btn-sm', 'ascribe-accordion-list-item-edition-widget', this.props.className)}>
className={classNames('btn', 'btn-secondary', 'btn-sm', 'ascribe-accordion-list-item-edition-widget', this.props.className)}>
{'0 ' + getLangText('Editions')}
</button>
);

View File

@ -25,6 +25,7 @@ import { mergeOptions } from '../../utils/general_utils';
let LoanForm = React.createClass({
propTypes: {
loanHeading: React.PropTypes.string,
buttons: React.PropTypes.element,
email: React.PropTypes.string,
gallery: React.PropTypes.string,
startDate: React.PropTypes.object,
@ -80,7 +81,11 @@ let LoanForm = React.createClass({
},
getButtons() {
if(this.props.loanHeading) {
const { buttons, loanHeading } = this.props;
if (buttons) {
return buttons;
} else if (loanHeading) {
return (
<button
type="submit"

View File

@ -47,7 +47,7 @@ let Vivi23Landing = React.createClass({
</div>
</div>
<div className="row vivi23-landing--content">
<div className="col-sm-6">
<div className="col-xs-6">
<p>
{getLangText('Existing ascribe user?')}
</p>
@ -57,7 +57,7 @@ let Vivi23Landing = React.createClass({
</Button>
</LinkContainer>
</div>
<div className="col-sm-6">
<div className="col-xs-6">
<p>
{getLangText('Do you need an account?')}
</p>

View File

@ -70,7 +70,7 @@ let CylandLanding = React.createClass({
</div>
</div>
<div className="row" style={{border: '1px solid #CCC', borderTop: 'none', padding: '2em'}}>
<div className="col-sm-6">
<div className="col-xs-6">
<p>
{getLangText('Existing ascribe user?')}
</p>
@ -80,7 +80,7 @@ let CylandLanding = React.createClass({
</Button>
</LinkContainer>
</div>
<div className="col-sm-6">
<div className="col-xs-6">
<p>
{getLangText('Do you need an account?')}
</p>

View File

@ -8,6 +8,8 @@ import Moment from 'moment';
import Col from 'react-bootstrap/lib/Col';
import Row from 'react-bootstrap/lib/Row';
import LinkContainer from 'react-router-bootstrap/lib/LinkContainer';
import RegisterPieceForm from '../../../../ascribe_forms/form_register_piece';
import WhitelabelActions from '../../../../../actions/whitelabel_actions';
@ -150,20 +152,38 @@ let CylandRegisterPiece = React.createClass({
);
},
changeSlide() {
// only transition to the login store, if user is not logged in
// ergo the currentUser object is not properly defined
if(this.state.currentUser && !this.state.currentUser.email) {
this.onLoggedOut();
}
},
render() {
const { location } = this.props;
const { currentUser, piece, step, whitelabel } = this.state;
let today = new Moment();
let datetimeWhenWeAllWillBeFlyingCoolHoverboardsAndDinosaursWillLiveAgain = new Moment();
const today = new Moment();
const datetimeWhenWeAllWillBeFlyingCoolHoverboardsAndDinosaursWillLiveAgain = new Moment();
datetimeWhenWeAllWillBeFlyingCoolHoverboardsAndDinosaursWillLiveAgain.add(1000, 'years');
const loanHeading = getLangText('Loan to Cyland archive');
const loanButtons = (
<div>
<div
className='col-xs-6 pull-left'
style={{padding: '0 2px 2px 0'}}>
<button className='btn btn-default btn-wide'>
{getLangText('Loan to archive')}
</button>
</div>
<div
className='col-xs-6 pull-right'
style={{padding: '0 0 2px 2px'}}>
<LinkContainer to='/collection'>
<button
type='button'
className='btn btn-secondary btn-wide'>
{getLangText('Loan later')}
</button>
</LinkContainer>
</div>
</div>
);
setDocumentTitle(getLangText('Register a new piece'));
return (
@ -174,18 +194,18 @@ let CylandRegisterPiece = React.createClass({
pending: 'glyphicon glyphicon-chevron-right',
completed: 'glyphicon glyphicon-lock'
}}
location={this.props.location}>
location={location}>
<div data-slide-title={getLangText('Register work')}>
<Row className="no-margin">
<Col xs={12} sm={10} md={8} smOffset={1} mdOffset={2}>
<RegisterPieceForm
disabled={this.state.step > 0}
disabled={step > 0}
enableLocalHashing={false}
headerMessage={getLangText('Submit to Cyland Archive')}
submitMessage={getLangText('Submit')}
isFineUploaderActive={true}
handleSuccess={this.handleRegisterSuccess}
location={this.props.location}/>
location={location}/>
</Col>
</Row>
</div>
@ -193,9 +213,9 @@ let CylandRegisterPiece = React.createClass({
<Row className="no-margin">
<Col xs={12} sm={10} md={8} smOffset={1} mdOffset={2}>
<CylandAdditionalDataForm
disabled={this.state.step > 1}
disabled={step > 1}
handleSuccess={this.handleAdditionalDataSuccess}
piece={this.state.piece} />
piece={piece} />
</Col>
</Row>
</div>
@ -204,15 +224,16 @@ let CylandRegisterPiece = React.createClass({
<Col xs={12} sm={10} md={8} smOffset={1} mdOffset={2}>
<LoanForm
loanHeading={getLangText('Loan to Cyland archive')}
buttons={loanButtons}
message={getAclFormMessage({
aclName: 'acl_loan',
entities: this.state.piece,
entities: piece,
isPiece: true,
senderName: this.state.currentUser.username
senderName: currentUser.username
})}
id={{piece_id: this.state.piece.id}}
id={{piece_id: piece.id}}
url={ApiUrls.ownership_loans_pieces}
email={this.state.whitelabel.user}
email={whitelabel.user}
gallery="Cyland Archive"
startDate={today}
endDate={datetimeWhenWeAllWillBeFlyingCoolHoverboardsAndDinosaursWillLiveAgain}

View File

@ -53,7 +53,7 @@ let LumenusLanding = React.createClass({
</div>
</div>
<div className="row" style={{border: '1px solid #CCC', borderTop: 'none', padding: '2em'}}>
<div className="col-sm-6">
<div className="col-xs-6">
<p>
{getLangText('Existing ascribe user?')}
</p>
@ -63,7 +63,7 @@ let LumenusLanding = React.createClass({
</Button>
</LinkContainer>
</div>
<div className="col-sm-6">
<div className="col-xs-6">
<p>
{getLangText('Do you need an account?')}
</p>

View File

@ -59,6 +59,7 @@ html {
.ascribe-default-app {
overflow-x: hidden;
padding-top: 70px;
padding-bottom: 10px;
}
hr {

View File

@ -3,6 +3,7 @@
.ascribe-prize-app {
border-radius: 0;
padding-top: 70px;
min-height: 100vh;
padding-top: 70px;
padding-bottom: 10px;
}

View File

@ -1,6 +1,7 @@
$cyland--nav-bg-color: #fcfcfc;
$cyland--nav-fg-prim-color: #1E1E1E;
$cyland--button-color: $cyland--nav-fg-prim-color;
$cyland--button-sec-color: #515151;
.client--cyland {
.navbar-default {
@ -117,8 +118,8 @@ $cyland--button-color: $cyland--nav-fg-prim-color;
&.active:hover,
&.active:focus,
&.active.focus {
background-color: $cyland--button-color;
border-color: $cyland--button-color;
background-color: $cyland--button-sec-color;
border-color: $cyland--button-sec-color;
color: white;
}
}
@ -234,4 +235,4 @@ $cyland--button-color: $cyland--nav-fg-prim-color;
.client--cyland .upload-button-wrapper > span {
color: $cyland--button-color;
}
}

View File

@ -5,6 +5,7 @@
.ascribe-wallet-app {
border-radius: 0;
padding-top: 70px;
min-height: 100vh;
padding-top: 70px;
padding-bottom: 10px;
}