-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc8b6ac
commit c2c5dda
Showing
10 changed files
with
123 additions
and
8 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<%= link_to ' << Recipe', recipe_path(@recipe.id), class: "btn btn-outline-success mb-2" %> | ||
<div class="card col-md-6 offset-md-3"> | ||
<div class="card-body"> | ||
<div class="container"> | ||
<p style="font-size: 30px; text-align:center; color: var(--primary-color)">Shopping list</p> | ||
<div class="row"> | ||
<ul class="list-unstyled"> | ||
<li class="text-black"><%= @recipe.name %></li> | ||
<li class="text-muted mt-1"><%= @inventory.name %></li> | ||
<li class="text-black mt-1">Items to purchase: <%= @shopping_list.length %></li> | ||
<li class="text-black mt-1">Total Cost: <%= "$#{@cost}" %></li> | ||
</ul> | ||
</div> | ||
<div class="row"> | ||
<div class="col-xl-5"> | ||
<b>Item</b> | ||
</div> | ||
<div class="col-xl-5"> | ||
<b>Quantity</b> | ||
</div> | ||
<div class="col-xl-2"> | ||
<b class="float-end">Price </b> | ||
</div> | ||
<hr> | ||
</div> | ||
<% @shopping_list.each do |food| %> | ||
<div class="row"> | ||
<div class="col-xl-5"> | ||
<p><%= food.name %></p> | ||
</div> | ||
<div class="col-xl-5"> | ||
<p><%= "#{food.quantity} #{food.measurement_unit}" %></p> | ||
</div> | ||
<div class="col-xl-2"> | ||
<p class="float-end"> $<%= food.quantity * food.price %> </p> | ||
</div> | ||
<hr> | ||
</div> | ||
<% end %> | ||
<div class="text-center" style="margin-top: 10px;"> | ||
<a onclick="window.print(); return false;" style="cursor:pointer"><u class="text-primary"><i class="fa fa-print" aria-hidden="true"></i>Print</u></a> | ||
<p>Thank you for using our product</p> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<div class="modal fade" id="listBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="listBackdropLabel" aria-hidden="true"> | ||
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title" id="listBackdropLabel"> | ||
<i class="fa fa-shopping-basket" aria-hidden="true"></i> | ||
Generating Shopping List <br /> | ||
</h5> | ||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | ||
</div> | ||
<%= form_with url: shopping_list_path, method: :get do |form| %> | ||
<div class="modal-body"> | ||
<h6>Select Inventory to use</h6> | ||
<%= form.select :inventory_id, list, {}, {:class => 'form-control'} %> | ||
<%= form.hidden_field :recipe_id, value: recipe %> | ||
</div> | ||
<div class="modal-footer"> | ||
<%=button_tag type: 'submit', class: "btn btn-outline-success popover-test", title: "This gives you a list of items that you need to purchase to make your recipe based on store inventory", data: {disable_with: "Loading..."}, name: nil do %> | ||
<i class="fa fa-list-ol" aria-hidden="true"></i> Get List | ||
<% end %> | ||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters