From 5f372eedda57fb25c649812b7a8b667f0b44445e Mon Sep 17 00:00:00 2001 From: diminator Date: Wed, 1 Jul 2015 15:28:48 +0200 Subject: [PATCH] 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;