2021-03-03 10:16:11 -05:00
|
|
|
<h2>Show Property</h2>
|
2020-09-14 12:22:25 -04:00
|
|
|
|
|
|
|
<%= if @live_action in [:edit] do %>
|
2021-02-24 07:49:39 -05:00
|
|
|
<%= live_modal @socket, Bones73kWeb.PropertyLive.FormComponent,
|
2020-09-14 12:22:25 -04:00
|
|
|
id: @property.id,
|
|
|
|
title: @page_title,
|
|
|
|
action: @live_action,
|
|
|
|
property: @property,
|
|
|
|
return_to: Routes.property_show_path(@socket, :show, @property) %>
|
|
|
|
<% end %>
|
|
|
|
|
2021-03-03 10:16:11 -05:00
|
|
|
<table class="table table-nonfluid">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<th scope="row" class="text-end">Name</th>
|
|
|
|
<td><%= @property.name %></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row" class="text-end">Price</th>
|
|
|
|
<td><%= @property.price %></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row" class="text-end">Description</th>
|
|
|
|
<td><%= @property.description %></td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-09-14 12:22:25 -04:00
|
|
|
|
2020-09-15 04:47:19 -04:00
|
|
|
<%= if Roles.can?(@current_user, @property, :index) do %>
|
2021-03-03 10:16:11 -05:00
|
|
|
<%= live_redirect "Back", to: Routes.property_index_path(@socket, :index), class: "btn btn-secondary" %>
|
|
|
|
<% end %>
|
|
|
|
<%= if Roles.can?(@current_user, @property, :edit) do %>
|
|
|
|
<%= live_patch "Edit", to: Routes.property_show_path(@socket, :edit, @property), class: "btn btn-primary" %>
|
2020-09-15 04:47:19 -04:00
|
|
|
<% end %>
|