-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
5 changed files
with
77 additions
and
58 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
display: flex; | ||
} | ||
|
||
.cards-row { | ||
flex: 0 0 60%; | ||
} | ||
|
||
.meal-card { | ||
width: 100%; | ||
position: relative; | ||
|
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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
<h2>Log in</h2> | ||
<div class="container"> | ||
|
||
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> | ||
<div class="form-inputs"> | ||
<%= f.input :email, | ||
required: false, | ||
autofocus: true, | ||
input_html: { autocomplete: "email" } %> | ||
<%= f.input :password, | ||
required: false, | ||
input_html: { autocomplete: "current-password" } %> | ||
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %> | ||
</div> | ||
<h2>Log in</h2> | ||
|
||
<div class="form-actions"> | ||
<%= f.button :submit, "Log in" %> | ||
</div> | ||
<% end %> | ||
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> | ||
<div class="form-inputs"> | ||
<%= f.input :email, | ||
required: false, | ||
autofocus: true, | ||
input_html: { autocomplete: "email" } %> | ||
<%= f.input :password, | ||
required: false, | ||
input_html: { autocomplete: "current-password" } %> | ||
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %> | ||
</div> | ||
|
||
<%= render "devise/shared/links" %> | ||
<div class="form-actions"> | ||
<%= f.button :submit, "Log in", class: "button" %> | ||
</div> | ||
<% end %> | ||
|
||
<%= render "devise/shared/links" %> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,59 @@ | ||
<h2> To be cooked ! </h2> | ||
<% @my_received_orders.each do |order| %> | ||
<% if order.status == "accepted" %> | ||
<div class="card-items"> | ||
<%= cl_image_tag order.meal.photo %> | ||
<div class="card-item-infos"> | ||
<%= order.meal.name %> - <%= order.user.email %> - status <%= order.status %> | ||
<div class="container"> | ||
<h2 class="mt-3">To be cooked</h2> | ||
<% @my_received_orders.each do |order| %> | ||
<% if order.status == "accepted" %> | ||
<div class="card-items"> | ||
<%= cl_image_tag order.meal.photo %> | ||
<div class="card-item-infos"> | ||
<p><%= order.meal.name %></p> | ||
<p><%= order.user.username %></p> | ||
<p>Status <%= order.status %></p> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
||
<h2> my received orders </h2> | ||
<% @my_received_orders.each do |order| %> | ||
<% if order.status != "accepted" %> | ||
<div class="card-items"> | ||
<%= cl_image_tag order.meal.photo %> | ||
<div class="card-item-infos"> | ||
<%= order.meal.name %> - <%= order.user.email %> - status <%= order.status %> | ||
<p><%= link_to "Accept", change_status_order_path(order, :status => "accept"), method: :POST, class:"btn btn-outline-dark" %></p> | ||
<p><%= link_to "Decline", change_status_order_path(order, :status => "decline"), method: :POST, class:"btn btn-outline-dark" %> </p> | ||
<h2 class="mt-3">My received orders </h2> | ||
<% @my_received_orders.each do |order| %> | ||
<% if order.status != "accepted" %> | ||
<div class="card-items"> | ||
<%= cl_image_tag order.meal.photo %> | ||
<div class="card-item-infos"> | ||
<p><%= order.meal.name %></p> | ||
<p><%= order.user.username %></p> | ||
<p>Status <%= order.status %></p> | ||
<p><%= link_to "Accept", change_status_order_path(order, :status => "accept"), method: :POST, class:"btn btn-outline-dark" %></p> | ||
<p><%= link_to "Decline", change_status_order_path(order, :status => "decline"), method: :POST, class:"btn btn-outline-dark" %> </p> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
||
|
||
<h2>my meals</h2> | ||
<% @my_meals.each do |meal| %> | ||
<div class="card-items" > | ||
<%= cl_image_tag meal.photo %> | ||
<div class="card-item-infos"> | ||
<h2><%= meal.name %></h2> | ||
<p><%= meal.description %><%= meal.quantity_max %></p> | ||
<h2 class="mt-3">My meals</h2> | ||
<% @my_meals.each do |meal| %> | ||
<div class="card-items" > | ||
<%= cl_image_tag meal.photo %> | ||
<div class="card-item-infos"> | ||
<p><%= meal.name %></p> | ||
<% meal.categories.each do |category| %> | ||
<span><%= category.name %></span> | ||
<% end %> | ||
<p><%= meal.quantity_max %></p> | ||
|
||
<% if meal.can_delete? %> | ||
<% if meal.can_delete? %> | ||
|
||
<p><%= link_to "Edit", edit_meal_path(meal.id), class:"btn btn-outline-dark" %></p> | ||
<p><%= link_to "Delete", meal_path(meal.id), class:"btn btn-outline-dark", | ||
method: :delete, | ||
data: { confirm: "Are you sure?" } %> | ||
</p> | ||
<p><%= link_to "Edit", edit_meal_path(meal.id), class:"btn btn-outline-dark" %></p> | ||
<p><%= link_to "Delete", meal_path(meal.id), class:"btn btn-outline-dark", | ||
method: :delete, | ||
data: { confirm: "Are you sure?" } %> | ||
</p> | ||
|
||
<% end %> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> | ||
|
||
<% end %> | ||
|
||
</div> | ||
|
||
|