Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Commit

Permalink
Fixes empty reservation card leading to a view with insufficent permi…
Browse files Browse the repository at this point in the history
…ssions

Fixes #209
  • Loading branch information
Denis Krienbühl committed May 30, 2016
1 parent e42fcef commit b7d9a1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions HISTORY.rst
@@ -1,6 +1,9 @@
Changelog
---------

- Fixes empty reservation card leading to a view with insufficent permissions.
[href]

- Adds the ability to remove towns through the cli.
[href]

Expand Down
8 changes: 7 additions & 1 deletion onegov/town/assets/js/reservationcalendar.jsx
Expand Up @@ -626,8 +626,14 @@ ReservationSelection = React.createClass({
handleClick: function(reservation) {
rc.delete($(this.props.calendar), reservation.delete);
},
handleSubmit: function() {
if (this.props.reservations.length) {
window.location = this.props.reservationform;
}
},
render: function() {
var self = this;

return (
<div className="reservation-selection-inner">
<h3>{locale("Dates")}</h3>
Expand All @@ -651,7 +657,7 @@ ReservationSelection = React.createClass({
})
}</ul>
}
<a href={this.props.reservationform} className={this.props.reservations.length === 0 && 'disabled button secondary' || 'button'}>
<a onClick={self.handleSubmit} className={this.props.reservations.length === 0 && 'disabled button secondary' || 'button'}>
{locale("Reserve")}
</a>
</div>
Expand Down

0 comments on commit b7d9a1c

Please sign in to comment.