From ea9fb306c4359ca18e2fe8b280e5647c4943e483 Mon Sep 17 00:00:00 2001 From: diminator Date: Fri, 21 Aug 2015 16:22:08 +0200 Subject: [PATCH 1/3] add request action loan to piece --- js/components/ascribe_detail/edition.js | 79 ------------------------- 1 file changed, 79 deletions(-) diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index a2156eb0..c48b729c 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -107,7 +107,6 @@ let Edition = React.createClass({ }, render() { - console.log(!!this.props.edition.public_note || this.props.edition.acl.acl_edit) return ( @@ -315,84 +314,6 @@ let EditionSummary = React.createClass({ }); -let EditionPersonalNote = React.createClass({ - propTypes: { - edition: React.PropTypes.object, - currentUser: React.PropTypes.object, - handleSuccess: React.PropTypes.func - }, - showNotification(){ - this.props.handleSuccess(); - let notification = new GlobalNotificationModel(getLangText('Private note saved'), 'success'); - GlobalNotificationActions.appendGlobalNotification(notification); - }, - - render() { - if (this.props.currentUser.username && true || false) { - return ( -
- - - - -
-
- ); - } - return null; - } -}); - -let EditionPublicEditionNote = React.createClass({ - propTypes: { - edition: React.PropTypes.object, - handleSuccess: React.PropTypes.func - }, - showNotification(){ - this.props.handleSuccess(); - let notification = new GlobalNotificationModel(getLangText('Public note saved'), 'success'); - GlobalNotificationActions.appendGlobalNotification(notification); - }, - render() { - let isEditable = this.props.edition.acl.acl_edit; - if (isEditable || this.props.edition.public_note){ - return ( -
- - - - -
-
- ); - } - return null; - } -}); - let CoaDetails = React.createClass({ propTypes: { edition: React.PropTypes.object From 33cd23d11eb7fa67d9d5736f98e1f1bb20df7a6c Mon Sep 17 00:00:00 2001 From: diminator Date: Fri, 21 Aug 2015 16:38:18 +0200 Subject: [PATCH 2/3] getlangtext --- js/components/ascribe_detail/edition.js | 9 ++++----- js/components/ascribe_detail/note.js | 4 ++-- js/components/ascribe_detail/piece_container.js | 8 ++++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index c48b729c..2675d804 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -25,7 +25,6 @@ import CollapsibleParagraph from './../ascribe_collapsible/collapsible_paragraph import Form from './../ascribe_forms/form'; import Property from './../ascribe_forms/property'; import EditionDetailProperty from './detail_property'; -import InputTextAreaToggable from './../ascribe_forms/input_textarea_toggable'; import EditionFurtherDetails from './further_details'; @@ -163,19 +162,19 @@ let Edition = React.createClass({ id={this.getId} label={getLangText('Personal note (private)')} defaultValue={this.props.edition.private_note ? this.props.edition.private_note : null} - placeholder='Enter your comments ...' + placeholder={getLangText('Enter your comments ...')} editable={true} - successMessage='Private note saved' + successMessage={getLangText('Private note saved')} url={ApiUrls.note_private_edition} currentUser={this.state.currentUser}/> diff --git a/js/components/ascribe_detail/note.js b/js/components/ascribe_detail/note.js index e41a3184..b22d9602 100644 --- a/js/components/ascribe_detail/note.js +++ b/js/components/ascribe_detail/note.js @@ -28,8 +28,8 @@ let Note = React.createClass({ return { editable: true, show: true, - placeholder: 'Enter a note', - successMessage: 'Note saved' + placeholder: getLangText('Enter a note'), + successMessage: getLangText('Note saved') }; }, diff --git a/js/components/ascribe_detail/piece_container.js b/js/components/ascribe_detail/piece_container.js index 97cd76c1..fa17d82c 100644 --- a/js/components/ascribe_detail/piece_container.js +++ b/js/components/ascribe_detail/piece_container.js @@ -196,21 +196,21 @@ let PieceContainer = React.createClass({ history={this.state.piece.loan_history} /> 0 || this.state.piece.other_data.length > 0} From 8b6c5e6e0f9467ddbfd5f08ebf803ba5c5db3cbb Mon Sep 17 00:00:00 2001 From: diminator Date: Fri, 21 Aug 2015 16:39:06 +0200 Subject: [PATCH 3/3] username boolean --- js/components/ascribe_detail/note.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/components/ascribe_detail/note.js b/js/components/ascribe_detail/note.js index b22d9602..0f32e5da 100644 --- a/js/components/ascribe_detail/note.js +++ b/js/components/ascribe_detail/note.js @@ -39,7 +39,7 @@ let Note = React.createClass({ }, render() { - if ((this.props.currentUser.username && true || false) && this.props.show) { + if (!!this.props.currentUser.username && this.props.show) { return (