Skip to content

Commit

Permalink
commiting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
loicsans committed Feb 17, 2016
1 parent 9ea3531 commit 50663e4
Show file tree
Hide file tree
Showing 3 changed files with 178 additions and 122 deletions.
94 changes: 52 additions & 42 deletions akvo/rsr/static/scripts-src/my-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,52 +571,58 @@ var UpdateEntry = React.createClass({displayName: 'UpdateEntry',
);
} else if (this.state.askRemove) {
return (
React.DOM.ul( {className:"nav-pills bottomRow navbar-right"},
React.DOM.li( {role:"presentation", className:"cancelUpdate"},
i18n.delete_confirmation
),
React.DOM.li( {role:"presentation", className:"removeUpdateConfirm"},
React.DOM.a( {onClick:this.removeUpdate, className:"btn btn-default btn-xs"}, i18n.yes)
),
React.DOM.li( {role:"presentation", className:"removeUpdateCancel"},
React.DOM.a( {onClick:this.switchAskRemove, className:"btn btn-default btn-xs"}, i18n.no)
React.DOM.div( {className:"menuAction"},
React.DOM.ul( {className:"nav-pills bottomRow navbar-right"},
React.DOM.li( {role:"presentation", className:"cancelUpdate"},
i18n.delete_confirmation
),
React.DOM.li( {role:"presentation", className:"removeUpdateConfirm"},
React.DOM.a( {onClick:this.removeUpdate, className:"btn btn-default btn-xs"}, i18n.yes)
),
React.DOM.li( {role:"presentation", className:"removeUpdateCancel"},
React.DOM.a( {onClick:this.switchAskRemove, className:"btn btn-default btn-xs"}, i18n.no)
)
)
)
);
} else if (this.editing()) {
switch(this.props.update.status) {
case 'P':
return (
React.DOM.ul( {className:"nav-pills bottomRow navbar-right"},
React.DOM.li( {role:"presentation", className:"cancelUpdate"},
React.DOM.a( {onClick:this.switchEdit, className:"btn btn-link btn-xs"}, i18n.cancel)
),
React.DOM.li( {role:"presentation", className:"removeUpdate"},
React.DOM.div( {className:"menuAction"},
React.DOM.div( {role:"presentation", className:"removeUpdate"},
React.DOM.a( {onClick:this.switchAskRemove, className:"btn btn-default btn-xs"}, i18n.delete)
),
React.DOM.li( {role:"presentation", className:"saveUpdate"},
React.DOM.a( {onClick:this.saveUpdate, className:"btn btn-default btn-xs"}, i18n.save)
),
React.DOM.li( {role:"presentation", className:"approveUpdate"},
React.DOM.a( {onClick:this.approve, className:"btn btn-default btn-xs"}, i18n.approve)
React.DOM.ul( {className:"nav-pills bottomRow navbar-right"},
React.DOM.li( {role:"presentation", className:"cancelUpdate"},
React.DOM.a( {onClick:this.switchEdit, className:"btn btn-link btn-xs"}, i18n.cancel)
),
React.DOM.li( {role:"presentation", className:"saveUpdate"},
React.DOM.a( {onClick:this.saveUpdate, className:"btn btn-default btn-xs"}, i18n.save)
),
React.DOM.li( {role:"presentation", className:"approveUpdate"},
React.DOM.a( {onClick:this.approve, className:"btn btn-default btn-xs"}, i18n.approve)
)
)
)
);
default:
return (
React.DOM.ul( {className:"nav-pills bottomRow navbar-right"},
React.DOM.li( {role:"presentation", className:"cancelUpdate"},
React.DOM.a( {onClick:this.switchEdit, className:"btn btn-link btn-xs"}, i18n.cancel)
),
React.DOM.li( {role:"presentation", className:"removeUpdate"},
React.DOM.div( {className:"menuAction"},
React.DOM.div( {role:"presentation", className:"removeUpdate"},
React.DOM.a( {onClick:this.switchAskRemove, className:"btn btn-default btn-xs"}, i18n.delete)
),
React.DOM.li( {role:"presentation", className:"saveUpdate"},
React.DOM.a( {onClick:this.saveUpdate, className:"btn btn-default btn-xs"}, i18n.save)
),
React.DOM.li( {role:"presentation", className:"submitUpdate"},
React.DOM.a( {onClick:this.askForApproval, className:"btn btn-default btn-xs"}, i18n.submit_for_approval)
)
React.DOM.ul( {className:"nav-pills bottomRow navbar-right"},
React.DOM.li( {role:"presentation", className:"cancelUpdate"},
React.DOM.a( {onClick:this.switchEdit, className:"btn btn-link btn-xs"}, i18n.cancel)
),
React.DOM.li( {role:"presentation", className:"saveUpdate"},
React.DOM.a( {onClick:this.saveUpdate, className:"btn btn-default btn-xs"}, i18n.save)
),
React.DOM.li( {role:"presentation", className:"submitUpdate"},
React.DOM.a( {onClick:this.askForApproval, className:"btn btn-default btn-xs"}, i18n.submit_for_approval)
)
)
)
);
}
Expand All @@ -625,15 +631,17 @@ var UpdateEntry = React.createClass({displayName: 'UpdateEntry',
case 'P':
if (isAdmin) {
return (
React.DOM.ul( {className:"nav-pills bottomRow navbar-right"},
React.DOM.li( {role:"presentation", className:"returnUpdate"},
React.DOM.a( {onClick:this.returnForRevision, className:"btn btn-default btn-xs"}, i18n.return_for_revision)
),
React.DOM.li( {role:"presentation", className:"editUpdate"},
React.DOM.a( {onClick:this.switchEdit, className:"btn btn-default btn-xs"}, i18n.edit_update)
),
React.DOM.li( {role:"presentation", className:"approveUpdate"},
React.DOM.a( {onClick:this.approve, className:"btn btn-default btn-xs"}, i18n.approve)
React.DOM.div( {className:"menuAction"},
React.DOM.ul( {className:"nav-pills bottomRow navbar-right"},
React.DOM.li( {role:"presentation", className:"returnUpdate"},
React.DOM.a( {onClick:this.returnForRevision, className:"btn btn-default btn-xs"}, i18n.return_for_revision)
),
React.DOM.li( {role:"presentation", className:"editUpdate"},
React.DOM.a( {onClick:this.switchEdit, className:"btn btn-default btn-xs"}, i18n.edit_update)
),
React.DOM.li( {role:"presentation", className:"approveUpdate"},
React.DOM.a( {onClick:this.approve, className:"btn btn-default btn-xs"}, i18n.approve)
)
)
)
);
Expand All @@ -650,9 +658,11 @@ var UpdateEntry = React.createClass({displayName: 'UpdateEntry',
default:
if (this.props.update.user === user.id || isAdmin) {
return (
React.DOM.ul( {className:"nav-pills bottomRow navbar-right"},
React.DOM.li( {role:"presentation", className:"editUpdate"},
React.DOM.a( {onClick:this.switchEdit, className:"btn btn-default btn-xs"}, i18n.edit_update)
React.DOM.div( {className:"menuAction"},
React.DOM.ul( {className:"nav-pills bottomRow navbar-right"},
React.DOM.li( {role:"presentation", className:"editUpdate"},
React.DOM.a( {onClick:this.switchEdit, className:"btn btn-default btn-xs"}, i18n.edit_update)
)
)
)
);
Expand Down
116 changes: 63 additions & 53 deletions akvo/rsr/static/scripts-src/my-results.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -571,71 +571,79 @@ var UpdateEntry = React.createClass({
);
} else if (this.state.askRemove) {
return (
<ul className="nav-pills bottomRow navbar-right">
<li role="presentation" className="cancelUpdate">
{i18n.delete_confirmation}
</li>
<li role="presentation" className="removeUpdateConfirm">
<a onClick={this.removeUpdate} className="btn btn-default btn-xs">{i18n.yes}</a>
</li>
<li role="presentation" className="removeUpdateCancel">
<a onClick={this.switchAskRemove} className="btn btn-default btn-xs">{i18n.no}</a>
</li>
</ul>
<div className="menuAction">
<ul className="nav-pills bottomRow navbar-right">
<li role="presentation" className="cancelUpdate">
{i18n.delete_confirmation}
</li>
<li role="presentation" className="removeUpdateConfirm">
<a onClick={this.removeUpdate} className="btn btn-default btn-xs">{i18n.yes}</a>
</li>
<li role="presentation" className="removeUpdateCancel">
<a onClick={this.switchAskRemove} className="btn btn-default btn-xs">{i18n.no}</a>
</li>
</ul>
</div>
);
} else if (this.editing()) {
switch(this.props.update.status) {
case 'P':
return (
<ul className="nav-pills bottomRow navbar-right">
<li role="presentation" className="cancelUpdate">
<a onClick={this.switchEdit} className="btn btn-link btn-xs">{i18n.cancel}</a>
</li>
<li role="presentation" className="removeUpdate">
<div className="menuAction">
<div role="presentation" className="removeUpdate">
<a onClick={this.switchAskRemove} className="btn btn-default btn-xs">{i18n.delete}</a>
</li>
<li role="presentation" className="saveUpdate">
<a onClick={this.saveUpdate} className="btn btn-default btn-xs">{i18n.save}</a>
</li>
<li role="presentation" className="approveUpdate">
<a onClick={this.approve} className="btn btn-default btn-xs">{i18n.approve}</a>
</li>
</ul>
</div>
<ul className="nav-pills bottomRow navbar-right">
<li role="presentation" className="cancelUpdate">
<a onClick={this.switchEdit} className="btn btn-link btn-xs">{i18n.cancel}</a>
</li>
<li role="presentation" className="saveUpdate">
<a onClick={this.saveUpdate} className="btn btn-default btn-xs">{i18n.save}</a>
</li>
<li role="presentation" className="approveUpdate">
<a onClick={this.approve} className="btn btn-default btn-xs">{i18n.approve}</a>
</li>
</ul>
</div>
);
default:
return (
<ul className="nav-pills bottomRow navbar-right">
<li role="presentation" className="cancelUpdate">
<a onClick={this.switchEdit} className="btn btn-link btn-xs">{i18n.cancel}</a>
</li>
<li role="presentation" className="removeUpdate">
<div className="menuAction">
<div role="presentation" className="removeUpdate">
<a onClick={this.switchAskRemove} className="btn btn-default btn-xs">{i18n.delete}</a>
</li>
<li role="presentation" className="saveUpdate">
<a onClick={this.saveUpdate} className="btn btn-default btn-xs">{i18n.save}</a>
</li>
<li role="presentation" className="submitUpdate">
<a onClick={this.askForApproval} className="btn btn-default btn-xs">{i18n.submit_for_approval}</a>
</li>
</ul>
</div>
<ul className="nav-pills bottomRow navbar-right">
<li role="presentation" className="cancelUpdate">
<a onClick={this.switchEdit} className="btn btn-link btn-xs">{i18n.cancel}</a>
</li>
<li role="presentation" className="saveUpdate">
<a onClick={this.saveUpdate} className="btn btn-default btn-xs">{i18n.save}</a>
</li>
<li role="presentation" className="submitUpdate">
<a onClick={this.askForApproval} className="btn btn-default btn-xs">{i18n.submit_for_approval}</a>
</li>
</ul>
</div>
);
}
} else {
switch(this.props.update.status) {
case 'P':
if (isAdmin) {
return (
<ul className="nav-pills bottomRow navbar-right">
<li role="presentation" className="returnUpdate">
<a onClick={this.returnForRevision} className="btn btn-default btn-xs">{i18n.return_for_revision}</a>
</li>
<li role="presentation" className="editUpdate">
<a onClick={this.switchEdit} className="btn btn-default btn-xs">{i18n.edit_update}</a>
</li>
<li role="presentation" className="approveUpdate">
<a onClick={this.approve} className="btn btn-default btn-xs">{i18n.approve}</a>
</li>
</ul>
<div className="menuAction">
<ul className="nav-pills bottomRow navbar-right">
<li role="presentation" className="returnUpdate">
<a onClick={this.returnForRevision} className="btn btn-default btn-xs">{i18n.return_for_revision}</a>
</li>
<li role="presentation" className="editUpdate">
<a onClick={this.switchEdit} className="btn btn-default btn-xs">{i18n.edit_update}</a>
</li>
<li role="presentation" className="approveUpdate">
<a onClick={this.approve} className="btn btn-default btn-xs">{i18n.approve}</a>
</li>
</ul>
</div>
);
} else {
return (
Expand All @@ -650,11 +658,13 @@ var UpdateEntry = React.createClass({
default:
if (this.props.update.user === user.id || isAdmin) {
return (
<ul className="nav-pills bottomRow navbar-right">
<li role="presentation" className="editUpdate">
<a onClick={this.switchEdit} className="btn btn-default btn-xs">{i18n.edit_update}</a>
</li>
</ul>
<div className="menuAction">
<ul className="nav-pills bottomRow navbar-right">
<li role="presentation" className="editUpdate">
<a onClick={this.switchEdit} className="btn btn-default btn-xs">{i18n.edit_update}</a>
</li>
</ul>
</div>
);
} else {
return (
Expand Down
Loading

0 comments on commit 50663e4

Please sign in to comment.