1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 01:25:17 +01:00

only one agreement pending

agreement notifications per subdomain (only by whitelabel owner)
This commit is contained in:
diminator 2015-09-09 19:29:58 +02:00
parent ecb51ca5e7
commit 1c5b0c7172
5 changed files with 30 additions and 17 deletions

View File

@ -54,6 +54,7 @@ let ContractAgreementForm = React.createClass({
let notification = 'Contract agreement send';
notification = new GlobalNotificationModel(notification, 'success', 10000);
GlobalNotificationActions.appendGlobalNotification(notification);
this.refs.form.reset();
},
getFormData(){

View File

@ -53,15 +53,14 @@ let CreateContractForm = React.createClass({
ContractListActions.fetchContractList({is_active: 'True'});
let notification = new GlobalNotificationModel(getLangText('Contract %s successfully created', response.name), 'success', 5000);
GlobalNotificationActions.appendGlobalNotification(notification);
//
//// also refresh contract lists for the rest of the contract settings page
//ContractListActions.fetchContractList();
this.refs.form.reset();
},
render() {
return (
<Form
ref='form'
url={ApiUrls.ownership_contract_list}
getFormData={this.getFormData}
handleSuccess={this.handleCreateSuccess}
@ -81,6 +80,7 @@ let CreateContractForm = React.createClass({
<Property
label="Contract file">
<ReactS3FineUploader
ref='uploader'
keyRoutine={{
url: AppConstants.serverUrl + 's3/key/',
fileClass: 'contract'
@ -121,7 +121,7 @@ let CreateContractForm = React.createClass({
required/>
</Property>
<Property
name="public"
name="is_public"
className="ascribe-settings-property-collapsible-toggle"
style={{paddingBottom: 0}}>
<InputCheckbox>

View File

@ -90,8 +90,10 @@ let Property = React.createClass({
// maybe do reset by reload instead of front end state?
this.setState({value: this.state.initialValue});
// resets the value of a custom react component input
this.refs.input.state.value = this.state.initialValue;
if (this.refs.input.state && this.refs.input.state.value) {
// 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
this.refs.input.getDOMNode().value = this.state.initialValue;

View File

@ -53,7 +53,7 @@ let IkonotvContractNotifications = React.createClass({
this.setState(state);
},
displayContract(){
getContract(){
let notifications = this.state.contractAgreementListNotifications[0];
let blob = notifications.contract_agreement.contract.blob;
if (blob.mime === 'pdf') {
@ -62,7 +62,7 @@ let IkonotvContractNotifications = React.createClass({
<embed src={blob.url_safe} alt="pdf"
pluginspage="http://www.adobe.com/products/acrobat/readstep2.html"/>
<div className='notification-contract-pdf-download'>
<a href={blob.url_safe}>
<a href={blob.url_safe} target="_blank">
<Glyphicon glyph='download-alt'/>
<span style={{padding: '0.3em'}}>
Download PDF version
@ -74,7 +74,7 @@ let IkonotvContractNotifications = React.createClass({
}
return (
<div className='notification-contract-download'>
<a href={blob.url_safe}>
<a href={blob.url_safe} target="_blank">
<Glyphicon glyph='download-alt'/>
<span style={{padding: '0.3em'}}>
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() {
let notification = new GlobalNotificationModel(getLangText('You have accepted the conditions'), 'success', 10000);
GlobalNotificationActions.appendGlobalNotification(notification);
@ -117,13 +132,10 @@ let IkonotvContractNotifications = React.createClass({
{getLangText('Production Contract')}
</div>
</div>
{this.displayContract()}
{this.getContract()}
<div className='notification-contract-footer'>
<h1>{getLangText('Appendix')}</h1>
<pre>
{contractAgreement.appendix.default}
</pre>
{this.getAppendix}
<h1>{getLangText('Are you a member of any copyright societies?')}</h1>
<p>
ARS, DACS, Bildkunst, Pictoright, SODRAC, Copyright Agency/Viscopy, SAVA, Bildrecht GmbH,

View File

@ -118,9 +118,7 @@ class Requests {
merged.method = verb;
return fetch(url, merged)
.then(this.unpackResponse)
.catch( () => {
this.handleError();
});
.catch(this.handleError);
}
get(url, params) {