fix for property module authorization

This commit is contained in:
Harry Bomrah 2018-01-17 16:17:23 +08:00
parent e37286ef6e
commit 0e655ebb61
3 changed files with 24 additions and 18 deletions

View File

@ -10,15 +10,17 @@
<% @properties.each do |property| %>
<tr>
<td>
<% if can_edit_or_delete?(property) %>
<a href="<%= admin_property_hire_path(property) %>"><%= property.title %></a>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(property) %>
<li><a href="<%= edit_admin_property_hire_path(property, :page => params[:page]) %>"><%= t(:edit) %></a></li>
<li><a href="<%= admin_property_hire_path(property.id, :page => params[:page]) %>" data-method="delete" data-confirm="Are you sure?"><%= t(:delete_) %></a></li>
<% end %>
</ul>
</div>
<% else %>
<%= property.title %>
<% end %>
</td>
<td>
<%= property.category.title %>

View File

@ -30,6 +30,7 @@
<% end %>
</td>
<td>
<% if can_edit_or_delete?(p_hire.property) %>
<a href="<%= show_booking_details_admin_property_hire_path(p_hire, :page => params[:page]) %>" class="btn btn-info">View</a>
<% if p_hire.passed %>
<a href="<%= pass_booking_admin_property_hire_path(p_hire, :page => params[:page], :status => "reject", :ref => "index") %>" class="btn btn-warning">Reject</a>
@ -37,6 +38,7 @@
<a href="<%= pass_booking_admin_property_hire_path(p_hire, :page => params[:page], :status => "accept", :ref => "index") %>" class="btn btn-success">Accept</a>
<% end %>
<a href="<%= delete_booking_details_admin_property_hire_path(p_hire, :page => params[:page]) %>" class="btn btn-danger" data-method="delete" data-confirm="Are you sure?">Delete</a>
<% end %>
</td>
</tr>
<% end %>

View File

@ -39,12 +39,14 @@
</tbody>
</table>
<a href="<%= admin_property_hire_path(@booking.property, :page => params[:page]) %>" class="btn btn-warning">Back</a>
<% if can_edit_or_delete?(@booking.property) %>
<% if @booking.passed %>
<a href="<%= pass_booking_admin_property_hire_path(@booking, :status => "reject") %>" class="btn btn-warning">Reject</a>
<% else %>
<a href="<%= pass_booking_admin_property_hire_path(@booking, :status => "accept") %>" class="btn btn-success">Accept</a>
<% 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?">Delete</a>
<% end %>