bones73k/lib/bones73k_web/live/property_live/show.html.leex

37 lines
884 B
Text
Raw Normal View History

2020-09-14 12:22:25 -04:00
<h1>Show Property</h1>
<%= 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 %>
<ul>
<li>
<strong>Name:</strong>
<%= @property.name %>
</li>
<li>
<strong>Price:</strong>
<%= @property.price %>
</li>
<li>
<strong>Description:</strong>
<%= @property.description %>
</li>
</ul>
<%= if Roles.can?(@current_user, @property, :edit) do %>
<span><%= live_patch "Edit", to: Routes.property_show_path(@socket, :edit, @property), class: "button" %></span>
<% end %>
<%= if Roles.can?(@current_user, @property, :index) do %>
<span><%= live_redirect "Back", to: Routes.property_index_path(@socket, :index) %></span>
<% end %>