mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
qMerge branch 'master' into AD-538-users-and-even-devs-are-unsure-wh
This commit is contained in:
commit
23f10d4d7f
@ -25,7 +25,7 @@ import CollapsibleParagraph from './../ascribe_collapsible/collapsible_paragraph
|
|||||||
import Form from './../ascribe_forms/form';
|
import Form from './../ascribe_forms/form';
|
||||||
import Property from './../ascribe_forms/property';
|
import Property from './../ascribe_forms/property';
|
||||||
import EditionDetailProperty from './detail_property';
|
import EditionDetailProperty from './detail_property';
|
||||||
|
import LicenseDetail from './license_detail';
|
||||||
import EditionFurtherDetails from './further_details';
|
import EditionFurtherDetails from './further_details';
|
||||||
|
|
||||||
import ListRequestActions from './../ascribe_forms/list_form_request_actions';
|
import ListRequestActions from './../ascribe_forms/list_form_request_actions';
|
||||||
@ -101,7 +101,6 @@ let Edition = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
refreshCollection() {
|
refreshCollection() {
|
||||||
console.log('freshing');
|
|
||||||
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search,
|
PieceListActions.fetchPieceList(this.state.page, this.state.pageSize, this.state.search,
|
||||||
this.state.orderBy, this.state.orderAsc, this.state.filterBy);
|
this.state.orderBy, this.state.orderAsc, this.state.filterBy);
|
||||||
EditionListActions.refreshEditionList({pieceId: this.props.edition.parent});
|
EditionListActions.refreshEditionList({pieceId: this.props.edition.parent});
|
||||||
@ -316,6 +315,7 @@ let EditionSummary = React.createClass({
|
|||||||
<EditionDetailProperty
|
<EditionDetailProperty
|
||||||
label={getLangText('OWNER')}
|
label={getLangText('OWNER')}
|
||||||
value={ this.props.edition.owner } />
|
value={ this.props.edition.owner } />
|
||||||
|
<LicenseDetail license={this.props.edition.license_type}/>
|
||||||
{this.getStatus()}
|
{this.getStatus()}
|
||||||
<hr />
|
<hr />
|
||||||
{this.getActions()}
|
{this.getActions()}
|
||||||
|
31
js/components/ascribe_detail/license_detail.js
Normal file
31
js/components/ascribe_detail/license_detail.js
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import DetailProperty from './detail_property';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is the component that implements display-specific functionality
|
||||||
|
*/
|
||||||
|
let LicenseDetail = React.createClass({
|
||||||
|
propTypes: {
|
||||||
|
license: React.PropTypes.object
|
||||||
|
},
|
||||||
|
render () {
|
||||||
|
if (this.props.license.code === 'default') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<DetailProperty
|
||||||
|
label="LICENSE"
|
||||||
|
value={
|
||||||
|
<a href={this.props.license.url} target="_blank">
|
||||||
|
{ this.props.license.code.toUpperCase() + ': ' + this.props.license.name}
|
||||||
|
</a>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export default LicenseDetail;
|
@ -19,6 +19,7 @@ import CollapsibleParagraph from './../ascribe_collapsible/collapsible_paragraph
|
|||||||
import FurtherDetails from './further_details';
|
import FurtherDetails from './further_details';
|
||||||
|
|
||||||
import DetailProperty from './detail_property';
|
import DetailProperty from './detail_property';
|
||||||
|
import LicenseDetail from './license_detail';
|
||||||
import HistoryIterator from './history_iterator';
|
import HistoryIterator from './history_iterator';
|
||||||
|
|
||||||
import AclButtonList from './../ascribe_buttons/acl_button_list';
|
import AclButtonList from './../ascribe_buttons/acl_button_list';
|
||||||
@ -224,6 +225,7 @@ let PieceContainer = React.createClass({
|
|||||||
<div className="ascribe-detail-header">
|
<div className="ascribe-detail-header">
|
||||||
<DetailProperty label={getLangText('REGISTREE')} value={ this.state.piece.user_registered } />
|
<DetailProperty label={getLangText('REGISTREE')} value={ this.state.piece.user_registered } />
|
||||||
<DetailProperty label={getLangText('ID')} value={ this.state.piece.bitcoin_id } ellipsis={true} />
|
<DetailProperty label={getLangText('ID')} value={ this.state.piece.bitcoin_id } ellipsis={true} />
|
||||||
|
<LicenseDetail license={this.state.piece.license_type} />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
buttons={this.getActions()}>
|
buttons={this.getActions()}>
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import DropdownButton from 'react-bootstrap/lib/DropdownButton';
|
import DropdownButton from 'react-bootstrap/lib/DropdownButton';
|
||||||
import MenuItem from 'react-bootstrap/lib/MenuItem';
|
|
||||||
|
|
||||||
import { getLangText } from '../../utils/lang_utils.js';
|
import { getLangText } from '../../utils/lang_utils.js';
|
||||||
|
|
||||||
@ -62,7 +61,8 @@ let PieceListToolbarOrderWidget = React.createClass({
|
|||||||
</li>
|
</li>
|
||||||
{this.props.orderParams.map((param) => {
|
{this.props.orderParams.map((param) => {
|
||||||
return (
|
return (
|
||||||
<MenuItem
|
<div>
|
||||||
|
<li
|
||||||
key={param}
|
key={param}
|
||||||
onClick={this.orderBy(param)}
|
onClick={this.orderBy(param)}
|
||||||
className="filter-widget-item">
|
className="filter-widget-item">
|
||||||
@ -75,7 +75,8 @@ let PieceListToolbarOrderWidget = React.createClass({
|
|||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={param.indexOf(this.props.orderBy) > -1} />
|
checked={param.indexOf(this.props.orderBy) > -1} />
|
||||||
</div>
|
</div>
|
||||||
</MenuItem>
|
</li>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</DropdownButton>
|
</DropdownButton>
|
||||||
|
@ -64,20 +64,22 @@ let Header = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
getLogo(){
|
getLogo(){
|
||||||
let logo = (
|
if (this.state.whitelabel && this.state.whitelabel.logo){
|
||||||
|
return <img className="img-brand" src={this.state.whitelabel.logo} />;
|
||||||
|
}
|
||||||
|
return (
|
||||||
<span>
|
<span>
|
||||||
<span>ascribe </span>
|
<span>ascribe </span>
|
||||||
<span className="glyph-ascribe-spool-chunked ascribe-color"></span>
|
<span className="glyph-ascribe-spool-chunked ascribe-color"></span>
|
||||||
</span>);
|
</span>
|
||||||
if (this.state.whitelabel && this.state.whitelabel.logo){
|
);
|
||||||
logo = <img className="img-brand" src={this.state.whitelabel.logo} />;
|
|
||||||
}
|
|
||||||
return logo;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getPoweredBy(){
|
getPoweredBy(){
|
||||||
if (this.state.whitelabel && this.state.whitelabel.logo) {
|
|
||||||
return (
|
return (
|
||||||
|
<AclProxy
|
||||||
|
aclObject={this.state.whitelabel}
|
||||||
|
aclName="acl_view_powered_by">
|
||||||
<li>
|
<li>
|
||||||
<a className="pull-right" href="https://www.ascribe.io/" target="_blank">
|
<a className="pull-right" href="https://www.ascribe.io/" target="_blank">
|
||||||
<span id="powered">{getLangText('powered by')} </span>
|
<span id="powered">{getLangText('powered by')} </span>
|
||||||
@ -85,10 +87,10 @@ let Header = React.createClass({
|
|||||||
<span className="glyph-ascribe-spool-chunked ascribe-color"></span>
|
<span className="glyph-ascribe-spool-chunked ascribe-color"></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
</AclProxy>
|
||||||
);
|
);
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onChange(state) {
|
onChange(state) {
|
||||||
this.setState(state);
|
this.setState(state);
|
||||||
|
|
||||||
|
@ -46,12 +46,19 @@ let CCRegisterPiece = React.createClass({
|
|||||||
label={getLangText('Copyright license%s', '...')}
|
label={getLangText('Copyright license%s', '...')}
|
||||||
onChange={this.onLicenseChange}
|
onChange={this.onLicenseChange}
|
||||||
footer={
|
footer={
|
||||||
|
<span className="pull-right">
|
||||||
<a
|
<a
|
||||||
className="pull-right"
|
|
||||||
href={this.state.licenses[this.state.selectedLicense].url}
|
href={this.state.licenses[this.state.selectedLicense].url}
|
||||||
target="_blank">
|
target="_blank">
|
||||||
{getLangText('Learn more')}
|
{getLangText('Learn more about ') + this.state.licenses[this.state.selectedLicense].code}
|
||||||
</a>
|
</a>
|
||||||
|
(
|
||||||
|
<a
|
||||||
|
href='https://www.ascribe.io/faq/#legals'
|
||||||
|
target="_blank">
|
||||||
|
{getLangText('ascribe faq')}
|
||||||
|
</a>)
|
||||||
|
</span>
|
||||||
}>
|
}>
|
||||||
<select name="license">
|
<select name="license">
|
||||||
{this.state.licenses.map((license, i) => {
|
{this.state.licenses.map((license, i) => {
|
||||||
@ -74,7 +81,7 @@ let CCRegisterPiece = React.createClass({
|
|||||||
return (
|
return (
|
||||||
<RegisterPiece
|
<RegisterPiece
|
||||||
enableLocalHashing={false}
|
enableLocalHashing={false}
|
||||||
headerMessage={getLangText('Submit to Creative Commons')}
|
headerMessage={getLangText('Register under a Creative Commons license')}
|
||||||
submitMessage={getLangText('Submit')}>
|
submitMessage={getLangText('Submit')}>
|
||||||
{this.getLicenses()}
|
{this.getLicenses()}
|
||||||
</RegisterPiece>
|
</RegisterPiece>
|
||||||
|
Loading…
Reference in New Issue
Block a user