Skip to content

Commit

Permalink
styled show page. centered image. aligned doses and trashcan.
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceykao committed May 13, 2020
1 parent 85214af commit 25284e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 11 additions & 8 deletions app/views/cocktails/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
<div class="container d-flex justify-content-between">
<div class="card">
<div class="container">
<div class="card mt-3 p-3">
<h2><%= @cocktail.name %></h2>
<%= cl_image_tag @cocktail.photo.key, height: 300, width: 400, crop: :fill %>
<div style="text-align: center;"><%= cl_image_tag @cocktail.photo.key, height: 300, width: 400, crop: :fill %></div>
</div>
<div class="card">
<div class="card mt-3 p-3">
<h3>Ingredients</h3>
<ul class="list-group">
<% @cocktail.doses.each do |dose| %>
<li class="list-group-item">
<li class="list-group-item d-flex justify-content-between">
<div>
<%= dose.description %>
<%= dose.ingredient.name %>
</div>
<div>
<%= link_to dose_path(dose),
method: :delete,
data: { confirm: "Are you sure?" } do %>
<i class="fas fa-trash"></i>
<% end %>
</div>
</li>
<% end %>
</ul>
</div>
</div>
<div class="container d-flex justify-content-between">

<div class="container d-flex justify-content-around mt-3">
<%= link_to 'Edit name or image', edit_cocktail_path(@cocktail), class: "btn btn-primary" %>

<%= link_to 'Add Ingredient', new_cocktail_dose_path(@cocktail), class: "btn btn-primary" %>

<%= link_to 'Back', cocktails_path, class: "btn btn-primary" %>
</div>
2 changes: 1 addition & 1 deletion app/views/shared/_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="navbar justify-content-between fixed-top" style="background: white">
<div class="navbar justify-content-between" style="background: white">
<%= link_to cocktails_path, style: 'text-decoration: none;' do %><%= image_tag "cocktail.png", class: "avatar"%> Home
<% end %>
</div>

0 comments on commit 25284e3

Please sign in to comment.