mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
only one agreement pending
agreement notifications per subdomain (only by whitelabel owner)
This commit is contained in:
parent
ecb51ca5e7
commit
1c5b0c7172
@ -54,6 +54,7 @@ let ContractAgreementForm = React.createClass({
|
|||||||
let notification = 'Contract agreement send';
|
let notification = 'Contract agreement send';
|
||||||
notification = new GlobalNotificationModel(notification, 'success', 10000);
|
notification = new GlobalNotificationModel(notification, 'success', 10000);
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
|
this.refs.form.reset();
|
||||||
},
|
},
|
||||||
|
|
||||||
getFormData(){
|
getFormData(){
|
||||||
|
@ -53,15 +53,14 @@ let CreateContractForm = React.createClass({
|
|||||||
ContractListActions.fetchContractList({is_active: 'True'});
|
ContractListActions.fetchContractList({is_active: 'True'});
|
||||||
let notification = new GlobalNotificationModel(getLangText('Contract %s successfully created', response.name), 'success', 5000);
|
let notification = new GlobalNotificationModel(getLangText('Contract %s successfully created', response.name), 'success', 5000);
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
//
|
this.refs.form.reset();
|
||||||
//// also refresh contract lists for the rest of the contract settings page
|
|
||||||
//ContractListActions.fetchContractList();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
|
ref='form'
|
||||||
url={ApiUrls.ownership_contract_list}
|
url={ApiUrls.ownership_contract_list}
|
||||||
getFormData={this.getFormData}
|
getFormData={this.getFormData}
|
||||||
handleSuccess={this.handleCreateSuccess}
|
handleSuccess={this.handleCreateSuccess}
|
||||||
@ -81,6 +80,7 @@ let CreateContractForm = React.createClass({
|
|||||||
<Property
|
<Property
|
||||||
label="Contract file">
|
label="Contract file">
|
||||||
<ReactS3FineUploader
|
<ReactS3FineUploader
|
||||||
|
ref='uploader'
|
||||||
keyRoutine={{
|
keyRoutine={{
|
||||||
url: AppConstants.serverUrl + 's3/key/',
|
url: AppConstants.serverUrl + 's3/key/',
|
||||||
fileClass: 'contract'
|
fileClass: 'contract'
|
||||||
@ -121,7 +121,7 @@ let CreateContractForm = React.createClass({
|
|||||||
required/>
|
required/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property
|
<Property
|
||||||
name="public"
|
name="is_public"
|
||||||
className="ascribe-settings-property-collapsible-toggle"
|
className="ascribe-settings-property-collapsible-toggle"
|
||||||
style={{paddingBottom: 0}}>
|
style={{paddingBottom: 0}}>
|
||||||
<InputCheckbox>
|
<InputCheckbox>
|
||||||
|
@ -90,8 +90,10 @@ let Property = React.createClass({
|
|||||||
// maybe do reset by reload instead of front end state?
|
// maybe do reset by reload instead of front end state?
|
||||||
this.setState({value: this.state.initialValue});
|
this.setState({value: this.state.initialValue});
|
||||||
|
|
||||||
// resets the value of a custom react component input
|
if (this.refs.input.state && this.refs.input.state.value) {
|
||||||
this.refs.input.state.value = this.state.initialValue;
|
// resets the value of a custom react component input
|
||||||
|
this.refs.input.state.value = this.state.initialValue;
|
||||||
|
}
|
||||||
|
|
||||||
// resets the value of a plain HTML5 input
|
// resets the value of a plain HTML5 input
|
||||||
this.refs.input.getDOMNode().value = this.state.initialValue;
|
this.refs.input.getDOMNode().value = this.state.initialValue;
|
||||||
|
@ -53,7 +53,7 @@ let IkonotvContractNotifications = React.createClass({
|
|||||||
this.setState(state);
|
this.setState(state);
|
||||||
},
|
},
|
||||||
|
|
||||||
displayContract(){
|
getContract(){
|
||||||
let notifications = this.state.contractAgreementListNotifications[0];
|
let notifications = this.state.contractAgreementListNotifications[0];
|
||||||
let blob = notifications.contract_agreement.contract.blob;
|
let blob = notifications.contract_agreement.contract.blob;
|
||||||
if (blob.mime === 'pdf') {
|
if (blob.mime === 'pdf') {
|
||||||
@ -62,7 +62,7 @@ let IkonotvContractNotifications = React.createClass({
|
|||||||
<embed src={blob.url_safe} alt="pdf"
|
<embed src={blob.url_safe} alt="pdf"
|
||||||
pluginspage="http://www.adobe.com/products/acrobat/readstep2.html"/>
|
pluginspage="http://www.adobe.com/products/acrobat/readstep2.html"/>
|
||||||
<div className='notification-contract-pdf-download'>
|
<div className='notification-contract-pdf-download'>
|
||||||
<a href={blob.url_safe}>
|
<a href={blob.url_safe} target="_blank">
|
||||||
<Glyphicon glyph='download-alt'/>
|
<Glyphicon glyph='download-alt'/>
|
||||||
<span style={{padding: '0.3em'}}>
|
<span style={{padding: '0.3em'}}>
|
||||||
Download PDF version
|
Download PDF version
|
||||||
@ -74,7 +74,7 @@ let IkonotvContractNotifications = React.createClass({
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className='notification-contract-download'>
|
<div className='notification-contract-download'>
|
||||||
<a href={blob.url_safe}>
|
<a href={blob.url_safe} target="_blank">
|
||||||
<Glyphicon glyph='download-alt'/>
|
<Glyphicon glyph='download-alt'/>
|
||||||
<span style={{padding: '0.3em'}}>
|
<span style={{padding: '0.3em'}}>
|
||||||
Download contract
|
Download contract
|
||||||
@ -84,6 +84,21 @@ let IkonotvContractNotifications = React.createClass({
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getAppendix() {
|
||||||
|
let notifications = this.state.contractAgreementListNotifications[0];
|
||||||
|
let appendix = notifications.contract_agreement.appendix;
|
||||||
|
if (appendix) {
|
||||||
|
return (<div>
|
||||||
|
<h1>{getLangText('Appendix')}</h1>
|
||||||
|
<pre>
|
||||||
|
{appendix.default}
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
|
||||||
handleConfirmSuccess() {
|
handleConfirmSuccess() {
|
||||||
let notification = new GlobalNotificationModel(getLangText('You have accepted the conditions'), 'success', 10000);
|
let notification = new GlobalNotificationModel(getLangText('You have accepted the conditions'), 'success', 10000);
|
||||||
GlobalNotificationActions.appendGlobalNotification(notification);
|
GlobalNotificationActions.appendGlobalNotification(notification);
|
||||||
@ -117,13 +132,10 @@ let IkonotvContractNotifications = React.createClass({
|
|||||||
{getLangText('Production Contract')}
|
{getLangText('Production Contract')}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{this.displayContract()}
|
{this.getContract()}
|
||||||
|
|
||||||
<div className='notification-contract-footer'>
|
<div className='notification-contract-footer'>
|
||||||
<h1>{getLangText('Appendix')}</h1>
|
{this.getAppendix}
|
||||||
<pre>
|
|
||||||
{contractAgreement.appendix.default}
|
|
||||||
</pre>
|
|
||||||
<h1>{getLangText('Are you a member of any copyright societies?')}</h1>
|
<h1>{getLangText('Are you a member of any copyright societies?')}</h1>
|
||||||
<p>
|
<p>
|
||||||
ARS, DACS, Bildkunst, Pictoright, SODRAC, Copyright Agency/Viscopy, SAVA, Bildrecht GmbH,
|
ARS, DACS, Bildkunst, Pictoright, SODRAC, Copyright Agency/Viscopy, SAVA, Bildrecht GmbH,
|
||||||
|
@ -118,9 +118,7 @@ class Requests {
|
|||||||
merged.method = verb;
|
merged.method = verb;
|
||||||
return fetch(url, merged)
|
return fetch(url, merged)
|
||||||
.then(this.unpackResponse)
|
.then(this.unpackResponse)
|
||||||
.catch( () => {
|
.catch(this.handleError);
|
||||||
this.handleError();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get(url, params) {
|
get(url, params) {
|
||||||
|
Loading…
Reference in New Issue
Block a user