diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index 7b89c339..a2156eb0 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -37,6 +37,8 @@ import DeleteButton from '../ascribe_buttons/delete_button'; import GlobalNotificationModel from '../../models/global_notification_model'; import GlobalNotificationActions from '../../actions/global_notification_actions'; +import Note from './note'; + import ApiUrls from '../../constants/api_urls'; import AppConstants from '../../constants/application_constants'; @@ -100,7 +102,12 @@ let Edition = React.createClass({ this.transitionTo('pieces'); }, + getId() { + return {'bitcoin_id': this.props.edition.bitcoin_id}; + }, + render() { + console.log(!!this.props.edition.public_note || this.props.edition.acl.acl_edit) return ( @@ -153,13 +160,25 @@ let Edition = React.createClass({ title="Notes" show={(this.state.currentUser.username && true || false) || (this.props.edition.acl.acl_edit || this.props.edition.public_note)}> - - + + + + + +
+ + ); + } + return null; + } +}); + +export default Note \ No newline at end of file diff --git a/js/components/ascribe_detail/piece_container.js b/js/components/ascribe_detail/piece_container.js index dd638366..97cd76c1 100644 --- a/js/components/ascribe_detail/piece_container.js +++ b/js/components/ascribe_detail/piece_container.js @@ -29,9 +29,7 @@ import DeleteButton from '../ascribe_buttons/delete_button'; import GlobalNotificationModel from '../../models/global_notification_model'; import GlobalNotificationActions from '../../actions/global_notification_actions'; -import Form from '../ascribe_forms/form'; -import Property from '../ascribe_forms/property'; -import InputTextAreaToggable from '../ascribe_forms/input_textarea_toggable'; +import Note from './note'; import ApiUrls from '../../constants/api_urls'; import AppConstants from '../../constants/application_constants'; @@ -146,6 +144,10 @@ let PieceContainer = React.createClass({ GlobalNotificationActions.appendGlobalNotification(notification); }, + getId() { + return {'id': this.state.piece.id}; + }, + render() { if('title' in this.state.piece) { return ( @@ -193,7 +195,20 @@ let PieceContainer = React.createClass({
- + + + - { - // - } + ); } else { @@ -224,43 +235,4 @@ let PieceContainer = React.createClass({ } }); - -let PersonalNote = React.createClass({ - propTypes: { - piece: React.PropTypes.object, - currentUser: React.PropTypes.object - }, - showNotification(){ - let notification = new GlobalNotificationModel(getLangText('Jury note saved'), 'success'); - GlobalNotificationActions.appendGlobalNotification(notification); - }, - - render() { - if (this.props.currentUser.username && true || false) { - return ( -
- - - - -
-
- ); - } - return null; - } -}); - - export default PieceContainer; diff --git a/js/constants/api_urls.js b/js/constants/api_urls.js index f56879e5..8e2545e7 100644 --- a/js/constants/api_urls.js +++ b/js/constants/api_urls.js @@ -22,8 +22,10 @@ let ApiUrls = { 'editions': AppConstants.apiEndpoint + 'editions/', // this should be moved to the one below 'editions_list': AppConstants.apiEndpoint + 'pieces/${piece_id}/editions/', 'licenses': AppConstants.apiEndpoint + 'ownership/licenses/', - 'note_notes': AppConstants.apiEndpoint + 'note/notes/', - 'note_edition': AppConstants.apiEndpoint + 'note/edition_notes/', + 'note_private_edition': AppConstants.apiEndpoint + 'note/private/editions/', + 'note_private_piece': AppConstants.apiEndpoint + 'note/private/pieces/', + 'note_public_edition': AppConstants.apiEndpoint + 'note/public/editions/', + 'note_public_piece': AppConstants.apiEndpoint + 'note/public/pieces/', 'ownership_consigns': AppConstants.apiEndpoint + 'ownership/consigns/', 'ownership_consigns_confirm': AppConstants.apiEndpoint + 'ownership/consigns/confirm/', 'ownership_consigns_deny': AppConstants.apiEndpoint + 'ownership/consigns/deny/',