1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 21:52:08 +02:00

piece note hidden from non-owner

This commit is contained in:
Cevo 2015-11-20 11:47:41 +01:00
parent c0e0354ce8
commit dc96e908eb

View File

@ -57,7 +57,6 @@ let PieceContainer = React.createClass({
mixins: [History], mixins: [History],
getInitialState() { getInitialState() {
console.log('Piece initially ... ', PieceStore.getState());
return mergeOptions( return mergeOptions(
UserStore.getState(), UserStore.getState(),
PieceListStore.getState(), PieceListStore.getState(),
@ -252,7 +251,6 @@ let PieceContainer = React.createClass({
} }
buttons={this.getActions()}> buttons={this.getActions()}>
{this.getCreateEditionsDialog()} {this.getCreateEditionsDialog()}
<CollapsibleParagraph <CollapsibleParagraph
title={getLangText('Loan History')} title={getLangText('Loan History')}
show={this.state.piece.loan_history && this.state.piece.loan_history.length > 0}> show={this.state.piece.loan_history && this.state.piece.loan_history.length > 0}>
@ -261,7 +259,8 @@ let PieceContainer = React.createClass({
</CollapsibleParagraph> </CollapsibleParagraph>
<CollapsibleParagraph <CollapsibleParagraph
title={getLangText('Notes')} title={getLangText('Notes')}
show={!!(this.state.currentUser.username || this.state.piece.public_note)}> show={(!!(this.state.currentUser.username || this.state.piece.public_note)) &&
(!!this.state.piece.acl.acl_edit)}>
<Note <Note
id={this.getId} id={this.getId}
label={getLangText('Personal note (private)')} label={getLangText('Personal note (private)')}
@ -276,14 +275,11 @@ let PieceContainer = React.createClass({
label={getLangText('Personal note (public)')} label={getLangText('Personal note (public)')}
defaultValue={this.state.piece.public_note || null} defaultValue={this.state.piece.public_note || null}
placeholder={getLangText('Enter your comments ...')} placeholder={getLangText('Enter your comments ...')}
editable={this.state.piece.acl.acl_edit} editable={!!this.state.piece.acl.acl_edit}
successMessage={getLangText('Public note saved')} successMessage={getLangText('Public note saved')}
url={ApiUrls.note_public_piece} url={ApiUrls.note_public_piece}
currentUser={this.state.currentUser}/> currentUser={this.state.currentUser}/>
</CollapsibleParagraph> </CollapsibleParagraph>
{console.log('hey')}
{console.log(this.state.piece)}
{console.log(this.state.piece.acl.acl_edit)}
<CollapsibleParagraph <CollapsibleParagraph
title={getLangText('Further Details')} title={getLangText('Further Details')}
show={this.state.piece.acl.acl_edit show={this.state.piece.acl.acl_edit