From 2e8e86c62f312094b171c75b69af75fe66158f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Thu, 9 Jul 2015 17:56:27 +0200 Subject: [PATCH] add boilerplate code for creating an edition --- .../ascribe_accordion_list/accordion_list_item.js | 4 ++-- .../accordion_list_item_edition_widget.js | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/js/components/ascribe_accordion_list/accordion_list_item.js b/js/components/ascribe_accordion_list/accordion_list_item.js index 2311be58..b3e31265 100644 --- a/js/components/ascribe_accordion_list/accordion_list_item.js +++ b/js/components/ascribe_accordion_list/accordion_list_item.js @@ -81,13 +81,12 @@ 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]}, {/* {getLangText('%s license', this.props.content.license_type.code)} */} -
@@ -96,6 +95,7 @@ let AccordionListItem = React.createClass({ + {/* 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 723f9cc8..baa9778e 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 @@ -73,14 +73,22 @@ let AccordionListItemEditionWidget = React.createClass({ let piece = this.props.piece; let numEditions = piece.num_editions; - if(numEditions === 1) { + if(numEditions === 0) { + return ( + + Create editions + + ); + } else if(numEditions === 1) { let editionMapping = piece && piece.firstEdition ? piece.firstEdition.edition_number + '/' + piece.num_editions : ''; return ( - {', ' + editionMapping + ' ' + getLangText('Edition')} {this.getGlyphicon()} + {editionMapping + ' ' + getLangText('Edition')} {this.getGlyphicon()} ); } else { @@ -88,7 +96,7 @@ let AccordionListItemEditionWidget = React.createClass({ - {', ' + numEditions + ' ' + getLangText('Editions')} {this.getGlyphicon()} + {numEditions + ' ' + getLangText('Editions')} {this.getGlyphicon()} ); }