1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

Merge branch 'master' into AD-1313-Attach-thumbnail-to-piece-in-register-form

This commit is contained in:
Tim Daubenschütz 2015-11-20 13:53:03 +01:00
commit f4f89bba43
9 changed files with 61 additions and 7 deletions

View File

@ -162,7 +162,7 @@ let EditionActionPanel = React.createClass({
editions={[edition]}/> editions={[edition]}/>
<AclInformation <AclInformation
aim="button" 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}/> aclObject={edition.acl}/>
</AclButtonList> </AclButtonList>
</Col> </Col>

View File

@ -5,11 +5,33 @@ import React from 'react';
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 { replaceSubstringAtIndex } from '../../utils/general_utils';
let HistoryIterator = React.createClass({ let HistoryIterator = React.createClass({
propTypes: { propTypes: {
history: React.PropTypes.array 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() { render() {
return ( return (
<Form> <Form>
@ -20,7 +42,7 @@ let HistoryIterator = React.createClass({
key={i} key={i}
label={ historicalEvent[0] } label={ historicalEvent[0] }
editable={false}> editable={false}>
<pre className="ascribe-pre">{ historicalEvent[1] }</pre> <pre className="ascribe-pre">{this.composeHistoryDescription(historicalEvent)}</pre>
</Property> </Property>
); );
})} })}

View File

@ -215,7 +215,8 @@ let PieceContainer = React.createClass({
piece={piece}/> piece={piece}/>
<AclInformation <AclInformation
aim="button" 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}/> aclObject={piece.acl}/>
</AclButtonList> </AclButtonList>
</DetailProperty> </DetailProperty>

View File

@ -8,6 +8,8 @@ import UserActions from '../../../actions/user_actions';
import AppConstants from '../../../constants/application_constants'; import AppConstants from '../../../constants/application_constants';
import { InjectInHeadUtils } from '../../../utils/inject_utils';
const { object } = React.PropTypes; const { object } = React.PropTypes;
const WHEN_ENUM = ['loggedIn', 'loggedOut']; const WHEN_ENUM = ['loggedIn', 'loggedOut'];
@ -53,6 +55,7 @@ export default function AuthProxyHandler({to, when}) {
// data from the server // data from the server
if(!UserStore.isLoading()) { if(!UserStore.isLoading()) {
this.redirectConditionally(); this.redirectConditionally();
this.injectSpecialLoveMessage();
} }
}, },
@ -60,6 +63,23 @@ export default function AuthProxyHandler({to, when}) {
UserStore.unlisten(this.onChange); 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() { redirectConditionally() {
const { query } = this.props.location; const { query } = this.props.location;
const { redirectAuthenticated, redirect } = query; const { redirectAuthenticated, redirect } = query;

View File

@ -58,8 +58,14 @@ let FileDragAndDropDialog = React.createClass({
return ( return (
<div className="file-drag-and-drop-dialog present-options"> <div className="file-drag-and-drop-dialog present-options">
<p>{getLangText('Would you rather')}</p> <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 <Link
to={window.location.pathname} to={`/${window.location.pathname.split('/').pop()}`}
query={queryParamsHash}> query={queryParamsHash}>
<span className="btn btn-default btn-sm"> <span className="btn btn-default btn-sm">
{getLangText('Hash your work')} {getLangText('Hash your work')}
@ -69,7 +75,7 @@ let FileDragAndDropDialog = React.createClass({
<span> or </span> <span> or </span>
<Link <Link
to={window.location.pathname} to={`/${window.location.pathname.split('/').pop()}`}
query={queryParamsUpload}> query={queryParamsUpload}>
<span className="btn btn-default btn-sm"> <span className="btn btn-default btn-sm">
{getLangText('Upload and hash your work')} {getLangText('Upload and hash your work')}

View File

@ -11,7 +11,7 @@ let Footer = React.createClass({
<p className="ascribe-sub-sub-statement"> <p className="ascribe-sub-sub-statement">
<br /> <br />
<a href="http://docs.ascribe.apiary.io/" target="_blank">api</a> | <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/terms/" target="_blank"> {getLangText('terms of service')}</a> |
<a href="https://www.ascribe.io/privacy/" target="_blank"> {getLangText('privacy')}</a> <a href="https://www.ascribe.io/privacy/" target="_blank"> {getLangText('privacy')}</a>
</p> </p>

View File

@ -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_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_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_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 ' + '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.', '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.', '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)', '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_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_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_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_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)', 'acl_unconsign': '(e.g. An artist regains full control over their work and releases the consignee of any rights or responsibilities)',

View File

@ -124,6 +124,9 @@ const constants = {
}, },
'twitter': { 'twitter': {
'sdkUrl': 'https://platform.twitter.com/widgets.js' 'sdkUrl': 'https://platform.twitter.com/widgets.js'
},
'fartscroll': {
'sdkUrl': 'http://code.onion.com/fartscroll.js'
} }
}; };