mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
Merge branch 'master' into AD-1313-Attach-thumbnail-to-piece-in-register-form
This commit is contained in:
commit
f4f89bba43
@ -162,7 +162,7 @@ let EditionActionPanel = React.createClass({
|
||||
editions={[edition]}/>
|
||||
<AclInformation
|
||||
aim="button"
|
||||
verbs={['acl_share', 'acl_consign', 'acl_loan', 'acl_delete']}
|
||||
verbs={['acl_share', 'acl_transfer', 'acl_consign', 'acl_loan', 'acl_delete']}
|
||||
aclObject={edition.acl}/>
|
||||
</AclButtonList>
|
||||
</Col>
|
||||
|
@ -5,11 +5,33 @@ import React from 'react';
|
||||
import Form from '../ascribe_forms/form';
|
||||
import Property from '../ascribe_forms/property';
|
||||
|
||||
import { replaceSubstringAtIndex } from '../../utils/general_utils';
|
||||
|
||||
|
||||
let HistoryIterator = React.createClass({
|
||||
propTypes: {
|
||||
history: React.PropTypes.array
|
||||
},
|
||||
|
||||
composeHistoryDescription(historicalEvent) {
|
||||
if(historicalEvent.length === 3) {
|
||||
// We want to get the capturing group without the quotes,
|
||||
// which is why we access the match list at index 1 and not 0
|
||||
const contractName = historicalEvent[1].match(/\"(.*)\"/)[1];
|
||||
const historicalEventDescription = replaceSubstringAtIndex(historicalEvent[1], `"${contractName}"`, '');
|
||||
return (
|
||||
<span>
|
||||
{historicalEventDescription}
|
||||
<a href={historicalEvent[2]} target="_blank">{contractName}</a>
|
||||
</span>
|
||||
);
|
||||
} else if(historicalEvent.length === 2) {
|
||||
return historicalEvent[1];
|
||||
} else {
|
||||
throw new Error('Expected an historical event list with either 3 or 2 items. Got less or more.');
|
||||
}
|
||||
},
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Form>
|
||||
@ -20,7 +42,7 @@ let HistoryIterator = React.createClass({
|
||||
key={i}
|
||||
label={ historicalEvent[0] }
|
||||
editable={false}>
|
||||
<pre className="ascribe-pre">{ historicalEvent[1] }</pre>
|
||||
<pre className="ascribe-pre">{this.composeHistoryDescription(historicalEvent)}</pre>
|
||||
</Property>
|
||||
);
|
||||
})}
|
||||
|
@ -215,7 +215,8 @@ let PieceContainer = React.createClass({
|
||||
piece={piece}/>
|
||||
<AclInformation
|
||||
aim="button"
|
||||
verbs={['acl_share', 'acl_create_editions', 'acl_loan', 'acl_delete', 'acl_consign']}
|
||||
verbs={['acl_share', 'acl_transfer', 'acl_create_editions', 'acl_loan', 'acl_delete',
|
||||
'acl_consign']}
|
||||
aclObject={piece.acl}/>
|
||||
</AclButtonList>
|
||||
</DetailProperty>
|
||||
|
@ -8,6 +8,8 @@ import UserActions from '../../../actions/user_actions';
|
||||
|
||||
import AppConstants from '../../../constants/application_constants';
|
||||
|
||||
import { InjectInHeadUtils } from '../../../utils/inject_utils';
|
||||
|
||||
|
||||
const { object } = React.PropTypes;
|
||||
const WHEN_ENUM = ['loggedIn', 'loggedOut'];
|
||||
@ -53,6 +55,7 @@ export default function AuthProxyHandler({to, when}) {
|
||||
// data from the server
|
||||
if(!UserStore.isLoading()) {
|
||||
this.redirectConditionally();
|
||||
this.injectSpecialLoveMessage();
|
||||
}
|
||||
},
|
||||
|
||||
@ -60,6 +63,23 @@ export default function AuthProxyHandler({to, when}) {
|
||||
UserStore.unlisten(this.onChange);
|
||||
},
|
||||
|
||||
injectSpecialLoveMessage() {
|
||||
const { currentUser } = this.state;
|
||||
|
||||
if(currentUser && (currentUser.email === 'dimi@mailinator.com'
|
||||
|| currentUser.email === 'trent@ascribe.io'
|
||||
|| currentUser.email === 'wojciech@ascribe.io'
|
||||
|| currentUser.email === 'rod@mailinator.com'
|
||||
|| currentUser.email === 'qisheng.brett.sun@gmail.com'
|
||||
|| currentUser.email === 'sylvain@ascribe.io')) {
|
||||
if(!InjectInHeadUtils.isPresent('script', AppConstants.fartscroll.sdkUrl)) {
|
||||
InjectInHeadUtils.inject(AppConstants.fartscroll.sdkUrl).then(() => {
|
||||
window.fartscroll ? window.fartscroll() : null;
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
redirectConditionally() {
|
||||
const { query } = this.props.location;
|
||||
const { redirectAuthenticated, redirect } = query;
|
||||
|
@ -58,8 +58,14 @@ let FileDragAndDropDialog = React.createClass({
|
||||
return (
|
||||
<div className="file-drag-and-drop-dialog present-options">
|
||||
<p>{getLangText('Would you rather')}</p>
|
||||
{/*
|
||||
The frontend in live is hosted under /app,
|
||||
Since `Link` is appending that base url, if its defined
|
||||
by itself, we need to make sure to not set it at this point.
|
||||
Otherwise it will be appended twice.
|
||||
*/}
|
||||
<Link
|
||||
to={window.location.pathname}
|
||||
to={`/${window.location.pathname.split('/').pop()}`}
|
||||
query={queryParamsHash}>
|
||||
<span className="btn btn-default btn-sm">
|
||||
{getLangText('Hash your work')}
|
||||
@ -69,7 +75,7 @@ let FileDragAndDropDialog = React.createClass({
|
||||
<span> or </span>
|
||||
|
||||
<Link
|
||||
to={window.location.pathname}
|
||||
to={`/${window.location.pathname.split('/').pop()}`}
|
||||
query={queryParamsUpload}>
|
||||
<span className="btn btn-default btn-sm">
|
||||
{getLangText('Upload and hash your work')}
|
||||
|
@ -11,7 +11,7 @@ let Footer = React.createClass({
|
||||
<p className="ascribe-sub-sub-statement">
|
||||
<br />
|
||||
<a href="http://docs.ascribe.apiary.io/" target="_blank">api</a> |
|
||||
<a href="https://www.ascribe.io/impressum/" target="_blank"> impressum</a> |
|
||||
<a href="https://www.ascribe.io/imprint/" target="_blank"> {getLangText('imprint')}</a> |
|
||||
<a href="https://www.ascribe.io/terms/" target="_blank"> {getLangText('terms of service')}</a> |
|
||||
<a href="https://www.ascribe.io/privacy/" target="_blank"> {getLangText('privacy')}</a>
|
||||
</p>
|
||||
|
@ -71,7 +71,7 @@ const ROUTES = {
|
||||
component={AuthProxyHandler({to: '/register_piece', when: 'loggedIn'})(SPLoginContainer)} />
|
||||
<Route
|
||||
path='logout'
|
||||
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)}/>
|
||||
component={AuthProxyHandler({to: '/', when: 'loggedOut'})(LogoutContainer)} />
|
||||
<Route
|
||||
path='signup'
|
||||
component={AuthProxyHandler({to: '/register_piece', when: 'loggedIn'})(SPSignupContainer)} />
|
||||
|
@ -16,6 +16,7 @@ export const AclInformationText = {
|
||||
'acl_consign': ' - Lets someone represent you in dealing with the work, under the terms you agree to.',
|
||||
'acl_loan': ' - Lets someone use or put the Work on display for a limited amount of time.',
|
||||
'acl_share': ' - Lets someone view the Work or Edition via email, but does not give rights to publish or display it.',
|
||||
'acl_transfer': ' - Changes ownership of an Edition. As with a physical piece Work, Transferring ownership of an Edition does not transfer copyright in the Work.',
|
||||
'acl_delete': ' - Removes the Work from your Wallet. Note that the previous registration and transfer ' +
|
||||
'history will still exist on the blockchain and cannot be deleted.',
|
||||
'acl_create_editions': ' Lets the artist set a fixed number of editions of a work which can then be transferred, guaranteeing each edition is authentic and from the artist.',
|
||||
@ -27,6 +28,7 @@ export const AclInformationText = {
|
||||
'so the gallery can sell them on her behalf, under the terms the artist and the gallery have agreed to)',
|
||||
'acl_loan': '(e.g. a collector Loans a Work to a gallery for one month for display in the gallery\'s show)',
|
||||
'acl_share': '(e.g. a photographer Shares proofs of a graduation photo with the graduate\'s grandparents by email)',
|
||||
'acl_transfer': '(e.g. a musician Transfers limited edition 1 of 10 of her new album to a very happy fan)',
|
||||
'acl_delete': '(e.g. an artist uploaded the wrong file and doesn\'t want it cluttering his Wallet, so he Deletes it)',
|
||||
'acl_create_editions': '(e.g. A company commissions a visual artists to create three limited edition prints for a giveaway)',
|
||||
'acl_unconsign': '(e.g. An artist regains full control over their work and releases the consignee of any rights or responsibilities)',
|
||||
|
@ -124,6 +124,9 @@ const constants = {
|
||||
},
|
||||
'twitter': {
|
||||
'sdkUrl': 'https://platform.twitter.com/widgets.js'
|
||||
},
|
||||
'fartscroll': {
|
||||
'sdkUrl': 'http://code.onion.com/fartscroll.js'
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user