From 2436e198db4b0512862aae8214c4208a9152f958 Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 1 Jul 2015 09:15:36 +0200 Subject: [PATCH 1/7] styling + licenses url --- js/components/register_piece.js | 8 ++++---- sass/variables.scss | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/components/register_piece.js b/js/components/register_piece.js index 2e7fc184..5ae5fa57 100644 --- a/js/components/register_piece.js +++ b/js/components/register_piece.js @@ -51,7 +51,7 @@ let RegisterPiece = React.createClass( { }, handleSuccess(){ - let notification = new GlobalNotificationModel('Login successsful', 'success', 10000); + let notification = new GlobalNotificationModel('Piece successfully registered', 'success', 10000); GlobalNotificationActions.appendGlobalNotification(notification); this.transitionTo('pieces'); }, @@ -98,7 +98,7 @@ let RegisterPiece = React.createClass( { onChange={this.onLicenseChange} footer={ - Learn more about this license + Learn more }> `s -$input-color: white !default; +$input-color: $gray !default; //** `` border color $input-border: #ccc !default; From 3e71926b7df50454386164f908331d4fc84d1e1f Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 1 Jul 2015 11:21:43 +0200 Subject: [PATCH 2/7] register piece transitions --- js/components/register_piece.js | 6 +++--- sass/main.scss | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/js/components/register_piece.js b/js/components/register_piece.js index 5ae5fa57..c59296e9 100644 --- a/js/components/register_piece.js +++ b/js/components/register_piece.js @@ -50,10 +50,10 @@ let RegisterPiece = React.createClass( { this.setState(state); }, - handleSuccess(){ - let notification = new GlobalNotificationModel('Piece successfully registered', 'success', 10000); + handleSuccess(response){ + let notification = new GlobalNotificationModel(response.notification, 'success', 10000); GlobalNotificationActions.appendGlobalNotification(notification); - this.transitionTo('pieces'); + this.transitionTo('edition', {editionId: response.edition.bitcoin_id}); }, getFormData(){ diff --git a/sass/main.scss b/sass/main.scss index 4b7230bb..570bdff4 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -97,7 +97,10 @@ body { margin-right: 0; margin-left: 0; } - +.btn-delete{ + background-color: rgba(0,0,0,0); + color: #888; +} .btn-ascribe, .btn-ascribe-inv { border: 1px solid #444; line-height: 2em; From f58a65eb0c040d3574e3987c59cb41b470afa670 Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 1 Jul 2015 11:43:33 +0200 Subject: [PATCH 3/7] s3 views dont accept anonymous --- js/components/ascribe_buttons/delete_button.js | 4 ++-- sass/main.scss | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/js/components/ascribe_buttons/delete_button.js b/js/components/ascribe_buttons/delete_button.js index 7077138d..37f3d862 100644 --- a/js/components/ascribe_buttons/delete_button.js +++ b/js/components/ascribe_buttons/delete_button.js @@ -42,11 +42,11 @@ let DeleteButton = React.createClass({ if (availableAcls.indexOf('delete') > -1) { content = ; - btnDelete = ; + btnDelete = ; } else if (availableAcls.indexOf('del_from_collection') > -1){ content = ; - btnDelete = ; + btnDelete = ; } else{ return null; diff --git a/sass/main.scss b/sass/main.scss index 93b7155e..c0d15861 100644 --- a/sass/main.scss +++ b/sass/main.scss @@ -100,6 +100,10 @@ body { .btn-delete{ background-color: rgba(0,0,0,0); color: #888; + border: 1px solid rgba(0,0,0,0); + &:hover{ + border: 1px solid $ascribe-brand-danger; + } } .btn-ascribe, .btn-ascribe-inv { border: 1px solid #444; From 1ec47338a109155b43422a5e89b94efbf1784da1 Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 1 Jul 2015 12:17:50 +0200 Subject: [PATCH 4/7] deleted editions cannot be retrieved --- js/components/ascribe_accordion_list/accordion_list_item.js | 2 +- sass/ascribe_accordion_list.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/components/ascribe_accordion_list/accordion_list_item.js b/js/components/ascribe_accordion_list/accordion_list_item.js index 27eaf0d0..03c66d1f 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item.js +++ b/js/components/ascribe_accordion_list/accordion_list_item.js @@ -19,7 +19,7 @@ let AccordionListItem = React.createClass({
-
+

{this.props.content.title}

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

{this.props.content.date_created.split('-')[0]}

diff --git a/sass/ascribe_accordion_list.scss b/sass/ascribe_accordion_list.scss index 90af4bfb..e39204e8 100644 --- a/sass/ascribe_accordion_list.scss +++ b/sass/ascribe_accordion_list.scss @@ -41,7 +41,7 @@ $ascribe-accordion-list-font: 'Source Sans Pro'; } h3 { font-size: 1.1em; - margin: .7em 0 0 0; + margin: .2em 0 0 0; } } } From eb947e68aaf6a5f99bcabe116cbdd9d0eee20c3f Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 1 Jul 2015 13:54:58 +0200 Subject: [PATCH 5/7] licenses in header and on piece level --- .../ascribe_accordion_list/accordion_list_item.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/js/components/ascribe_accordion_list/accordion_list_item.js b/js/components/ascribe_accordion_list/accordion_list_item.js index 03c66d1f..40771dc2 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item.js +++ b/js/components/ascribe_accordion_list/accordion_list_item.js @@ -16,13 +16,20 @@ let AccordionListItem = React.createClass({
-
- +
+
+ +
-
+

{this.props.content.title}

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

-

{this.props.content.date_created.split('-')[0]}

+
+ {this.props.content.date_created.split('-')[0]} + + {this.props.content.license_type.code} license + +
From 5f372eedda57fb25c649812b7a8b667f0b44445e Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 1 Jul 2015 15:28:48 +0200 Subject: [PATCH 6/7] edition_index + default license --- .../ascribe_accordion_list/accordion_list_item.js | 14 ++++++++++++-- js/constants/api_urls.js | 1 + sass/ascribe_accordion_list.scss | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/js/components/ascribe_accordion_list/accordion_list_item.js b/js/components/ascribe_accordion_list/accordion_list_item.js index 40771dc2..23b54ad3 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item.js +++ b/js/components/ascribe_accordion_list/accordion_list_item.js @@ -1,28 +1,38 @@ 'use strict'; import React from 'react'; +import Router from 'react-router'; + +import requests from '../../utils/requests'; import { getLangText } from '../../utils/lang_utils'; let AccordionListItem = React.createClass({ + mixins: [Router.Navigation], + propTypes: { className: React.PropTypes.string, content: React.PropTypes.object, children: React.PropTypes.object }, + handleClick(event){ + requests.get('piece_first_edition_id', {'piece_id': this.props.content.id}) + .then((res) => this.transitionTo('edition', {editionId: res.bitcoin_id})); + console.log(event.target); + }, render() { return (
-
+
-

{this.props.content.title}

+

{this.props.content.title}

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

{this.props.content.date_created.split('-')[0]} diff --git a/js/constants/api_urls.js b/js/constants/api_urls.js index 97da32e2..6d84785d 100644 --- a/js/constants/api_urls.js +++ b/js/constants/api_urls.js @@ -31,6 +31,7 @@ let apiUrls = { 'ownership_unconsigns_request': AppConstants.apiEndpoint + 'ownership/unconsigns/request/', 'piece': AppConstants.apiEndpoint + 'pieces/${piece_id}', 'piece_extradata': AppConstants.apiEndpoint + 'pieces/${piece_id}/extradata/', + 'piece_first_edition_id': AppConstants.apiEndpoint + 'pieces/${piece_id}/edition_index/', 'pieces_list': AppConstants.apiEndpoint + 'pieces/', 'user': AppConstants.apiEndpoint + 'users/', 'users_login': AppConstants.apiEndpoint + 'users/login/', diff --git a/sass/ascribe_accordion_list.scss b/sass/ascribe_accordion_list.scss index e39204e8..42ae2f12 100644 --- a/sass/ascribe_accordion_list.scss +++ b/sass/ascribe_accordion_list.scss @@ -24,6 +24,7 @@ $ascribe-accordion-list-font: 'Source Sans Pro'; width: 110px; height: 110px; padding:0; + cursor: pointer; img { max-width: 100%; max-height: 100%; @@ -38,6 +39,7 @@ $ascribe-accordion-list-font: 'Source Sans Pro'; h1 { margin-top: .3em; font-size: 2.25em; + cursor: pointer; } h3 { font-size: 1.1em; From 4ca2144c0c5c1b4866e1ea63d359d51ccaef1dcc Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 1 Jul 2015 19:05:47 +0200 Subject: [PATCH 7/7] request actions in frontend --- js/actions/piece_list_actions.js | 35 ++++++++++++------- .../accordion_list_item.js | 17 +++++++++ .../accordion_list_item_table_editions.js | 6 +++- .../ascribe_forms/form_request_action.js | 4 +-- .../piece_list_toolbar.js | 2 +- .../piece_list_toolbar_filter_widget.js | 2 +- .../ascribe_table/table_item_acl_filtered.js | 2 +- js/components/header.js | 7 +++- js/components/piece_list.js | 3 +- js/components/settings_container.js | 2 +- js/constants/api_urls.js | 1 + js/fetchers/piece_list_fetcher.js | 4 +++ js/stores/piece_list_store.js | 5 +++ sass/ascribe_accordion_list.scss | 12 +++++++ sass/main.scss | 10 ++++-- 15 files changed, 89 insertions(+), 23 deletions(-) diff --git a/js/actions/piece_list_actions.js b/js/actions/piece_list_actions.js index a4ab626c..2d5f6447 100644 --- a/js/actions/piece_list_actions.js +++ b/js/actions/piece_list_actions.js @@ -8,23 +8,34 @@ import PieceListFetcher from '../fetchers/piece_list_fetcher'; class PieceListActions { constructor() { this.generateActions( - 'updatePieceList' + 'updatePieceList', + 'updatePieceListRequestActions' ); } fetchPieceList(page, pageSize, search, orderBy, orderAsc) { - PieceListFetcher - .fetch(page, pageSize, search, orderBy, orderAsc) - .then((res) => { - this.actions.updatePieceList({ - page, - pageSize, - search, - orderBy, - orderAsc, - 'pieceList': res.pieces, - 'pieceListCount': res.count + return new Promise((resolve, reject) => { + PieceListFetcher + .fetch(page, pageSize, search, orderBy, orderAsc) + .then((res) => { + this.actions.updatePieceList({ + page, + pageSize, + search, + orderBy, + orderAsc, + 'pieceList': res.pieces, + 'pieceListCount': res.count + }); + resolve(); }); + }); + } + fetchPieceRequestActions() { + PieceListFetcher + .fetchRequestActions() + .then((res) => { + this.actions.updatePieceListRequestActions(res.piece_ids); }); } diff --git a/js/components/ascribe_accordion_list/accordion_list_item.js b/js/components/ascribe_accordion_list/accordion_list_item.js index 23b54ad3..f7bfa925 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item.js +++ b/js/components/ascribe_accordion_list/accordion_list_item.js @@ -3,6 +3,10 @@ import React from 'react'; import Router from 'react-router'; +import Glyphicon from 'react-bootstrap/lib/Glyphicon'; +import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger'; +import Tooltip from 'react-bootstrap/lib/Tooltip'; + import requests from '../../utils/requests'; import { getLangText } from '../../utils/lang_utils'; @@ -21,6 +25,16 @@ let AccordionListItem = React.createClass({ console.log(event.target); }, + getGlyphicon(){ + if (this.props.content.requestAction){ + return ( + You have actions pending in one of your editions}> + + ); + } + return null; + }, render() { return (
@@ -42,6 +56,9 @@ let AccordionListItem = React.createClass({
+
+ {this.getGlyphicon()} +
{this.props.children} diff --git a/js/components/ascribe_accordion_list/accordion_list_item_table_editions.js b/js/components/ascribe_accordion_list/accordion_list_item_table_editions.js index a3fcc00d..7e030f1c 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item_table_editions.js +++ b/js/components/ascribe_accordion_list/accordion_list_item_table_editions.js @@ -139,8 +139,12 @@ let AccordionListItemTableEditions = React.createClass({ ), new ColumnModel( (item) => { + let content = item.acl; + if (item.request_action){ + content = [item.request_action + ' request']; + } return { - 'content': item.acl + 'content': content }; }, 'acl', getLangText('Actions'), diff --git a/js/components/ascribe_forms/form_request_action.js b/js/components/ascribe_forms/form_request_action.js index c355460f..8772871f 100644 --- a/js/components/ascribe_forms/form_request_action.js +++ b/js/components/ascribe_forms/form_request_action.js @@ -54,10 +54,10 @@ let RequestActionForm = React.createClass({ let buttons = ( -
ACCEPT
+
ACCEPT
-
REJECT
+
REJECT
); diff --git a/js/components/ascribe_piece_list_toolbar/piece_list_toolbar.js b/js/components/ascribe_piece_list_toolbar/piece_list_toolbar.js index 135a112d..49037991 100644 --- a/js/components/ascribe_piece_list_toolbar/piece_list_toolbar.js +++ b/js/components/ascribe_piece_list_toolbar/piece_list_toolbar.js @@ -21,7 +21,7 @@ let PieceListToolbar = React.createClass({ }, render() { - let searchIcon = ; + let searchIcon = ; return (
diff --git a/js/components/ascribe_piece_list_toolbar/piece_list_toolbar_filter_widget.js b/js/components/ascribe_piece_list_toolbar/piece_list_toolbar_filter_widget.js index d9d2b172..64974b41 100644 --- a/js/components/ascribe_piece_list_toolbar/piece_list_toolbar_filter_widget.js +++ b/js/components/ascribe_piece_list_toolbar/piece_list_toolbar_filter_widget.js @@ -8,7 +8,7 @@ import MenuItem from 'react-bootstrap/lib/MenuItem'; let PieceListToolbarFilterWidgetFilter = React.createClass({ render() { - let filterIcon = ; + let filterIcon = ; return ( diff --git a/js/components/ascribe_table/table_item_acl_filtered.js b/js/components/ascribe_table/table_item_acl_filtered.js index 10a419f0..562f1268 100644 --- a/js/components/ascribe_table/table_item_acl_filtered.js +++ b/js/components/ascribe_table/table_item_acl_filtered.js @@ -9,7 +9,7 @@ let TableItemAclFiltered = React.createClass({ }, render() { - var availableAcls = ['consign', 'loan', 'transfer', 'view']; + var availableAcls = ['consign', 'loan', 'transfer', 'view', 'consign request', 'unconsign request', 'loan request']; let filteredAcls = this.props.content.filter((v) => { return availableAcls.indexOf(v) > -1; diff --git a/js/components/header.js b/js/components/header.js index e4233a06..f1b1b8a3 100644 --- a/js/components/header.js +++ b/js/components/header.js @@ -80,6 +80,7 @@ let Header = React.createClass({ render() { let account = null; let signup = null; + let collection = null; if (this.state.currentUser.username){ account = ( @@ -91,6 +92,7 @@ let Header = React.createClass({ {getLangText('Log out')} ); + collection = COLLECTION; } else { account = LOGIN; @@ -101,11 +103,14 @@ let Header = React.createClass({
+ {this.getLogo()} } toggleNavKey={0}> +