From 0e655ebb61a9a5a4617bee092e83c7b2b2a793a8 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 17 Jan 2018 16:17:23 +0800 Subject: [PATCH] fix for property module authorization --- app/views/admin/property_hires/index.html.erb | 16 +++++++++------- app/views/admin/property_hires/show.html.erb | 14 ++++++++------ .../property_hires/show_booking_details.html.erb | 12 +++++++----- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/app/views/admin/property_hires/index.html.erb b/app/views/admin/property_hires/index.html.erb index 9ec3be9..1d6b595 100644 --- a/app/views/admin/property_hires/index.html.erb +++ b/app/views/admin/property_hires/index.html.erb @@ -10,15 +10,17 @@ <% @properties.each do |property| %> - <%= property.title %> -
- +
+ <% else %> + <%= property.title %> + <% end %> <%= property.category.title %> diff --git a/app/views/admin/property_hires/show.html.erb b/app/views/admin/property_hires/show.html.erb index 1b46933..1aa72b3 100644 --- a/app/views/admin/property_hires/show.html.erb +++ b/app/views/admin/property_hires/show.html.erb @@ -30,13 +30,15 @@ <% end %> - View - <% if p_hire.passed %> - "index") %>" class="btn btn-warning">Reject - <% else %> - "index") %>" class="btn btn-success">Accept + <% if can_edit_or_delete?(p_hire.property) %> + View + <% if p_hire.passed %> + "index") %>" class="btn btn-warning">Reject + <% else %> + "index") %>" class="btn btn-success">Accept + <% end %> + Delete <% end %> - Delete <% end %> diff --git a/app/views/admin/property_hires/show_booking_details.html.erb b/app/views/admin/property_hires/show_booking_details.html.erb index cef0c69..abbcabc 100644 --- a/app/views/admin/property_hires/show_booking_details.html.erb +++ b/app/views/admin/property_hires/show_booking_details.html.erb @@ -39,12 +39,14 @@ Back -<% if @booking.passed %> - " class="btn btn-warning">Reject -<% else %> - " class="btn btn-success">Accept +<% if can_edit_or_delete?(@booking.property) %> + <% if @booking.passed %> + " class="btn btn-warning">Reject + <% else %> + " class="btn btn-success">Accept + <% end %> + Delete <% end %> -Delete