From b1ad4cc36f37ea8f7365da72b7a0fb62a259a9fd Mon Sep 17 00:00:00 2001 From: diminator Date: Thu, 25 Jun 2015 23:25:03 +0200 Subject: [PATCH] withdraw transfer part one --- js/components/edition.js | 489 ------------------------------- js/components/login_container.js | 2 +- sass/main.scss | 6 + 3 files changed, 7 insertions(+), 490 deletions(-) diff --git a/js/components/edition.js b/js/components/edition.js index cb5f0dbb..e69de29b 100644 --- a/js/components/edition.js +++ b/js/components/edition.js @@ -1,489 +0,0 @@ -'use strict'; - -import React from 'react'; -import Router from 'react-router'; - -import Row from 'react-bootstrap/lib/Row'; -import Col from 'react-bootstrap/lib/Col'; -import Button from 'react-bootstrap/lib/Button'; -import Glyphicon from 'react-bootstrap/lib/Glyphicon'; - -import UserActions from '../actions/user_actions'; -import UserStore from '../stores/user_store'; -import CoaActions from '../actions/coa_actions'; -import CoaStore from '../stores/coa_store'; - -import MediaPlayer from './ascribe_media/media_player'; - -import CollapsibleParagraph from './ascribe_collapsible/collapsible_paragraph'; - -import Form from './ascribe_forms/form'; -import Property from './ascribe_forms/property'; -import InputTextAreaToggable from './ascribe_forms/input_textarea_toggable'; - -import PieceExtraDataForm from './ascribe_forms/form_piece_extradata'; -import RequestActionForm from './ascribe_forms/form_request_action'; - -import EditionActions from '../actions/edition_actions'; -import AclButtonList from './ascribe_buttons/acl_button_list'; - -import GlobalNotificationModel from '../models/global_notification_model'; -import GlobalNotificationActions from '../actions/global_notification_actions'; - -import apiUrls from '../constants/api_urls'; -import AppConstants from '../constants/application_constants'; - -let Link = Router.Link; -/** - * This is the component that implements display-specific functionality - */ -let Edition = React.createClass({ - propTypes: { - edition: React.PropTypes.object, - loadEdition: React.PropTypes.func - }, - - getInitialState() { - return UserStore.getState(); - }, - - componentDidMount() { - UserStore.listen(this.onChange); - UserActions.fetchCurrentUser(); - }, - - componentWillUnmount() { - UserStore.unlisten(this.onChange); - }, - - onChange(state) { - this.setState(state); - }, - - render() { - let thumbnail = this.props.edition.thumbnail; - let mimetype = this.props.edition.digital_work.mime; - let extraData = null; - - if (this.props.edition.digital_work.encoding_urls) { - extraData = this.props.edition.digital_work.encoding_urls.map(e => { return { url: e.url, type: e.label }; }); - } - - let bitcoinIdValue = ( - {this.props.edition.bitcoin_id} - ); - - let hashOfArtwork = ( - {this.props.edition.hash_as_address} - ); - - let ownerAddress = ( - {this.props.edition.btc_owner_address_noprefix} - ); - - return ( - - - -

- -

- - - - - - -1 || this.props.edition.public_note)}> - - - - - -1 || Object.keys(this.props.edition.extra_data).length > 0}> - - - - -1}> - - - - 0}> - - - - 0}> - - - - 0}> - - - - -
- -
{bitcoinIdValue}
-
- -
{hashOfArtwork}
-
- -
{ownerAddress}
-
-
-
-
- -
- ); - } -}); - -let EditionHeader = React.createClass({ - propTypes: { - edition: React.PropTypes.object - }, - - render() { - var titleHtml =
{this.props.edition.title}
; - return ( -
- - - -
-
- ); - } -}); - - -let EditionSummary = React.createClass({ - propTypes: { - edition: React.PropTypes.object - }, - - handleSuccess(){ - EditionActions.fetchOne(this.props.edition.id); - }, - showNotification(response){ - this.handleSuccess(); - let notification = new GlobalNotificationModel(response.notification, 'success'); - GlobalNotificationActions.appendGlobalNotification(notification); - }, - render() { - let status = null; - if (this.props.edition.status.length > 0){ - status = ; - } - let actions = null; - if (this.props.edition.request_action && this.props.edition.request_action.length > 0){ - actions = ( - ); - } - else { - actions = ( - - - - - ); - } - - return ( -
- - - - {status} -
- {actions} -
-
- ); - - } -}); - - -let EditionDetailProperty = React.createClass({ - propTypes: { - label: React.PropTypes.string, - value: React.PropTypes.oneOfType([ - React.PropTypes.string, - React.PropTypes.element - ]), - separator: React.PropTypes.string, - labelClassName: React.PropTypes.string, - valueClassName: React.PropTypes.string - }, - - getDefaultProps() { - return { - separator: ':', - labelClassName: 'col-xs-5 col-sm-4 col-md-3 col-lg-3', - valueClassName: 'col-xs-7 col-sm-8 col-md-9 col-lg-9' - }; - }, - - render() { - return ( -
-
-
-
{ this.props.label + this.props.separator}
-
-
-
{ this.props.value }
-
-
-
- ); - } -}); - -let EditionDetailHistoryIterator = React.createClass({ - propTypes: { - history: React.PropTypes.array - }, - - render() { - return ( -
- {this.props.history.map((historicalEvent, i) => { - return ( - - ); - })} -
- ); - } -}); - -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('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('Public note saved', 'success'); - GlobalNotificationActions.appendGlobalNotification(notification); - }, - render() { - let isEditable = this.props.edition.acl.indexOf('edit') > -1; - if (this.props.edition.acl.indexOf('edit') > -1 || this.props.edition.public_note){ - return ( -
- - - - -
-
- ); - } - return null; - } -}); - - -let EditionFurtherDetails = React.createClass({ - propTypes: { - edition: React.PropTypes.object, - handleSuccess: React.PropTypes.func - }, - showNotification(){ - this.props.handleSuccess(); - let notification = new GlobalNotificationModel('Details updated', 'success'); - GlobalNotificationActions.appendGlobalNotification(notification); - }, - - render() { - let editable = this.props.edition.acl.indexOf('edit') > -1; - return ( - - - - - - - - ); - } -}); - -let CoaDetails = React.createClass({ - propTypes: { - edition: React.PropTypes.object - }, - - getInitialState() { - return CoaStore.getState(); - }, - - componentDidMount() { - CoaStore.listen(this.onChange); - if (this.props.edition.coa) { - CoaActions.fetchOne(this.props.edition.coa); - } - else{ - console.log('create coa'); - CoaActions.create(this.props.edition); - } - }, - - componentWillUnmount() { - CoaStore.unlisten(this.onChange); - }, - - onChange(state) { - this.setState(state); - }, - - render() { - if (this.state.coa.url_safe) { - return ( -
-

- - - - - -

-
- ); - } - return ( -
- -
); - - } -}); - -export default Edition; diff --git a/js/components/login_container.js b/js/components/login_container.js index 4363971f..24b63ce7 100644 --- a/js/components/login_container.js +++ b/js/components/login_container.js @@ -40,7 +40,7 @@ let LoginForm = React.createClass({ GlobalNotificationActions.appendGlobalNotification(notification); /*Taken from http://stackoverflow.com/a/14916411 */ - /* + /* We actually have to trick the Browser into showing the "save password" dialog as Chrome expects the login page to be reloaded after the login. Users on Stack Overflow claim this is a bug in chrome and should be fixed in the future. diff --git a/sass/main.scss b/sass/main.scss index 0fa799ab..7b2a7494 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -33,6 +33,12 @@ body { display: none; } +.no-margin{ + margin: 0; +} +.no-padding{ + padding: 0; +} .navbar-default { border: none; border-left:0;