edit and view button permission fix
This commit is contained in:
parent
6997636dbd
commit
f76b22ec6b
|
@ -199,6 +199,16 @@ var Calendar = function(dom, property_id, valid_range, currentView, display_hire
|
||||||
c.dialog.show({"x": originalEvent.clientX,"y": originalEvent.clientY});
|
c.dialog.show({"x": originalEvent.clientX,"y": originalEvent.clientY});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
eventContent: function(arg) {
|
||||||
|
let propertyTitle = arg.event.extendedProps.property_title || '';
|
||||||
|
let eventTitle = arg.event.title;
|
||||||
|
|
||||||
|
let html = `<div class="fc-event-title-container">
|
||||||
|
<div class="event-property">${propertyTitle}</div>
|
||||||
|
<div class="fc-event-title">${eventTitle}</div>
|
||||||
|
</div>`;
|
||||||
|
return { html: html };
|
||||||
|
},
|
||||||
dateClick: function(ev) {
|
dateClick: function(ev) {
|
||||||
var calendar = this;
|
var calendar = this;
|
||||||
var calendar_dom = $(this.el);
|
var calendar_dom = $(this.el);
|
||||||
|
|
|
@ -60,7 +60,13 @@ class PHire
|
||||||
classNames = ["mybooking"]
|
classNames = ["mybooking"]
|
||||||
viewButton = true
|
viewButton = true
|
||||||
end
|
end
|
||||||
|
if viewButton === false
|
||||||
|
if Admin::PropertyHiresController.helpers.check_if_user_is_manager?
|
||||||
|
viewButton = true
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
label = self.send(self.property.calendar_label_field_name) rescue ""
|
label = self.send(self.property.calendar_label_field_name) rescue ""
|
||||||
title = startt.strftime("%H:%M") + " ~ " + endt.strftime("%H:%M") + " " + label
|
title = startt.strftime("%H:%M") + " ~ " + endt.strftime("%H:%M") + " " + label
|
||||||
fields_to_show = Property::FIELDSNAME.select{|k,v| self.property.send(k)["for_display"] == "true"}
|
fields_to_show = Property::FIELDSNAME.select{|k,v| self.property.send(k)["for_display"] == "true"}
|
||||||
|
|
|
@ -67,16 +67,18 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<% manager = can_edit_or_delete?(property) %>
|
||||||
<a href="" onclick="window.history.back();return false;" class="btn btn-warning">Back</a>
|
<a href="" onclick="window.history.back();return false;" class="btn btn-warning">Back</a>
|
||||||
<% if can_edit_or_delete?(@booking.property) %>
|
<% if manager || @booking.hiring_person_id == current_user.member_profile.id.to_s %>
|
||||||
<a href="<%= edit_hire_admin_property_hire_path(@booking) %>" class="btn btn-info"><%= t("property_hire.edit") %></a>
|
<a href="<%= edit_hire_admin_property_hire_path(@booking) %>" class="btn btn-info"><%= t("property_hire.edit") %></a>
|
||||||
|
<a href="<%= delete_booking_details_admin_property_hire_path(@booking, :page => params[:page]) %>" class="btn btn-danger" data-method="delete" data-confirm="Are you sure?"><%= t("property_hire.delete") %></a>
|
||||||
|
<% end %>
|
||||||
|
<% if manager %>
|
||||||
<% if @booking.passed %>
|
<% if @booking.passed %>
|
||||||
<a href="<%= pass_booking_admin_property_hire_path(@booking, :status => "reject") %>" class="btn btn-warning"><%= t("property_hire.reject") %></a>
|
<a href="<%= pass_booking_admin_property_hire_path(@booking, :status => "reject") %>" class="btn btn-warning"><%= t("property_hire.reject") %></a>
|
||||||
<% else %>
|
<% else %>
|
||||||
<a href="<%= pass_booking_admin_property_hire_path(@booking, :status => "accept") %>" class="btn btn-success"><%= t("property_hire.accept") %></a>
|
<a href="<%= pass_booking_admin_property_hire_path(@booking, :status => "accept") %>" class="btn btn-success"><%= t("property_hire.accept") %></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<a href="<%= delete_booking_details_admin_property_hire_path(@booking, :page => params[:page]) %>" class="btn btn-danger" data-method="delete" data-confirm="Are you sure?"><%= t("property_hire.delete") %></a>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,4 +53,5 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var property_id = "<%= property.id.to_s %>";
|
var property_id = "<%= property.id.to_s %>";
|
||||||
var calendar = new Calendar("#calendar",property_id,false);
|
var calendar = new Calendar("#calendar",property_id,false);
|
||||||
|
|
||||||
</script>
|
</script>
|
Loading…
Reference in New Issue