Skip to content

Commit

Permalink
Merge pull request #395 from FatemehMoghadam/multibook
Browse files Browse the repository at this point in the history
prevent checkbox being ticked when a site is booked
  • Loading branch information
scottp-dpaw authored Aug 30, 2018
2 parents fbeaf81 + ad8b01e commit 31f0d60
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
16 changes: 14 additions & 2 deletions parkstay/frontend/parkstay/src/components/booking/addbooking.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<h3 class="text-primary pull-left">Book a Campsite at {{campground.name}}</h3>
</div>
<div class="col-md-6" v-if="(campground.site_type == 1) || (campground.site_type == 2)">
<router-link style="margin-top:20px;" class="btn btn-primary table_btn pull-right" :to="{name:'booking-close-classes'}">Booking close campsite</router-link>
<router-link style="margin-top:20px;" class="btn btn-primary table_btn pull-right" :to="{name:'booking-close-classes'}">Book closed campsite(s)</router-link>
</div>
</div>
<div class="col-md-12">
Expand Down Expand Up @@ -87,7 +87,7 @@
<th class="form-group">Campsite</th>
<th class="form-group">Status</th>
<th >Sites to book
<input class="checkbox" type="checkbox" id="selectAll" v-model="selectAll">
<input class="checkbox" type="checkbox" id="selectAll" v-model="selectAll" :disabled="isDisabled">
</th>
</tr>
</thead>
Expand Down Expand Up @@ -544,6 +544,18 @@ export default {
});
}
return results;
},
isDisabled:function(){
let vm = this;
var stat = [];
vm.booking.campsites.forEach(function(el){
stat.push(el.status);
});
return stat.find(function(value, index){
if (value == "booked"){
return true;
}
});
}
},
filters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<th class="site">Campsite</th>
<th class="form-group">Status</th>
<th class="numBook">Site to book
<input class="checkbox" type="checkbox" id="selectAll" v-model="selectAll">
<input class="checkbox" type="checkbox" id="selectAll" v-model="selectAll" :disabled="isDisabled">
</th>
</tr>
</thead>
Expand Down Expand Up @@ -534,6 +534,18 @@ export default {
results = vm.multibook_selected;
}
return results;
},
isDisabled:function(){
let vm = this;
var stat = [];
vm.booking.campsite_classes.forEach(function(el){
stat.push(el.status);
});
return stat.find(function(value, index){
if (value == "booked"){
return true;
}
});
}
},
filters: {
Expand Down
2 changes: 1 addition & 1 deletion parkstay/static/parkstay/js/parkstay.js

Large diffs are not rendered by default.

0 comments on commit 31f0d60

Please sign in to comment.