Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caroline checkout #79

Merged
merged 4 commits into from
Nov 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ footer section {
list-style: none;
}


.middle_flex {
display: flex;
}
/// OPTIONAL: Caroline is still toying with this ///

.nav-tabs {
Expand Down
14 changes: 9 additions & 5 deletions app/views/categories/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<%= render "/merchants/dashboard" %>

<ul><%= form_with model: @category, class:"new-category-form" do |f| %>
<li><%= f.label :name %>
<%= f.text_field :name %></li>

<%= f.submit "Create a new Category", class: "category-form-buttom "%>
<br>
<%= form_with model: @category, class:"new-category-form" do |f| %>
<section class="form-group">
<%= f.label :name, class: "form-row" %>
<%= f.text_field :name, class: "form-control" %>
</section>

<%= f.submit "Create a new Category", class: "btn btn-primary category-form-buttom "%>

<% end %>
</ul>
13 changes: 8 additions & 5 deletions app/views/merchants/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<section class="form-group">

<%= form_with model: @merchant, class: merchant_form_class do |f| %>

<%= f.label :name %>
<%= f.text_field :name %>
<%= f.label :email %>
<%= f.text_field :email %>
<%= f.label :name, class: "form-row" %>
<%= f.text_field :name, class: "form-control" %>
<%= f.label :email, class: "form-row" %>
<%= f.text_field :email, class: "form-control" %>

<%= f.submit submit_button_label, class: "merchant-form-button" %>
</section>
<%= f.submit submit_button_label, class: "btn btn-primary merchant-form-button" %>

<% end %>
9 changes: 6 additions & 3 deletions app/views/orders/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<%# <%= form_with model: @order, url: order_path(@order.id) do |f| %>
<p> Edit Order </p>
<h1> Edit Order </h1>
<% @order.order_items.each do |item| %>
<section class="form-group middle_flex">
<%= form_with model: @order_item, url: order_order_item_path(id: item.id, order_id: @order.id), method: :patch do |f| %>
Item: <%= item.id %>
Item #<%= item.id %><br>
Name: <%= item.product.name.capitalize %><br>
<%= f.label :quantity %>
<%= f.number_field :quantity, value: item.qty %>
<%= f.label :remove %>
<%= f.check_box :remove %>
<%= f.submit "Update" %>
<%= f.submit "Update", class: "btn btn-primary" %>
<% end %>
</section>
<% end %>
34 changes: 19 additions & 15 deletions app/views/products/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<%= render "merchants/dashboard" %>

<ul><%= form_with model: @product, class:"new-product-form" do |f| %>
<li><%= f.label :name %>
<%= f.text_field :name %></li>
<li><%= f.label :price %>
<%= f.text_field :price %></li>
<li><%= f.label :stock %>
<%= f.text_field :stock %></li>
<li><%= f.label :description %>
<%= f.text_field :description %></li>
<li><%= f.label :img_url %>
<%= f.text_field :img_url %></li>
<%= form_with model: @product, class:"new-product-form" do |f| %>

<li><%= f.label :categories %>
<%= collection_check_boxes(:product, :category_ids, Category.all, :id, :name) %></li>
<section class="form-group">

<%= f.label :name, class: "form-row" %>
<%= f.text_field :name, class: "form-control" %>
<%= f.label :price, class: "form-row" %>
<%= f.text_field :price, class: "form-control" %>
<%= f.label :stock, class: "form-row" %>
<%= f.text_field :stock, class: "form-control" %>
<%= f.label :description, class: "form-row" %>
<%= f.text_field :description, class: "form-control" %>
<%= f.label :img_url, class: "form-row" %>
<%= f.text_field :img_url, class: "form-control" %>

<%= f.submit "Create a new Product", class: "product-form-buttom "%>
<%= f.label :categories %>
<%= collection_check_boxes(:product, :category_ids, Category.all, :id, :name) %>

</section>

<%= f.submit "Create a new Product", class: "btn btn-primary product-form-buttom "%>
<% end %>
</ul>