From 05a63f28e9776b8163a9909f32b5f47ae3bd174e Mon Sep 17 00:00:00 2001 From: diminator Date: Thu, 9 Jul 2015 15:53:10 +0100 Subject: [PATCH 01/16] editions layout --- sass/ascribe_accordion_list.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sass/ascribe_accordion_list.scss b/sass/ascribe_accordion_list.scss index dad5bb2d..4e86db75 100644 --- a/sass/ascribe_accordion_list.scss +++ b/sass/ascribe_accordion_list.scss @@ -8,7 +8,7 @@ $ascribe-accordion-list-font: 'Source Sans Pro'; padding-left:0; padding-right:0; - margin-top: 3em; + margin-top: 1.5em; &::first-child { margin-top:0; } From 8f78de3fb4677109bc2e8abfed4d4e2aa36f583f Mon Sep 17 00:00:00 2001 From: diminator Date: Thu, 9 Jul 2015 18:46:53 +0100 Subject: [PATCH 02/16] editions styling fix otherdata collapsible styling --- .../accordion_list_item.js | 7 ++++--- .../accordion_list_item_edition_widget.js | 15 ++++++++++++--- js/components/ascribe_detail/edition.js | 4 ++-- .../react_s3_fine_uploader.js | 2 +- sass/ascribe_accordion_list.scss | 19 ++++++++++++------- sass/ascribe_edition.scss | 4 ++-- 6 files changed, 33 insertions(+), 18 deletions(-) diff --git a/js/components/ascribe_accordion_list/accordion_list_item.js b/js/components/ascribe_accordion_list/accordion_list_item.js index 69d4bae5..d68c5ce4 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item.js +++ b/js/components/ascribe_accordion_list/accordion_list_item.js @@ -59,15 +59,16 @@ let AccordionListItem = React.createClass({ overlay={{this.props.content.title}}>

{this.props.content.title}

-

{getLangText('by %s', this.props.content.artist_name)}

+

{getLangText('by %s', this.props.content.artist_name)}

+
+ {this.props.content.date_created.split('-')[0]} +
- {this.props.content.date_created.split('-')[0]} {/* {getLangText('%s license', this.props.content.license_type.code)} */} -
diff --git a/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js b/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js index 92a8a1c4..cf285da3 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js +++ b/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js @@ -75,15 +75,24 @@ let AccordionListItemEditionWidget = React.createClass({ - {', ' + editionMapping + ' ' + getLangText('Edition')} {this.getGlyphicon()} + {editionMapping + ' ' + getLangText('Edition')} {this.getGlyphicon()} ); - } else { + } else if(numEditions === 0){ return ( - {', ' + numEditions + ' ' + getLangText('Editions')} {this.getGlyphicon()} + {'+ Editions'} + + ); + } + else { + return ( + + {numEditions + ' ' + getLangText('Editions')} {this.getGlyphicon()} ); } diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index 94f6e507..73da8e65 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -275,7 +275,7 @@ let EditionPersonalNote = React.createClass({ label={getLangText('Personal note (private)')} editable={true}> { diff --git a/sass/ascribe_accordion_list.scss b/sass/ascribe_accordion_list.scss index 4e86db75..fa77522e 100644 --- a/sass/ascribe_accordion_list.scss +++ b/sass/ascribe_accordion_list.scss @@ -19,7 +19,7 @@ $ascribe-accordion-list-font: 'Source Sans Pro'; border-right: 0.1em solid rgba(0,0,0,.2); border-top: 0.1em solid rgba(0,0,0,.2); border-radius: 1px; - border-bottom: 0.1em solid rgba(0,0,0,.2); + border-bottom: 0.1em solid rgba(0,0,0,0); .wrapper { &:hover{ background-color: rgba(2, 182, 163, 0.05); @@ -44,13 +44,14 @@ $ascribe-accordion-list-font: 'Source Sans Pro'; } } h1 { - margin-top: .3em; - font-size: 2.25em; + margin: .1em 0 .1em 0; + font-size: 2.2em; cursor: pointer; } h3 { - font-size: 1.1em; - margin: .2em 0 0 0; + font-size: 1.3em; + margin: .2em 0 .3em 0; + cursor: pointer; } a { color: #666; @@ -88,6 +89,7 @@ $ascribe-accordion-list-font: 'Source Sans Pro'; } } border-left: 3px solid rgba(0,0,0,0); + border-top: 1px solid rgba(0,0,0,.1); border-bottom: 1px solid rgba(0,0,0,.05); } tbody { @@ -143,9 +145,12 @@ span.ascribe-accordion-list-table-toggle { .ascribe-accordion-list-item-edition-widget { cursor: pointer; - //margin-left: 0.3em; &:hover { - color: $ascribe-color-full; + color: $ascribe-color-dark; + } + .glyphicon { + top: 1px !important; + font-size: 0.8em; } } \ No newline at end of file diff --git a/sass/ascribe_edition.scss b/sass/ascribe_edition.scss index 4af3168f..ee082a04 100644 --- a/sass/ascribe_edition.scss +++ b/sass/ascribe_edition.scss @@ -11,8 +11,8 @@ .ascribe-edition-collapsible-wrapper > div:first-child { width: 100%; cursor: pointer; - background-color: #F5F5F5; - padding: 10px; + background-color: rgba(0,0,0,0); + padding: 0 10px 10px 0; margin-top: 20px; } .ascribe-edition-collapsible-wrapper > div > span { From 22b201f388dd5b99878348205c397fdfc3429f1c Mon Sep 17 00:00:00 2001 From: diminator Date: Fri, 10 Jul 2015 10:30:17 +0200 Subject: [PATCH 03/16] register piece returns to piece detail --- .../ascribe_accordion_list/accordion_list_item.js | 4 +++- .../accordion_list_item_edition_widget.js | 10 +--------- js/components/ascribe_forms/form.js | 1 + js/components/register_piece.js | 2 +- sass/ascribe_accordion_list.scss | 2 +- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/js/components/ascribe_accordion_list/accordion_list_item.js b/js/components/ascribe_accordion_list/accordion_list_item.js index b3e31265..930eb0cc 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item.js +++ b/js/components/ascribe_accordion_list/accordion_list_item.js @@ -81,7 +81,9 @@ let AccordionListItem = React.createClass({

{getLangText('by %s', this.props.content.artist_name)}

- {this.props.content.date_created.split('-')[0]}, + {this.props.content.date_created.split('-')[0]} +
+
{/* diff --git a/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js b/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js index edc53ec9..3e02e189 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js +++ b/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js @@ -78,7 +78,7 @@ let AccordionListItemEditionWidget = React.createClass({ - Create editions + + Editions ); } else if(numEditions === 1) { @@ -91,14 +91,6 @@ let AccordionListItemEditionWidget = React.createClass({ {editionMapping + ' ' + getLangText('Edition')} {this.getGlyphicon()} ); - } else if(numEditions === 0){ - return ( - - {'+ Editions'} - - ); } else { return ( diff --git a/js/components/ascribe_forms/form.js b/js/components/ascribe_forms/form.js index 414c1aab..fb2f77af 100644 --- a/js/components/ascribe_forms/form.js +++ b/js/components/ascribe_forms/form.js @@ -35,6 +35,7 @@ let Form = React.createClass({ this.refs[ref].reset(); } } + this.setState(this.getInitialState()); }, submit(event){ if (event) { diff --git a/js/components/register_piece.js b/js/components/register_piece.js index 94f4cc64..72d4aa4d 100644 --- a/js/components/register_piece.js +++ b/js/components/register_piece.js @@ -94,7 +94,7 @@ let RegisterPiece = React.createClass( { this.state.orderBy, this.state.orderAsc); - this.transitionTo('piece', {editionId: response.piece.id}); + this.transitionTo('piece', {pieceId: response.piece.id}); }, getFormData(){ diff --git a/sass/ascribe_accordion_list.scss b/sass/ascribe_accordion_list.scss index 94ac0fe1..6909b028 100644 --- a/sass/ascribe_accordion_list.scss +++ b/sass/ascribe_accordion_list.scss @@ -19,7 +19,7 @@ $ascribe-accordion-list-font: 'Source Sans Pro'; border-right: 0.1em solid rgba(0,0,0,.2); border-top: 0.1em solid rgba(0,0,0,.2); border-radius: 1px; - border-bottom: 0.1em solid rgba(0,0,0,0); + border-bottom: 0.1em solid rgba(0,0,0,.2); .wrapper { &:hover{ background-color: rgba(2, 182, 163, 0.05); From bcb1bbe29b93fba6603eb8f5c096582e848a8c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 10 Jul 2015 10:32:39 +0200 Subject: [PATCH 04/16] first cut edition creation in piece list item --- .../accordion_list_item.js | 2 + .../accordion_list_item_create_editions.js | 52 +++++++++++++++++++ js/components/register_piece.js | 3 +- js/constants/languages.js | 3 ++ 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 js/components/ascribe_accordion_list/accordion_list_item_create_editions.js diff --git a/js/components/ascribe_accordion_list/accordion_list_item.js b/js/components/ascribe_accordion_list/accordion_list_item.js index b3e31265..1679138d 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item.js +++ b/js/components/ascribe_accordion_list/accordion_list_item.js @@ -10,6 +10,7 @@ import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger'; import Tooltip from 'react-bootstrap/lib/Tooltip'; import AccordionListItemEditionWidget from './accordion_list_item_edition_widget'; +import AccordionListItemCreateEditions from './accordion_list_item_create_editions'; import { getLangText } from '../../utils/lang_utils'; @@ -95,6 +96,7 @@ let AccordionListItem = React.createClass({
+ {/* this.props.children is AccordionListItemTableEditions */} {this.props.children} diff --git a/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js b/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js new file mode 100644 index 00000000..4edb0225 --- /dev/null +++ b/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js @@ -0,0 +1,52 @@ +'use strict'; + +import React from 'react'; + +import Form from '../ascribe_forms/form'; +import FormPropertyHeader from '../ascribe_forms/form_property_header'; +import Property from '../ascribe_forms/property'; + +import apiUrls from '../../constants/api_urls'; +import { getLangText } from '../../utils/lang_utils'; + +let AccordionListItemCreateEditions = React.createClass({ + + handleSuccess() { + + }, + + render() { + return ( +
+
+ {getLangText('Create editions')} + } + spinner={ + + }> + + + + +
+
+ ); + } +}); + +export default AccordionListItemCreateEditions; \ No newline at end of file diff --git a/js/components/register_piece.js b/js/components/register_piece.js index 94f4cc64..3bca4214 100644 --- a/js/components/register_piece.js +++ b/js/components/register_piece.js @@ -138,8 +138,7 @@ let RegisterPiece = React.createClass( { label={getLangText('Copyright license%s', '...')} onChange={this.onLicenseChange} footer={ -
- {getLangText('Learn more')} + {getLangText('Learn more')} }> @@ -317,8 +317,8 @@ let EditionPublicEditionNote = React.createClass({ rows={1} editable={isEditable} defaultValue={this.props.edition.public_note} - placeholder={getLangText('Enter a public note for this edition%', '...')} - required/> + placeholder={getLangText('Enter a public note for this edition%s', '...')} + required="required"/>
diff --git a/js/components/ascribe_uploader/react_s3_fine_uploader.js b/js/components/ascribe_uploader/react_s3_fine_uploader.js index 13b9d5c8..e206271a 100644 --- a/js/components/ascribe_uploader/react_s3_fine_uploader.js +++ b/js/components/ascribe_uploader/react_s3_fine_uploader.js @@ -24,11 +24,17 @@ var ReactS3FineUploader = React.createClass({ keyRoutine: React.PropTypes.shape({ url: React.PropTypes.string, fileClass: React.PropTypes.string, - pieceId: React.PropTypes.string + pieceId: React.PropTypes.oneOfType([ + React.PropTypes.string, + React.PropTypes.number + ]) }), createBlobRoutine: React.PropTypes.shape({ url: React.PropTypes.string, - pieceId: React.PropTypes.string + pieceId: React.PropTypes.oneOfType([ + React.PropTypes.string, + React.PropTypes.number + ]) }), submitKey: React.PropTypes.func, autoUpload: React.PropTypes.bool, @@ -70,7 +76,10 @@ var ReactS3FineUploader = React.createClass({ customHeaders: React.PropTypes.object }).isRequired, session: React.PropTypes.shape({ - endpoint: React.PropTypes.bool + customHeaders: React.PropTypes.object, + endpoint: React.PropTypes.string, + params: React.PropTypes.object, + refreshOnRequests: React.PropTypes.bool }), validation: React.PropTypes.shape({ itemLimit: React.PropTypes.number, diff --git a/js/fetchers/coa_fetcher.js b/js/fetchers/coa_fetcher.js index 48ee9e73..e4956c66 100644 --- a/js/fetchers/coa_fetcher.js +++ b/js/fetchers/coa_fetcher.js @@ -11,7 +11,6 @@ let CoaFetcher = { return requests.get('coa', {'id': id}); }, create(bitcoinId) { - console.log(bitcoinId); return requests.post('coa_create', {body: {'bitcoin_id': bitcoinId}}); } }; From 75590dbb345d83db221ac366cb906f6d0a6e00a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 10 Jul 2015 14:34:14 +0200 Subject: [PATCH 08/16] fix position of spinner in fine uploader --- sass/ascribe_accordion_list.scss | 5 +++++ sass/ascribe_uploader.scss | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sass/ascribe_accordion_list.scss b/sass/ascribe_accordion_list.scss index 6909b028..526fbc34 100644 --- a/sass/ascribe_accordion_list.scss +++ b/sass/ascribe_accordion_list.scss @@ -150,6 +150,11 @@ span.ascribe-accordion-list-table-toggle { .ascribe-accordion-list-item-edition-widget { cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -khtml-user-select: none; + -ms-user-select: none; + &:hover { color: $ascribe-color-dark; } diff --git a/sass/ascribe_uploader.scss b/sass/ascribe_uploader.scss index c07fccf8..ceb8b427 100644 --- a/sass/ascribe_uploader.scss +++ b/sass/ascribe_uploader.scss @@ -82,7 +82,7 @@ .file-drag-and-drop-preview-image .action-file { font-size: 2.5em; - margin-top: .3em; + margin-top: .6em; color: white; text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black; cursor: pointer; From fd6fad5da3b7ea10afbb584b58de44817d56adc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 10 Jul 2015 14:48:55 +0200 Subject: [PATCH 09/16] correct number of editions --- js/components/ascribe_accordion_list/accordion_list_item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/components/ascribe_accordion_list/accordion_list_item.js b/js/components/ascribe_accordion_list/accordion_list_item.js index 2da5abd0..1fff7f98 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item.js +++ b/js/components/ascribe_accordion_list/accordion_list_item.js @@ -87,7 +87,7 @@ let AccordionListItem = React.createClass({ PieceListActions.updatePropertyForPiece({ pieceId: this.props.content.id, key: 'num_editions', - value: res.count + value: res.editions[0].num_editions }); EditionListActions.toggleEditionList(this.props.content.id); From 6f7600fca2e5254d037dff22d67d4f6c3da02ef0 Mon Sep 17 00:00:00 2001 From: diminator Date: Fri, 10 Jul 2015 15:52:09 +0200 Subject: [PATCH 10/16] login errors + request obfuscated --- .../accordion_list_item_create_editions.js | 9 +++------ js/components/password_reset_container.js | 8 ++++---- js/components/register_piece.js | 9 +++------ 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js b/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js index 8a1c8ace..30a6efbc 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js +++ b/js/components/ascribe_accordion_list/accordion_list_item_create_editions.js @@ -16,12 +16,9 @@ let AccordionListItemCreateEditions = React.createClass({ }, getFormData(){ - let data = {}; - for (let ref in this.refs.form.refs){ - data[this.refs.form.refs[ref].props.name] = this.refs.form.refs[ref].state.value; - } - data.piece_id = parseInt(this.props.pieceId, 10); - return data; + return { + piece_id: parseInt(this.props.pieceId, 10) + }; }, render() { diff --git a/js/components/password_reset_container.js b/js/components/password_reset_container.js index 43501436..20a35b16 100644 --- a/js/components/password_reset_container.js +++ b/js/components/password_reset_container.js @@ -105,10 +105,10 @@ let PasswordResetForm = React.createClass({ mixins: [Router.Navigation], getFormData(){ - let data = {}; - data.email = this.props.email; - data.token = this.props.token; - return data; + return { + email: this.props.email, + token: this.props.token + }; }, handleSuccess() { this.transitionTo('pieces'); diff --git a/js/components/register_piece.js b/js/components/register_piece.js index 045ba06e..f0dd1e02 100644 --- a/js/components/register_piece.js +++ b/js/components/register_piece.js @@ -98,12 +98,9 @@ let RegisterPiece = React.createClass( { }, getFormData(){ - let data = {}; - for (let ref in this.refs.form.refs){ - data[this.refs.form.refs[ref].props.name] = this.refs.form.refs[ref].state.value; - } - data.digital_work_key = this.state.digitalWorkKey; - return data; + return { + digital_work_key: this.state.digitalWorkKey + }; }, submitKey(key){ From b364414e16d77a5325bd688eb9a4ede1e2d6f32f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 10 Jul 2015 15:56:54 +0200 Subject: [PATCH 11/16] input checkbox functionality --- js/components/ascribe_forms/input_checkbox.js | 47 +++++++++---------- js/components/ascribe_forms/property.js | 35 ++++++++++++-- js/components/signup_container.js | 20 ++++---- js/constants/languages.js | 6 +++ sass/ascribe_accordion_list.scss | 7 ++- sass/ascribe_settings.scss | 13 +++-- sass/main.scss | 5 ++ 7 files changed, 84 insertions(+), 49 deletions(-) diff --git a/js/components/ascribe_forms/input_checkbox.js b/js/components/ascribe_forms/input_checkbox.js index 28f75bc3..dfb13ada 100644 --- a/js/components/ascribe_forms/input_checkbox.js +++ b/js/components/ascribe_forms/input_checkbox.js @@ -2,48 +2,43 @@ import React from 'react'; -import AlertMixin from '../../mixins/alert_mixin'; +import { getLangText } from '../../utils/lang_utils'; let InputCheckbox = React.createClass({ propTypes: { - submitted: React.PropTypes.bool.isRequired, required: React.PropTypes.string.isRequired, label: React.PropTypes.string.isRequired }, - mixins: [AlertMixin], - getInitialState() { return { - value: null, - alerts: null // needed in AlertMixin + show: false }; }, - - handleChange(event) { - this.setState({value: event.target.value}); + + handleFocus() { + this.refs.checkbox.getDOMNode().checked = !this.refs.checkbox.getDOMNode().checked; + this.setState({ + show: this.refs.checkbox.getDOMNode().checked + }); }, render() { - let alerts = (this.props.submitted) ? null : this.state.alerts; return ( -
- {alerts} -
-
- -
-
-
+ + + + + {getLangText('I agree to the Terms of Service') + ' '} + ( + {getLangText('read')} + ) + + + ); - } }); diff --git a/js/components/ascribe_forms/property.js b/js/components/ascribe_forms/property.js index df3df761..40b5af6e 100644 --- a/js/components/ascribe_forms/property.js +++ b/js/components/ascribe_forms/property.js @@ -18,13 +18,21 @@ let Property = React.createClass({ ]), footer: React.PropTypes.element, handleChange: React.PropTypes.func, - ignoreFocus: React.PropTypes.bool + ignoreFocus: React.PropTypes.bool, + className: React.PropTypes.string, + onClick: React.PropTypes.func, + onChange: React.PropTypes.func, + children: React.PropTypes.oneOfType([ + React.PropTypes.arrayOf(React.PropTypes.element), + React.PropTypes.element + ]) }, getDefaultProps() { return { editable: true, - hidden: false + hidden: false, + className: '' }; }, @@ -36,12 +44,14 @@ let Property = React.createClass({ errors: null }; }, + componentWillReceiveProps(){ this.setState({ initialValue: this.refs.input.getDOMNode().defaultValue, value: this.refs.input.getDOMNode().value }); }, + reset(){ // maybe do reset by reload instead of frontend state? this.setState({value: this.state.initialValue}); @@ -62,26 +72,39 @@ let Property = React.createClass({ } this.setState({value: event.target.value}); }, + handleFocus() { + // if ignoreFocus (bool) is defined, then just ignore focusing on + // the property and input if(this.props.ignoreFocus) { return; } + + // if onClick is defined from the outside, + // just call it + if(this.props.onClick) { + this.props.onClick(); + } + this.refs.input.getDOMNode().focus(); this.setState({ isFocused: true }); }, + handleBlur() { this.setState({ isFocused: false }); }, + handleSuccess(){ this.setState({ isFocused: false, errors: null }); }, + setErrors(errors){ this.setState({ errors: errors.map((error) => { @@ -89,9 +112,11 @@ let Property = React.createClass({ }) }); }, + clearErrors(){ this.setState({errors: null}); }, + getClassName() { if(this.props.hidden){ return 'is-hidden'; @@ -108,6 +133,7 @@ let Property = React.createClass({ return ''; } }, + renderChildren() { return ReactAddons.Children.map(this.props.children, (child) => { return ReactAddons.addons.cloneWithProps(child, { @@ -120,6 +146,7 @@ let Property = React.createClass({ }); }); }, + render() { let tooltip = ; if (this.props.tooltip){ @@ -139,12 +166,12 @@ let Property = React.createClass({
+ onFocus={this.handleFocus}> -
+
{this.state.errors} { this.props.label} {this.renderChildren()} diff --git a/js/components/signup_container.js b/js/components/signup_container.js index f71a37b0..1ec500f1 100644 --- a/js/components/signup_container.js +++ b/js/components/signup_container.js @@ -15,6 +15,7 @@ import Form from './ascribe_forms/form'; import Property from './ascribe_forms/property'; import InputCheckbox from './ascribe_forms/input_checkbox'; + import apiUrls from '../constants/api_urls'; @@ -77,6 +78,10 @@ let SignupContainer = React.createClass({ let SignupForm = React.createClass({ + propTypes: { + handleSuccess: React.PropTypes.func + }, + mixins: [Router.Navigation], handleSuccess(response){ @@ -142,16 +147,11 @@ let SignupForm = React.createClass({ type="text" placeholder={getLangText('Enter a promocode here (Optional)')}/> -
- - - {getLangText('I agree to the')} {getLangText('Terms of Service')} - -
}/> + + + ); } diff --git a/js/constants/languages.js b/js/constants/languages.js index 742ed32c..78c2b148 100644 --- a/js/constants/languages.js +++ b/js/constants/languages.js @@ -207,6 +207,8 @@ const languages = { 'Specify editions': 'Specify editions', 'Editions': 'Editions', 'Create editions': 'Create editions', + 'I agree to the Terms of Service': 'I agree to the Terms of Service', + 'read': 'read', }, 'de': { 'ID': 'ID', @@ -414,6 +416,8 @@ const languages = { 'Specify editions': 'Specify editions', 'Editions': 'Editions', 'Create editions': 'Create editions', + 'I agree to the Terms of Service': 'I agree to the Terms of Service', + 'read': 'read', }, 'fr': { 'ID': 'ID', @@ -621,6 +625,8 @@ const languages = { 'Specify editions': 'Specify editions', 'Editions': 'Editions', 'Create editions': 'Create editions', + 'I agree to the Terms of Service': 'I agree to the Terms of Service', + 'read': 'read', } }; diff --git a/sass/ascribe_accordion_list.scss b/sass/ascribe_accordion_list.scss index 526fbc34..6a8208ce 100644 --- a/sass/ascribe_accordion_list.scss +++ b/sass/ascribe_accordion_list.scss @@ -122,8 +122,11 @@ $ascribe-accordion-list-font: 'Source Sans Pro'; } span.ascribe-accordion-list-table-toggle { - ::selection { background: transparent; } - ::-moz-selection { background: transparent; } + -webkit-user-select: none; + -moz-user-select: none; + -khtml-user-select: none; + -ms-user-select: none; + &:hover { color: $ascribe-color-dark; cursor:pointer; diff --git a/sass/ascribe_settings.scss b/sass/ascribe_settings.scss index 7c655547..85de4915 100644 --- a/sass/ascribe_settings.scss +++ b/sass/ascribe_settings.scss @@ -58,8 +58,6 @@ } } - - .ascribe-settings-property { display: inline-block; width: 100%; @@ -145,7 +143,7 @@ cursor:pointer; /* Taken from: http://www.htmllion.com/css3-checkbox.html */ - .checkbox { + > .checkbox { display: inline-block; cursor: pointer; @@ -155,14 +153,15 @@ color: rgba(0, 0, 0, .5); vertical-align:middle; - span { + > span { position: relative; top: 1px; left: 5px; - &:hover { - color: rgba(2, 182, 163, 1); - } + -webkit-user-select: none; + -moz-user-select: none; + -khtml-user-select: none; + -ms-user-select: none; } } diff --git a/sass/main.scss b/sass/main.scss index df8b4285..d6adc5b2 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -92,6 +92,11 @@ hr { padding-right:0; } +.clear-margins { + margin-top:0; + margin-bottom:0; +} + .ascribe-color { color: $ascribe-color; } From e55bc239b44057e9328c339844e967683ca067ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Fri, 10 Jul 2015 16:04:57 +0200 Subject: [PATCH 12/16] refactor signup form --- js/components/ascribe_forms/input_checkbox.js | 2 +- js/components/ascribe_forms/property.js | 6 ++-- js/components/signup_container.js | 11 +++++--- sass/ascribe_settings.scss | 28 +++++++++---------- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/js/components/ascribe_forms/input_checkbox.js b/js/components/ascribe_forms/input_checkbox.js index dfb13ada..959401e9 100644 --- a/js/components/ascribe_forms/input_checkbox.js +++ b/js/components/ascribe_forms/input_checkbox.js @@ -31,7 +31,7 @@ let InputCheckbox = React.createClass({ - {getLangText('I agree to the Terms of Service') + ' '} + {' ' + getLangText('I agree to the Terms of Service') + ' '} ( {getLangText('read')} ) diff --git a/js/components/ascribe_forms/property.js b/js/components/ascribe_forms/property.js index 40b5af6e..6ff25712 100644 --- a/js/components/ascribe_forms/property.js +++ b/js/components/ascribe_forms/property.js @@ -25,7 +25,8 @@ let Property = React.createClass({ children: React.PropTypes.oneOfType([ React.PropTypes.arrayOf(React.PropTypes.element), React.PropTypes.element - ]) + ]), + style: React.PropTypes.object }, getDefaultProps() { @@ -166,7 +167,8 @@ let Property = React.createClass({
+ onFocus={this.handleFocus} + style={this.props.style}>
-
- {getLangText('Welcome to')} ascribe... -
); @@ -99,6 +97,7 @@ let SignupForm = React.createClass({ getLangText('Store it in a safe place') + '!'; return (
}> + +

{getLangText('Welcome to ascribe')}

+
@@ -149,7 +151,8 @@ let SignupForm = React.createClass({ + className="ascribe-settings-property-collapsible-toggle" + style={{paddingBottom: 0}}>
diff --git a/sass/ascribe_settings.scss b/sass/ascribe_settings.scss index 85de4915..8dd0b169 100644 --- a/sass/ascribe_settings.scss +++ b/sass/ascribe_settings.scss @@ -28,13 +28,13 @@ .is-error { background-color: rgba(169, 68, 66, 0.05); border-left: 3px solid rgba(169, 68, 66, 1); - div { - span { + > div { + > span { color: rgba(169, 68, 66, 1); font-size: 0.9em; margin-right: 1em; } - input, textarea { + > input, > textarea { color: #666; } } @@ -46,12 +46,12 @@ .is-fixed { cursor: default; - div { + > div { cursor: default; - span { + > span { cursor: default; } - input, div, pre, textarea { + > input, > div, > pre, > textarea { cursor: default; color: #666; } @@ -70,19 +70,19 @@ cursor:pointer; - input, div, span:not(.glyphicon), pre, textarea, select { + > input, > div, > span:not(.glyphicon), > pre, > textarea, > select { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } - span { + > span { font-weight: normal; font-size: 0.9em; color: rgba(0,0,0,.5); } - div { + > div { /* margin-top: 10px; */ - div:not(.file-drag-and-drop div) { + > div:not(.file-drag-and-drop div) { padding-left: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: normal; @@ -92,11 +92,11 @@ } } - .progressbar-container, .progressbar-progress { + > .progressbar-container, .progressbar-progress { margin-top: 0 !important; } - input, pre, textarea, select { + > input, > pre, > textarea, > select { font-weight: 400; font-size: 1.1em; width:100%; @@ -119,7 +119,7 @@ } - textarea{ + > textarea{ color: #666; margin-top: 1em; padding: 0; @@ -143,7 +143,7 @@ cursor:pointer; /* Taken from: http://www.htmllion.com/css3-checkbox.html */ - > .checkbox { + .checkbox { display: inline-block; cursor: pointer; From b58fe51722dee4e7d2b1289f3aa9bbc3c2975a54 Mon Sep 17 00:00:00 2001 From: diminator Date: Fri, 10 Jul 2015 16:45:49 +0200 Subject: [PATCH 13/16] fixed crowdcurity issues on login/email/requestpassword num editions supports status: -1, 0, >0 --- js/components/ascribe_detail/edition.js | 3 ++- js/components/ascribe_detail/piece.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index 36a234f8..df3f86b5 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -84,7 +84,8 @@ let Edition = React.createClass({ -1 || this.props.edition.public_note)}> + (this.props.edition.acl.indexOf('edit') > -1 || this.props.edition.public_note)} + defaultExpanded={true}> -1 || Object.keys(this.props.piece.extra_data).length > 0 - || this.props.piece.other_data !== null}> + || this.props.piece.other_data !== null} + defaultExpanded={true}> -1} pieceId={this.props.piece.id} From 62289be5ce967e20ebca538b9f8813f00ff068db Mon Sep 17 00:00:00 2001 From: diminator Date: Fri, 10 Jul 2015 18:51:35 +0200 Subject: [PATCH 14/16] polling for editions --- .../accordion_list_item.js | 7 ++--- .../accordion_list_item_edition_widget.js | 26 +++++++++---------- js/components/ascribe_forms/form.js | 7 ++--- js/components/ascribe_forms/input_checkbox.js | 3 ++- js/components/signup_container.js | 6 ++++- js/utils/general_utils.js | 18 +++++++++++++ 6 files changed, 46 insertions(+), 21 deletions(-) diff --git a/js/components/ascribe_accordion_list/accordion_list_item.js b/js/components/ascribe_accordion_list/accordion_list_item.js index 1fff7f98..03d14425 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item.js +++ b/js/components/ascribe_accordion_list/accordion_list_item.js @@ -37,7 +37,7 @@ let AccordionListItem = React.createClass({ }, componentDidMount() { - if(this.props.content.num_editions !== 0) { + if(this.props.content.num_editions > 0) { PieceListActions.fetchFirstEditionForPiece(this.props.content.id); } }, @@ -66,6 +66,7 @@ let AccordionListItem = React.createClass({ handleEditionCreationSuccess(response) { let notification = new GlobalNotificationModel(response.notification, 'success', 10000); GlobalNotificationActions.appendGlobalNotification(notification); + PieceListActions.updatePropertyForPiece({pieceId: this.props.content.id, key: 'num_editions', value: 0}); this.setState({ creatingEditions: true @@ -106,7 +107,7 @@ let AccordionListItem = React.createClass({ render() { let linkData; - if(this.props.content.num_editions === 0) { + if(this.props.content.num_editions < 1) { linkData = { to: 'piece', params: { @@ -157,7 +158,7 @@ let AccordionListItem = React.createClass({
- {this.props.content.num_editions === 0 && this.state.showCreateEditionsDialog ? : null} + {this.props.content.num_editions < 1 && this.state.showCreateEditionsDialog ? : null} {/* this.props.children is AccordionListItemTableEditions */} {this.props.children} diff --git a/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js b/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js index 39352fd5..0c6a1082 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js +++ b/js/components/ascribe_accordion_list/accordion_list_item_edition_widget.js @@ -75,23 +75,23 @@ let AccordionListItemEditionWidget = React.createClass({ let piece = this.props.piece; let numEditions = piece.num_editions; - if(numEditions === 0) { - if(this.props.creatingEditions) { - return ( + if(numEditions === -1) { + return ( + + + Editions + + ); + } + else if(numEditions === 0) { + return ( Creating Editions ); - } else { - return ( - - + Editions - - ); - } - } else if(numEditions === 1) { + } + else if(numEditions === 1) { let editionMapping = piece && piece.firstEdition ? piece.firstEdition.edition_number + '/' + piece.num_editions : ''; return ( diff --git a/js/components/ascribe_forms/form.js b/js/components/ascribe_forms/form.js index f767141f..7e0d6b42 100644 --- a/js/components/ascribe_forms/form.js +++ b/js/components/ascribe_forms/form.js @@ -7,6 +7,7 @@ import Button from 'react-bootstrap/lib/Button'; import requests from '../../utils/requests'; import { getLangText } from '../../utils/lang_utils'; +import { mergeOptionsWithDuplicates } from '../../utils/general_utils'; import AlertDismissable from './alert'; @@ -55,12 +56,12 @@ let Form = React.createClass({ getFormData(){ let data = {}; - if ('getFormData' in this.props){ - data = this.props.getFormData(); - } for (let ref in this.refs){ data[this.refs[ref].props.name] = this.refs[ref].state.value; } + if ('getFormData' in this.props){ + data = mergeOptionsWithDuplicates(data, this.props.getFormData()); + } return data; }, diff --git a/js/components/ascribe_forms/input_checkbox.js b/js/components/ascribe_forms/input_checkbox.js index 959401e9..7dc2f9ac 100644 --- a/js/components/ascribe_forms/input_checkbox.js +++ b/js/components/ascribe_forms/input_checkbox.js @@ -19,7 +19,8 @@ let InputCheckbox = React.createClass({ handleFocus() { this.refs.checkbox.getDOMNode().checked = !this.refs.checkbox.getDOMNode().checked; this.setState({ - show: this.refs.checkbox.getDOMNode().checked + show: this.refs.checkbox.getDOMNode().checked, + value: this.refs.checkbox.getDOMNode().checked }); }, diff --git a/js/components/signup_container.js b/js/components/signup_container.js index d1895870..654b9c03 100644 --- a/js/components/signup_container.js +++ b/js/components/signup_container.js @@ -91,6 +91,9 @@ let SignupForm = React.createClass({ ', ' + getLangText('please confirm') + '.'); }, + getFormData(){ + return {terms: this.refs.form.refs.terms.refs.input.state.value}; + }, render() { let tooltipPassword = getLangText('Your password must be at least 10 characters') + '.\n ' + getLangText('This password is securing your digital property like a bank account') + '.\n ' + @@ -101,6 +104,7 @@ let SignupForm = React.createClass({ ref='form' url={apiUrls.users_signup} handleSuccess={this.handleSuccess} + getFormData={this.getFormData} buttons={ + +

+ } + spinner={ +
+ +
+ } + > + + + + + + + ); } }); 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/', From a07bc9e0e2b9d5f12a5afaff35635ab4f2afc583 Mon Sep 17 00:00:00 2001 From: diminator Date: Mon, 13 Jul 2015 14:10:46 +0200 Subject: [PATCH 16/16] piece + share acl first cut --- js/components/ascribe_buttons/acl_button.js | 51 ++++++++++++++- .../ascribe_buttons/acl_button_list.js | 8 ++- .../ascribe_buttons/create_editions_button.js | 44 +++++++++++++ js/components/ascribe_detail/edition.js | 1 - js/components/ascribe_detail/piece.js | 29 ++++----- js/components/ascribe_forms/form_login.js | 64 ------------------- .../ascribe_forms/form_note_edition.js | 43 ------------- .../ascribe_forms/form_note_personal.js | 43 ------------- .../ascribe_forms/form_password_reset.js | 51 --------------- .../form_password_reset_request.js | 42 ------------ .../form_remove_editions_from_collection.js | 5 +- .../ascribe_forms/form_share_email.js | 50 ++++----------- js/components/ascribe_modal/modal_login.js | 33 ---------- js/components/ascribe_modal/modal_signup.js | 32 ---------- js/constants/api_urls.js | 3 +- sass/ascribe_accordion_list.scss | 2 +- 16 files changed, 131 insertions(+), 370 deletions(-) create mode 100644 js/components/ascribe_buttons/create_editions_button.js delete mode 100644 js/components/ascribe_forms/form_login.js delete mode 100644 js/components/ascribe_forms/form_note_edition.js delete mode 100644 js/components/ascribe_forms/form_note_personal.js delete mode 100644 js/components/ascribe_forms/form_password_reset.js delete mode 100644 js/components/ascribe_forms/form_password_reset_request.js delete mode 100644 js/components/ascribe_modal/modal_login.js delete mode 100644 js/components/ascribe_modal/modal_signup.js diff --git a/js/components/ascribe_buttons/acl_button.js b/js/components/ascribe_buttons/acl_button.js index e054a23c..1e20d0d8 100644 --- a/js/components/ascribe_buttons/acl_button.js +++ b/js/components/ascribe_buttons/acl_button.js @@ -14,18 +14,21 @@ import GlobalNotificationModel from '../../models/global_notification_model'; import GlobalNotificationActions from '../../actions/global_notification_actions'; import { getLangText } from '../../utils/lang_utils.js'; - +import apiUrls from '../../constants/api_urls'; let AclButton = React.createClass({ propTypes: { action: React.PropTypes.oneOf(AppConstants.aclList).isRequired, availableAcls: React.PropTypes.array.isRequired, - pieceOrEditions: React.PropTypes.array.isRequired, + pieceOrEditions: React.PropTypes.object.isRequired, currentUser: React.PropTypes.object, handleSuccess: React.PropTypes.func.isRequired, className: React.PropTypes.string }, + isPiece(){ + return !(this.props.pieceOrEditions.constructor === Array); + }, actionProperties(){ if (this.props.action === 'consign'){ return { @@ -62,16 +65,46 @@ let AclButton = React.createClass({ return { title: getLangText('Share artwork'), tooltip: getLangText('Share the artwork'), - form: , + form: ( + + ), handleSuccess: this.showNotification }; } }, + showNotification(response){ this.props.handleSuccess(); let notification = new GlobalNotificationModel(response.notification, 'success'); GlobalNotificationActions.appendGlobalNotification(notification); }, + + getTitlesString(){ + if (this.isPiece()){ + return '\"' + this.props.pieceOrEditions.title + '\"'; + } + else { + return this.props.pieceOrEditions.map(function(edition) { + return '- \"' + edition.title + ', ' + getLangText('edition') + ' ' + edition.edition_number + '\"\n'; + }).join(''); + } + + }, + + getFormDataId(){ + if (this.isPiece()) { + return {piece_id: this.props.pieceOrEditions.id}; + } + else { + return {bitcoin_id: this.props.pieceOrEditions.map(function(edition){ + return edition.bitcoin_id; + }).join()}; + } + }, + render() { let shouldDisplay = this.props.availableAcls.indexOf(this.props.action) > -1; let aclProps = this.actionProperties(); @@ -88,6 +121,18 @@ let AclButton = React.createClass({ { aclProps.form } ); + }, + + getShareMessage(){ + return ( +`${getLangText('Hi')}, + +${getLangText('I am sharing')} : +${this.getTitlesString()}${getLangText('with you')}. + +${getLangText('Truly yours')}, +${this.props.currentUser.username}` + ); } }); diff --git a/js/components/ascribe_buttons/acl_button_list.js b/js/components/ascribe_buttons/acl_button_list.js index 07003d11..eb3dc720 100644 --- a/js/components/ascribe_buttons/acl_button_list.js +++ b/js/components/ascribe_buttons/acl_button_list.js @@ -7,11 +7,12 @@ import UserStore from '../../stores/user_store'; import AclButton from '../ascribe_buttons/acl_button'; import DeleteButton from '../ascribe_buttons/delete_button'; +import CreateEditionButton from '../ascribe_buttons/create_editions_button'; let AclButtonList = React.createClass({ propTypes: { className: React.PropTypes.string, - editions: React.PropTypes.array, + editions: React.PropTypes.object, availableAcls: React.PropTypes.array, handleSuccess: React.PropTypes.func }, @@ -66,7 +67,10 @@ let AclButtonList = React.createClass({ pieceOrEditions={this.props.editions} currentUser={this.state.currentUser} handleSuccess={this.props.handleSuccess} /> - + + ); } diff --git a/js/components/ascribe_buttons/create_editions_button.js b/js/components/ascribe_buttons/create_editions_button.js new file mode 100644 index 00000000..4b189db2 --- /dev/null +++ b/js/components/ascribe_buttons/create_editions_button.js @@ -0,0 +1,44 @@ +'use strict'; + +import React from 'react'; +import Router from 'react-router'; + +import Button from 'react-bootstrap/lib/Button'; + +import EditionDeleteForm from '../ascribe_forms/form_delete_edition'; +import EditionRemoveFromCollectionForm from '../ascribe_forms/form_remove_editions_from_collection'; +import ModalWrapper from '../ascribe_modal/modal_wrapper'; +import AccordionListItemCreateEditions from './../ascribe_accordion_list/accordion_list_item_create_editions'; +import GlobalNotificationModel from '../../models/global_notification_model'; +import GlobalNotificationActions from '../../actions/global_notification_actions'; + +import { getAvailableAcls } from '../../utils/acl_utils'; +import { getLangText } from '../../utils/lang_utils.js' + +import EditionListActions from '../../actions/edition_list_actions'; + +let CreateEditionsButton = React.createClass({ + propTypes: { + piece: React.PropTypes.object.isRequired + }, + + mixins: [Router.Navigation], + + render: function () { + if (this.props.piece.constructor === Array){ + return null; + } + let availableAcls = getAvailableAcls([this.props.piece]); + if (availableAcls.indexOf('editions') === -1){ + return null; + } + return ( + + ); + } +}); + +export default CreateEditionsButton; + diff --git a/js/components/ascribe_detail/edition.js b/js/components/ascribe_detail/edition.js index df3f86b5..028cb8ae 100644 --- a/js/components/ascribe_detail/edition.js +++ b/js/components/ascribe_detail/edition.js @@ -218,7 +218,6 @@ let EditionSummary = React.createClass({ {this.getStatus()} -
{this.getActions()}
diff --git a/js/components/ascribe_detail/piece.js b/js/components/ascribe_detail/piece.js index b04b511e..d37addea 100644 --- a/js/components/ascribe_detail/piece.js +++ b/js/components/ascribe_detail/piece.js @@ -70,7 +70,8 @@ let Piece = React.createClass({ content={this.props.piece}/> + piece={this.props.piece} + handleSuccess={this.props.loadPiece}/> -1 @@ -95,26 +96,24 @@ let PieceSummary = React.createClass({ propTypes: { piece: React.PropTypes.object }, - getActions(){ - //let actions = ( - // - // - // - // - // ); - //return actions; - return null; + let actions = ( + + + + + ); + return actions; + //return null; }, render() { return (
-
{this.getActions()}
diff --git a/js/components/ascribe_forms/form_login.js b/js/components/ascribe_forms/form_login.js deleted file mode 100644 index fc44b08b..00000000 --- a/js/components/ascribe_forms/form_login.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -import React from 'react'; - -import apiUrls from '../../constants/api_urls'; -import FormMixin from '../../mixins/form_mixin'; -import InputText from './input_text'; -import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close'; - -import SignupModal from '../ascribe_modal/modal_signup'; -import PasswordResetRequestModal from '../ascribe_modal/modal_password_request_reset'; -import { getLangText } from '../../utils/lang_utils.js'; - -let LoginForm = React.createClass({ - mixins: [FormMixin], - - - url() { - return apiUrls.users_login; - }, - - getFormData() { - return { - email: this.refs.email.state.value, - password: this.refs.password.state.value - }; - }, - renderForm() { - return ( -
- - - - -
- {getLangText('Forgot your password')}? - {getLangText('Reset password')}}/> -
-
- {getLangText('Not a member yet')}? - {getLangText('Sign up')}}/> -
- - - ); - } -}); - -export default LoginForm; diff --git a/js/components/ascribe_forms/form_note_edition.js b/js/components/ascribe_forms/form_note_edition.js deleted file mode 100644 index ca1af7ed..00000000 --- a/js/components/ascribe_forms/form_note_edition.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -import React from 'react'; - -import apiUrls from '../../constants/api_urls'; -import FormMixin from '../../mixins/form_mixin'; - -import InputTextAreaToggable from './input_textarea_toggable'; - - -let EditionNoteForm = React.createClass({ - mixins: [FormMixin], - - url() { - return apiUrls.note_edition; - }, - - getFormData() { - return { - bitcoin_id: this.getBitcoinIds().join(), - note: this.refs.personalNote.state.value - }; - }, - - renderForm() { - - return ( -
- - - ); - } -}); - -export default EditionNoteForm; \ No newline at end of file diff --git a/js/components/ascribe_forms/form_note_personal.js b/js/components/ascribe_forms/form_note_personal.js deleted file mode 100644 index 7f3c4f2b..00000000 --- a/js/components/ascribe_forms/form_note_personal.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -import React from 'react'; - -import apiUrls from '../../constants/api_urls'; -import FormMixin from '../../mixins/form_mixin'; - -import InputTextAreaToggable from './input_textarea_toggable'; - - -let PersonalNoteForm = React.createClass({ - mixins: [FormMixin], - - url() { - return apiUrls.note_notes; - }, - - getFormData() { - return { - bitcoin_id: this.getBitcoinIds().join(), - note: this.refs.personalNote.state.value - }; - }, - - renderForm() { - - return ( -
- - - ); - } -}); - -export default PersonalNoteForm; \ No newline at end of file diff --git a/js/components/ascribe_forms/form_password_reset.js b/js/components/ascribe_forms/form_password_reset.js deleted file mode 100644 index e42689a4..00000000 --- a/js/components/ascribe_forms/form_password_reset.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -import React from 'react'; - -import apiUrls from '../../constants/api_urls'; -import FormMixin from '../../mixins/form_mixin'; -import InputText from './input_text'; -import ButtonSubmit from '../ascribe_buttons/button_submit'; -import { getLangText } from '../../utils/lang_utils.js' - -let PasswordResetForm = React.createClass({ - mixins: [FormMixin], - - url() { - return apiUrls.users_password_reset; - }, - - getFormData() { - return { - email: this.props.email, - token: this.props.token, - password: this.refs.password.state.value, - password_confirm: this.refs.password_confirm.state.value - }; - }, - - renderForm() { - return ( -
-
Reset the password for {this.props.email}:
- - - - - ); - } -}); - -export default PasswordResetForm; \ No newline at end of file diff --git a/js/components/ascribe_forms/form_password_reset_request.js b/js/components/ascribe_forms/form_password_reset_request.js deleted file mode 100644 index 7e5ac62b..00000000 --- a/js/components/ascribe_forms/form_password_reset_request.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -import React from 'react'; - -import apiUrls from '../../constants/api_urls'; -import FormMixin from '../../mixins/form_mixin'; -import InputText from './input_text'; -import ButtonSubmitOrClose from '../ascribe_buttons/button_submit_close'; -import { getLangText } from '../../utils/lang_utils.js' - -let PasswordResetRequestForm = React.createClass({ - mixins: [FormMixin], - - url() { - return apiUrls.users_password_reset_request; - }, - - getFormData() { - return { - email: this.refs.email.state.value - }; - }, - - renderForm() { - return ( -
- - - - ); - } -}); - -export default PasswordResetRequestForm; 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 71607b3d..0ba13975 100644 --- a/js/components/ascribe_forms/form_remove_editions_from_collection.js +++ b/js/components/ascribe_forms/form_remove_editions_from_collection.js @@ -24,8 +24,9 @@ let EditionRemoveFromCollectionForm = React.createClass({

{getLangText('Are you sure you would like to remove these editions from your collection')}?

{getLangText('This is an irrevocable action%s', '.')}

- - + +
); diff --git a/js/components/ascribe_forms/form_share_email.js b/js/components/ascribe_forms/form_share_email.js index 8c01cf6a..cfdce452 100644 --- a/js/components/ascribe_forms/form_share_email.js +++ b/js/components/ascribe_forms/form_share_email.js @@ -2,7 +2,7 @@ import React from 'react'; -import ApiUrls from '../../constants/api_urls'; + import Form from './form'; import Property from './property'; @@ -15,49 +15,27 @@ import { getLangText } from '../../utils/lang_utils.js'; let ShareForm = React.createClass({ propTypes: { + url: React.PropTypes.string, + id: React.PropTypes.string, + message: React.PropTypes.string, editions: React.PropTypes.array, - currentUser: React.PropTypes.object + currentUser: React.PropTypes.object, + onRequestHide: React.PropTypes.func, + handleSuccess: React.PropTypes.func }, - getFormData() { - return { - 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; - }); - }, - - getTitlesString(){ - return this.props.editions.map(function(edition){ - return '- \"' + edition.title + ', ' + getLangText('edition') + ' ' + edition.edition_number + '\"\n'; - }); + getFormData(){ + return this.props.id; }, render() { - let title = this.getTitlesString().join(''); - let username = this.props.currentUser.username; - let message = -`${getLangText('Hi')}, -${getLangText('I am sharing')} : -${title}${getLangText('with you')}. - -${getLangText('Truly yours')}, -${username}`; return (

@@ -73,9 +51,7 @@ ${username}`; spinner={

-
- } - > + }> @@ -91,7 +67,7 @@ ${username}`; diff --git a/js/components/ascribe_modal/modal_login.js b/js/components/ascribe_modal/modal_login.js deleted file mode 100644 index 70fe9ece..00000000 --- a/js/components/ascribe_modal/modal_login.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -import React from 'react'; - -import ModalWrapper from './modal_wrapper'; -import LoginForm from '../ascribe_forms/form_login'; - -import GlobalNotificationModel from '../../models/global_notification_model'; -import GlobalNotificationActions from '../../actions/global_notification_actions'; -import { getLangText } from '../../utils/lang_utils.js' - -let LoginModal = React.createClass({ - handleLoginSuccess(){ - this.props.handleSuccess(); - let notificationText = getLangText('Login successful'); - let notification = new GlobalNotificationModel(notificationText, 'success'); - GlobalNotificationActions.appendGlobalNotification(notification); - }, - - render() { - return ( - - - - ); - } -}); - -export default LoginModal; diff --git a/js/components/ascribe_modal/modal_signup.js b/js/components/ascribe_modal/modal_signup.js deleted file mode 100644 index 49f3cde5..00000000 --- a/js/components/ascribe_modal/modal_signup.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -import React from 'react'; - -import ModalWrapper from './modal_wrapper'; -import SignupForm from '../ascribe_forms/form_signup'; - -import GlobalNotificationModel from '../../models/global_notification_model'; -import GlobalNotificationActions from '../../actions/global_notification_actions'; -import { getLangText } from '../../utils/lang_utils.js' - -let SignupModal = React.createClass({ - handleSignupSuccess(response){ - let notificationText = getLangText('We sent an email to your address') + ' ' + response.user.email + ', ' + getLangText('please confirm') + '.'; - let notification = new GlobalNotificationModel(notificationText, 'success', 50000); - GlobalNotificationActions.appendGlobalNotification(notification); - }, - - render() { - return ( - - - - ); - } -}); - -export default SignupModal; diff --git a/js/constants/api_urls.js b/js/constants/api_urls.js index b5d9a9eb..6d3ce7c8 100644 --- a/js/constants/api_urls.js +++ b/js/constants/api_urls.js @@ -12,7 +12,7 @@ let apiUrls = { 'coa_verify': AppConstants.apiEndpoint + 'coa/verify_coa/', 'edition': AppConstants.apiEndpoint + 'editions/${bitcoin_id}/', 'edition_delete': AppConstants.apiEndpoint + 'editions/${edition_id}/', - 'edition_remove_from_collection': AppConstants.apiEndpoint + 'ownership/shares/${edition_id}/', + 'edition_remove_from_collection': AppConstants.apiEndpoint + 'ownership/shares/editions/${edition_id}/', '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/', @@ -26,6 +26,7 @@ let apiUrls = { 'ownership_loans_deny': AppConstants.apiEndpoint + 'ownership/loans/deny/', 'ownership_loans_contract': AppConstants.apiEndpoint + 'ownership/loans/contract/', 'ownership_shares_editions': AppConstants.apiEndpoint + 'ownership/shares/editions/', + 'ownership_shares_pieces': AppConstants.apiEndpoint + 'ownership/shares/pieces/', 'ownership_transfers': AppConstants.apiEndpoint + 'ownership/transfers/', 'ownership_transfers_withdraw': AppConstants.apiEndpoint + 'ownership/transfers/withdraw/', 'ownership_unconsigns': AppConstants.apiEndpoint + 'ownership/unconsigns/', diff --git a/sass/ascribe_accordion_list.scss b/sass/ascribe_accordion_list.scss index 6a8208ce..962358f2 100644 --- a/sass/ascribe_accordion_list.scss +++ b/sass/ascribe_accordion_list.scss @@ -93,7 +93,7 @@ $ascribe-accordion-list-font: 'Source Sans Pro'; } } border-left: 3px solid rgba(0,0,0,0); - border-top: 1px solid rgba(0,0,0,.1); + //border-top: 1px solid rgba(0,0,0,.1); border-bottom: 1px solid rgba(0,0,0,.05); } tbody {