+
{getLangText('Are you sure you would like to permanently delete this piece')}?
+
{getLangText('This is an irrevocable action%s', '.')}
+
+
+
+
+
+ );
+ }
+});
+
+
+export default PieceDeleteForm;
diff --git a/js/components/ascribe_forms/form_remove_editions_from_collection.js b/js/components/ascribe_forms/form_remove_editions_from_collection.js
index e0cbcdf7..4ab8fdf7 100644
--- a/js/components/ascribe_forms/form_remove_editions_from_collection.js
+++ b/js/components/ascribe_forms/form_remove_editions_from_collection.js
@@ -12,13 +12,9 @@ let EditionRemoveFromCollectionForm = React.createClass({
mixins: [FormMixin],
url() {
- if (this.props.editions.constructor === Array) {
- return requests.prepareUrl(apiUrls.edition_remove_from_collection, {edition_id: this.getBitcoinIds().join()});
- }
- else {
- return requests.prepareUrl(apiUrls.piece_remove_from_collection, {piece_id: this.props.editions.id});
- }
+ return requests.prepareUrl(apiUrls.edition_remove_from_collection, {edition_id: this.getBitcoinIds().join()});
},
+
httpVerb(){
return 'delete';
},
diff --git a/js/components/ascribe_forms/form_remove_piece_from_collection.js b/js/components/ascribe_forms/form_remove_piece_from_collection.js
new file mode 100644
index 00000000..905cfcf6
--- /dev/null
+++ b/js/components/ascribe_forms/form_remove_piece_from_collection.js
@@ -0,0 +1,42 @@
+'use strict';
+
+import React from 'react';
+
+import { getLangText } from '../../utils/lang_utils.js';
+import requests from '../../utils/requests';
+import apiUrls from '../../constants/api_urls';
+import FormMixin from '../../mixins/form_mixin';
+
+let PieceRemoveFromCollectionForm = React.createClass({
+
+ propTypes: {
+ pieceId: React.PropTypes.number
+ },
+
+ mixins: [FormMixin],
+
+ url() {
+ return requests.prepareUrl(apiUrls.piece_remove_from_collection, {piece_id: this.props.pieceId});
+ },
+
+ httpVerb(){
+ return 'delete';
+ },
+
+ renderForm () {
+ return (
+
+
{getLangText('Are you sure you would like to remove this piece from your collection')}?
+
{getLangText('This is an irrevocable action%s', '.')}
+
+
+
+
+
+ );
+ }
+});
+
+
+export default PieceRemoveFromCollectionForm;
diff --git a/js/components/ascribe_modal/modal_wrapper.js b/js/components/ascribe_modal/modal_wrapper.js
index e8dcbaa3..a8f7b182 100644
--- a/js/components/ascribe_modal/modal_wrapper.js
+++ b/js/components/ascribe_modal/modal_wrapper.js
@@ -17,24 +17,41 @@ let ModalWrapper = React.createClass({
handleSuccess: React.PropTypes.func.isRequired,
button: React.PropTypes.object.isRequired,
children: React.PropTypes.object,
- tooltip: React.PropTypes.string.isRequired
+ tooltip: React.PropTypes.string
+ },
+
+ getModalTrigger() {
+ return (
+