styling progress

This commit is contained in:
Adam Piontek 2021-03-03 10:16:11 -05:00
parent 0869d6a58c
commit c7e12f7d49
3 changed files with 31 additions and 29 deletions

View file

@ -25,3 +25,6 @@
.no-valid-style .form-check-input.is-valid ~ .form-check-label {
color: inherit !important;
}
.table-nonfluid {
width: auto !important;
}

View file

@ -1,4 +1,7 @@
<div class="d-flex justify-content-between d-flex align-items-end">
<h2>Listing Properties</h2>
<span><%= live_patch "New Property", to: Routes.property_index_path(@socket, :new), class: "btn btn-primary" %></span>
</div>
<%= if @live_action in [:new, :edit] do %>
<%= live_modal @socket, Bones73kWeb.PropertyLive.FormComponent,
@ -29,18 +32,16 @@
<td>
<%= if Roles.can?(@current_user, property, :show) do %>
<span><%= live_redirect "Show", to: Routes.property_show_path(@socket, :show, property) %></span>
<%= live_redirect "Show", to: Routes.property_show_path(@socket, :show, property), class: "link-secondary mx-1" %>
<% end %>
<%= if Roles.can?(@current_user, property, :edit) do %>
<span><%= live_patch "Edit", to: Routes.property_index_path(@socket, :edit, property) %></span>
<%= live_patch "Edit", to: Routes.property_index_path(@socket, :edit, property), class: "mx-1" %>
<% end %>
<%= if Roles.can?(@current_user, property, :delete) do %>
<span><%= link "Delete", to: "#", phx_click: "delete", phx_value_id: property.id, data: [confirm: "Are you sure?"] %></span>
<%= link "Delete", to: "#", phx_click: "delete", phx_value_id: property.id, data: [confirm: "Are you sure?"], class: "link-danger mx-1" %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<span><%= live_patch "New Property", to: Routes.property_index_path(@socket, :new) %></span>

View file

@ -1,4 +1,4 @@
<h1>Show Property</h1>
<h2>Show Property</h2>
<%= if @live_action in [:edit] do %>
<%= live_modal @socket, Bones73kWeb.PropertyLive.FormComponent,
@ -9,28 +9,26 @@
return_to: Routes.property_show_path(@socket, :show, @property) %>
<% end %>
<ul>
<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>
<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>
<%= 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" %>
<% end %>