-1
@@ -72,4 +91,37 @@ let Piece = React.createClass({
}
});
+let PieceSummary = React.createClass({
+ propTypes: {
+ piece: React.PropTypes.object
+ },
+
+ getActions(){
+ //let actions = (
+ //
+ //
+ //
+ //
+ //
);
+ //return actions;
+ return null;
+ },
+ render() {
+ return (
+
+
+
+ {this.getActions()}
+
+
+ );
+
+ }
+});
+
+
export default Piece;
diff --git a/js/components/ascribe_forms/form_share_email.js b/js/components/ascribe_forms/form_share_email.js
index e10492d4..8c01cf6a 100644
--- a/js/components/ascribe_forms/form_share_email.js
+++ b/js/components/ascribe_forms/form_share_email.js
@@ -3,29 +3,45 @@
import React from 'react';
import ApiUrls from '../../constants/api_urls';
-import FormMixin from '../../mixins/form_mixin';
-import InputText from './input_text';
-import InputTextArea from './input_textarea';
-import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close';
-import { getLangText } from '../../utils/lang_utils.js'
+
+import Form from './form';
+import Property from './property';
+import InputTextAreaToggable from './input_textarea_toggable';
+import Button from 'react-bootstrap/lib/Button';
+
+import AppConstants from '../../constants/application_constants';
+import { getLangText } from '../../utils/lang_utils.js';
let ShareForm = React.createClass({
- mixins: [FormMixin],
-
- url() {
- return ApiUrls.ownership_shares;
+ propTypes: {
+ editions: React.PropTypes.array,
+ currentUser: React.PropTypes.object
},
getFormData() {
return {
- bitcoin_id: this.getBitcoinIds().join(),
- share_emails: this.refs.share_emails.state.value,
- share_message: this.refs.share_message.state.value
+ bitcoin_id: this.getBitcoinIds().join()
};
},
+ handleSuccess(response){
+ if ('handleSuccess' in this.props){
+ this.props.handleSuccess(response);
+ }
+ },
+ getBitcoinIds(){
+ return this.props.editions.map(function(edition){
+ return edition.bitcoin_id;
+ });
+ },
- renderForm() {
+ getTitlesString(){
+ return this.props.editions.map(function(edition){
+ return '- \"' + edition.title + ', ' + getLangText('edition') + ' ' + edition.edition_number + '\"\n';
+ });
+ },
+
+ render() {
let title = this.getTitlesString().join('');
let username = this.props.currentUser.username;
let message =
@@ -36,25 +52,50 @@ ${title}${getLangText('with you')}.
${getLangText('Truly yours')},
${username}`;
-
return (
-
+
);
}
});
diff --git a/js/constants/api_urls.js b/js/constants/api_urls.js
index 040d37ba..b5d9a9eb 100644
--- a/js/constants/api_urls.js
+++ b/js/constants/api_urls.js
@@ -25,7 +25,7 @@ let apiUrls = {
'ownership_loans_confirm': AppConstants.apiEndpoint + 'ownership/loans/confirm/',
'ownership_loans_deny': AppConstants.apiEndpoint + 'ownership/loans/deny/',
'ownership_loans_contract': AppConstants.apiEndpoint + 'ownership/loans/contract/',
- 'ownership_shares': AppConstants.apiEndpoint + 'ownership/shares/',
+ 'ownership_shares_editions': AppConstants.apiEndpoint + 'ownership/shares/editions/',
'ownership_transfers': AppConstants.apiEndpoint + 'ownership/transfers/',
'ownership_transfers_withdraw': AppConstants.apiEndpoint + 'ownership/transfers/withdraw/',
'ownership_unconsigns': AppConstants.apiEndpoint + 'ownership/unconsigns/',