Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
guineveresaenger committed Oct 28, 2016
2 parents c1931f4 + 511e4d5 commit 72448b1
Show file tree
Hide file tree
Showing 95 changed files with 255 additions and 124 deletions.
Binary file added app/assets/images/babay-cloth_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/baby-cloth.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/baby_robot .jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/bag-flappy-disk.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/bag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/coffe_mug_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/coffe_mug_4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/coffe_mug_7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/coffee_mug.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/coffee_mug_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/computer-bag.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/computer_bag.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/computer_pad.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/computer_tote_bag.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/geek_coffee_5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/pen_holders.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/t-shirt4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/t-shirt_9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/t_shirt.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/t_shirt_10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/tie.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/tishirt.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/tot_bag_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/tot_bags.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/travel_mug .jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/wedding-cap.webp
Binary file not shown.
Binary file added app/assets/images/wedding_shirt.webp
Binary file not shown.
Binary file added app/assets/images/women-shirt.jpg
47 changes: 44 additions & 3 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@
*= require foundation_and_overrides
*/
body {
background-color: rgba(245,242,225, 0.5);
font-family: 'Rubik', sans-serif;
}

h1, .title-area, .name {
margin: 0 0;
background-color: rgb(245,242,225)
width: 100rem;
background-color: rgb(245,242,225);
}

.name {
Expand All @@ -33,9 +38,19 @@ a:hover {
color: #cacaca;
}

.row.top-bar {
max-width: 100rem;
margin-left: none;
margin-right: none;
}

.top-bar {
box-shadow:0px 1px 1px rgb(136,149,194);
}

.top-bar, .top-bar ul {
background-color: rgb(136,149,194);
padding: 0;
background-color: rgb(136,149,194);
padding: 0;
}

.dropdown.menu.medium-horizontal > li.is-dropdown-submenu-parent > a::after {
Expand All @@ -51,3 +66,29 @@ a:hover {
font-family: 'Chelsea Market', cursive;

}

li.column {
list-style: none;
}

.small-up-4 > li {
margin-bottom: 2.25rem;
margin-top: 2rem;
}


h2 {
color: rgb(136, 149, 194);
text-shadow: 2px 2px 3px rgb(82, 82, 142);
font-family: 'Chelsea Market', cursive;
}

.product-info {
color: rgb(82, 82, 142);
font-family: 'Rubik', sans-serif;
}

.notice {
font-weight: bold;
font-size: 1rem;
}
17 changes: 17 additions & 0 deletions app/assets/stylesheets/sessions.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Place all the styles related to the Sessions controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

.welcome-message {
margin-top: 2rem;
}

.welcome-message > h2, .welcome-message > h3 {
font-family: 'Chelsea Market', cursive;
text-shadow: 2px 2px 3px rgb(136, 149, 194);
}

.welcome-message > h2 {
color: rgb(82, 82, 142);
}

.welcome-message > h3 {
color: rgb(136, 149, 194);
}
4 changes: 2 additions & 2 deletions app/controllers/order_items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def ship
order = @order_item.order
order.complete_order

redirect_to orders_path
redirect_to order_order_items_path(@order_item.order)
end


Expand All @@ -46,6 +46,6 @@ def get_order_item
end

def order_item_params
params.require(:order_item).permit(:quantity)
params.require(:order_item).permit(:quantity, :shipped)
end
end
15 changes: 15 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ def sign_up_button(**kwargs)
link_to text, path, method: method, **kwargs
end

def product_image(product, **kwargs)
if product.image.nil?
path = "no_image.png"
dimensions = "80x60"
text = "Robits"
else
path = (product.image_stored? ? product.image.thumb('80x60').url : "")
dimensions = "80x60"
text = "Buy Me"
end
image_tag path, size: dimensions, alt: text
end



def render_date(date)
("<span class='date'>" + date.strftime("%A, %b %d %Y") + "</span>").html_safe
end
Expand Down
25 changes: 12 additions & 13 deletions app/views/application/_products_index.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<ul>
<% @products.each do |product| %>
<% if product.image != nil %>
<strong>Image:</strong>
<li class="image"><%= product.image_stored? ? image_tag(product.image.thumb('80x60').url) : "" %></li>
<% elsif %>
<li class="image"><%= image_tag "no_image.png", size: "80x60", alt: "Robots" %></li>
<% end %>
<li><%= link_to product.name, product_path(product.id) %></li>
<li> Price: <%= product.price %></li>
<li>In Stock: <%= product.quantity %></li>
<% end %>
</ul>
<ul class='row small-up-4'>
<% @products.each do |product| %>
<li class="column text-center">
<%= product_image(product) %>
<ul 'row small-up-3' >
<li class="column text-center"><h2><%= link_to product.name, product_path(product.id) %></h2></li>
<li class="product-info column text-center"> $ <%= product.price %>0</li>
<li class="product-info notice column text-center">Only <%= product.quantity %> left!</li>
</ul>
</li>
<% end %>
</ul>
68 changes: 35 additions & 33 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<%= javascript_include_tag "application", 'data-turbolinks-track' => true %>

<!-- ROBITS cute font -->
<link href="https://fonts.googleapis.com/css?family=Chelsea+Market" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Chelsea+Market|Rubik" rel="stylesheet">
<%= csrf_meta_tags %>
</head>

Expand All @@ -27,42 +27,44 @@
</ul>
</section>

<div class="lower-link-area">
<section class="small-12 columns top-bar-left">
<!-- Make this unordered list horizontal at medium and larger screens & verticle on small ones -->
<ul class="vertical menu medium-horizontal" data-responsive-menu="accordion medium-dropdown">
<li>
<%= link_to 'SHOP ALL', products_path %>
</li>

<li>
<%= link_to 'CATEGORIES', categories_path %>
<!-- Submenu of Categories -->
<ul class="menu vertical">
<% category.each do |f| %>
<li>
<%= link_to "#{f.name}", category_path(f.id) %>
</li>
<% end %>
</ul>
</li>
<div class="lower-link-area">
<section class="small-12 columns top-bar-left">
<!-- Make this unordered list horizontal at medium and larger screens & verticle on small ones -->
<ul class="vertical menu medium-horizontal" data-responsive-menu="accordion medium-dropdown">
<li>
<%= link_to 'SHOP ALL', products_path %>
</li>

<li>
<%= link_to 'MERCHANTS', merchants_path %>
<!-- Submenu of Merchants -->
<ul class="menu vertical">
<% merchant.each do |f| %>
<li>
<%= link_to "#{f.user_name}", merchant_path(f.id) %>
</li>
<% end %>
<li>
<%= link_to 'CATEGORIES', categories_path %>
<!-- Submenu of Categories -->
<ul class="menu vertical">
<% category.each do |f| %>
<li>
<%= link_to "#{f.name}", category_path(f.id) %>
</li>
<% end %>
</ul>
</li>

</ul>
</li>
</section>
<li>
<%= link_to 'MERCHANTS', merchants_path %>
<!-- Submenu of Merchants -->
<ul class="menu vertical">
<% merchant.each do |f| %>
<li>
<%= link_to "#{f.user_name}", merchant_path(f.id) %>
</li>
<% end %>

<section>
</ul>
</li>
</section>

<section>
<% if session[:merchant_id] %>
<%= button_to "Merchant Control", sessions_merchant_login_path, method: :get %>
<% end %>
<ul class="menu top-bar-right">
<li><%= login_status %></li>
<li><%= login_button %></li>
Expand Down
1 change: 1 addition & 0 deletions app/views/products/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

<li class="field">
<%= f.label :Category %><br>
<li>Hold command and shift to select more than one category</li>
<%= f.select :category_ids, Category.all.collect{|category| [category.name, category.id]}, {}, {multiple: true}%>
</li>

Expand Down
5 changes: 5 additions & 0 deletions app/views/products/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
<% f.rating.times do |f| %>
<%= image_tag "robot.png", size: "18x18", alt: "Robots" %>
<% end %>
<% if current_merchant %>
<li>By: <%= "#{current_merchant.user_name}"%> </li>
<% else %>
<li>By: Anonymous</li>
<% end %>
<% if f.description != nil %>
<li><%= f.description %></li>
<% end %>
Expand Down
6 changes: 6 additions & 0 deletions app/views/sessions/_welcome.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<section class="welcome-message small-block-grid-1 text-center the-grid">

<h2 class='column'>WELCOME TO ROBITS </h2>

<h3 class='column'>Somewhere you belong</h3>
</section>
8 changes: 1 addition & 7 deletions app/views/sessions/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
<h3>HOMEPAGE | WELCOME TO ROBITS </h3>

<h4>Somewhere you belong</h4>

<p>
THIS IS THE GENERIC INDEX PAGE
</p>
<%= render partial: "welcome" %>
8 changes: 1 addition & 7 deletions app/views/sessions/index_log_in.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
<%# if session[:merchant_id] %>
<!-- <p>Login Successful! Welcome! <%# @current_merchant.user_name %></p> -->
<%# end %>

<h3>HOMEPAGE | WELCOME TO ROBITS </h3>

<h4>Somewhere you belong</h4>
<%= render partial: "welcome" %>
10 changes: 1 addition & 9 deletions app/views/sessions/index_log_out.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
<%# if session[:merchant_id].nil? %>
<%# if flash[:error] %>
<!-- <p><%# flash[:error] %></p> -->
<%# end %>
<%# end %>

<h3>HOMEPAGE | WELCOME TO ROBITS </h3>

<h4>Somewhere you belong</h4>
<%= render partial: "welcome" %>
Empty file modified db/migrate/20161018190923_create_merchants.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20161018190958_create_products.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20161018191223_create_orders.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20161018191241_create_reviews.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20161018191329_create_categories.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20161018191639_create_order_items.rb
100644 → 100755
Empty file.
Empty file.
Empty file modified db/migrate/20161019221424_add_uid_provider_to_merchants.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20161020041859_remove_uid_provider_from_merchants.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20161020042645_readd_uid_provider_to_merchants.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20161020225156_create_payment_details.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20161020225245_drop_payment_columns_from_order.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20161020234653_categories_products.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20161021000758_add_cv_vto_payment_details.rb
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified db/migrate/20161024204106_change_data_type_for_cc_expiration.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20161024204449_add_field_to_product.rb
100644 → 100755
Empty file.
Empty file.
Empty file modified db/migrate/20161026034918_add_id_to_categories_product.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20161026172114_add_description_to.rb
100644 → 100755
Empty file.
Empty file modified db/migrate/20161026183346_add_shipped_to_order_order_items.rb
100644 → 100755
Empty file.
Empty file modified db/schema.rb
100644 → 100755
Empty file.
Empty file modified db/seeds.rb
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: tishirt.jpg
model_class: Product
model_attachment: image
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: geek_coffee_5.jpg
model_class: Product
model_attachment: image
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: tishirt.jpg
model_class: Product
model_attachment: image
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: tishirt.jpg
model_class: Product
model_attachment: image
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: tishirt.jpg
model_class: Product
model_attachment: image
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: tishirt.jpg
model_class: Product
model_attachment: image
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: tishirt.jpg
model_class: Product
model_attachment: image
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: tishirt.jpg
model_class: Product
model_attachment: image
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: tishirt.jpg
model_class: Product
model_attachment: image
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: tishirt.jpg
model_class: Product
model_attachment: image
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: tishirt.jpg
model_class: Product
model_attachment: image
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: baby-cloth.jpg
model_class: Product
model_attachment: image
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: tishirt.jpg
model_class: Product
model_attachment: image
5 changes: 0 additions & 5 deletions test/controllers/categories_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ class CategoriesControllerTest < ActionController::TestCase
assert_equal assigns(:category), categories(:one)
end

def login_a_user
request.env['omniauth.auth'] = OmniAuth.config.mock_auth[:github]
get :create, { provider: "github" }
end

test "should get the new form when a logged-in User create a new category" do
session[:merchant_id] = merchants(:one).id
get :new
Expand Down
Loading

0 comments on commit 72448b1

Please sign in to comment.