Skip to content

Commit

Permalink
moved navbar and footer into shared folder. moved add new cocktail bu…
Browse files Browse the repository at this point in the history
…tton out of nav bar into mainbody. added home text next to navbar icon
  • Loading branch information
joyceykao committed May 13, 2020
1 parent b0770e7 commit 85214af
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
17 changes: 2 additions & 15 deletions app/views/cocktails/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<div class="navbar justify-content-between fixed-top" style="background: white">
<%= image_tag "cocktail.png", class: "avatar"%>
<%= link_to 'Add Cocktail', new_cocktail_path, class: "btn btn-primary" %>
</div>

<div class="banner" style="background-image: linear-gradient(rgba(0,0,0,0.4),rgba(0,0,0,0.4)), url(https://images.unsplash.com/photo-1534446322009-45c6d25cbca3?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=600&q=60);">
<div class="container">
Expand All @@ -14,22 +10,13 @@
<div class="cards">
<% @cocktails.each do |cocktail| %>
<%= link_to cocktail_path(cocktail), id: 'link' do %>
<div class="card-category nounderline" style="background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('<%= cl_image_path(cocktail.photo.key) %>')" >
<div class="card-category" style="background-image: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('<%= cl_image_path(cocktail.photo.key) %>')" >
<%= cocktail.name %>
</div>
<% end %>
<% end %>
</div>
</div>


<div class="footer">
<div class="footer-copyright">
Icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon"> www.flaticon.com</a>
</div>
<div class="footer-copyright">
This footer is made with <i class="fas fa-heart"></i> at Le Wagon
</div>
<%= link_to 'Add New Cocktail', new_cocktail_path, class: 'btn btn-primary mt-3' %>
</div>


Expand Down
2 changes: 2 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
</head>

<body>
<%= render 'shared/navbar' %>
<%= yield %>
<%= render 'shared/footer' %>
</body>
</html>
8 changes: 8 additions & 0 deletions app/views/shared/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="footer">
<div class="footer-copyright">
Icons made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon"> www.flaticon.com</a>
</div>
<div class="footer-copyright">
This footer is made with <i class="fas fa-heart"></i> at Le Wagon
</div>
</div>
4 changes: 4 additions & 0 deletions app/views/shared/_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="navbar justify-content-between fixed-top" 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 85214af

Please sign in to comment.