From f21684c4292100ea5d40c55d33ae2ec6ed7d7a18 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Mon, 2 May 2016 16:34:30 -0700 Subject: [PATCH 001/174] Created User model and controller. --- app/assets/javascripts/users.coffee | 3 +++ app/assets/stylesheets/users.scss | 3 +++ app/controllers/users_controller.rb | 2 ++ app/helpers/users_helper.rb | 2 ++ app/models/user.rb | 4 ++++ db/migrate/20160502232504_create_users.rb | 16 ++++++++++++++++ test/controllers/users_controller_test.rb | 7 +++++++ test/fixtures/users.yml | 21 +++++++++++++++++++++ test/models/user_test.rb | 7 +++++++ 9 files changed, 65 insertions(+) create mode 100644 app/assets/javascripts/users.coffee create mode 100644 app/assets/stylesheets/users.scss create mode 100644 app/controllers/users_controller.rb create mode 100644 app/helpers/users_helper.rb create mode 100644 app/models/user.rb create mode 100644 db/migrate/20160502232504_create_users.rb create mode 100644 test/controllers/users_controller_test.rb create mode 100644 test/fixtures/users.yml create mode 100644 test/models/user_test.rb diff --git a/app/assets/javascripts/users.coffee b/app/assets/javascripts/users.coffee new file mode 100644 index 0000000000..24f83d18bb --- /dev/null +++ b/app/assets/javascripts/users.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss new file mode 100644 index 0000000000..1efc835ccd --- /dev/null +++ b/app/assets/stylesheets/users.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the users controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb new file mode 100644 index 0000000000..3e74dea87f --- /dev/null +++ b/app/controllers/users_controller.rb @@ -0,0 +1,2 @@ +class UsersController < ApplicationController +end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb new file mode 100644 index 0000000000..2310a240d7 --- /dev/null +++ b/app/helpers/users_helper.rb @@ -0,0 +1,2 @@ +module UsersHelper +end diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 0000000000..75ff525a40 --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,4 @@ +class User < ActiveRecord::Base + has_many :orders + has_many :products +end diff --git a/db/migrate/20160502232504_create_users.rb b/db/migrate/20160502232504_create_users.rb new file mode 100644 index 0000000000..1bba6395b8 --- /dev/null +++ b/db/migrate/20160502232504_create_users.rb @@ -0,0 +1,16 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.string :username + t.string :email + t.string :password + t.string :full_name + t.integer :cc_number + t.date :exp_date + t.integer :cvv + t.integer :zip + + t.timestamps null: false + end + end +end diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb new file mode 100644 index 0000000000..d23f182948 --- /dev/null +++ b/test/controllers/users_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class UsersControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml new file mode 100644 index 0000000000..8c71b6dac9 --- /dev/null +++ b/test/fixtures/users.yml @@ -0,0 +1,21 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + username: MyString + email: MyString + password: MyString + full_name: MyString + cc_number: 1 + exp_date: 2016-05-02 + cvv: 1 + zip: 1 + +two: + username: MyString + email: MyString + password: MyString + full_name: MyString + cc_number: 1 + exp_date: 2016-05-02 + cvv: 1 + zip: 1 diff --git a/test/models/user_test.rb b/test/models/user_test.rb new file mode 100644 index 0000000000..82f61e0109 --- /dev/null +++ b/test/models/user_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class UserTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From 04b5cea87f6655f39442b417ce036fb8844b01f6 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Mon, 2 May 2016 16:41:11 -0700 Subject: [PATCH 002/174] Created routes. --- config/routes.rb | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 3f66539d54..1489f6bc27 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,8 @@ Rails.application.routes.draw do + resources :users + resources :products + resources :orders + resources :orderitem # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". @@ -26,31 +30,4 @@ # end # end - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end end From 294f11179a261c45c587272b4850828d7f90ea69 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 2 May 2016 16:52:24 -0700 Subject: [PATCH 003/174] model for product created, as well as relationships and validations. Controller created and ready for routes --- app/assets/javascripts/products.coffee | 3 +++ app/assets/stylesheets/products.scss | 3 +++ app/controllers/products_controller.rb | 2 ++ app/helpers/products_helper.rb | 2 ++ app/models/product.rb | 5 +++++ db/migrate/20160502231755_create_products.rb | 16 ++++++++++++++++ test/controllers/products_controller_test.rb | 7 +++++++ test/fixtures/products.yml | 11 +++++++++++ test/models/product_test.rb | 7 +++++++ 9 files changed, 56 insertions(+) create mode 100644 app/assets/javascripts/products.coffee create mode 100644 app/assets/stylesheets/products.scss create mode 100644 app/controllers/products_controller.rb create mode 100644 app/helpers/products_helper.rb create mode 100644 app/models/product.rb create mode 100644 db/migrate/20160502231755_create_products.rb create mode 100644 test/controllers/products_controller_test.rb create mode 100644 test/fixtures/products.yml create mode 100644 test/models/product_test.rb diff --git a/app/assets/javascripts/products.coffee b/app/assets/javascripts/products.coffee new file mode 100644 index 0000000000..24f83d18bb --- /dev/null +++ b/app/assets/javascripts/products.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/products.scss b/app/assets/stylesheets/products.scss new file mode 100644 index 0000000000..89e2e8db07 --- /dev/null +++ b/app/assets/stylesheets/products.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the products controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb new file mode 100644 index 0000000000..f1ad12ddea --- /dev/null +++ b/app/controllers/products_controller.rb @@ -0,0 +1,2 @@ +class ProductsController < ApplicationController +end diff --git a/app/helpers/products_helper.rb b/app/helpers/products_helper.rb new file mode 100644 index 0000000000..ab5c42b325 --- /dev/null +++ b/app/helpers/products_helper.rb @@ -0,0 +1,2 @@ +module ProductsHelper +end diff --git a/app/models/product.rb b/app/models/product.rb new file mode 100644 index 0000000000..6004309676 --- /dev/null +++ b/app/models/product.rb @@ -0,0 +1,5 @@ +class Product < ActiveRecord::Base + belongs_to :user + validates :name, presence: true, uniqueness: true + validates :price, presence: true, numericality: true, :greater_than_or_equal_to => 0 +end diff --git a/db/migrate/20160502231755_create_products.rb b/db/migrate/20160502231755_create_products.rb new file mode 100644 index 0000000000..05718845b5 --- /dev/null +++ b/db/migrate/20160502231755_create_products.rb @@ -0,0 +1,16 @@ +class CreateProducts < ActiveRecord::Migration + def change + create_table :products do |t| + t.string :name + t.float :price + t.integer :quantity + t.integer :rating + t.string :description + t.string :category + t.string :photo_url + t.string :status + t.integer :user_id + t.timestamps null: false + end + end +end diff --git a/test/controllers/products_controller_test.rb b/test/controllers/products_controller_test.rb new file mode 100644 index 0000000000..c881fa681b --- /dev/null +++ b/test/controllers/products_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ProductsControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/fixtures/products.yml b/test/fixtures/products.yml new file mode 100644 index 0000000000..937a0c002e --- /dev/null +++ b/test/fixtures/products.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/models/product_test.rb b/test/models/product_test.rb new file mode 100644 index 0000000000..211cdd0b4a --- /dev/null +++ b/test/models/product_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ProductTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From f65ba3567591488bad8194c76267b4a5d4b71b48 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Mon, 2 May 2016 16:54:15 -0700 Subject: [PATCH 004/174] Yak shaving almost done. --- app/assets/javascripts/orderitems.coffee | 3 +++ app/assets/javascripts/orders.coffee | 3 +++ app/assets/stylesheets/orderitems.scss | 3 +++ app/assets/stylesheets/orders.scss | 3 +++ app/controllers/orderitems_controller.rb | 2 ++ app/controllers/orders_controller.rb | 2 ++ app/helpers/orderitems_helper.rb | 2 ++ app/helpers/orders_helper.rb | 2 ++ app/models/user.rb | 2 ++ config/routes.rb | 14 -------------- test/controllers/orderitems_controller_test.rb | 7 +++++++ test/controllers/orders_controller_test.rb | 7 +++++++ 12 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 app/assets/javascripts/orderitems.coffee create mode 100644 app/assets/javascripts/orders.coffee create mode 100644 app/assets/stylesheets/orderitems.scss create mode 100644 app/assets/stylesheets/orders.scss create mode 100644 app/controllers/orderitems_controller.rb create mode 100644 app/controllers/orders_controller.rb create mode 100644 app/helpers/orderitems_helper.rb create mode 100644 app/helpers/orders_helper.rb create mode 100644 test/controllers/orderitems_controller_test.rb create mode 100644 test/controllers/orders_controller_test.rb diff --git a/app/assets/javascripts/orderitems.coffee b/app/assets/javascripts/orderitems.coffee new file mode 100644 index 0000000000..24f83d18bb --- /dev/null +++ b/app/assets/javascripts/orderitems.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/orders.coffee b/app/assets/javascripts/orders.coffee new file mode 100644 index 0000000000..24f83d18bb --- /dev/null +++ b/app/assets/javascripts/orders.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/orderitems.scss b/app/assets/stylesheets/orderitems.scss new file mode 100644 index 0000000000..3ae284dd37 --- /dev/null +++ b/app/assets/stylesheets/orderitems.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the orderitems controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/orders.scss b/app/assets/stylesheets/orders.scss new file mode 100644 index 0000000000..3b0428a94e --- /dev/null +++ b/app/assets/stylesheets/orders.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the orders controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/orderitems_controller.rb b/app/controllers/orderitems_controller.rb new file mode 100644 index 0000000000..bcac78bc17 --- /dev/null +++ b/app/controllers/orderitems_controller.rb @@ -0,0 +1,2 @@ +class OrderitemsController < ApplicationController +end diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb new file mode 100644 index 0000000000..8a0e3659ae --- /dev/null +++ b/app/controllers/orders_controller.rb @@ -0,0 +1,2 @@ +class OrdersController < ApplicationController +end diff --git a/app/helpers/orderitems_helper.rb b/app/helpers/orderitems_helper.rb new file mode 100644 index 0000000000..c74e407d1c --- /dev/null +++ b/app/helpers/orderitems_helper.rb @@ -0,0 +1,2 @@ +module OrderitemsHelper +end diff --git a/app/helpers/orders_helper.rb b/app/helpers/orders_helper.rb new file mode 100644 index 0000000000..443227fd48 --- /dev/null +++ b/app/helpers/orders_helper.rb @@ -0,0 +1,2 @@ +module OrdersHelper +end diff --git a/app/models/user.rb b/app/models/user.rb index 75ff525a40..13372763d0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,4 +1,6 @@ class User < ActiveRecord::Base has_many :orders has_many :products +# validation for users is unclear as guests should not be required to provide any info unless they actually buy something + # validates :username, presence: true end diff --git a/config/routes.rb b/config/routes.rb index 1489f6bc27..2a382ff571 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,20 +3,6 @@ resources :products resources :orders resources :orderitem - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products # Example resource route with options: # resources :products do diff --git a/test/controllers/orderitems_controller_test.rb b/test/controllers/orderitems_controller_test.rb new file mode 100644 index 0000000000..60b8236b8d --- /dev/null +++ b/test/controllers/orderitems_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class OrderitemsControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/orders_controller_test.rb b/test/controllers/orders_controller_test.rb new file mode 100644 index 0000000000..0afece19aa --- /dev/null +++ b/test/controllers/orders_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class OrdersControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end From 0c7ee6ddf291edd71e4fe07ac81abac2a8654a64 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Mon, 2 May 2016 16:54:56 -0700 Subject: [PATCH 005/174] made models for order and order item and added some seeds to seeds.rb --- app/models/order.rb | 5 +++++ app/models/orderitem.rb | 6 ++++++ db/migrate/20160502231830_create_orders.rb | 11 ++++++++++ .../20160502233423_create_orderitems.rb | 12 +++++++++++ db/seeds.rb | 21 +++++++++++++++++++ test/fixtures/orderitems.yml | 11 ++++++++++ test/fixtures/orders.yml | 11 ++++++++++ test/models/order_test.rb | 7 +++++++ test/models/orderitem_test.rb | 7 +++++++ 9 files changed, 91 insertions(+) create mode 100644 app/models/order.rb create mode 100644 app/models/orderitem.rb create mode 100644 db/migrate/20160502231830_create_orders.rb create mode 100644 db/migrate/20160502233423_create_orderitems.rb create mode 100644 test/fixtures/orderitems.yml create mode 100644 test/fixtures/orders.yml create mode 100644 test/models/order_test.rb create mode 100644 test/models/orderitem_test.rb diff --git a/app/models/order.rb b/app/models/order.rb new file mode 100644 index 0000000000..b9aa8cedf7 --- /dev/null +++ b/app/models/order.rb @@ -0,0 +1,5 @@ +class Order < ActiveRecord::Base + has_many :order_items + belongs_to :user + +end diff --git a/app/models/orderitem.rb b/app/models/orderitem.rb new file mode 100644 index 0000000000..7bdf796731 --- /dev/null +++ b/app/models/orderitem.rb @@ -0,0 +1,6 @@ +class Orderitem < ActiveRecord::Base + belongs_to :product + belongs_to :order + validates :quantity, presence: true, numericality: {only_integer: true, greater_than: 0} + +end diff --git a/db/migrate/20160502231830_create_orders.rb b/db/migrate/20160502231830_create_orders.rb new file mode 100644 index 0000000000..75a3d37ad0 --- /dev/null +++ b/db/migrate/20160502231830_create_orders.rb @@ -0,0 +1,11 @@ +class CreateOrders < ActiveRecord::Migration + def change + create_table :orders do |t| + t.string :status + t.float :price + t.user_id :integer + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20160502233423_create_orderitems.rb b/db/migrate/20160502233423_create_orderitems.rb new file mode 100644 index 0000000000..a3b4fd21da --- /dev/null +++ b/db/migrate/20160502233423_create_orderitems.rb @@ -0,0 +1,12 @@ +class CreateOrderitems < ActiveRecord::Migration + def change + create_table :orderitems do |t| + t.quantity :integer + t.subtotal :float + t.integer :order_id + t.integer :product_id + + t.timestamps null: false + end + end +end diff --git a/db/seeds.rb b/db/seeds.rb index 4edb1e857e..f64dc414fa 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,3 +5,24 @@ # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel', city: cities.first) + + +people = [ + { name: "Jess"}, + { name: "Alysia" }, + { name: "Deirdre"}, + { name: "Llama" }, + { name: "Puppy Party"}, +] + +people.each do |person| + User.create user +end + +Product.create(name: 'Hot Dog', price: 15, user_id: 2) +Product.create(name: "Dog Pirate", price: 20, user_id: 5) +Product.create(name: "Cat Spider", price: 1, user_id: 1) +Product.create(name: "Flying Fish", price: 56, user_id: 3) +Product.create(name: "Baked Potato", price: 94, user_id: 4) +Product.create(name: "Ice Cream Cone", price: 6, user_id: 2) +Product.create(name: "Banana Bird", price: 7, user_id: 5) diff --git a/test/fixtures/orderitems.yml b/test/fixtures/orderitems.yml new file mode 100644 index 0000000000..937a0c002e --- /dev/null +++ b/test/fixtures/orderitems.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/orders.yml b/test/fixtures/orders.yml new file mode 100644 index 0000000000..937a0c002e --- /dev/null +++ b/test/fixtures/orders.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/models/order_test.rb b/test/models/order_test.rb new file mode 100644 index 0000000000..15b8ed1348 --- /dev/null +++ b/test/models/order_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class OrderTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/orderitem_test.rb b/test/models/orderitem_test.rb new file mode 100644 index 0000000000..b98b8cd7d5 --- /dev/null +++ b/test/models/orderitem_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class OrderitemTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From 011cb3294ba4beb432987de757bdac1fbad2fd65 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Tue, 3 May 2016 09:51:27 -0700 Subject: [PATCH 006/174] added some details to seed file --- app/assets/javascripts/order.coffee | 3 ++ app/assets/stylesheets/order.scss | 3 ++ app/helpers/order_helper.rb | 2 ++ db/migrate/20160502231830_create_orders.rb | 4 +-- .../20160502233423_create_orderitems.rb | 4 +-- db/seeds.rb | 35 +++++++++---------- test/controllers/order_controller_test.rb | 7 ++++ 7 files changed, 35 insertions(+), 23 deletions(-) create mode 100644 app/assets/javascripts/order.coffee create mode 100644 app/assets/stylesheets/order.scss create mode 100644 app/helpers/order_helper.rb create mode 100644 test/controllers/order_controller_test.rb diff --git a/app/assets/javascripts/order.coffee b/app/assets/javascripts/order.coffee new file mode 100644 index 0000000000..24f83d18bb --- /dev/null +++ b/app/assets/javascripts/order.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/order.scss b/app/assets/stylesheets/order.scss new file mode 100644 index 0000000000..3ee74f9f68 --- /dev/null +++ b/app/assets/stylesheets/order.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the order controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/helpers/order_helper.rb b/app/helpers/order_helper.rb new file mode 100644 index 0000000000..05d197a0c1 --- /dev/null +++ b/app/helpers/order_helper.rb @@ -0,0 +1,2 @@ +module OrderHelper +end diff --git a/db/migrate/20160502231830_create_orders.rb b/db/migrate/20160502231830_create_orders.rb index 75a3d37ad0..7c0d1896ec 100644 --- a/db/migrate/20160502231830_create_orders.rb +++ b/db/migrate/20160502231830_create_orders.rb @@ -1,8 +1,8 @@ class CreateOrders < ActiveRecord::Migration def change create_table :orders do |t| - t.string :status - t.float :price + t.string :status + t.float :price t.user_id :integer t.timestamps null: false diff --git a/db/migrate/20160502233423_create_orderitems.rb b/db/migrate/20160502233423_create_orderitems.rb index a3b4fd21da..45c75dcd44 100644 --- a/db/migrate/20160502233423_create_orderitems.rb +++ b/db/migrate/20160502233423_create_orderitems.rb @@ -3,8 +3,8 @@ def change create_table :orderitems do |t| t.quantity :integer t.subtotal :float - t.integer :order_id - t.integer :product_id + t.integer :order_id + t.integer :product_id t.timestamps null: false end diff --git a/db/seeds.rb b/db/seeds.rb index f64dc414fa..3ae5d86eb2 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -6,23 +6,20 @@ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel', city: cities.first) +User.create(name: "Jess") +User.create(name: "Alysia") +User.create(name: "Deirdre") +User.create(name: "Llama") +User.create(name: "Puppy Party") -people = [ - { name: "Jess"}, - { name: "Alysia" }, - { name: "Deirdre"}, - { name: "Llama" }, - { name: "Puppy Party"}, -] - -people.each do |person| - User.create user -end - -Product.create(name: 'Hot Dog', price: 15, user_id: 2) -Product.create(name: "Dog Pirate", price: 20, user_id: 5) -Product.create(name: "Cat Spider", price: 1, user_id: 1) -Product.create(name: "Flying Fish", price: 56, user_id: 3) -Product.create(name: "Baked Potato", price: 94, user_id: 4) -Product.create(name: "Ice Cream Cone", price: 6, user_id: 2) -Product.create(name: "Banana Bird", price: 7, user_id: 5) +Product.create(name: 'Hot Dog', price: 15, user_id: 2, animal: 'Dog') +Product.create(name: "Dog Pirate", price: 20, user_id: 5, animal: 'Dog') +Product.create(name: "Alligator", price: 1, user_id: 1, animal: 'Dog') +Product.create(name: "Knight Guinea Pig", price: 56, user_id: 3, animal: "Guinea Pig") +Product.create(name: "St Patricks Dog", price: 94, user_id: 4, animal: "Dog") +Product.create(name: "Ewok dog", price: 6, user_id: 2, animal: "Dog") +Product.create(name: "Red Sweater", price: 7, user_id: 5, animal: "Goat") +Product.create(name: "Taco Cat", price: 14, user_id: 4, animal: "Cat") +Product.create(name: "Lion", price: 30, user_id: 3, animal: "Dog") +Product.create(name: 'Martini', price: 400, user_id: 1, animal: "Dog") +Product.create(name: 'Jockey', price: 22, user_id: 1, animal: "Dog") diff --git a/test/controllers/order_controller_test.rb b/test/controllers/order_controller_test.rb new file mode 100644 index 0000000000..60b0ccc521 --- /dev/null +++ b/test/controllers/order_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class OrderControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end From 22977e396c146db836764da58c0449b4ccf7bc90 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Tue, 3 May 2016 10:10:19 -0700 Subject: [PATCH 007/174] Merge commit. --- db/migrate/20160503164524_update_category_data_type.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 db/migrate/20160503164524_update_category_data_type.rb diff --git a/db/migrate/20160503164524_update_category_data_type.rb b/db/migrate/20160503164524_update_category_data_type.rb new file mode 100644 index 0000000000..df7f9d95da --- /dev/null +++ b/db/migrate/20160503164524_update_category_data_type.rb @@ -0,0 +1,6 @@ +class UpdateCategoryDataType < ActiveRecord::Migration + def change + change_column :products, :category, :array + add_column :products, :animal, :string + end +end From cf90f56e23722670d0118a7099c195ab65de3cea Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Tue, 3 May 2016 10:22:35 -0700 Subject: [PATCH 008/174] Update migration. --- db/migrate/20160503164524_update_category_data_type.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20160503164524_update_category_data_type.rb b/db/migrate/20160503164524_update_category_data_type.rb index df7f9d95da..c6b3efd906 100644 --- a/db/migrate/20160503164524_update_category_data_type.rb +++ b/db/migrate/20160503164524_update_category_data_type.rb @@ -1,6 +1,6 @@ class UpdateCategoryDataType < ActiveRecord::Migration def change - change_column :products, :category, :array + change_column :products, :category, :text, array:true, default:[] add_column :products, :animal, :string end end From ad2b941594ed4dd1b022d9fa137332fded3c3093 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Tue, 3 May 2016 12:31:00 -0700 Subject: [PATCH 009/174] took out animal attribute for product --- app/controllers/orders_controller.rb | 3 + app/models/product.rb | 2 +- db/migrate/20160502231830_create_orders.rb | 2 +- .../20160502233423_create_orderitems.rb | 4 +- ...0160503164524_update_category_data_type.rb | 8 +-- db/migrate/20160503165929_fix_problem.rb | 6 ++ db/schema.rb | 63 +++++++++++++++++++ db/seeds.rb | 32 +++++----- 8 files changed, 96 insertions(+), 24 deletions(-) create mode 100644 db/migrate/20160503165929_fix_problem.rb create mode 100644 db/schema.rb diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 8a0e3659ae..c2e6c6599f 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -1,2 +1,5 @@ class OrdersController < ApplicationController + + + end diff --git a/app/models/product.rb b/app/models/product.rb index 6004309676..ad7164bdd3 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -1,5 +1,5 @@ class Product < ActiveRecord::Base belongs_to :user validates :name, presence: true, uniqueness: true - validates :price, presence: true, numericality: true, :greater_than_or_equal_to => 0 + validates :price, presence: true, numericality: {greater_than: 0} end diff --git a/db/migrate/20160502231830_create_orders.rb b/db/migrate/20160502231830_create_orders.rb index 7c0d1896ec..65dc6201bd 100644 --- a/db/migrate/20160502231830_create_orders.rb +++ b/db/migrate/20160502231830_create_orders.rb @@ -3,7 +3,7 @@ def change create_table :orders do |t| t.string :status t.float :price - t.user_id :integer + t.integer :order_id t.timestamps null: false end diff --git a/db/migrate/20160502233423_create_orderitems.rb b/db/migrate/20160502233423_create_orderitems.rb index 45c75dcd44..bce0fef0bc 100644 --- a/db/migrate/20160502233423_create_orderitems.rb +++ b/db/migrate/20160502233423_create_orderitems.rb @@ -1,8 +1,8 @@ class CreateOrderitems < ActiveRecord::Migration def change create_table :orderitems do |t| - t.quantity :integer - t.subtotal :float + t.integer :quantity + t.float :price t.integer :order_id t.integer :product_id diff --git a/db/migrate/20160503164524_update_category_data_type.rb b/db/migrate/20160503164524_update_category_data_type.rb index c6b3efd906..0b4491f846 100644 --- a/db/migrate/20160503164524_update_category_data_type.rb +++ b/db/migrate/20160503164524_update_category_data_type.rb @@ -1,6 +1,6 @@ class UpdateCategoryDataType < ActiveRecord::Migration - def change - change_column :products, :category, :text, array:true, default:[] - add_column :products, :animal, :string - end + # def change + # change_column :products, :category, :string, array:true #default:[] + # + # end end diff --git a/db/migrate/20160503165929_fix_problem.rb b/db/migrate/20160503165929_fix_problem.rb new file mode 100644 index 0000000000..daade34859 --- /dev/null +++ b/db/migrate/20160503165929_fix_problem.rb @@ -0,0 +1,6 @@ +class FixProblem < ActiveRecord::Migration + # def change + # add_column :orders, :user_id, :integer + # remove_column :order, :integer, :user_id + # end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000000..2476781edb --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,63 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20160503165929) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "orderitems", force: :cascade do |t| + t.integer "quantity" + t.float "price" + t.integer "order_id" + t.integer "product_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "orders", force: :cascade do |t| + t.string "status" + t.float "price" + t.integer "order_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "products", force: :cascade do |t| + t.string "name" + t.float "price" + t.integer "quantity" + t.integer "rating" + t.string "description" + t.string "category" + t.string "photo_url" + t.string "status" + t.integer "user_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "users", force: :cascade do |t| + t.string "username" + t.string "email" + t.string "password" + t.string "full_name" + t.integer "cc_number" + t.date "exp_date" + t.integer "cvv" + t.integer "zip" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + +end diff --git a/db/seeds.rb b/db/seeds.rb index 3ae5d86eb2..9fabd7ce8c 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -6,20 +6,20 @@ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel', city: cities.first) -User.create(name: "Jess") -User.create(name: "Alysia") -User.create(name: "Deirdre") -User.create(name: "Llama") -User.create(name: "Puppy Party") +User.create(full_name: "Jess") +User.create(full_name: "Alysia") +User.create(full_name: "Deirdre") +User.create(full_name: "Llama") +User.create(full_name: "Puppy Party") -Product.create(name: 'Hot Dog', price: 15, user_id: 2, animal: 'Dog') -Product.create(name: "Dog Pirate", price: 20, user_id: 5, animal: 'Dog') -Product.create(name: "Alligator", price: 1, user_id: 1, animal: 'Dog') -Product.create(name: "Knight Guinea Pig", price: 56, user_id: 3, animal: "Guinea Pig") -Product.create(name: "St Patricks Dog", price: 94, user_id: 4, animal: "Dog") -Product.create(name: "Ewok dog", price: 6, user_id: 2, animal: "Dog") -Product.create(name: "Red Sweater", price: 7, user_id: 5, animal: "Goat") -Product.create(name: "Taco Cat", price: 14, user_id: 4, animal: "Cat") -Product.create(name: "Lion", price: 30, user_id: 3, animal: "Dog") -Product.create(name: 'Martini', price: 400, user_id: 1, animal: "Dog") -Product.create(name: 'Jockey', price: 22, user_id: 1, animal: "Dog") +Product.create(name: 'Hot Dog', price: 15, user_id: 2, category: 'Dog') +Product.create(name: "Dog Pirate", price: 20, user_id: 5, category: 'Dog') +Product.create(name: "Alligator", price: 1, user_id: 1, category: 'Dog') +Product.create(name: "Knight Guinea Pig", price: 56, user_id: 3, category: "Guinea Pig") +Product.create(name: "St Patricks Dog", price: 94, user_id: 4, category: "Dog") +Product.create(name: "Ewok dog", price: 6, user_id: 2, category: "Dog") +Product.create(name: "Red Sweater", price: 7, user_id: 5, category: "Goat") +Product.create(name: "Taco Cat", price: 14, user_id: 4, category: "Cat") +Product.create(name: "Lion", price: 30, user_id: 3, category: "Dog") +Product.create(name: 'Martini', price: 400, user_id: 1, category: "Dog") +Product.create(name: 'Jockey', price: 22, user_id: 1, category: "Dog") From 1d53370768ef68aea88f353e5929c19c1977d395 Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 3 May 2016 13:07:13 -0700 Subject: [PATCH 010/174] created home controller and root path view. also changed routes for users --- app/assets/javascripts/home.coffee | 3 +++ app/assets/stylesheets/home.scss | 3 +++ app/controllers/home_controller.rb | 7 +++++++ app/helpers/home_helper.rb | 2 ++ app/models/home.rb | 3 +++ app/views/home/index.html.erb | 18 ++++++++++++++++++ config/routes.rb | 16 ++++------------ db/migrate/20160503164300_create_homes.rb | 8 ++++++++ db/schema.rb | 5 +++++ test/controllers/home_controller_test.rb | 7 +++++++ test/fixtures/homes.yml | 11 +++++++++++ test/models/home_test.rb | 7 +++++++ 12 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 app/assets/javascripts/home.coffee create mode 100644 app/assets/stylesheets/home.scss create mode 100644 app/controllers/home_controller.rb create mode 100644 app/helpers/home_helper.rb create mode 100644 app/models/home.rb create mode 100644 app/views/home/index.html.erb create mode 100644 db/migrate/20160503164300_create_homes.rb create mode 100644 test/controllers/home_controller_test.rb create mode 100644 test/fixtures/homes.yml create mode 100644 test/models/home_test.rb diff --git a/app/assets/javascripts/home.coffee b/app/assets/javascripts/home.coffee new file mode 100644 index 0000000000..24f83d18bb --- /dev/null +++ b/app/assets/javascripts/home.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/home.scss b/app/assets/stylesheets/home.scss new file mode 100644 index 0000000000..f0ddc6846a --- /dev/null +++ b/app/assets/stylesheets/home.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the home controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb new file mode 100644 index 0000000000..8113e01295 --- /dev/null +++ b/app/controllers/home_controller.rb @@ -0,0 +1,7 @@ +class HomeController < ApplicationController + + def index + @products = Product.all + @product_picker = Product.where.not(id: nil).sample(3) + end +end diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb new file mode 100644 index 0000000000..23de56ac60 --- /dev/null +++ b/app/helpers/home_helper.rb @@ -0,0 +1,2 @@ +module HomeHelper +end diff --git a/app/models/home.rb b/app/models/home.rb new file mode 100644 index 0000000000..a24709a5cd --- /dev/null +++ b/app/models/home.rb @@ -0,0 +1,3 @@ +class Home < ActiveRecord::Base + +end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb new file mode 100644 index 0000000000..2502d6e205 --- /dev/null +++ b/app/views/home/index.html.erb @@ -0,0 +1,18 @@ +
+ +<%= link_to "Sign-up", new_user_path %> +<%= link_to "Log in", users_path %> +
+ +

+Featured Costumes +<%= @product_picker.name %> +<%= @product_picker.price %> +<%= link_to "Add to cart", orderitem_index_path %> +

+ +<%= link_to "View all costumes", products_path %> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 2a382ff571..d8e2428a43 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,19 +1,11 @@ Rails.application.routes.draw do - resources :users + + root 'home#index' + + resources :users, :only => [:new, :create] resources :products resources :orders resources :orderitem - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end end diff --git a/db/migrate/20160503164300_create_homes.rb b/db/migrate/20160503164300_create_homes.rb new file mode 100644 index 0000000000..475e8aac41 --- /dev/null +++ b/db/migrate/20160503164300_create_homes.rb @@ -0,0 +1,8 @@ +class CreateHomes < ActiveRecord::Migration + def change + create_table :homes do |t| + + t.timestamps null: false + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 2476781edb..9ef18eed17 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -16,6 +16,11 @@ # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" + create_table "homes", force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "orderitems", force: :cascade do |t| t.integer "quantity" t.float "price" diff --git a/test/controllers/home_controller_test.rb b/test/controllers/home_controller_test.rb new file mode 100644 index 0000000000..730478d380 --- /dev/null +++ b/test/controllers/home_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class HomeControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/fixtures/homes.yml b/test/fixtures/homes.yml new file mode 100644 index 0000000000..937a0c002e --- /dev/null +++ b/test/fixtures/homes.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/models/home_test.rb b/test/models/home_test.rb new file mode 100644 index 0000000000..c76d1123ea --- /dev/null +++ b/test/models/home_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class HomeTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From ba279f24bd11297ccc91254b6575b57515c8eefd Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 3 May 2016 13:22:05 -0700 Subject: [PATCH 011/174] home controller working with basics and needs links to other pages through controllers. need to work on animal vs category and getting 3 random costumes to show up instead of one --- app/controllers/products_controller.rb | 4 ++++ app/views/home/index.html.erb | 8 ++++---- config/routes.rb | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index f1ad12ddea..d85e402ac9 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -1,2 +1,6 @@ class ProductsController < ApplicationController + + def show + @products = Product.find(params[:category]) + end end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 2502d6e205..b02b1fdf71 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,17 +1,17 @@
<%= link_to "Sign-up", new_user_path %> <%= link_to "Log in", users_path %>
- +

Featured Costumes -<%= @product_picker.name %> -<%= @product_picker.price %> +<%= @product_picker.first.name %> +<%= @product_picker.first.price %> <%= link_to "Add to cart", orderitem_index_path %>

diff --git a/config/routes.rb b/config/routes.rb index d8e2428a43..fa6dcda312 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,6 +4,9 @@ resources :users, :only => [:new, :create] resources :products + + get '/products/:category' => 'products#show', as: 'product_category' + resources :orders resources :orderitem From c284ca62d5701cb29119f3dd24b291e5a480bdc2 Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 3 May 2016 14:18:51 -0700 Subject: [PATCH 012/174] we fixed the random sample of featured costumes so 3 show up. Fixed categories to show unique ones in the view --- app/controllers/home_controller.rb | 1 + app/controllers/products_controller.rb | 1 - app/views/home/index.html.erb | 15 +++++++++++---- config/routes.rb | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 8113e01295..23228998cd 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -3,5 +3,6 @@ class HomeController < ApplicationController def index @products = Product.all @product_picker = Product.where.not(id: nil).sample(3) + @categories = Product.uniq.pluck(:category) end end diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index d85e402ac9..f86094d0af 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -1,6 +1,5 @@ class ProductsController < ApplicationController def show - @products = Product.find(params[:category]) end end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index b02b1fdf71..0197fd90f4 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,7 +1,10 @@
<%= link_to "Sign-up", new_user_path %> @@ -10,9 +13,13 @@

Featured Costumes -<%= @product_picker.first.name %> -<%= @product_picker.first.price %> +
+<% @product_picker.each do |product| %> +<%= product.name %> +<%= product.price %> <%= link_to "Add to cart", orderitem_index_path %> +
+<% end %>

<%= link_to "View all costumes", products_path %> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index fa6dcda312..dea562f154 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,7 +5,7 @@ resources :users, :only => [:new, :create] resources :products - get '/products/:category' => 'products#show', as: 'product_category' + get '/products/category/:category' => 'products#show', as: 'product_category' resources :orders resources :orderitem From 0db3f009610070e6247a09419cbdb1060464cd7a Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Tue, 3 May 2016 14:48:12 -0700 Subject: [PATCH 013/174] updated validations for user --- app/models/user.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index 13372763d0..702c02a919 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,6 +1,12 @@ class User < ActiveRecord::Base has_many :orders has_many :products + + validates :username, presence: true, uniqueness: true + validates :email, presence: true, uniqueness: true, format: {with: /@/} + + + # validation for users is unclear as guests should not be required to provide any info unless they actually buy something # validates :username, presence: true end From df6e54c38ef4ae4467ddcaa7189638aae5bf8d49 Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 3 May 2016 14:48:39 -0700 Subject: [PATCH 014/174] created review model and validations --- app/models/product.rb | 1 + app/models/review.rb | 4 ++++ db/migrate/20160503213913_create_reviews.rb | 8 ++++++++ db/schema.rb | 7 ++++++- test/fixtures/reviews.yml | 11 +++++++++++ test/models/review_test.rb | 7 +++++++ 6 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 app/models/review.rb create mode 100644 db/migrate/20160503213913_create_reviews.rb create mode 100644 test/fixtures/reviews.yml create mode 100644 test/models/review_test.rb diff --git a/app/models/product.rb b/app/models/product.rb index ad7164bdd3..2e30cec221 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -1,5 +1,6 @@ class Product < ActiveRecord::Base belongs_to :user + has_many :reviews validates :name, presence: true, uniqueness: true validates :price, presence: true, numericality: {greater_than: 0} end diff --git a/app/models/review.rb b/app/models/review.rb new file mode 100644 index 0000000000..e73c9217c7 --- /dev/null +++ b/app/models/review.rb @@ -0,0 +1,4 @@ +class Review < ActiveRecord::Base + belongs_to :product + validates :rating, presence: true, numericality: { only_integer: true, greater_than_or_equal_to: 1, less_than_or_equal_to: 5 } +end diff --git a/db/migrate/20160503213913_create_reviews.rb b/db/migrate/20160503213913_create_reviews.rb new file mode 100644 index 0000000000..39c5709271 --- /dev/null +++ b/db/migrate/20160503213913_create_reviews.rb @@ -0,0 +1,8 @@ +class CreateReviews < ActiveRecord::Migration + def change + create_table :reviews do |t| + + t.timestamps null: false + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 9ef18eed17..0cc0d70bc5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160503165929) do +ActiveRecord::Schema.define(version: 20160503213913) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -52,6 +52,11 @@ t.datetime "updated_at", null: false end + create_table "reviews", force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "users", force: :cascade do |t| t.string "username" t.string "email" diff --git a/test/fixtures/reviews.yml b/test/fixtures/reviews.yml new file mode 100644 index 0000000000..937a0c002e --- /dev/null +++ b/test/fixtures/reviews.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/models/review_test.rb b/test/models/review_test.rb new file mode 100644 index 0000000000..11aa5204f0 --- /dev/null +++ b/test/models/review_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ReviewTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From a69eddaa3f2ec8d313ef2346c104c5c95c7e8da2 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Tue, 3 May 2016 15:12:21 -0700 Subject: [PATCH 015/174] Set up account registry and authentication. --- Gemfile | 3 +- Gemfile.lock | 5 ++++ app/controllers/users_controller.rb | 19 ++++++++++++ app/models/user.rb | 7 ++--- app/views/users/new.html.erb | 30 +++++++++++++++++++ .../20160503215236_add_bcrypt_pw_column.rb | 5 ++++ db/schema.rb | 7 +++-- 7 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 app/views/users/new.html.erb create mode 100644 db/migrate/20160503215236_add_bcrypt_pw_column.rb diff --git a/Gemfile b/Gemfile index fc06e5713d..ea98d33d36 100644 --- a/Gemfile +++ b/Gemfile @@ -24,7 +24,7 @@ gem 'jbuilder', '~> 2.0' gem 'sdoc', '~> 0.4.0', group: :doc # Use ActiveModel has_secure_password -# gem 'bcrypt', '~> 3.1.7' +gem 'bcrypt', '~> 3.1.7' # Use Unicorn as the app server # gem 'unicorn' @@ -44,4 +44,3 @@ group :development do # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' end - diff --git a/Gemfile.lock b/Gemfile.lock index a9da33c60c..5223ac4456 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -37,6 +37,7 @@ GEM thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) arel (6.0.3) + bcrypt (3.1.11) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) builder (3.2.2) @@ -143,6 +144,7 @@ PLATFORMS ruby DEPENDENCIES + bcrypt (~> 3.1.7) byebug coffee-rails (~> 4.1.0) jbuilder (~> 2.0) @@ -156,5 +158,8 @@ DEPENDENCIES uglifier (>= 1.3.0) web-console (~> 2.0) +RUBY VERSION + ruby 2.3.0p0 + BUNDLED WITH 1.12.1 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3e74dea87f..da4a5a5980 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,2 +1,21 @@ class UsersController < ApplicationController + + def new + @user = User.new + end + + def create + @user = User.new(user_create_params[:user]) + if @user.save + redirect_to root_path + else + render :new + end + end + + private + + def user_create_params + params.permit(user: [:username, :full_name, :email, :password, :password_confirmation]) + end end diff --git a/app/models/user.rb b/app/models/user.rb index 702c02a919..85b361c961 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,12 +1,11 @@ class User < ActiveRecord::Base + has_secure_password + has_many :orders has_many :products + validates :username, presence: true, uniqueness: true validates :email, presence: true, uniqueness: true, format: {with: /@/} - - -# validation for users is unclear as guests should not be required to provide any info unless they actually buy something - # validates :username, presence: true end diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb new file mode 100644 index 0000000000..7e0f8d707d --- /dev/null +++ b/app/views/users/new.html.erb @@ -0,0 +1,30 @@ +

Register for Petsy!

+<% if @user.errors.any? %> +
+

Grr... didn't work. :(

+
    + <% @user.errors.each do |attribute, message| %> +
  • <%= attribute %>: <%= message %>
  • + <% end %> +
+
+<% end %> +​ +<%= form_for @user do |f| %> + <%= f.label :username %> + <%= f.text_field :username %> + + <%= f.label :full_name %> + <%= f.text_field :full_name %> +​ + <%= f.label :email %> + <%= f.email_field :email %> +​ + <%= f.label :password %> + <%= f.password_field :password %> +​ + <%= f.label :password_confirmation %> + <%= f.password_field :password_confirmation %> +​ + <%= f.submit %> +<% end %> diff --git a/db/migrate/20160503215236_add_bcrypt_pw_column.rb b/db/migrate/20160503215236_add_bcrypt_pw_column.rb new file mode 100644 index 0000000000..21ab6dae4d --- /dev/null +++ b/db/migrate/20160503215236_add_bcrypt_pw_column.rb @@ -0,0 +1,5 @@ +class AddBcryptPwColumn < ActiveRecord::Migration + def change + add_column :users, :password_digest, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 0cc0d70bc5..aa70587850 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160503213913) do +ActiveRecord::Schema.define(version: 20160503215236) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -66,8 +66,9 @@ t.date "exp_date" t.integer "cvv" t.integer "zip" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "password_digest" end end From 81d29a5ededc8e3fa9d595799dbfe7131049297d Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Tue, 3 May 2016 15:50:07 -0700 Subject: [PATCH 016/174] Created login view/action. --- app/assets/javascripts/sessions.coffee | 3 ++ app/assets/stylesheets/sessions.scss | 3 ++ app/controllers/application_controller.rb | 7 ++++ app/controllers/sessions_controller.rb | 19 +++++++++ app/helpers/sessions_helper.rb | 2 + app/models/user.rb | 5 +++ app/views/home/index.html.erb | 42 +++++++++++--------- app/views/sessions/new.html.erb | 10 +++++ config/routes.rb | 3 ++ test/controllers/sessions_controller_test.rb | 7 ++++ 10 files changed, 82 insertions(+), 19 deletions(-) create mode 100644 app/assets/javascripts/sessions.coffee create mode 100644 app/assets/stylesheets/sessions.scss create mode 100644 app/controllers/sessions_controller.rb create mode 100644 app/helpers/sessions_helper.rb create mode 100644 app/views/sessions/new.html.erb create mode 100644 test/controllers/sessions_controller_test.rb diff --git a/app/assets/javascripts/sessions.coffee b/app/assets/javascripts/sessions.coffee new file mode 100644 index 0000000000..24f83d18bb --- /dev/null +++ b/app/assets/javascripts/sessions.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/sessions.scss b/app/assets/stylesheets/sessions.scss new file mode 100644 index 0000000000..7bef9cf826 --- /dev/null +++ b/app/assets/stylesheets/sessions.scss @@ -0,0 +1,3 @@ +// 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/ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d83690e1b9..31b8ba9882 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,4 +2,11 @@ class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception + + helper_method :current_user + + def current_user + @user ||= User.find_by(id: session[:user_id]) + end + end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb new file mode 100644 index 0000000000..2d1d110df6 --- /dev/null +++ b/app/controllers/sessions_controller.rb @@ -0,0 +1,19 @@ +class SessionsController < ApplicationController + def new + end + + def create + user = User.log_in(params[:username], params[:password]) + if user + session[:user_id] = user.id + redirect_to root_path + else + render :new + end + end + + def destroy + session.delete :user_id + redirect_to root_path + end +end diff --git a/app/helpers/sessions_helper.rb b/app/helpers/sessions_helper.rb new file mode 100644 index 0000000000..309f8b2eb3 --- /dev/null +++ b/app/helpers/sessions_helper.rb @@ -0,0 +1,2 @@ +module SessionsHelper +end diff --git a/app/models/user.rb b/app/models/user.rb index 85b361c961..d77a1e6360 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -8,4 +8,9 @@ class User < ActiveRecord::Base validates :username, presence: true, uniqueness: true validates :email, presence: true, uniqueness: true, format: {with: /@/} + def self.log_in(username, password) + somebody = find_by(username: username) + somebody && somebody.authenticate(password) + end + end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 0197fd90f4..0287d0a527 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,25 +1,29 @@
- -<%= link_to "Sign-up", new_user_path %> -<%= link_to "Log in", users_path %> +
    + <%= link_to "Sign-up", new_user_path %> + <%= link_to "Log in", new_session_path %> +
+
+
-

-Featured Costumes -
-<% @product_picker.each do |product| %> -<%= product.name %> -<%= product.price %> -<%= link_to "Add to cart", orderitem_index_path %> + +

Featured Costumes


+
    +
  • + <% @product_picker.each do |product| %> + <%= product.name %> + <%= product.price %> + <%= link_to "Add to cart", orderitem_index_path %> +
  • +
    +
<% end %> - +
-<%= link_to "View all costumes", products_path %> \ No newline at end of file +<%= link_to "View all costumes", products_path %> diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb new file mode 100644 index 0000000000..c69aa78cea --- /dev/null +++ b/app/views/sessions/new.html.erb @@ -0,0 +1,10 @@ +

Sign In

+<%= form_tag sessions_path, method: :post do %> + <%= label_tag :username, "Username:" %> + <%= text_field_tag :username %> +​ + <%= label_tag :password, "Password (secret):" %> + <%= password_field_tag :password %> +​ + <%= submit_tag "Sign In" %> +<% end %> diff --git a/config/routes.rb b/config/routes.rb index dea562f154..876bb69628 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,5 +10,8 @@ resources :orders resources :orderitem + resources :sessions, :only => [:new, :create] + delete "/logout" => "sessions#destroy" + end diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb new file mode 100644 index 0000000000..d30ebc380a --- /dev/null +++ b/test/controllers/sessions_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SessionsControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end From 2b5f24a8562ee1c4c8d93b33ae4c27c6c2e223ea Mon Sep 17 00:00:00 2001 From: Jessica Date: Wed, 4 May 2016 14:25:22 -0700 Subject: [PATCH 017/174] create view all for products. Show for products/id also working. --- Gemfile | 2 +- app/assets/stylesheets/application.css | 19 +++--------- app/controllers/products_controller.rb | 6 ++++ app/controllers/sessions_controller.rb | 3 +- app/views/home/index.html.erb | 40 +++++++++++--------------- app/views/products/index.html.erb | 11 +++++++ app/views/products/show.html.erb | 7 +++++ 7 files changed, 47 insertions(+), 41 deletions(-) create mode 100644 app/views/products/index.html.erb create mode 100644 app/views/products/show.html.erb diff --git a/Gemfile b/Gemfile index ea98d33d36..1b3b0513d8 100644 --- a/Gemfile +++ b/Gemfile @@ -43,4 +43,4 @@ group :development do # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' -end +end \ No newline at end of file diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index f9cd5b3483..fd40910d9e 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,15 +1,4 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the bottom of the - * compiled file so the styles you add here take precedence over styles defined in any styles - * defined in the other CSS/SCSS files in this directory. It is generally better to create a new - * file per style scope. - * - *= require_tree . - *= require_self - */ + + + + diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index f86094d0af..37068bc31d 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -1,5 +1,11 @@ class ProductsController < ApplicationController + def index + @products = Product.all + end + def show + @product = Product.find(params[:id]) + end end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 2d1d110df6..51a53af3e0 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,6 +1,5 @@ class SessionsController < ApplicationController - def new - end + def new; end def create user = User.log_in(params[:username], params[:password]) diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 0287d0a527..566e81214a 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,29 +1,23 @@
-
    - <%= link_to "Sign-up", new_user_path %> - <%= link_to "Log in", new_session_path %> -
- -
+ +<%= link_to "Sign-up", new_user_path %> +<%= link_to "Log in", users_path %> +

- -

Featured Costumes

+

+Featured Costumes
-
    -
  • - <% @product_picker.each do |product| %> - <%= product.name %> - <%= product.price %> - <%= link_to "Add to cart", orderitem_index_path %> -
  • -
    -
-<% end %> +<% @product_picker.each do |product| %> +<%= link_to product.name, product_path(product.id) %> +<%= product.price %> +<%= link_to "Add to cart", orders_path %>
+<% end %> +

-<%= link_to "View all costumes", products_path %> +<%= link_to "View all costumes", products_path %> \ No newline at end of file diff --git a/app/views/products/index.html.erb b/app/views/products/index.html.erb new file mode 100644 index 0000000000..8c82f27e2b --- /dev/null +++ b/app/views/products/index.html.erb @@ -0,0 +1,11 @@ +

All Products

+
+<% @products.each do |product| %> + <%= product.name %> +
+ <%= product.description %> +
+ <%= product.price %> + +<% end %> +
\ No newline at end of file diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb new file mode 100644 index 0000000000..ebce724080 --- /dev/null +++ b/app/views/products/show.html.erb @@ -0,0 +1,7 @@ +

<%= @product.name %>

+ +
+<%= @product.description %> +<%= @product.price %> +<%= link_to "Add to cart", orders_path %> +<%= @product.quantity %> \ No newline at end of file From e1818fda734037e65998a653a4d0257cfb5533c9 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Wed, 4 May 2016 14:28:13 -0700 Subject: [PATCH 018/174] migration added to change column name in orders --- db/migrate/20160504211945_correct_order_user_id_field.rb | 5 +++++ db/schema.rb | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20160504211945_correct_order_user_id_field.rb diff --git a/db/migrate/20160504211945_correct_order_user_id_field.rb b/db/migrate/20160504211945_correct_order_user_id_field.rb new file mode 100644 index 0000000000..eb7f49c82b --- /dev/null +++ b/db/migrate/20160504211945_correct_order_user_id_field.rb @@ -0,0 +1,5 @@ +class CorrectOrderUserIdField < ActiveRecord::Migration + def change + rename_column :orders, :order_id , :user_id + end +end diff --git a/db/schema.rb b/db/schema.rb index aa70587850..b0c6a966a2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160503215236) do +ActiveRecord::Schema.define(version: 20160504211945) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -33,7 +33,7 @@ create_table "orders", force: :cascade do |t| t.string "status" t.float "price" - t.integer "order_id" + t.integer "user_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false end From ee2bf1f0a98e3b1a44782adfc6804b7475124020 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Wed, 4 May 2016 14:34:39 -0700 Subject: [PATCH 019/174] Fixed Sign-In path. --- app/views/home/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 566e81214a..88e8920459 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -6,7 +6,7 @@ <% end %> <%= link_to "Sign-up", new_user_path %> -<%= link_to "Log in", users_path %> +<%= link_to "Log in", new_session_path %>

@@ -20,4 +20,4 @@ Featured Costumes <% end %>

-<%= link_to "View all costumes", products_path %> \ No newline at end of file +<%= link_to "View all costumes", products_path %> From c8845d4cf2bdf9bcae4044754463767f0d9eef42 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Wed, 4 May 2016 14:52:39 -0700 Subject: [PATCH 020/174] tried to put some session info about orders --- app/controllers/application_controller.rb | 4 ++++ app/controllers/sessions_controller.rb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 31b8ba9882..f837e79f79 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,4 +9,8 @@ def current_user @user ||= User.find_by(id: session[:user_id]) end + def current_order + @order || = Order.find_by(id: session[:order_id]) + end + end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 51a53af3e0..38e9bbca3a 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -3,6 +3,8 @@ def new; end def create user = User.log_in(params[:username], params[:password]) + order = Order.new + session[:order_id] = order.id if user session[:user_id] = user.id redirect_to root_path From 2277d01345ac730282858b5c8369c4acc92fa446 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Wed, 4 May 2016 14:59:48 -0700 Subject: [PATCH 021/174] Added custom nav for current user login/logout. --- app/controllers/sessions_controller.rb | 5 ++++- app/views/home/index.html.erb | 7 +++++-- config/routes.rb | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 51a53af3e0..c7e98e7dd2 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,5 +1,6 @@ class SessionsController < ApplicationController - def new; end + def new + end def create user = User.log_in(params[:username], params[:password]) @@ -15,4 +16,6 @@ def destroy session.delete :user_id redirect_to root_path end + + end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 88e8920459..539a674793 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -5,8 +5,11 @@ <%= link_to category, product_category_path(category) %> <% end %> -<%= link_to "Sign-up", new_user_path %> -<%= link_to "Log in", new_session_path %> + +<%= "Hi, #{current_user.full_name}!" if current_user %> +<%= link_to "Log out", logout_path if current_user %> +<%= link_to "Sign-up", new_user_path unless current_user %> +<%= link_to "Log in", new_session_path unless current_user %>

diff --git a/config/routes.rb b/config/routes.rb index 876bb69628..514ae9cfb8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,7 +11,7 @@ resources :orderitem resources :sessions, :only => [:new, :create] - delete "/logout" => "sessions#destroy" + get "/logout" => "sessions#destroy" end From cf5ab7ec1511b8233c434d7ee8ee376c0ed46f57 Mon Sep 17 00:00:00 2001 From: Jessica Date: Wed, 4 May 2016 15:37:34 -0700 Subject: [PATCH 022/174] working on checkboxes for filtering but not quite working yet --- app/controllers/home_controller.rb | 4 +++- app/controllers/products_controller.rb | 1 - app/views/home/index.html.erb | 19 ++++++++++++++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 23228998cd..3f367f4ad5 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -3,6 +3,8 @@ class HomeController < ApplicationController def index @products = Product.all @product_picker = Product.where.not(id: nil).sample(3) - @categories = Product.uniq.pluck(:category) + # @categories = Product.uniq.pluck(:category) + @categories = Product.where(:conditions => {:category => params[:category]}) end + end diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 37068bc31d..38f6037488 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -6,6 +6,5 @@ def index def show @product = Product.find(params[:id]) - end end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 566e81214a..5940262bae 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,12 +1,25 @@
<%= link_to "Sign-up", new_user_path %> -<%= link_to "Log in", users_path %> +<%= link_to "Log in", new_session_path %>

From bda73bf7668d110eeefdeb6570183cdb56523a56 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Wed, 4 May 2016 15:47:23 -0700 Subject: [PATCH 023/174] Merge commit. --- app/controllers/application_controller.rb | 2 +- app/controllers/orders_controller.rb | 6 ++++++ app/views/home/index.html.erb | 1 + app/views/users/order_fulfillment.html.erb | 12 ++++++++++++ config/routes.rb | 2 ++ 5 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 app/views/users/order_fulfillment.html.erb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f837e79f79..5f9006b63d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,7 +10,7 @@ def current_user end def current_order - @order || = Order.find_by(id: session[:order_id]) + @order ||= Order.find_by(id: session[:order_id]) end end diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index c2e6c6599f..a9e654d91a 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -1,5 +1,11 @@ class OrdersController < ApplicationController + # def self.index(user_id) + # @orders = Order.all + # @orders.each do |order| + # return order if order.id == user_id + # end + # end end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 539a674793..aeffa3b363 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -7,6 +7,7 @@ <%= "Hi, #{current_user.full_name}!" if current_user %> +<%= link_to "Order Fulfillment", order_fulfillment_path(current_user.id) if current_user %> <%= link_to "Log out", logout_path if current_user %> <%= link_to "Sign-up", new_user_path unless current_user %> <%= link_to "Log in", new_session_path unless current_user %> diff --git a/app/views/users/order_fulfillment.html.erb b/app/views/users/order_fulfillment.html.erb new file mode 100644 index 0000000000..bbfed7874a --- /dev/null +++ b/app/views/users/order_fulfillment.html.erb @@ -0,0 +1,12 @@ +
+

Order Fulfillment

+
+ + + +

Orders

+ +

Revenue

+ + + diff --git a/config/routes.rb b/config/routes.rb index 514ae9cfb8..e6439e339e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,6 +8,8 @@ get '/products/category/:category' => 'products#show', as: 'product_category' resources :orders + # get 'orders/order_fulfillment' => 'orders#index', as: 'order_fulfillment' + resources :orderitem resources :sessions, :only => [:new, :create] From 10f964ab6fa69bc97e52343ab6348e8fc91d8c5a Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Wed, 4 May 2016 16:56:52 -0700 Subject: [PATCH 024/174] working through the orderitem and cart --- Gemfile | 3 ++- Gemfile.lock | 8 ++++++++ app/controllers/application_controller.rb | 4 ++-- app/controllers/orderitems_controller.rb | 7 +++++++ app/controllers/sessions_controller.rb | 2 +- app/models/order.rb | 3 ++- app/models/orderitem.rb | 3 +++ app/views/home/index.html.erb | 13 +++++++++++-- config/routes.rb | 2 +- 9 files changed, 37 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 1b3b0513d8..fd9c346d1c 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,7 @@ ruby '2.3.0' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.2.6' +gem "pry" # Use postgresql as the database for Active Record gem 'pg', '~> 0.15' # Use SCSS for stylesheets @@ -43,4 +44,4 @@ group :development do # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' -end \ No newline at end of file +end diff --git a/Gemfile.lock b/Gemfile.lock index 5223ac4456..6b8ba30bc0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -42,6 +42,7 @@ GEM debug_inspector (>= 0.0.1) builder (3.2.2) byebug (8.2.5) + coderay (1.1.1) coffee-rails (4.1.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.1.x) @@ -68,6 +69,7 @@ GEM nokogiri (>= 1.5.9) mail (2.6.4) mime-types (>= 1.16, < 4) + method_source (0.8.2) mime-types (3.0) mime-types-data (~> 3.2015) mime-types-data (3.2016.0221) @@ -77,6 +79,10 @@ GEM nokogiri (1.6.7.2) mini_portile2 (~> 2.0.0.rc2) pg (0.18.4) + pry (0.10.3) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) rack (1.6.4) rack-test (0.6.3) rack (>= 1.0) @@ -117,6 +123,7 @@ GEM sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) + slop (3.6.0) spring (1.7.1) sprockets (3.6.0) concurrent-ruby (~> 1.0) @@ -150,6 +157,7 @@ DEPENDENCIES jbuilder (~> 2.0) jquery-rails pg (~> 0.15) + pry rails (= 4.2.6) sass-rails (~> 5.0) sdoc (~> 0.4.0) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f837e79f79..24f4569eb3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,14 +3,14 @@ class ApplicationController < ActionController::Base # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception - helper_method :current_user + helper_method :current_user, :current_order def current_user @user ||= User.find_by(id: session[:user_id]) end def current_order - @order || = Order.find_by(id: session[:order_id]) + @current_order ||= Order.find_or_create_by(id: session[:order_id]) end end diff --git a/app/controllers/orderitems_controller.rb b/app/controllers/orderitems_controller.rb index bcac78bc17..27c163ef95 100644 --- a/app/controllers/orderitems_controller.rb +++ b/app/controllers/orderitems_controller.rb @@ -1,2 +1,9 @@ class OrderitemsController < ApplicationController + + def create + @product = Product.find(params[:product_id]) + @orderitem = current_order.orderitems.create(product: @product, quantity: 1 ) + redirect_to root_path + end + end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 38e9bbca3a..cc1e20eaa8 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -3,7 +3,7 @@ def new; end def create user = User.log_in(params[:username], params[:password]) - order = Order.new + order = Order.create session[:order_id] = order.id if user session[:user_id] = user.id diff --git a/app/models/order.rb b/app/models/order.rb index b9aa8cedf7..cc1428becd 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -1,5 +1,6 @@ class Order < ActiveRecord::Base - has_many :order_items + has_many :orderitems belongs_to :user + end diff --git a/app/models/orderitem.rb b/app/models/orderitem.rb index 7bdf796731..c7ec927edb 100644 --- a/app/models/orderitem.rb +++ b/app/models/orderitem.rb @@ -3,4 +3,7 @@ class Orderitem < ActiveRecord::Base belongs_to :order validates :quantity, presence: true, numericality: {only_integer: true, greater_than: 0} + def total_price + self.product.price * self.quantity + end end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 566e81214a..2a0df97f2e 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -15,9 +15,18 @@ Featured Costumes <% @product_picker.each do |product| %> <%= link_to product.name, product_path(product.id) %> <%= product.price %> -<%= link_to "Add to cart", orders_path %> +<%= form_tag '/orderitems' do %> +<%= hidden_field_tag :product_id, product.id %>
+<%= hidden_field_tag :quantity, 1 %> +<%= submit_tag "Add to Cart!!" %> + + +
<% end %>

-<%= link_to "View all costumes", products_path %> \ No newline at end of file +<%= link_to "View all costumes", products_path %> + + +<% end %> diff --git a/config/routes.rb b/config/routes.rb index 876bb69628..22483a7fc3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,7 +8,7 @@ get '/products/category/:category' => 'products#show', as: 'product_category' resources :orders - resources :orderitem + resources :orderitems resources :sessions, :only => [:new, :create] delete "/logout" => "sessions#destroy" From c2ae75bcf3429922c76dc6a625efd45c85a7b614 Mon Sep 17 00:00:00 2001 From: Jessica Date: Wed, 4 May 2016 18:35:52 -0700 Subject: [PATCH 025/174] reverting back to what we had before with categories and will revist later once we get bootstrap. --- app/controllers/home_controller.rb | 3 +-- app/views/home/index.html.erb | 17 ++--------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 3f367f4ad5..b777307652 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -3,8 +3,7 @@ class HomeController < ApplicationController def index @products = Product.all @product_picker = Product.where.not(id: nil).sample(3) - # @categories = Product.uniq.pluck(:category) - @categories = Product.where(:conditions => {:category => params[:category]}) + @categories = Product.uniq.pluck(:category) end end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 5940262bae..b216e319f6 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,20 +1,7 @@
From 753258454989124abfbf31cbc768346e951f24ed Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Wed, 4 May 2016 22:29:03 -0700 Subject: [PATCH 026/174] think cart is working on a very basic level --- app/controllers/orderitems_controller.rb | 2 +- app/controllers/orders_controller.rb | 12 ++++++------ app/views/orders/show.html.erb | 7 +++++++ 3 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 app/views/orders/show.html.erb diff --git a/app/controllers/orderitems_controller.rb b/app/controllers/orderitems_controller.rb index 27c163ef95..ed05a3b481 100644 --- a/app/controllers/orderitems_controller.rb +++ b/app/controllers/orderitems_controller.rb @@ -3,7 +3,7 @@ class OrderitemsController < ApplicationController def create @product = Product.find(params[:product_id]) @orderitem = current_order.orderitems.create(product: @product, quantity: 1 ) - redirect_to root_path + redirect_to order_path(current_order.id) end end diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index a9e654d91a..fd3c373155 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -1,11 +1,11 @@ class OrdersController < ApplicationController - # def self.index(user_id) - # @orders = Order.all - # @orders.each do |order| - # return order if order.id == user_id - # end - # end + def show + @orders = Order.find(current_order.id).orderitems + + + + end end diff --git a/app/views/orders/show.html.erb b/app/views/orders/show.html.erb new file mode 100644 index 0000000000..1445c9f60d --- /dev/null +++ b/app/views/orders/show.html.erb @@ -0,0 +1,7 @@ +

Cart:

+ +<% @orders.each do |orderitem| %> +
    +
  • <%=Product.find(orderitem.product_id).name%>
  • +
+ <% end %> From f14a76bef574c2ef9acfb34dbb3b22755ae3eab4 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Wed, 4 May 2016 22:34:00 -0700 Subject: [PATCH 027/174] added format to numbers on product page, link to add to cart on product index: --- app/views/products/index.html.erb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/products/index.html.erb b/app/views/products/index.html.erb index 8c82f27e2b..6638882c3d 100644 --- a/app/views/products/index.html.erb +++ b/app/views/products/index.html.erb @@ -5,7 +5,14 @@
<%= product.description %>
- <%= product.price %> + $<%= number_with_precision product.price, precision: 2 %> +
+ <%= form_tag '/orderitems' do %> + <%= hidden_field_tag :product_id, product.id %>
+ <%= hidden_field_tag :quantity, 1 %> + <%= submit_tag "Add to Cart!!" %> + <% end %> +
<% end %> - \ No newline at end of file + From cb591f2391b79d78c619d39a4ac8b3017373c4e8 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Wed, 4 May 2016 22:43:59 -0700 Subject: [PATCH 028/174] added precision number to index page --- app/controllers/orders_controller.rb | 3 --- app/views/home/index.html.erb | 11 ++++------- app/views/orders/show.html.erb | 3 +++ app/views/products/show.html.erb | 4 ++-- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index fd3c373155..4f190b2e72 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -2,9 +2,6 @@ class OrdersController < ApplicationController def show @orders = Order.find(current_order.id).orderitems - - - end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 2e4d4c5fd9..081d00372a 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -16,23 +16,20 @@

Featured Costumes +


<% @product_picker.each do |product| %> <%= link_to product.name, product_path(product.id) %> -<%= product.price %> +$<%= number_with_precision product.price, precision: 2 %> <%= form_tag '/orderitems' do %> <%= hidden_field_tag :product_id, product.id %>
<%= hidden_field_tag :quantity, 1 %> <%= submit_tag "Add to Cart!!" %> - -
+
<% end %> -

- -<%= link_to "View all costumes", products_path %> - <% end %> +<%= link_to "View all costumes", products_path %> diff --git a/app/views/orders/show.html.erb b/app/views/orders/show.html.erb index 1445c9f60d..54bb507053 100644 --- a/app/views/orders/show.html.erb +++ b/app/views/orders/show.html.erb @@ -1,7 +1,10 @@

Cart:

+<% @cart_price = 0 %> <% @orders.each do |orderitem| %>
  • <%=Product.find(orderitem.product_id).name%>
  • + <% @cart_price += orderitem.total_price %>
<% end %> +

Total Price of Order: $<%= number_with_precision @cart_price , precision: 2 %>

diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb index ebce724080..4745fea368 100644 --- a/app/views/products/show.html.erb +++ b/app/views/products/show.html.erb @@ -2,6 +2,6 @@
<%= @product.description %> -<%= @product.price %> +$<%= number_with_precision @product.price, precision: 2 %> <%= link_to "Add to cart", orders_path %> -<%= @product.quantity %> \ No newline at end of file +<%= @product.quantity %> From 6a380a4ce3455c9ea9b85ec230d9b1e328558112 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Wed, 4 May 2016 22:59:05 -0700 Subject: [PATCH 029/174] fixed pathing on product show page to adjust for the route i made --- app/controllers/orderitems_controller.rb | 4 ++++ app/views/home/index.html.erb | 2 ++ app/views/layouts/application.html.erb | 1 + app/views/products/show.html.erb | 6 +++++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/controllers/orderitems_controller.rb b/app/controllers/orderitems_controller.rb index ed05a3b481..007b93ee0d 100644 --- a/app/controllers/orderitems_controller.rb +++ b/app/controllers/orderitems_controller.rb @@ -1,5 +1,9 @@ class OrderitemsController < ApplicationController + def index + redirect_to order_path(current_order.id) + end + def create @product = Product.find(params[:product_id]) @orderitem = current_order.orderitems.create(product: @product, quantity: 1 ) diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 081d00372a..1f1145c090 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -11,9 +11,11 @@ <%= link_to "Log out", logout_path if current_user %> <%= link_to "Sign-up", new_user_path unless current_user %> <%= link_to "Log in", new_session_path unless current_user %> +<%= link_to "Cart", orderitems_path %>
+

Featured Costumes

diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 9b70e01c2e..382d0bc998 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -8,6 +8,7 @@ + <%= yield %> diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb index 4745fea368..a3998c00e6 100644 --- a/app/views/products/show.html.erb +++ b/app/views/products/show.html.erb @@ -3,5 +3,9 @@
<%= @product.description %> $<%= number_with_precision @product.price, precision: 2 %> -<%= link_to "Add to cart", orders_path %> +<%= form_tag '/orderitems' do %> +<%= hidden_field_tag :product_id, @product.id %>
+<%= hidden_field_tag :quantity, 1 %> +<%= submit_tag "Add to Cart!!" %> +<% end %> <%= @product.quantity %> From 08bc6ef7b1e74ffe4f084edbacb2837691f7ad0a Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Wed, 4 May 2016 23:17:07 -0700 Subject: [PATCH 030/174] fixed a bug so that user can actually sign in and logout option and welcome will show up --- app/models/user.rb | 2 +- app/views/home/index.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index d77a1e6360..04461feefc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -9,7 +9,7 @@ class User < ActiveRecord::Base validates :email, presence: true, uniqueness: true, format: {with: /@/} def self.log_in(username, password) - somebody = find_by(username: username) + somebody = self.find_by(username: username) somebody && somebody.authenticate(password) end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 1f1145c090..3191a1ecfa 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -7,7 +7,7 @@ <%= "Hi, #{current_user.full_name}!" if current_user %> -<%= link_to "Order Fulfillment", order_fulfillment_path(current_user.id) if current_user %> +<% #link_to "Order Fulfillment", order_fulfillment_path(current_user.id) if current_user %> <%= link_to "Log out", logout_path if current_user %> <%= link_to "Sign-up", new_user_path unless current_user %> <%= link_to "Log in", new_session_path unless current_user %> From 486bb7aac33f2de88294370621f7ceea6be71393 Mon Sep 17 00:00:00 2001 From: Jessica Date: Thu, 5 May 2016 09:36:30 -0700 Subject: [PATCH 031/174] made some changes but pulling to get Deirdre's changes first and merging --- app/assets/stylesheets/application.css | 19 +++++++++++++++++ app/views/home/index.html.erb | 28 ++++++++++++-------------- app/views/layouts/application.html.erb | 3 +++ app/views/products/show.html.erb | 1 + app/views/users/index.html.erb | 1 + config/routes.rb | 2 +- 6 files changed, 38 insertions(+), 16 deletions(-) create mode 100644 app/views/users/index.html.erb diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index fd40910d9e..fd84e33dc7 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,4 +1,23 @@ +* { + font-family: 'Indie Flower', cursive; +} +.top-header { + float: right; + display: inline; + padding-right: 5%; + font-weight: bolder; + font-size: 25px; +} + +ul li { + display: inline; + padding-right: 30px; +} + +a { + text-decoration: none; +} diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 2e4d4c5fd9..ebd08e0f7e 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,19 +1,20 @@
-
-

Featured Costumes
@@ -23,7 +24,7 @@ Featured Costumes <%= form_tag '/orderitems' do %> <%= hidden_field_tag :product_id, product.id %>
<%= hidden_field_tag :quantity, 1 %> -<%= submit_tag "Add to Cart!!" %> +<%= submit_tag "Add to Cart" %> @@ -31,8 +32,5 @@ Featured Costumes <% end %>

-<%= link_to "View all costumes", products_path %> - - - <% end %> +<%= link_to "View all costumes", products_path %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 9b70e01c2e..526e3fb9b6 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -4,10 +4,13 @@ Betsy <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> + <%= csrf_meta_tags %> + + <%= yield %> diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb index ebce724080..a4291e0dc3 100644 --- a/app/views/products/show.html.erb +++ b/app/views/products/show.html.erb @@ -1,3 +1,4 @@ +

<%= @product.name %>


diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb new file mode 100644 index 0000000000..e498656080 --- /dev/null +++ b/app/views/users/index.html.erb @@ -0,0 +1 @@ +<%= link_to "Order Fulfillment", order_fulfillment_path(current_user.id) if current_user %> diff --git a/config/routes.rb b/config/routes.rb index 2dd13a8394..9c1733a364 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,7 +2,7 @@ root 'home#index' - resources :users, :only => [:new, :create] + resources :users, :only => [:index, :new, :create] resources :products get '/products/category/:category' => 'products#show', as: 'product_category' From 47c57580dd52a67f4b785f97f32b1f5b1521e939 Mon Sep 17 00:00:00 2001 From: Jessica Date: Thu, 5 May 2016 10:17:10 -0700 Subject: [PATCH 032/174] doing some css with bootstrap --- app/assets/stylesheets/application.css | 22 ++++++++++++++++-- app/views/home/index.html.erb | 32 +++++++++----------------- app/views/layouts/application.html.erb | 4 +++- 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index fd84e33dc7..ac2b63f2d5 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,5 +1,7 @@ * { - font-family: 'Indie Flower', cursive; + font-family: 'Architects Daughter', cursive; + letter-spacing: 1px; + font-size: 20px; } .top-header { @@ -10,7 +12,23 @@ font-size: 25px; } -ul li { +ul.nav-side li { + display: block; + float: left; +} + +/*.home-page { + float: right; + margin-top: 10%; + margin-right: 40%; + display: inline; +}*/ + +h2.home-header { + text-align: left; +} + +ul.nav-top li { display: inline; padding-right: 30px; } diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index a334e941b3..91d555a50e 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,47 +1,37 @@
+
- diff --git a/app/views/orders/edit.html.erb b/app/views/orders/edit.html.erb index 557824cace..0fd734fb55 100644 --- a/app/views/orders/edit.html.erb +++ b/app/views/orders/edit.html.erb @@ -1,18 +1,25 @@ -

Checkout!

+

Cart:

<% @cart_price = 0 %> - <% @orderitems.each do |orderitem| %> -
    -
  • - <%= Product.find(orderitem.product_id).name %> - Price $<%=number_with_precision orderitem.total_price, precision: 2 %> - <% @cart_price += orderitem.total_price %> +
    +
      + <% @order.orderitems.each do |orderitem| %> +
      +
    • + + <%= Product.find(orderitem.product_id).name %> + Price $<%=number_with_precision orderitem.total_price, precision: 2 %> + <% @cart_price += orderitem.total_price %> + <%=form_for orderitem do |f| %> + <%=f.label "Update Quantity" %> + <%=f.select 'quantity', options_for_select(@quantity_numbers, orderitem.quantity) %>
      - - Quantity <%= orderitem.quantity %> - <%= select_tag :quantity, options_for_select(@quantity_numbers) %>
      - -
    + <%=f.submit %> + <% end %> +
  • + <% end %> - <%= submit_tag "Update Order" , method: :patch%> +

Total Price of Order: $<%= number_with_precision @cart_price , precision: 2 %>

+ <%= button_to "Proceed to checkout", root_path, method: :get %> + diff --git a/app/views/orders/show.html.erb b/app/views/orders/show.html.erb index ee5d50b6fc..637dfc7215 100644 --- a/app/views/orders/show.html.erb +++ b/app/views/orders/show.html.erb @@ -1,16 +1,22 @@

Cart:

<% @cart_price = 0 %> -
+
    <% @orders.each do |orderitem| %> -
    +
  • <%= Product.find(orderitem.product_id).name %> Price $<%=number_with_precision orderitem.total_price, precision: 2 %> <% @cart_price += orderitem.total_price %> Quantity <%= orderitem.quantity %> + <%=form_for orderitem do |f| %> + <%=f.label "Update Quantity" %> + <%=f.select 'quantity', options_for_select(@quantity_numbers) %>
    + + <%=f.submit %> + <% end %>
  • <% end %> From a26ba784e3079196082dfbd81acd853d010ef94e Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Fri, 6 May 2016 13:57:46 -0700 Subject: [PATCH 058/174] minor css --- app/assets/stylesheets/application.css | 12 ++++++++++-- app/views/orders/edit.html.erb | 16 ++++++++++------ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 95657cf0ce..fee06d182e 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -110,12 +110,20 @@ a { div.cart { background-color:gray; + width: 80%; + margin: 10px 10px; +} + +div.wholecart { + width: 80%; + margin-left: 10%; } -div.cart-item { +div.orderitem { border: 2px solid black; + margin-top: 5px; } -.cart-item img { +.orderitem img { height: 200px; } diff --git a/app/views/orders/edit.html.erb b/app/views/orders/edit.html.erb index 4d4fdb9f0e..ee4d30a6ac 100644 --- a/app/views/orders/edit.html.erb +++ b/app/views/orders/edit.html.erb @@ -1,11 +1,13 @@ + +

    Cart:

    <% @cart_price = 0 %> -
    -
      +
      + <% @order.orderitems.each do |orderitem| %> -
    • -
      + +
      <%= Product.find(orderitem.product_id).name %> Price $<%=number_with_precision orderitem.total_price, precision: 2 %> @@ -17,9 +19,11 @@ <% end %> <% end %>
      -
    • -
    + +

    Total Price of Order: $<%= number_with_precision @cart_price , precision: 2 %>

    <%= button_to "Proceed to checkout", root_path, method: :get %>
    + +
    From a07c2d67d13cecc4cdecb0d63a8fda8639a256a2 Mon Sep 17 00:00:00 2001 From: Jessica Date: Fri, 6 May 2016 14:16:56 -0700 Subject: [PATCH 059/174] browse by category working --- app/controllers/home_controller.rb | 1 + app/controllers/products_controller.rb | 5 +++++ app/views/home/index.html.erb | 7 +++++++ app/views/products/show_merchant.html.erb | 20 +++++++++++++++++++ .../products/show_seller_products.html.erb | 1 + config/routes.rb | 1 + 6 files changed, 35 insertions(+) create mode 100644 app/views/products/show_merchant.html.erb diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index b777307652..c9b2f3ffda 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -4,6 +4,7 @@ def index @products = Product.all @product_picker = Product.where.not(id: nil).sample(3) @categories = Product.uniq.pluck(:category) + @users = User.all end end diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 363f2b791f..271797f742 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -15,6 +15,11 @@ def show_seller_products @products = @user.products end + def show_merchant + @user = User.find(params[:id]) + @products = @user.products + end + def new @user = User.find(params[:id]) @product = @user.products.new diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index ce9260e4c0..399c1e1346 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -2,9 +2,16 @@ diff --git a/app/views/products/show_merchant.html.erb b/app/views/products/show_merchant.html.erb new file mode 100644 index 0000000000..2d87d1c1ec --- /dev/null +++ b/app/views/products/show_merchant.html.erb @@ -0,0 +1,20 @@ +
    +
    +<% @products.each do |product| %> + + + +
    + <%= product.description %> + $<%= number_with_precision product.price, precision: 2 %> + + <%= form_tag '/orderitems' do %> + <%= link_to product.name, product_path(product.id) %> + <%= hidden_field_tag :product_id, product.id %>
    + <%= hidden_field_tag :quantity, 1 %> + <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
    + <% end %> + <%= product.quantity %> + <% end %> +
    +
    \ No newline at end of file diff --git a/app/views/products/show_seller_products.html.erb b/app/views/products/show_seller_products.html.erb index 814c13b778..c158795ba3 100644 --- a/app/views/products/show_seller_products.html.erb +++ b/app/views/products/show_seller_products.html.erb @@ -24,3 +24,4 @@ <%= link_to "Edit", edit_product_path(@user, product), class: 'btn btn-primary' %> <% end %>
    +
diff --git a/config/routes.rb b/config/routes.rb index 37d80c0f93..eaac28250b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,6 +9,7 @@ resources :products, :only => [:index, :show, :create] get '/products/category/:category' => 'products#show', as: 'product_category' + get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' post '/users/:id/products' => 'products#create' get '/users/:id/products/:id/edit' => 'products#edit', as: 'edit_product' From 3a8eddc866500f26cf279a1e0739560bd17141dd Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Fri, 6 May 2016 14:22:18 -0700 Subject: [PATCH 060/174] Added product_id column to Reviews. --- ...0160506211846_add_product_i_dto_reviews.rb | 5 ++++ db/schema.rb | 3 +- db/seeds.rb | 29 ++++++++++--------- 3 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 db/migrate/20160506211846_add_product_i_dto_reviews.rb diff --git a/db/migrate/20160506211846_add_product_i_dto_reviews.rb b/db/migrate/20160506211846_add_product_i_dto_reviews.rb new file mode 100644 index 0000000000..49c0ea3c65 --- /dev/null +++ b/db/migrate/20160506211846_add_product_i_dto_reviews.rb @@ -0,0 +1,5 @@ +class AddProductIDtoReviews < ActiveRecord::Migration + def change + add_column :reviews, :product_id, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 8c45f2c8c4..4dc884b053 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160505205017) do +ActiveRecord::Schema.define(version: 20160506211846) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -58,6 +58,7 @@ t.datetime "updated_at", null: false t.string "description" t.string "rating" + t.string "product_id" end create_table "users", force: :cascade do |t| diff --git a/db/seeds.rb b/db/seeds.rb index fd7f56b076..53513c0655 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -46,19 +46,22 @@ Order.create(status: 'complete', price: 12, user_id: 3) Order.create(status: 'complete', price: 44, user_id: 1) -Review.create(rating: 1, description: 44) -Review.create(rating: 2, description: 44) -Review.create(rating: 3, description: 44) -Review.create(rating: 4, description: 44) -Review.create(rating: 5, description: 44) -Review.create(rating: 1, description: 44) -Review.create(rating: 2, description: 44) -Review.create(rating: 3, description: 44) -Review.create(rating: 4, description: 44) -Review.create(rating: 5, description: 44) -Review.create(rating: 1, description: 44) -Review.create(rating: 2, description: 44) -Review.create(rating: 3, description: 44) +Review.create(rating: 1, description: '44', product_id: 1) +Review.create(rating: 1, description: '44', product_id: 1) +Review.create(rating: 1, description: '44', product_id: 1) +Review.create(rating: 1, description: '44', product_id: 1) +Review.create(rating: 1, description: '44', product_id: 1) +Review.create(rating: 1, description: '44', product_id: 2) +Review.create(rating: 1, description: '44', product_id: 2) +Review.create(rating: 1, description: '44', product_id: 2) +Review.create(rating: 1, description: '44', product_id: 2) +Review.create(rating: 1, description: '44', product_id: 2) +Review.create(rating: 1, description: '44', product_id: 3) +Review.create(rating: 1, description: '44', product_id: 3) +Review.create(rating: 1, description: '44', product_id: 3) +Review.create(rating: 1, description: '44', product_id: 3) +Review.create(rating: 1, description: '44', product_id: 3) +Review.create(rating: 1, description: '44', product_id: 3) Orderitem.create(quantity: 2, price: 5, order_id: 1, product_id: 1, seller_id: 1) Orderitem.create(quantity: 3, price: 10, order_id: 1, product_id: 1, seller_id: 1) From 3d2ec4334b020221bcde134f2a8ca720127f06d6 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Fri, 6 May 2016 14:28:02 -0700 Subject: [PATCH 061/174] added quantity button to show page for product --- app/controllers/products_controller.rb | 4 +++- app/views/products/show.html.erb | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 271797f742..3812717588 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -1,6 +1,6 @@ class ProductsController < ApplicationController before_action :require_login, only: [:new, :create] - + def index @products = Product.all @quantity_numbers = [1,2,3,4,5,6,7,8,9,10] @@ -8,6 +8,8 @@ def index def show @product = Product.find(params[:id]) + @quantity_numbers = [1,2,3,4,5,6,7,8,9,10] + end def show_seller_products diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb index e6ae908cd9..e437344419 100644 --- a/app/views/products/show.html.erb +++ b/app/views/products/show.html.erb @@ -8,6 +8,7 @@ <%= form_tag '/orderitems' do %> <%= hidden_field_tag :product_id, @product.id %>
+ <%= select_tag :quantity, options_for_select(@quantity_numbers) %>
<%= submit_tag "Add to Cart", class: 'btn btn-primary' %> <% end %> <%= @product.quantity %> From 4f7109eaf43c5659e5aec93ae0d80981b6b1b819 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Fri, 6 May 2016 14:48:22 -0700 Subject: [PATCH 062/174] Added hyperlink to seller's orderitem chart for individual order view. --- app/controllers/orders_controller.rb | 3 +++ app/views/orders/seller_items.html.erb | 1 + app/views/orders/show_seller_orders.html.erb | 2 +- config/routes.rb | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 app/views/orders/seller_items.html.erb diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 4af4d63755..db9129f173 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -26,6 +26,9 @@ def update end end + def seller_items + end + private def orderitem_edit_params diff --git a/app/views/orders/seller_items.html.erb b/app/views/orders/seller_items.html.erb new file mode 100644 index 0000000000..ff8feb5034 --- /dev/null +++ b/app/views/orders/seller_items.html.erb @@ -0,0 +1 @@ +

Hello, World!

diff --git a/app/views/orders/show_seller_orders.html.erb b/app/views/orders/show_seller_orders.html.erb index b0b37a7568..2975532c64 100644 --- a/app/views/orders/show_seller_orders.html.erb +++ b/app/views/orders/show_seller_orders.html.erb @@ -31,7 +31,7 @@ <% orders = Orderitem.where(order_id: order.id) %> <% orders.each do |order| %> - <%= order.order_id %> + <%= link_to (order.order_id), seller_items_path %> <%= order.product.name %> <%= order.quantity %> $<%= order.price %>0 diff --git a/config/routes.rb b/config/routes.rb index eaac28250b..267d543ed7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,7 +7,7 @@ # resources :products, :only => [:show, :new] # end - resources :products, :only => [:index, :show, :create] + resources :products, :only => [:index, :show, :create] get '/products/category/:category' => 'products#show', as: 'product_category' get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' @@ -18,6 +18,7 @@ resources :orders get '/users/:id/orders' => 'orders#show_seller_orders', as: 'show_seller_orders' + get '/users/:id/orders/seller_items' => 'orders#seller_items', as: 'seller_items' resources :orderitems From e983f18f0746d655d843faf4e89539ef257f2980 Mon Sep 17 00:00:00 2001 From: Jessica Date: Fri, 6 May 2016 15:00:29 -0700 Subject: [PATCH 063/174] merge --- app/controllers/products_controller.rb | 4 ++++ app/views/products/show_category.html.erb | 5 +++++ config/routes.rb | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 app/views/products/show_category.html.erb diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 3812717588..d7cdcc8dc3 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -22,6 +22,10 @@ def show_merchant @products = @user.products end + def show_category + @products = Product.where(category: :category) + end + def new @user = User.find(params[:id]) @product = @user.products.new diff --git a/app/views/products/show_category.html.erb b/app/views/products/show_category.html.erb new file mode 100644 index 0000000000..4878c855e7 --- /dev/null +++ b/app/views/products/show_category.html.erb @@ -0,0 +1,5 @@ +
<%= params %>
+<% @products.each do |product| %> + + <%= @products.name %> +<% end %> diff --git a/config/routes.rb b/config/routes.rb index eaac28250b..b9f90b9197 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,7 +8,7 @@ # end resources :products, :only => [:index, :show, :create] - get '/products/category/:category' => 'products#show', as: 'product_category' + get '/products/category/:category' => 'products#show_category', as: 'product_category' get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' post '/users/:id/products' => 'products#create' From 8d877cb7a81bfe35c43c797ec76c60890f8a33f6 Mon Sep 17 00:00:00 2001 From: Jessica Date: Fri, 6 May 2016 15:15:39 -0700 Subject: [PATCH 064/174] forgot to branch --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 267d543ed7..a0a8a3ed9a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,7 +8,7 @@ # end resources :products, :only => [:index, :show, :create] - get '/products/category/:category' => 'products#show', as: 'product_category' + get '/products/category/:category' => 'products#show_category', as: 'product_category' get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' post '/users/:id/products' => 'products#create' From d41c4da1495b50b8b84c70d207d5402c3477fb02 Mon Sep 17 00:00:00 2001 From: Jessica Date: Fri, 6 May 2016 15:26:50 -0700 Subject: [PATCH 065/174] browse by category fully working --- app/controllers/products_controller.rb | 5 +++++ app/views/products/show_category.html.erb | 20 ++++++++++++++++++++ app/views/products/show_merchant.html.erb | 2 ++ config/routes.rb | 2 +- 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 app/views/products/show_category.html.erb diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 3812717588..ef0c34fab7 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -22,6 +22,11 @@ def show_merchant @products = @user.products end + def show_category + @products = Product.where(category: params[:category]) + + end + def new @user = User.find(params[:id]) @product = @user.products.new diff --git a/app/views/products/show_category.html.erb b/app/views/products/show_category.html.erb new file mode 100644 index 0000000000..360efc3aef --- /dev/null +++ b/app/views/products/show_category.html.erb @@ -0,0 +1,20 @@ +

<%= params[:category] %> Costumes

+
+
+<% @products.each do |product| %> + + +
+ <%= product.description %> + $<%= number_with_precision product.price, precision: 2 %> + + <%= form_tag '/orderitems' do %> + <%= link_to product.name, product_path(product.id) %> + <%= hidden_field_tag :product_id, product.id %>
+ <%= hidden_field_tag :quantity, 1 %> + <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
+ <% end %> + <%= product.quantity %> + <% end %> +
+
diff --git a/app/views/products/show_merchant.html.erb b/app/views/products/show_merchant.html.erb index 2d87d1c1ec..f7228d4e5e 100644 --- a/app/views/products/show_merchant.html.erb +++ b/app/views/products/show_merchant.html.erb @@ -1,3 +1,5 @@ +

Costumes by <%= params[:full_name] %>

+
<% @products.each do |product| %> diff --git a/config/routes.rb b/config/routes.rb index eaac28250b..b9f90b9197 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,7 +8,7 @@ # end resources :products, :only => [:index, :show, :create] - get '/products/category/:category' => 'products#show', as: 'product_category' + get '/products/category/:category' => 'products#show_category', as: 'product_category' get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' post '/users/:id/products' => 'products#create' From ee9b3ea99559814d19630be0c756efdba26df3db Mon Sep 17 00:00:00 2001 From: Jessica Date: Fri, 6 May 2016 15:32:02 -0700 Subject: [PATCH 066/174] routes no longer broken --- config/routes.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index ca9e4be321..bd50d99b85 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,11 +7,8 @@ # resources :products, :only => [:show, :new] # end -<<<<<<< HEAD resources :products, :only => [:index, :show, :create] -======= - resources :products, :only => [:index, :show, :create] ->>>>>>> category + get '/products/category/:category' => 'products#show_category', as: 'product_category' get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' From 6c80bdbdde9945052490bc4b0321c98c52cbdccf Mon Sep 17 00:00:00 2001 From: Jessica Date: Fri, 6 May 2016 15:34:26 -0700 Subject: [PATCH 067/174] changed zip code to string with migration --- db/migrate/20160506223329_make_zip_code_string.rb | 5 +++++ db/schema.rb | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20160506223329_make_zip_code_string.rb diff --git a/db/migrate/20160506223329_make_zip_code_string.rb b/db/migrate/20160506223329_make_zip_code_string.rb new file mode 100644 index 0000000000..6c9dc24875 --- /dev/null +++ b/db/migrate/20160506223329_make_zip_code_string.rb @@ -0,0 +1,5 @@ +class MakeZipCodeString < ActiveRecord::Migration + def change + change_column :users, :zip, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 4dc884b053..57947d6785 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160506211846) do +ActiveRecord::Schema.define(version: 20160506223329) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -69,7 +69,7 @@ t.integer "cc_number" t.date "exp_date" t.integer "cvv" - t.integer "zip" + t.string "zip" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "password_digest" From a3b7aeb91b36fcafa081104c30fd70e80b47252b Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Fri, 6 May 2016 15:35:53 -0700 Subject: [PATCH 068/174] got ratings up and running, including an average of all numeric ratings for each product --- app/controllers/products_controller.rb | 8 ++++- app/views/products/show.html.erb | 12 +++++-- db/seeds.rb | 48 +++++++++++++------------- 3 files changed, 40 insertions(+), 28 deletions(-) diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 3812717588..9e37188f26 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -9,7 +9,13 @@ def index def show @product = Product.find(params[:id]) @quantity_numbers = [1,2,3,4,5,6,7,8,9,10] - + @rating = overall_rating(@product) + end + + def overall_rating(product) + ratings = product.reviews.collect { |a| a.rating.to_f } + overall = ratings.reduce(:+)/ratings.length + overall end def show_seller_products diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb index e437344419..1260ec26aa 100644 --- a/app/views/products/show.html.erb +++ b/app/views/products/show.html.erb @@ -7,9 +7,15 @@ $<%= number_with_precision @product.price, precision: 2 %> <%= form_tag '/orderitems' do %> - <%= hidden_field_tag :product_id, @product.id %>
- <%= select_tag :quantity, options_for_select(@quantity_numbers) %>
+ <%= hidden_field_tag :product_id, @product.id %>
+ <%= select_tag :quantity, options_for_select(@quantity_numbers) %>
<%= submit_tag "Add to Cart", class: 'btn btn-primary' %> <% end %> - <%= @product.quantity %> + + Overall Rating: <%= @rating %> / 5 + Reviews:
<% @product.reviews.each do |review|%> + <%= review.description %>
+ <% end %> + + <%= @product.quantity %> Available
diff --git a/db/seeds.rb b/db/seeds.rb index 53513c0655..8740e0ecce 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -12,24 +12,24 @@ User.create(full_name: "Llama") User.create(full_name: "Puppy Party") -Product.create(name: 'Hot Dog', price: 15, +Product.create(name: 'Hot Dog', price: 15, quantity: 20, photo_url: "http://ecx.images-amazon.com/images/I/41qN0y-0FFL._SY300_.jpg", user_id: 2, category: 'Dog') -Product.create(name: "Dog Pirate", price: 20, user_id: 5, category: 'Dog', +Product.create(name: "Dog Pirate", price: 20, user_id: 5, category: 'Dog', quantity: 10, photo_url: "http://www.gadgetreview.com/wp-content/uploads/2012/05/Dog-Pirate-Costume-650x472.jpg") -Product.create(name: "Alligator", price: 1, user_id: 1, category: 'Dog', +Product.create(name: "Alligator", price: 1, user_id: 1, category: 'Dog', quantity: 30, photo_url: "http://cdn1-www.dogtime.com/assets/uploads/gallery/cool-halloween-costumes/dog-halloween-costume-eaten_by_alligator.jpg") Product.create(name: "Knight Guinea Pig", price: 56, user_id: 3, category: "Guinea Pig", photo_url: "http://static.dudeiwantthat.com/img/gear/pets/handmade-guinea-pig-armor-8201.jpg") -Product.create(name: "St Patricks Dog", price: 94, user_id: 4, category: "Dog", +Product.create(name: "St Patricks Dog", price: 94, user_id: 4, category: "Dog", quantity: 5, photo_url: "https://s-media-cache-ak0.pinimg.com/236x/26/84/c3/2684c33c0be14d73dfa983b019a3e249.jpg") -Product.create(name: "Ewok dog", price: 6, user_id: 2, category: "Dog", +Product.create(name: "Ewok dog", price: 6, user_id: 2, category: "Dog", quantity: 20, photo_url: "https://s-media-cache-ak0.pinimg.com/736x/86/bb/c0/86bbc0780b0d655924868ed0b858d7d6.jpg") Product.create(name: "Taco Cat", price: 14, user_id: 4, category: "Cat", photo_url: "http://pixel.brit.co/wp-content/uploads/2014/10/5-TacoKitten.jpg") -Product.create(name: "Lion", price: 30, user_id: 3, category: "Dog", +Product.create(name: "Lion", price: 30, user_id: 3, category: "Dog", quantity: 3, photo_url: "http://ecx.images-amazon.com/images/I/51ELTYHPEBL._AC_UL320_SR228,320_.jpg" ) -Product.create(name: 'Martini', price: 400, user_id: 1, category: "Dog", +Product.create(name: 'Martini', price: 400, user_id: 1, category: "Dog", quantity: 11, photo_url: "http://littlefun.org/uploads/52741c71e691b26f19aec579_736.jpg" ) -Product.create(name: 'Jockey', price: 22, user_id: 1, category: "Dog", +Product.create(name: 'Jockey', price: 22, user_id: 1, category: "Dog", quantity: 8, photo_url: "http://a.dilcdn.com/bl/wp-content/uploads/sites/13/2012/10/dog2.jpg") Order.create(status: 'pending', price: 46, user_id: 1) @@ -46,22 +46,22 @@ Order.create(status: 'complete', price: 12, user_id: 3) Order.create(status: 'complete', price: 44, user_id: 1) -Review.create(rating: 1, description: '44', product_id: 1) -Review.create(rating: 1, description: '44', product_id: 1) -Review.create(rating: 1, description: '44', product_id: 1) -Review.create(rating: 1, description: '44', product_id: 1) -Review.create(rating: 1, description: '44', product_id: 1) -Review.create(rating: 1, description: '44', product_id: 2) -Review.create(rating: 1, description: '44', product_id: 2) -Review.create(rating: 1, description: '44', product_id: 2) -Review.create(rating: 1, description: '44', product_id: 2) -Review.create(rating: 1, description: '44', product_id: 2) -Review.create(rating: 1, description: '44', product_id: 3) -Review.create(rating: 1, description: '44', product_id: 3) -Review.create(rating: 1, description: '44', product_id: 3) -Review.create(rating: 1, description: '44', product_id: 3) -Review.create(rating: 1, description: '44', product_id: 3) -Review.create(rating: 1, description: '44', product_id: 3) +Review.create(rating: 1, description: 'Amazing!', product_id: 1) +Review.create(rating: 2, description: 'Wonderful', product_id: 1) +Review.create(rating: 3, description: 'What is that?', product_id: 2) +Review.create(rating: 4, description: 'Unholy', product_id: 2) +Review.create(rating: 5, description: 'Love it', product_id: 3) +Review.create(rating: 3, description: 'I want five just like it', product_id: 3) +Review.create(rating: 4, description: 'My daughter wears it. ', product_id: 4) +Review.create(rating: 2, description: 'The best.', product_id: 4) +Review.create(rating: 3, description: 'Just awful.', product_id: 5) +Review.create(rating: 4, description: 'Where can I get one for my fish?', product_id: 6) +Review.create(rating: 5, description: 'Bad delivery time.', product_id: 7) +Review.create(rating: 5, description: 'Is this edible?', product_id: 7) +Review.create(rating: 2, description: 'Feels real', product_id: 7) +Review.create(rating: 3, description: 'Can i eat that?', product_id: 7) +Review.create(rating: 2, description: "I'll take five.", product_id: 8) +Review.create(rating: 4, description: 'Nope.', product_id: 9) Orderitem.create(quantity: 2, price: 5, order_id: 1, product_id: 1, seller_id: 1) Orderitem.create(quantity: 3, price: 10, order_id: 1, product_id: 1, seller_id: 1) From f1a2d8995d800fe9f03ac0a3bd927315ffae19dc Mon Sep 17 00:00:00 2001 From: Jessica Date: Fri, 6 May 2016 16:26:11 -0700 Subject: [PATCH 069/174] can now view costumes by category or by pet/animal --- app/controllers/home_controller.rb | 1 + app/controllers/products_controller.rb | 4 ++++ app/views/home/index.html.erb | 11 +++++++++-- app/views/products/edit.html.erb | 4 ++-- app/views/products/show_animal.html.erb | 22 ++++++++++++++++++++++ app/views/products/show_category.html.erb | 1 - config/routes.rb | 3 ++- db/migrate/20160506230434_add_animal.rb | 5 +++++ db/schema.rb | 3 ++- db/seeds.rb | 20 ++++++++++---------- 10 files changed, 57 insertions(+), 17 deletions(-) create mode 100644 app/views/products/show_animal.html.erb create mode 100644 db/migrate/20160506230434_add_animal.rb diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index c9b2f3ffda..2bf3094377 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -3,6 +3,7 @@ class HomeController < ApplicationController def index @products = Product.all @product_picker = Product.where.not(id: nil).sample(3) + @animals = Product.uniq.pluck(:animal) @categories = Product.uniq.pluck(:category) @users = User.all end diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index aefad65714..06301c9144 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -22,6 +22,10 @@ def show_merchant @products = @user.products end + def show_animal + @products = Product.where(animal: params[:animal]) + end + def show_category @products = Product.where(category: params[:category]) end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 399c1e1346..bc7e519241 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -2,12 +2,19 @@
->>>>>>> category diff --git a/config/routes.rb b/config/routes.rb index bd50d99b85..0caf99c360 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,7 +9,8 @@ resources :products, :only => [:index, :show, :create] - get '/products/category/:category' => 'products#show_category', as: 'product_category' + get '/products/category/:animal' => 'products#show_animal', as: 'product_animal' + get '/products/animal/:category' => 'products#show_category', as: 'product_category' get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' post '/users/:id/products' => 'products#create' diff --git a/db/migrate/20160506230434_add_animal.rb b/db/migrate/20160506230434_add_animal.rb new file mode 100644 index 0000000000..d257ded6fd --- /dev/null +++ b/db/migrate/20160506230434_add_animal.rb @@ -0,0 +1,5 @@ +class AddAnimal < ActiveRecord::Migration + def change + add_column :products, :animal, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 57947d6785..3cbc2b8336 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160506223329) do +ActiveRecord::Schema.define(version: 20160506230434) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -51,6 +51,7 @@ t.integer "user_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.string "animal" end create_table "reviews", force: :cascade do |t| diff --git a/db/seeds.rb b/db/seeds.rb index 53513c0655..1d34cdd7dd 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -13,23 +13,23 @@ User.create(full_name: "Puppy Party") Product.create(name: 'Hot Dog', price: 15, -photo_url: "http://ecx.images-amazon.com/images/I/41qN0y-0FFL._SY300_.jpg", user_id: 2, category: 'Dog') -Product.create(name: "Dog Pirate", price: 20, user_id: 5, category: 'Dog', +photo_url: "http://ecx.images-amazon.com/images/I/41qN0y-0FFL._SY300_.jpg", user_id: 2, animal: 'Dog', category: "Food") +Product.create(name: "Dog Pirate", price: 20, user_id: 5, animal: 'Dog', category: "Misc", photo_url: "http://www.gadgetreview.com/wp-content/uploads/2012/05/Dog-Pirate-Costume-650x472.jpg") -Product.create(name: "Alligator", price: 1, user_id: 1, category: 'Dog', +Product.create(name: "Alligator", price: 1, user_id: 1, animal: 'Dog', category: "Animal", photo_url: "http://cdn1-www.dogtime.com/assets/uploads/gallery/cool-halloween-costumes/dog-halloween-costume-eaten_by_alligator.jpg") -Product.create(name: "Knight Guinea Pig", price: 56, user_id: 3, category: "Guinea Pig", +Product.create(name: "Knight Guinea Pig", price: 56, user_id: 3, animal: "Guinea Pig", category: "Misc", photo_url: "http://static.dudeiwantthat.com/img/gear/pets/handmade-guinea-pig-armor-8201.jpg") -Product.create(name: "St Patricks Dog", price: 94, user_id: 4, category: "Dog", +Product.create(name: "St Patricks Dog", price: 94, user_id: 4, animal: "Dog", category: "Holiday", photo_url: "https://s-media-cache-ak0.pinimg.com/236x/26/84/c3/2684c33c0be14d73dfa983b019a3e249.jpg") -Product.create(name: "Ewok dog", price: 6, user_id: 2, category: "Dog", +Product.create(name: "Ewok dog", price: 6, user_id: 2, animal: "Dog", category: "Star Wars", photo_url: "https://s-media-cache-ak0.pinimg.com/736x/86/bb/c0/86bbc0780b0d655924868ed0b858d7d6.jpg") -Product.create(name: "Taco Cat", price: 14, user_id: 4, category: "Cat", photo_url: "http://pixel.brit.co/wp-content/uploads/2014/10/5-TacoKitten.jpg") -Product.create(name: "Lion", price: 30, user_id: 3, category: "Dog", +Product.create(name: "Taco Cat", price: 14, user_id: 4, animal: "Cat", category: "Food", photo_url: "http://pixel.brit.co/wp-content/uploads/2014/10/5-TacoKitten.jpg") +Product.create(name: "Lion", price: 30, user_id: 3, animal: "Dog", category: "Animal", photo_url: "http://ecx.images-amazon.com/images/I/51ELTYHPEBL._AC_UL320_SR228,320_.jpg" ) -Product.create(name: 'Martini', price: 400, user_id: 1, category: "Dog", +Product.create(name: 'Martini', price: 400, user_id: 1, animal: "Dog", category: "Food", photo_url: "http://littlefun.org/uploads/52741c71e691b26f19aec579_736.jpg" ) -Product.create(name: 'Jockey', price: 22, user_id: 1, category: "Dog", +Product.create(name: 'Jockey', price: 22, user_id: 1, animal: "Dog", category: "Misc", photo_url: "http://a.dilcdn.com/bl/wp-content/uploads/sites/13/2012/10/dog2.jpg") Order.create(status: 'pending', price: 46, user_id: 1) From 005c30ac625d3cf94baeb79752422a0b694be375 Mon Sep 17 00:00:00 2001 From: Jessica Date: Sat, 7 May 2016 14:00:31 -0700 Subject: [PATCH 070/174] got side nav bar lookin good and working on header. --- app/assets/stylesheets/application.css | 50 +++++++++----------------- app/controllers/home_controller.rb | 2 +- app/views/home/index.html.erb | 14 ++++---- app/views/layouts/application.html.erb | 7 ++-- 4 files changed, 28 insertions(+), 45 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index fee06d182e..d270283fa9 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,9 +1,10 @@ * { - font-family: 'Architects Daughter', cursive; + font-family: 'Roboto Condensed', sans-serif; letter-spacing: 1px; font-size: 20px; } + div.top-header { float: right; display: inline; @@ -12,21 +13,20 @@ div.top-header { font-size: 25px; } -ul.nav-side li { - display: block; - float: left; + +ul.nav-top li.logged-in { + padding-top: 10px; +} + +.sidebar { + border-right: solid 1px; + margin: 2% 5% 2% 2%; } -/*.home-page { - float: right; - margin-top: 10%; - margin-right: 40%; - display: inline; -}*/ header { height: 100px; width: 100%; - border: 2px black solid; + border-bottom: solid 1px; } div.container { @@ -51,6 +51,7 @@ div.product { height: 80px; text-align: left; } + body { margin-left: 10%; margin-right: 10%: @@ -75,35 +76,12 @@ a { text-decoration: none; } -/*div.product-list { - border: 2px black solid; - background-color: lightblue; - width: 30%; -}*/ - -/*.product-list img { - width: 80%; -}*/ - -/*.product { - width: 40%; - background: 3px solid blue; - background-color: gray; - margin-left: 20%; - -}*/ - .product img { max-width: 80%; margin-left: 2%; border: 5px solid navy; } -/*div.all-products { - display: inline-block; - width: 80%; - margin-left: 10%; -}*/ .favoritepic img { width: 80%; } @@ -127,3 +105,7 @@ div.orderitem { .orderitem img { height: 200px; } + +img { + +} diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 2bf3094377..b95c5f2757 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,5 +1,5 @@ class HomeController < ApplicationController - + layout 'application' def index @products = Product.all @product_picker = Product.where.not(id: nil).sample(3) diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index bc7e519241..316aedac37 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,26 +1,28 @@ +

Featured Costumes @@ -39,9 +41,7 @@ $<%= number_with_precision product.price, precision: 2 %> <%= hidden_field_tag :product_id, product.id %>
<%= hidden_field_tag :quantity, 1 %> <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
- <% end %> -

- + <% end %> <%= link_to "View all costumes", products_path %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6dd4ec8c95..f8e2f57071 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,10 +1,11 @@ + Betsy <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> - + <%= csrf_meta_tags %> @@ -18,8 +19,8 @@ <%= image_tag "dog logo.png", alt: "cute dog" %>
diff --git a/app/views/orders/show.html.erb b/app/views/orders/show.html.erb index 637dfc7215..b67c47e657 100644 --- a/app/views/orders/show.html.erb +++ b/app/views/orders/show.html.erb @@ -22,5 +22,5 @@ <% end %>

Total Price of Order: $<%= number_with_precision @cart_price , precision: 2 %>

- <%= button_to "Proceed to checkout", edit_order_path(current_order.id), method: :get %> + <%= button_to "Proceed to checkout", '/order/current_order.id/checkout', action: "edit" method: :get %> diff --git a/config/routes.rb b/config/routes.rb index bd50d99b85..12d6b6ab02 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -28,6 +28,8 @@ resources :sessions, :only => [:new, :create] get "/logout" => "sessions#destroy" - + get "/orders/:id/checkout" => 'orders#checkout', as: 'order_checkout' + patch "/orders/:id/checkout" => "orders#confirmation" + get '/orders/:id/confirmation' => 'orders#confirmation', as: "order_confirmation" end diff --git a/db/migrate/20160507035811_add_columns_to_order.rb b/db/migrate/20160507035811_add_columns_to_order.rb new file mode 100644 index 0000000000..25246c7f9a --- /dev/null +++ b/db/migrate/20160507035811_add_columns_to_order.rb @@ -0,0 +1,13 @@ +class AddColumnsToOrder < ActiveRecord::Migration + def change + add_column :orders, :email, :string + add_column :orders, :street_address, :string + add_column :orders, :city, :string + add_column :orders, :state, :string + add_column :orders, :name_on_credit_card, :string + add_column :orders, :credit_card_number, :integer + add_column :orders, :credit_card_exp_date, :string + add_column :orders, :credit_card_cvv, :integer + add_column :orders, :billing_zip, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 57947d6785..d77f1d17ea 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160506223329) do +ActiveRecord::Schema.define(version: 20160507035811) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -35,8 +35,17 @@ t.string "status" t.float "price" t.integer "user_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.string "email" + t.string "street_address" + t.string "city" + t.string "state" + t.string "name_on_credit_card" + t.integer "credit_card_number" + t.string "credit_card_exp_date" + t.integer "credit_card_cvv" + t.string "billing_zip" end create_table "products", force: :cascade do |t| From 929192fcbe56805addb6b88a287c17c98604769b Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Sat, 7 May 2016 14:57:45 -0700 Subject: [PATCH 073/174] confirmation page now shows details of transation --- app/controllers/orderitems_controller.rb | 27 +++++++++++------------- app/controllers/orders_controller.rb | 6 ++++++ app/views/orders/confirmation.html.erb | 13 ++++++++++++ 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/app/controllers/orderitems_controller.rb b/app/controllers/orderitems_controller.rb index 9ea60593b4..92886499d8 100644 --- a/app/controllers/orderitems_controller.rb +++ b/app/controllers/orderitems_controller.rb @@ -10,23 +10,20 @@ def create redirect_to edit_order_path(current_order.id) end + def update + @orderitem = Orderitem.find(params[:id]) + if @orderitem.update(orderitem_edit_params[:orderitem]) + redirect_to root_path + else + redirect_to root_path + end + end + private - def update - - @orderitem = Orderitem.find(params[:id]) - if @orderitem.update(orderitem_edit_params[:orderitem]) - redirect_to root_path - else - redirect_to root_path - end - end - - private - - def orderitem_edit_params - params.permit(orderitem: [:quantity]) - end + def orderitem_edit_params + params.permit(orderitem: [:quantity]) + end end diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 7237de4136..4ca4abf6ef 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -36,6 +36,12 @@ def checkout @order = current_order end + def confirmation + # binding.pry + @order = current_order + @orderitems = @order.orderitems + end + private diff --git a/app/views/orders/confirmation.html.erb b/app/views/orders/confirmation.html.erb index b72bf0138f..3cd425f180 100644 --- a/app/views/orders/confirmation.html.erb +++ b/app/views/orders/confirmation.html.erb @@ -1 +1,14 @@

Congratulations! You bought some stuff!

+ +

Details of Order # <%= @order.id %>

+<% @cart_price = 0 %> +<% @order.orderitems.each do |item| %> +Item: <%= Product.find(item.product_id).name %>
+Quantity: <%= item.quantity %>
+Subtotal: <%= item.total_price %>

+<% @cart_price += item.total_price %> +<% end %> + +

Total Price of Order: $<%= number_with_precision @cart_price , precision: 2 %>

+ +<%= link_to "Thanks for Shopping at Petsy!", root_path %> From b3d49682baadc0d47138f800006b607f15ef3cf6 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Sat, 7 May 2016 15:14:22 -0700 Subject: [PATCH 074/174] when confirmation page displays, current_order session gets destroyed --- app/controllers/orders_controller.rb | 5 +---- app/views/orders/confirmation.html.erb | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 4ca4abf6ef..b0890abf24 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -4,7 +4,6 @@ def show @orders = Order.find(current_order.id).orderitems end - def show_seller_orders @user = User.find(params[:id]) @orders = @user.orders @@ -17,12 +16,9 @@ def edit end def update - # binding.pry @order = current_order - # @order.update(order_update_params[:order]) @order.update(order_update_params[:order]) if @order.status == "Completed" - flash.now[:alert] = 'Sale could not be deleted.' redirect_to order_confirmation_path(@order.id) else render :checkout @@ -40,6 +36,7 @@ def confirmation # binding.pry @order = current_order @orderitems = @order.orderitems + session.delete :order_id end diff --git a/app/views/orders/confirmation.html.erb b/app/views/orders/confirmation.html.erb index 3cd425f180..31740c3849 100644 --- a/app/views/orders/confirmation.html.erb +++ b/app/views/orders/confirmation.html.erb @@ -10,5 +10,7 @@ Subtotal: <%= item.total_price %>

<% end %>

Total Price of Order: $<%= number_with_precision @cart_price , precision: 2 %>

+

Order Status: <%= @order.status %>

+

Time Order was placed: <%= @order.updated_at %>

<%= link_to "Thanks for Shopping at Petsy!", root_path %> From 4c397c824d9ccb910c2214aca12410521bf7e844 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Sat, 7 May 2016 15:42:36 -0700 Subject: [PATCH 075/174] newed up current_order after confirmaion page --- app/controllers/orders_controller.rb | 2 ++ app/controllers/sessions_controller.rb | 5 +++++ app/views/orders/confirmation.html.erb | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index b0890abf24..f589f7b43a 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -37,6 +37,8 @@ def confirmation @order = current_order @orderitems = @order.orderitems session.delete :order_id + order = Order.create + session[:order_id] = order.id end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 686e3cb06c..d6bce5d3bb 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -19,5 +19,10 @@ def destroy redirect_to root_path end + def new_order_session + order = Order.create + session[:order_id] = order.id + end + end diff --git a/app/views/orders/confirmation.html.erb b/app/views/orders/confirmation.html.erb index 31740c3849..825e9f5104 100644 --- a/app/views/orders/confirmation.html.erb +++ b/app/views/orders/confirmation.html.erb @@ -3,7 +3,7 @@

Details of Order # <%= @order.id %>

<% @cart_price = 0 %> <% @order.orderitems.each do |item| %> -Item: <%= Product.find(item.product_id).name %>
+Item: <%= link_to Product.find(item.product_id).name , product_path(Product.find(item.product_id).id) %>
Quantity: <%= item.quantity %>
Subtotal: <%= item.total_price %>

<% @cart_price += item.total_price %> From 882b3f4c554db08a50344b7911bb68e0f35a77b1 Mon Sep 17 00:00:00 2001 From: Jessica Date: Sat, 7 May 2016 15:42:52 -0700 Subject: [PATCH 076/174] got cart icon in header with number of order items in cart listed there. also got some other pictures for the costumes so they are all more the same size. --- app/assets/stylesheets/application.css | 18 ++++++++++--- app/controllers/home_controller.rb | 2 +- app/controllers/orderitems_controller.rb | 28 +++++++++------------ app/controllers/sessions_controller.rb | 1 + app/views/home/index.html.erb | 6 ++--- app/views/layouts/application.html.erb | 6 ++--- db/seeds.rb | 32 ++++++++++++++++-------- 7 files changed, 54 insertions(+), 39 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index c14021c2d1..8a13f548ff 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -5,10 +5,10 @@ } -div.top-header { +div.header { float: right; display: inline; - padding-right: 5%; + padding-right: 8%; font-weight: bolder; font-size: 25px; } @@ -23,10 +23,15 @@ li.logged-in { margin: 2% 5% 2% 2%; } +.order-quantity { + color: #b30000; +} + header { height: 100px; width: 100%; border-bottom: solid 1px; + padding: 1% 2% 0 2%; } div.container { @@ -52,6 +57,10 @@ div.product { text-align: left; } +.logo { + padding-left: 2%; +} + body { margin-left: 10%; margin-right: 10%: @@ -60,6 +69,7 @@ body { h2.home-header { text-align: left; display: inline-block; + padding-bottom: 3%; } div.home-page { @@ -84,6 +94,8 @@ a { .favoritepic img { width: 80%; + display: block; + margin: auto; } div.cart { @@ -106,6 +118,4 @@ div.orderitem { height: 200px; } -img { -} diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index b95c5f2757..7443dcb28d 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -5,7 +5,7 @@ def index @product_picker = Product.where.not(id: nil).sample(3) @animals = Product.uniq.pluck(:animal) @categories = Product.uniq.pluck(:category) - @users = User.all + @users = User.all end end diff --git a/app/controllers/orderitems_controller.rb b/app/controllers/orderitems_controller.rb index 9ea60593b4..d19e8afcb0 100644 --- a/app/controllers/orderitems_controller.rb +++ b/app/controllers/orderitems_controller.rb @@ -10,23 +10,19 @@ def create redirect_to edit_order_path(current_order.id) end + def update + @orderitem = Orderitem.find(params[:id]) + if @orderitem.update(orderitem_edit_params[:orderitem]) + redirect_to root_path + else + redirect_to root_path + end + end + private - def update - - @orderitem = Orderitem.find(params[:id]) - if @orderitem.update(orderitem_edit_params[:orderitem]) - redirect_to root_path - else - redirect_to root_path - end - end - - private - - def orderitem_edit_params - params.permit(orderitem: [:quantity]) - end - + def orderitem_edit_params + params.permit(orderitem: [:quantity]) + end end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 686e3cb06c..09905fcde2 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,5 +1,6 @@ class SessionsController < ApplicationController def new + end def create diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 316aedac37..191d450e61 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -3,7 +3,7 @@ -

-Featured Costumes -

+

Featured Costumes


<% @product_picker.each do |product| %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f8e2f57071..ebf837ce0e 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -14,10 +14,10 @@
diff --git a/db/seeds.rb b/db/seeds.rb index 1d34cdd7dd..f70b1d6205 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -14,23 +14,33 @@ Product.create(name: 'Hot Dog', price: 15, photo_url: "http://ecx.images-amazon.com/images/I/41qN0y-0FFL._SY300_.jpg", user_id: 2, animal: 'Dog', category: "Food") -Product.create(name: "Dog Pirate", price: 20, user_id: 5, animal: 'Dog', category: "Misc", -photo_url: "http://www.gadgetreview.com/wp-content/uploads/2012/05/Dog-Pirate-Costume-650x472.jpg") +Product.create(name: "Arrr Matey", price: 20, user_id: 5, animal: 'Dog', category: "Misc", +photo_url: "http://s2.thisnext.com/media/largest_dimension/A1684071.jpg") +# Product.create(name: "Alligator", price: 1, user_id: 1, animal: 'Dog', category: "Animal", +# photo_url: "http://cdn1-www.dogtime.com/assets/uploads/gallery/cool-halloween-costumes/dog-halloween-costume-eaten_by_alligator.jpg") Product.create(name: "Alligator", price: 1, user_id: 1, animal: 'Dog', category: "Animal", -photo_url: "http://cdn1-www.dogtime.com/assets/uploads/gallery/cool-halloween-costumes/dog-halloween-costume-eaten_by_alligator.jpg") +photo_url: "http://pixel.brit.co/wp-content/uploads/2014/10/72-Gator-RADLAB.jpg") Product.create(name: "Knight Guinea Pig", price: 56, user_id: 3, animal: "Guinea Pig", category: "Misc", -photo_url: "http://static.dudeiwantthat.com/img/gear/pets/handmade-guinea-pig-armor-8201.jpg") +photo_url: "http://www.thesundaytimes.co.uk/sto/multimedia/dynamic/00358/stg28minmagcheatshe_358537k.jpg") Product.create(name: "St Patricks Dog", price: 94, user_id: 4, animal: "Dog", category: "Holiday", -photo_url: "https://s-media-cache-ak0.pinimg.com/236x/26/84/c3/2684c33c0be14d73dfa983b019a3e249.jpg") -Product.create(name: "Ewok dog", price: 6, user_id: 2, animal: "Dog", category: "Star Wars", -photo_url: "https://s-media-cache-ak0.pinimg.com/736x/86/bb/c0/86bbc0780b0d655924868ed0b858d7d6.jpg") -Product.create(name: "Taco Cat", price: 14, user_id: 4, animal: "Cat", category: "Food", photo_url: "http://pixel.brit.co/wp-content/uploads/2014/10/5-TacoKitten.jpg") -Product.create(name: "Lion", price: 30, user_id: 3, animal: "Dog", category: "Animal", +photo_url: "https://s-media-cache-ak0.pinimg.com/736x/65/82/48/65824840727b14eb271524e4db3a69b0.jpg") +# Product.create(name: "Ewok dog", price: 6, user_id: 2, animal: "Dog", category: "Star Wars", +# photo_url: "https://s-media-cache-ak0.pinimg.com/736x/86/bb/c0/86bbc0780b0d655924868ed0b858d7d6.jpg") +Product.create(name: "Yoda Pup", price: 10, user_id: 1, animal: "Dog", category: "Star Wars", photo_url: "http://thissortofthing.com/storage/yoda_dog_costume.jpg?__SQUARESPACE_CACHEVERSION=1377883510952") +Product.create(name: "Sushi Roll Cat", price: 14, user_id: 4, animal: "Cat", category: "Food", photo_url: "https://s-media-cache-ak0.pinimg.com/736x/10/a8/69/10a869497c6bc793ecfcbf3e0b842886.jpg") +Product.create(name: "RAWR", price: 30, user_id: 3, animal: "Dog", category: "Animal", photo_url: "http://ecx.images-amazon.com/images/I/51ELTYHPEBL._AC_UL320_SR228,320_.jpg" ) -Product.create(name: 'Martini', price: 400, user_id: 1, animal: "Dog", category: "Food", -photo_url: "http://littlefun.org/uploads/52741c71e691b26f19aec579_736.jpg" ) +Product.create(name: 'Martini Kitty', price: 400, user_id: 1, animal: "Cat", category: "Food", +photo_url: "http://pets.petsmart.com/content/assets/_images/expo/CONTENTTHUMB-EXPO-martini-Glass.jpg" ) Product.create(name: 'Jockey', price: 22, user_id: 1, animal: "Dog", category: "Misc", photo_url: "http://a.dilcdn.com/bl/wp-content/uploads/sites/13/2012/10/dog2.jpg") +Product.create(name: "Witch", price: 16, user_id: 3, animal: "Guinea Pig", category: "Holiday", +photo_url: "http://mms.businesswire.com/media/20130905005372/en/381196/5/Guinea_Pig_Witch_Costume.jpg") +Product.create(name: "Sheepy", price: 2, user_id: 1, animal: "Guinea Pig", category: "Animal", +photo_url: "http://www.fuzzytoday.com/wp-content/uploads/2014/04/10173656_706647296068039_5966309383389001510_n.jpg") +Product.create(name: "Dewback", price: 52, user_id: 4, animal: "Dog", category: "Star Wars", +photo_url: "http://www.officialstarwarscostumes.com/~/media/products/oc/star-wars-costumes/kids-star-wars-costumes/99886582-dewback-pet-costume-pet-star-wars-costumes-000.ashx?&w=600&h=600&bc=FFFFFF") + Order.create(status: 'pending', price: 46, user_id: 1) Order.create(status: 'paid', price: 99, user_id: 2) From d22af201d1b53ab92235a501f48e3ae2be8ffc37 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Sat, 7 May 2016 15:44:46 -0700 Subject: [PATCH 077/174] fixed tiny redirect bug on cart --- app/controllers/orderitems_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/orderitems_controller.rb b/app/controllers/orderitems_controller.rb index 92886499d8..20136f38c8 100644 --- a/app/controllers/orderitems_controller.rb +++ b/app/controllers/orderitems_controller.rb @@ -13,7 +13,7 @@ def create def update @orderitem = Orderitem.find(params[:id]) if @orderitem.update(orderitem_edit_params[:orderitem]) - redirect_to root_path + redirect_to edit_order_path(current_order.id) else redirect_to root_path end From 49d0f3e7a2fdf462c2b00b26233be8cf92f778cc Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Sat, 7 May 2016 15:49:32 -0700 Subject: [PATCH 078/174] missing end to method --- app/controllers/orderitems_controller.rb | 1 + db/schema.rb | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/controllers/orderitems_controller.rb b/app/controllers/orderitems_controller.rb index 823d559eea..e8e7152cec 100644 --- a/app/controllers/orderitems_controller.rb +++ b/app/controllers/orderitems_controller.rb @@ -16,6 +16,7 @@ def update redirect_to edit_order_path(current_order.id) else redirect_to root_path + end end private diff --git a/db/schema.rb b/db/schema.rb index 6f2d4aac14..2374adcd85 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,10 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. - - -ActiveRecord::Schema.define(version: 20160506230434) do - +ActiveRecord::Schema.define(version: 20160507035811) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" From ed6adc1c56af739af74122a493c4debb278c4b1d Mon Sep 17 00:00:00 2001 From: Jessica Date: Sat, 7 May 2016 16:36:12 -0700 Subject: [PATCH 079/174] added descriptions for products to seeds. did some css for product/show page. lookin pretty good --- app/assets/stylesheets/application.css | 21 ++++++++------ app/views/home/index.html.erb | 2 +- app/views/layouts/application.html.erb | 3 +- app/views/products/show.html.erb | 27 ++++++++++-------- db/seeds.rb | 38 ++++++++++++++------------ 5 files changed, 52 insertions(+), 39 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 8a13f548ff..2bf2c5841b 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,5 +1,5 @@ * { - font-family: 'Roboto Condensed', sans-serif; + font-family: 'Lora', serif; letter-spacing: 1px; font-size: 20px; } @@ -42,14 +42,10 @@ div.container { } div.product { - border: 2px black solid; - border-radius: 4px; padding: 20px; margin-bottom: 20px; margin-left: 5%; - box-shadow: 5px 5px 2px rgb(59, 59, 58); width: 25%; - background-color: grey; } .top-header img { @@ -72,7 +68,7 @@ h2.home-header { padding-bottom: 3%; } -div.home-page { +div.all-pages { width: 25%; display: inline-block; } @@ -87,9 +83,18 @@ a { } .product img { - max-width: 80%; + max-width: 250px; margin-left: 2%; - border: 5px solid navy; +} + +.rating-description { + float: right; + margin-top: 2%; + margin-right: 30%; +} + +.description { + color: #003399; } .favoritepic img { diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 191d450e61..c24c67f149 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -27,7 +27,7 @@

Featured Costumes


<% @product_picker.each do |product| %> -
+
<% unless product.photo_url.nil? %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index ebf837ce0e..600d56b652 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,7 +5,8 @@ Betsy <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> - + + <%= csrf_meta_tags %> diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb index 1260ec26aa..4e41aa9757 100644 --- a/app/views/products/show.html.erb +++ b/app/views/products/show.html.erb @@ -1,21 +1,24 @@ -
-

<%= @product.name %>

- - -
- <%= @product.description %> +
+

<%= @product.description %>

+
$<%= number_with_precision @product.price, precision: 2 %> <%= form_tag '/orderitems' do %> <%= hidden_field_tag :product_id, @product.id %>
<%= select_tag :quantity, options_for_select(@quantity_numbers) %>
- <%= submit_tag "Add to Cart", class: 'btn btn-primary' %> + <%= submit_tag "Add to Cart", class: 'btn btn-primary' %> <% end %> - - Overall Rating: <%= @rating %> / 5 - Reviews:
<% @product.reviews.each do |review|%> +

<%= @product.quantity %> Available

+
+

Overall Rating: <%= @rating %> / 5

+

Reviews:
<% @product.reviews.each do |review|%> <%= review.description %>
- <% end %> + <% end %>

+
- <%= @product.quantity %> Available +
+

<%= @product.name %>

+ + +
diff --git a/db/seeds.rb b/db/seeds.rb index 056b3f0d35..d65b79cb3a 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -12,33 +12,33 @@ User.create(full_name: "Llama") User.create(full_name: "Puppy Party") -Product.create(name: 'Hot Dog', price: 15, +Product.create(name: 'Hot Dog', description: "Hot diggity dog. Mustard too!", price: 15, photo_url: "http://ecx.images-amazon.com/images/I/41qN0y-0FFL._SY300_.jpg", user_id: 2, animal: 'Dog', category: "Food") -Product.create(name: "Arrr Matey", price: 20, user_id: 5, animal: 'Dog', category: "Misc", +Product.create(name: "Arrr Matey", description: "Whar be me treasure buried?", price: 20, user_id: 5, animal: 'Dog', category: "Misc", photo_url: "http://s2.thisnext.com/media/largest_dimension/A1684071.jpg") # Product.create(name: "Alligator", price: 1, user_id: 1, animal: 'Dog', category: "Animal", # photo_url: "http://cdn1-www.dogtime.com/assets/uploads/gallery/cool-halloween-costumes/dog-halloween-costume-eaten_by_alligator.jpg") -Product.create(name: "Alligator", price: 1, user_id: 1, animal: 'Dog', category: "Animal", +Product.create(name: "Alligator", description: "Too cute to take a bite outta anyone!", price: 1, user_id: 1, animal: 'Dog', category: "Animal", photo_url: "http://pixel.brit.co/wp-content/uploads/2014/10/72-Gator-RADLAB.jpg") -Product.create(name: "Knight Guinea Pig", price: 56, user_id: 3, animal: "Guinea Pig", category: "Misc", +Product.create(name: "Knight Guinea Pig", description: "Standing guard!", price: 56, user_id: 3, animal: "Guinea Pig", category: "Misc", photo_url: "http://www.thesundaytimes.co.uk/sto/multimedia/dynamic/00358/stg28minmagcheatshe_358537k.jpg") -Product.create(name: "St Patricks Dog", price: 94, user_id: 4, animal: "Dog", category: "Holiday", +Product.create(name: "St Patricks Dog", description: "Lucky 🍀 Dog.", price: 94, user_id: 4, animal: "Dog", category: "Holiday", photo_url: "https://s-media-cache-ak0.pinimg.com/736x/65/82/48/65824840727b14eb271524e4db3a69b0.jpg") # Product.create(name: "Ewok dog", price: 6, user_id: 2, animal: "Dog", category: "Star Wars", # photo_url: "https://s-media-cache-ak0.pinimg.com/736x/86/bb/c0/86bbc0780b0d655924868ed0b858d7d6.jpg") -Product.create(name: "Yoda Pup", price: 10, user_id: 1, animal: "Dog", category: "Star Wars", photo_url: "http://thissortofthing.com/storage/yoda_dog_costume.jpg?__SQUARESPACE_CACHEVERSION=1377883510952") -Product.create(name: "Sushi Roll Cat", price: 14, user_id: 4, animal: "Cat", category: "Food", photo_url: "https://s-media-cache-ak0.pinimg.com/736x/10/a8/69/10a869497c6bc793ecfcbf3e0b842886.jpg") -Product.create(name: "RAWR", price: 30, user_id: 3, animal: "Dog", category: "Animal", +Product.create(name: "Yoda Pup", description: "Use the force, you will.", price: 10, user_id: 1, animal: "Dog", category: "Star Wars", photo_url: "http://thissortofthing.com/storage/yoda_dog_costume.jpg?__SQUARESPACE_CACHEVERSION=1377883510952") +Product.create(name: "Sushi Roll Cat", description: "Wrapped up in cute. ", price: 14, user_id: 4, animal: "Cat", category: "Food", photo_url: "https://s-media-cache-ak0.pinimg.com/736x/10/a8/69/10a869497c6bc793ecfcbf3e0b842886.jpg") +Product.create(name: "RAWR", description: "Big roar, much cute.", price: 30, user_id: 3, animal: "Dog", category: "Animal", photo_url: "http://ecx.images-amazon.com/images/I/51ELTYHPEBL._AC_UL320_SR228,320_.jpg" ) -Product.create(name: 'Martini Kitty', price: 400, user_id: 1, animal: "Cat", category: "Food", +Product.create(name: 'Martini Kitty', description: "Turn that cone into something fun!", price: 400, user_id: 1, animal: "Cat", category: "Food", photo_url: "http://pets.petsmart.com/content/assets/_images/expo/CONTENTTHUMB-EXPO-martini-Glass.jpg" ) -Product.create(name: 'Jockey', price: 22, user_id: 1, animal: "Dog", category: "Misc", +Product.create(name: 'Jockey', description: "Your dog is kind of like a horse, right?", price: 22, user_id: 1, animal: "Dog", category: "Misc", photo_url: "http://a.dilcdn.com/bl/wp-content/uploads/sites/13/2012/10/dog2.jpg") -Product.create(name: "Witch", price: 16, user_id: 3, animal: "Guinea Pig", category: "Holiday", +Product.create(name: "Witch", description: "Your guinea pig should have fun too!", price: 16, user_id: 3, animal: "Guinea Pig", category: "Holiday", photo_url: "http://mms.businesswire.com/media/20130905005372/en/381196/5/Guinea_Pig_Witch_Costume.jpg") -Product.create(name: "Sheepy", price: 2, user_id: 1, animal: "Guinea Pig", category: "Animal", +Product.create(name: "Sheepy", description: "Baaaahhh. Tiny sheep. Tiny cute.", price: 2, user_id: 1, animal: "Guinea Pig", category: "Animal", photo_url: "http://www.fuzzytoday.com/wp-content/uploads/2014/04/10173656_706647296068039_5966309383389001510_n.jpg") -Product.create(name: "Dewback", price: 52, user_id: 4, animal: "Dog", category: "Star Wars", +Product.create(name: "Dewback", description: "Straight from Tatooine.", price: 52, user_id: 4, animal: "Dog", category: "Star Wars", photo_url: "http://www.officialstarwarscostumes.com/~/media/products/oc/star-wars-costumes/kids-star-wars-costumes/99886582-dewback-pet-costume-pet-star-wars-costumes-000.ashx?&w=600&h=600&bc=FFFFFF") @@ -69,10 +69,14 @@ Review.create(rating: 4, description: 'Where can I get one for my fish?', product_id: 6) Review.create(rating: 5, description: 'Bad delivery time.', product_id: 7) Review.create(rating: 5, description: 'Is this edible?', product_id: 7) -Review.create(rating: 2, description: 'Feels real', product_id: 7) -Review.create(rating: 3, description: 'Can i eat that?', product_id: 7) -Review.create(rating: 2, description: "I'll take five.", product_id: 8) -Review.create(rating: 4, description: 'Nope.', product_id: 9) +Review.create(rating: 2, description: 'Feels real', product_id: 8) +Review.create(rating: 3, description: 'Can i eat that?', product_id: 9) +Review.create(rating: 2, description: "I'll take five.", product_id: 10) +Review.create(rating: 4, description: 'Nope.', product_id: 11) +Review.create(rating: 4, description: 'Cute.', product_id: 11) +Review.create(rating: 4, description: 'I LOVE IT.', product_id: 12) +Review.create(rating: 4, description: 'Fit perfectly.', product_id: 13) + Orderitem.create(quantity: 2, price: 5, order_id: 1, product_id: 1, seller_id: 1) Orderitem.create(quantity: 3, price: 10, order_id: 1, product_id: 1, seller_id: 1) From e454ac6c79b45eddfe97a4e51cde38d4207997c2 Mon Sep 17 00:00:00 2001 From: Jessica Date: Sat, 7 May 2016 17:12:00 -0700 Subject: [PATCH 080/174] adjusted location of view all costumes link on home page. view all costumes now looking pretty good --- app/assets/stylesheets/application.css | 19 ++++++++++++++++++- app/views/home/index.html.erb | 12 ++++++------ app/views/products/index.html.erb | 20 ++++++++++---------- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 2bf2c5841b..61f92fc9de 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -4,6 +4,17 @@ font-size: 20px; } +h1 { + padding-left: 3%; +} + +.view-link { + text-decoration: none; + float: right; + padding-top: 2%; + padding-right: 10%; + font-size: 25px; +} div.header { float: right; @@ -73,6 +84,12 @@ div.all-pages { display: inline-block; } +div.all-products { + margin: 3%; + width: 25%; + display: inline-block; +} + ul.nav-top li { display: inline; padding-right: 30px; @@ -83,7 +100,7 @@ a { } .product img { - max-width: 250px; + max-width: 300px; margin-left: 2%; } diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index c24c67f149..088331fcdd 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,3 +1,4 @@ +<%= link_to "View all costumes", products_path, class: "view-link" %> <%= link_to product.name, product_path(product.id) %> $<%= number_with_precision product.price, precision: 2 %> -<%= form_tag '/orderitems' do %> -<%= hidden_field_tag :product_id, product.id %>
-<%= hidden_field_tag :quantity, 1 %> -<%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
-<% end %> + <%= form_tag '/orderitems' do %> + <%= hidden_field_tag :product_id, product.id %>
+ <%= hidden_field_tag :quantity, 1 %> + <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
+ <% end %>
<% end %> -<%= link_to "View all costumes", products_path %> diff --git a/app/views/products/index.html.erb b/app/views/products/index.html.erb index aa0f8b0fac..9b9e09c43e 100644 --- a/app/views/products/index.html.erb +++ b/app/views/products/index.html.erb @@ -1,20 +1,20 @@ -

All Products

-
+

All Costumes

<% @products.each do |product| %> -
+
+
<% unless product.photo_url.nil? %> <% end %>
- <%= link_to product.name, product_path(product.id) %>
- <%= product.description %>
- $<%= number_with_precision product.price, precision: 2 %>
+
+ <%= link_to product.name, product_path(product.id) %>
+ <%= product.description %>
+ $<%= number_with_precision product.price, precision: 2 %>
<%= form_tag '/orderitems' do %> <%= hidden_field_tag :product_id, product.id %>
<%= select_tag :quantity, options_for_select(@quantity_numbers) %>
- <%= submit_tag "Add to Cart", class: 'btn btn-primary' %> + <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
+
<% end %> -
-
- <% end %>
+ <% end %> \ No newline at end of file From e7f7d72720e8259417b71ff60af96c474e23e503 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Sat, 7 May 2016 21:52:38 -0700 Subject: [PATCH 081/174] added a delete button to items in cart for easy removal --- app/controllers/application_controller.rb | 2 ++ app/controllers/orderitems_controller.rb | 6 ++++ app/views/orders/edit.html.erb | 39 +++++++++++------------ 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d7011df0ca..1e231230c7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -13,6 +13,8 @@ def current_order @current_order ||= Order.find_or_create_by(id: session[:order_id]) end + + def require_login if current_user.nil? flash[:error] = "You must be logged in to view this section" diff --git a/app/controllers/orderitems_controller.rb b/app/controllers/orderitems_controller.rb index e8e7152cec..f9e76cde20 100644 --- a/app/controllers/orderitems_controller.rb +++ b/app/controllers/orderitems_controller.rb @@ -19,6 +19,12 @@ def update end end + def destroy + @orderitem = Orderitem.find(params[:id]) + @orderitem.destroy + redirect_to edit_order_path(current_order.id) + end + private def orderitem_edit_params diff --git a/app/views/orders/edit.html.erb b/app/views/orders/edit.html.erb index f341a1678f..909b9d1bb5 100644 --- a/app/views/orders/edit.html.erb +++ b/app/views/orders/edit.html.erb @@ -1,29 +1,26 @@
-

Cart:

+

Cart:

+ <% @cart_price = 0 %> +
+ <% @order.orderitems.each do |orderitem| %> +
+ + <%= Product.find(orderitem.product_id).name %> + Price $<%=number_with_precision orderitem.total_price, precision: 2 %> + <% @cart_price += orderitem.total_price %> + <%=form_for orderitem do |f| %> + <%=f.label "Update Quantity" %> + <%=f.select 'quantity', options_for_select(@quantity_numbers, orderitem.quantity) %>
+ <%=f.submit %> + <% end %> + <%= button_to "Remove from Cart", orderitem_path(orderitem.id), method: :delete %> + <% end %> +
-<% @cart_price = 0 %> -
- - <% @order.orderitems.each do |orderitem| %> - -
- - <%= Product.find(orderitem.product_id).name %> - Price $<%=number_with_precision orderitem.total_price, precision: 2 %> - <% @cart_price += orderitem.total_price %> - <%=form_for orderitem do |f| %> - <%=f.label "Update Quantity" %> - <%=f.select 'quantity', options_for_select(@quantity_numbers, orderitem.quantity) %>
- <%=f.submit %> - <% end %> - <% end %> -
- -

Total Price of Order: $<%= number_with_precision @cart_price , precision: 2 %>

<%= button_to "Proceed to checkout", order_checkout_path(current_order.id), method: :get %> -
+
From 4e06af13eb6797cb3d860558743a291ac038901b Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Sun, 8 May 2016 15:06:45 -0700 Subject: [PATCH 082/174] wrote some fixtures --- app/controllers/sessions_controller.rb | 6 ----- config/routes.rb | 5 ++-- test/fixtures/orderitems.yml | 6 +++++ test/fixtures/orders.yml | 28 +++++++++++++++++++++ test/fixtures/products.yml | 22 +++++++++++++++++ test/fixtures/reviews.yml | 10 ++++++++ test/fixtures/users.yml | 34 +++++++++++++------------- 7 files changed, 85 insertions(+), 26 deletions(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 39fb2f8e68..686e3cb06c 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,6 +1,5 @@ class SessionsController < ApplicationController def new - end def create @@ -20,10 +19,5 @@ def destroy redirect_to root_path end - def new_order_session - order = Order.create - session[:order_id] = order.id - end - end diff --git a/config/routes.rb b/config/routes.rb index ff3fe16257..a21491c7bd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,8 +9,7 @@ resources :products, :only => [:index, :show, :create] - get '/products/category/:animal' => 'products#show_animal', as: 'product_animal' - get '/products/animal/:category' => 'products#show_category', as: 'product_category' + get '/products/category/:category' => 'products#show_category', as: 'product_category' get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' post '/users/:id/products' => 'products#create' @@ -30,7 +29,7 @@ resources :sessions, :only => [:new, :create] get "/logout" => "sessions#destroy" get "/orders/:id/checkout" => 'orders#checkout', as: 'order_checkout' - patch "/orders/:id/checkout" => "orders#confirmation" + patch "/orders/:id/checkout" => "orders#confirmation" as: 'order_confirmation' get '/orders/:id/confirmation' => 'orders#confirmation', as: "order_confirmation" end diff --git a/test/fixtures/orderitems.yml b/test/fixtures/orderitems.yml index 937a0c002e..aef58af322 100644 --- a/test/fixtures/orderitems.yml +++ b/test/fixtures/orderitems.yml @@ -9,3 +9,9 @@ one: {} # two: {} # column: value + +first_orderitem: + quantity: 2 + price: 12 + order_id: 5 + product_id: 1 diff --git a/test/fixtures/orders.yml b/test/fixtures/orders.yml index 937a0c002e..af85f42934 100644 --- a/test/fixtures/orders.yml +++ b/test/fixtures/orders.yml @@ -9,3 +9,31 @@ one: {} # two: {} # column: value + +first_order: + status: "pending" + price: 5 + user_id: + email: user@user.com + street_address: 128 Petsy Blvd + city: Petville + state: WA + name_on_credit_card: Mr Doggy Dog + credit_card_number: 9999 + credit_card_exp_date: 2018-05-02 + credit_card_cvv: 888 + billing_zip: 12345 + +second_order: + status: "complete" + price: 90 + user_id: 2 + email: other_user@user.com + street_address: 4 Dog Road + city: Dogville + state: WA + name_on_credit_card: Mrs Second Order + credit_card_number: 9876 + credit_card_exp_date: 2019-05-02 + credit_card_cvv: 798 + billing_zip: 54321 diff --git a/test/fixtures/products.yml b/test/fixtures/products.yml index 937a0c002e..b88dd51e03 100644 --- a/test/fixtures/products.yml +++ b/test/fixtures/products.yml @@ -9,3 +9,25 @@ one: {} # two: {} # column: value + +dog_pirate: + name: Dog Pirate + price: 12 + quantity: 9 + rating: 4 + category: pirate + photo_url: http://www.dog-pirate.com + status: Pending + user_id: 2 + animal: Dog + +sushi_cat: + name: Sushi Cat + price: 200 + quantity: 5 + rating: 3 + category: Food + photo_url: http://www.sushi-cat.com + status: Pending + user_id: 3 + animal: Cat diff --git a/test/fixtures/reviews.yml b/test/fixtures/reviews.yml index 937a0c002e..e1bb22c894 100644 --- a/test/fixtures/reviews.yml +++ b/test/fixtures/reviews.yml @@ -9,3 +9,13 @@ one: {} # two: {} # column: value + +dog_pirate_review1: + description: Dog Pirate is the best. + rating: 3 + product_id: 1 + +dog_pirate_review2: + description: I love my dog pirate. + rating: 5 + product_id: 1 diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index 8c71b6dac9..e027bd09d8 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -1,21 +1,21 @@ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html -one: - username: MyString - email: MyString - password: MyString - full_name: MyString - cc_number: 1 +dog_merchant: + username: dogs_yes + email: dog@dog.com + password_digest: <%= BCrypt::Password.create('password', cost: 1) %> + full_name: Dog Merchant + cc_number: 5555 exp_date: 2016-05-02 - cvv: 1 - zip: 1 + cvv: 333 + zip: 11111 -two: - username: MyString - email: MyString - password: MyString - full_name: MyString - cc_number: 1 - exp_date: 2016-05-02 - cvv: 1 - zip: 1 +cat_merchant: + username: cats_yes + email: cat@cat.com + password_digest: <%= BCrypt::Password.create('other_password', cost: 1) %> + full_name: Cat Merchant + cc_number: 6666 + exp_date: 2017-05-02 + cvv: 444 + zip: 22222 From c5bad61b09bada21983bbb7ef483d8a67d410001 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Sun, 8 May 2016 15:15:39 -0700 Subject: [PATCH 083/174] wrote some tests for user --- config/routes.rb | 2 +- test/models/user_test.rb | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index a21491c7bd..12d6b6ab02 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -29,7 +29,7 @@ resources :sessions, :only => [:new, :create] get "/logout" => "sessions#destroy" get "/orders/:id/checkout" => 'orders#checkout', as: 'order_checkout' - patch "/orders/:id/checkout" => "orders#confirmation" as: 'order_confirmation' + patch "/orders/:id/checkout" => "orders#confirmation" get '/orders/:id/confirmation' => 'orders#confirmation', as: "order_confirmation" end diff --git a/test/models/user_test.rb b/test/models/user_test.rb index 82f61e0109..5ffcfbb881 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -1,7 +1,20 @@ require 'test_helper' class UserTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end + + test "validations: username can't be blank" do + user = User.new + + assert_not user.valid? + assert user.errors.keys.include?(:username), "username is not in the errors hash" + end + + + test "validations: email can't be blank" do + user = User.new + + assert_not user.valid? + assert user.errors.keys.include?(:email), "email is not in the errors hash" + end + end From 2a440dc46d78b95bac66fa93edb435825bbe1a94 Mon Sep 17 00:00:00 2001 From: Jessica Date: Sun, 8 May 2016 15:26:50 -0700 Subject: [PATCH 084/174] more css --- app/controllers/home_controller.rb | 1 - app/views/home/index.html.erb | 2 +- app/views/layouts/application.html.erb | 2 +- app/views/products/show_animal.html.erb | 19 ++++++++++--------- app/views/products/show_category.html.erb | 17 +++++++++-------- app/views/products/show_merchant.html.erb | 16 +++++++++------- 6 files changed, 30 insertions(+), 27 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 7443dcb28d..d9c69362fc 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,5 +1,4 @@ class HomeController < ApplicationController - layout 'application' def index @products = Product.all @product_picker = Product.where.not(id: nil).sample(3) diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 088331fcdd..35a1de8d30 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -25,7 +25,7 @@
-

Featured Costumes

+

Featured Costumes


<% @product_picker.each do |product| %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 600d56b652..6fa3592b5b 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -2,7 +2,7 @@ - Betsy + Petsy <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> diff --git a/app/views/products/show_animal.html.erb b/app/views/products/show_animal.html.erb index 883f9f07f7..2342183f1a 100644 --- a/app/views/products/show_animal.html.erb +++ b/app/views/products/show_animal.html.erb @@ -1,12 +1,13 @@ +

<%= params[:animal] %> Costumes

-

<%= params[:animal] %> Costumes

-
-
<% @products.each do |product| %> - - -
- <%= product.description %> +
+
+ <% unless product.photo_url.nil? %> + + <% end %>
+
+

<%= product.description %>

$<%= number_with_precision product.price, precision: 2 %> <%= form_tag '/orderitems' do %> @@ -15,8 +16,8 @@ <%= hidden_field_tag :quantity, 1 %> <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
<% end %> +
<%= product.quantity %> - <% end %> -
+ <% end %> diff --git a/app/views/products/show_category.html.erb b/app/views/products/show_category.html.erb index 9751ec3ae3..0dc6fdad6f 100644 --- a/app/views/products/show_category.html.erb +++ b/app/views/products/show_category.html.erb @@ -1,10 +1,12 @@ +

<%= params[:category] %> Costumes

-

<%= params[:category] %> Costumes

-
-
<% @products.each do |product| %> - - +
+
+ <% unless product.photo_url.nil? %> + + <% end %>
+

<%= product.description %> $<%= number_with_precision product.price, precision: 2 %> @@ -12,10 +14,9 @@ <%= form_tag '/orderitems' do %> <%= link_to product.name, product_path(product.id) %> <%= hidden_field_tag :product_id, product.id %>
- <%= hidden_field_tag :quantity, 1 %> <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
<% end %> +
<%= product.quantity %> - <% end %> -
+ <% end %> diff --git a/app/views/products/show_merchant.html.erb b/app/views/products/show_merchant.html.erb index f7228d4e5e..c0c58ee815 100644 --- a/app/views/products/show_merchant.html.erb +++ b/app/views/products/show_merchant.html.erb @@ -1,11 +1,12 @@ -

Costumes by <%= params[:full_name] %>

+

Costumes by <%= params[:full_name] %>

-
-
<% @products.each do |product| %> - - - +
+
+ <% unless product.photo_url.nil? %> + + <% end %>
+

<%= product.description %> $<%= number_with_precision product.price, precision: 2 %> @@ -17,6 +18,7 @@ <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
<% end %> <%= product.quantity %> - <% end %> +
+ <% end %>
\ No newline at end of file From 31d7af68595d8081686dcd7d54099223fdfa6063 Mon Sep 17 00:00:00 2001 From: Jessica Date: Sun, 8 May 2016 15:40:53 -0700 Subject: [PATCH 085/174] committing so i can merge --- app/views/layouts/application.html.erb | 2 +- app/views/products/new.html.erb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 600d56b652..6fa3592b5b 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -2,7 +2,7 @@ - Betsy + Petsy <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> diff --git a/app/views/products/new.html.erb b/app/views/products/new.html.erb index a193cff215..4edb154bd5 100644 --- a/app/views/products/new.html.erb +++ b/app/views/products/new.html.erb @@ -14,6 +14,8 @@ <%= f.label :quantity %> <%= f.select(:quantity, options_for_select(1..10)) %>
+ <%= f.label :animal %> + <%= f.radio_button_tag(:animal, "Dog") <%= f.label :category %> <%= f.select(:category, options_for_select(["Cat", "Dog", "Guinea Pig", "Goat"])) %>
From 678a5f6c2b20ebd7e120a11ebe313f474859a73a Mon Sep 17 00:00:00 2001 From: Jessica Date: Sun, 8 May 2016 17:03:13 -0700 Subject: [PATCH 086/174] added bootstrap stuff to sign up form --- Gemfile | 4 - app/assets/stylesheets/application.css | 8 +- app/views/products/new.html.erb | 7 +- app/views/sessions/new.html.erb | 4 +- app/views/users/new.html.erb | 51 ++++-- config/initializers/simple_form.rb | 165 +++++++++++++++++++ config/initializers/simple_form_bootstrap.rb | 149 +++++++++++++++++ config/locales/simple_form.en.yml | 31 ++++ config/routes.rb | 13 +- lib/templates/erb/scaffold/_form.html.erb | 13 ++ 10 files changed, 409 insertions(+), 36 deletions(-) create mode 100644 config/initializers/simple_form.rb create mode 100644 config/initializers/simple_form_bootstrap.rb create mode 100644 config/locales/simple_form.en.yml create mode 100644 lib/templates/erb/scaffold/_form.html.erb diff --git a/Gemfile b/Gemfile index fd9c346d1c..1417edec6f 100644 --- a/Gemfile +++ b/Gemfile @@ -12,10 +12,6 @@ gem 'sass-rails', '~> 5.0' gem 'uglifier', '>= 1.3.0' # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.1.0' -# See https://github.com/rails/execjs#readme for more supported runtimes -# gem 'therubyracer', platforms: :ruby - -# Use jquery as the JavaScript library gem 'jquery-rails' # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks gem 'turbolinks' diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 61f92fc9de..6b42467ce1 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,11 +1,12 @@ + * { font-family: 'Lora', serif; letter-spacing: 1px; font-size: 20px; } -h1 { - padding-left: 3%; +h1{ + text-align: center; } .view-link { @@ -29,6 +30,9 @@ li.logged-in { padding-top: 10px; } +.btn-success { + margin-left: 34%; +} .sidebar { border-right: solid 1px; margin: 2% 5% 2% 2%; diff --git a/app/views/products/new.html.erb b/app/views/products/new.html.erb index 4edb154bd5..c1344ecce5 100644 --- a/app/views/products/new.html.erb +++ b/app/views/products/new.html.erb @@ -14,10 +14,11 @@ <%= f.label :quantity %> <%= f.select(:quantity, options_for_select(1..10)) %>
- <%= f.label :animal %> - <%= f.radio_button_tag(:animal, "Dog") + <%= f.radio_button(:animal, "Cat") %> + <%= f.label(:animal, "Cat", :value => 'Cat') %> +
<%= f.label :category %> - <%= f.select(:category, options_for_select(["Cat", "Dog", "Guinea Pig", "Goat"])) %> + <%= f.select(:category, options_for_select(["Food"])) %>
<%= f.label :'Photo URL' %> <%= f.url_field(:photo_url) %> diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index b271e347b9..8752a490ff 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,3 +1,4 @@ +

Sign In

<%= form_tag sessions_path, method: :post do %> <%= label_tag :username, "Username:" %> @@ -6,5 +7,6 @@ <%= label_tag :password, "Password (secret):" %> <%= password_field_tag :password %> ​ - <%= submit_tag "Sign In", class: 'btn btn-success' %> + <%= submit_tag "Sign In", class: "btn btn-success" %> <% end %> + diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 7e0f8d707d..a2b1fad55b 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -1,4 +1,4 @@ -

Register for Petsy!

+

Register for Petsy!

<% if @user.errors.any? %>

Grr... didn't work. :(

@@ -10,21 +10,36 @@
<% end %> ​ -<%= form_for @user do |f| %> - <%= f.label :username %> - <%= f.text_field :username %> - - <%= f.label :full_name %> - <%= f.text_field :full_name %> -​ - <%= f.label :email %> - <%= f.email_field :email %> -​ - <%= f.label :password %> - <%= f.password_field :password %> -​ - <%= f.label :password_confirmation %> - <%= f.password_field :password_confirmation %> -​ - <%= f.submit %> +<%= form_for @user, :html => { :class => "form-horizontal center" } do |f| %> +
+ <%= f.label :username, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :username, class: "form-control" %> +
+​
+
+ <%= f.label :full_name, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :full_name, class: "form-control" %> +​
+​
+
+ <%= f.label :email, class: "col-xs-4 control-label" %> +
+ <%= f.email_field :email, class: "form-control" %> +​
+​
+
+ <%= f.label :password, class: "col-xs-4 control-label" %> +
+ <%= f.password_field :password, class: "form-control" %> +​
+
+
+ <%= f.label :password_confirmation, class: "col-xs-4 control-label" %> +
+ <%= f.password_field :password_confirmation, class: "form-control" %> +
+
+ <%= f.submit "Create Account", class: "register-btn", class: "btn btn-success" %> <% end %> diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb new file mode 100644 index 0000000000..934487af6a --- /dev/null +++ b/config/initializers/simple_form.rb @@ -0,0 +1,165 @@ +# Use this setup block to configure all options available in SimpleForm. +SimpleForm.setup do |config| + # Wrappers are used by the form builder to generate a + # complete input. You can remove any component from the + # wrapper, change the order or even add your own to the + # stack. The options given below are used to wrap the + # whole input. + config.wrappers :default, class: :input, + hint_class: :field_with_hint, error_class: :field_with_errors do |b| + ## Extensions enabled by default + # Any of these extensions can be disabled for a + # given input by passing: `f.input EXTENSION_NAME => false`. + # You can make any of these extensions optional by + # renaming `b.use` to `b.optional`. + + # Determines whether to use HTML5 (:email, :url, ...) + # and required attributes + b.use :html5 + + # Calculates placeholders automatically from I18n + # You can also pass a string as f.input placeholder: "Placeholder" + b.use :placeholder + + ## Optional extensions + # They are disabled unless you pass `f.input EXTENSION_NAME => true` + # to the input. If so, they will retrieve the values from the model + # if any exists. If you want to enable any of those + # extensions by default, you can change `b.optional` to `b.use`. + + # Calculates maxlength from length validations for string inputs + b.optional :maxlength + + # Calculates pattern from format validations for string inputs + b.optional :pattern + + # Calculates min and max from length validations for numeric inputs + b.optional :min_max + + # Calculates readonly automatically from readonly attributes + b.optional :readonly + + ## Inputs + b.use :label_input + b.use :hint, wrap_with: { tag: :span, class: :hint } + b.use :error, wrap_with: { tag: :span, class: :error } + + ## full_messages_for + # If you want to display the full error message for the attribute, you can + # use the component :full_error, like: + # + # b.use :full_error, wrap_with: { tag: :span, class: :error } + end + + # The default wrapper to be used by the FormBuilder. + config.default_wrapper = :default + + # Define the way to render check boxes / radio buttons with labels. + # Defaults to :nested for bootstrap config. + # inline: input + label + # nested: label > input + config.boolean_style = :nested + + # Default class for buttons + config.button_class = 'btn' + + # Method used to tidy up errors. Specify any Rails Array method. + # :first lists the first message for each field. + # Use :to_sentence to list all errors for each field. + # config.error_method = :first + + # Default tag used for error notification helper. + config.error_notification_tag = :div + + # CSS class to add for error notification helper. + config.error_notification_class = 'error_notification' + + # ID to add for error notification helper. + # config.error_notification_id = nil + + # Series of attempts to detect a default label method for collection. + # config.collection_label_methods = [ :to_label, :name, :title, :to_s ] + + # Series of attempts to detect a default value method for collection. + # config.collection_value_methods = [ :id, :to_s ] + + # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none. + # config.collection_wrapper_tag = nil + + # You can define the class to use on all collection wrappers. Defaulting to none. + # config.collection_wrapper_class = nil + + # You can wrap each item in a collection of radio/check boxes with a tag, + # defaulting to :span. + # config.item_wrapper_tag = :span + + # You can define a class to use in all item wrappers. Defaulting to none. + # config.item_wrapper_class = nil + + # How the label text should be generated altogether with the required text. + # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" } + + # You can define the class to use on all labels. Default is nil. + # config.label_class = nil + + # You can define the default class to be used on forms. Can be overriden + # with `html: { :class }`. Defaulting to none. + # config.default_form_class = nil + + # You can define which elements should obtain additional classes + # config.generate_additional_classes_for = [:wrapper, :label, :input] + + # Whether attributes are required by default (or not). Default is true. + # config.required_by_default = true + + # Tell browsers whether to use the native HTML5 validations (novalidate form option). + # These validations are enabled in SimpleForm's internal config but disabled by default + # in this configuration, which is recommended due to some quirks from different browsers. + # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations, + # change this configuration to true. + config.browser_validations = false + + # Collection of methods to detect if a file type was given. + # config.file_methods = [ :mounted_as, :file?, :public_filename ] + + # Custom mappings for input types. This should be a hash containing a regexp + # to match as key, and the input type that will be used when the field name + # matches the regexp as value. + # config.input_mappings = { /count/ => :integer } + + # Custom wrappers for input types. This should be a hash containing an input + # type as key and the wrapper that will be used for all inputs with specified type. + # config.wrapper_mappings = { string: :prepend } + + # Namespaces where SimpleForm should look for custom input classes that + # override default inputs. + # config.custom_inputs_namespaces << "CustomInputs" + + # Default priority for time_zone inputs. + # config.time_zone_priority = nil + + # Default priority for country inputs. + # config.country_priority = nil + + # When false, do not use translations for labels. + # config.translate_labels = true + + # Automatically discover new inputs in Rails' autoload path. + # config.inputs_discovery = true + + # Cache SimpleForm inputs discovery + # config.cache_discovery = !Rails.env.development? + + # Default class for inputs + # config.input_class = nil + + # Define the default class of the input wrapper of the boolean input. + config.boolean_label_class = 'checkbox' + + # Defines if the default input wrapper class should be included in radio + # collection wrappers. + # config.include_default_input_wrapper_class = true + + # Defines which i18n scope will be used in Simple Form. + # config.i18n_scope = 'simple_form' +end diff --git a/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb new file mode 100644 index 0000000000..109d29a370 --- /dev/null +++ b/config/initializers/simple_form_bootstrap.rb @@ -0,0 +1,149 @@ +# Use this setup block to configure all options available in SimpleForm. +SimpleForm.setup do |config| + config.error_notification_class = 'alert alert-danger' + config.button_class = 'btn btn-default' + config.boolean_label_class = nil + + config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :pattern + b.optional :min_max + b.optional :readonly + b.use :label, class: 'control-label' + + b.use :input, class: 'form-control' + b.use :error, wrap_with: { tag: 'span', class: 'help-block' } + b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } + end + + config.wrappers :vertical_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :readonly + b.use :label, class: 'control-label' + + b.use :input + b.use :error, wrap_with: { tag: 'span', class: 'help-block' } + b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } + end + + config.wrappers :vertical_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| + b.use :html5 + b.optional :readonly + + b.wrapper tag: 'div', class: 'checkbox' do |ba| + ba.use :label_input + end + + b.use :error, wrap_with: { tag: 'span', class: 'help-block' } + b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } + end + + config.wrappers :vertical_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| + b.use :html5 + b.optional :readonly + b.use :label, class: 'control-label' + b.use :input + b.use :error, wrap_with: { tag: 'span', class: 'help-block' } + b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } + end + + config.wrappers :horizontal_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :pattern + b.optional :min_max + b.optional :readonly + b.use :label, class: 'col-sm-3 control-label' + + b.wrapper tag: 'div', class: 'col-sm-9' do |ba| + ba.use :input, class: 'form-control' + ba.use :error, wrap_with: { tag: 'span', class: 'help-block' } + ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' } + end + end + + config.wrappers :horizontal_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :readonly + b.use :label, class: 'col-sm-3 control-label' + + b.wrapper tag: 'div', class: 'col-sm-9' do |ba| + ba.use :input + ba.use :error, wrap_with: { tag: 'span', class: 'help-block' } + ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' } + end + end + + config.wrappers :horizontal_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| + b.use :html5 + b.optional :readonly + + b.wrapper tag: 'div', class: 'col-sm-offset-3 col-sm-9' do |wr| + wr.wrapper tag: 'div', class: 'checkbox' do |ba| + ba.use :label_input + end + + wr.use :error, wrap_with: { tag: 'span', class: 'help-block' } + wr.use :hint, wrap_with: { tag: 'p', class: 'help-block' } + end + end + + config.wrappers :horizontal_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| + b.use :html5 + b.optional :readonly + + b.use :label, class: 'col-sm-3 control-label' + + b.wrapper tag: 'div', class: 'col-sm-9' do |ba| + ba.use :input + ba.use :error, wrap_with: { tag: 'span', class: 'help-block' } + ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' } + end + end + + config.wrappers :inline_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| + b.use :html5 + b.use :placeholder + b.optional :maxlength + b.optional :pattern + b.optional :min_max + b.optional :readonly + b.use :label, class: 'sr-only' + + b.use :input, class: 'form-control' + b.use :error, wrap_with: { tag: 'span', class: 'help-block' } + b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } + end + + config.wrappers :multi_select, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| + b.use :html5 + b.optional :readonly + b.use :label, class: 'control-label' + b.wrapper tag: 'div', class: 'form-inline' do |ba| + ba.use :input, class: 'form-control' + ba.use :error, wrap_with: { tag: 'span', class: 'help-block' } + ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' } + end + end + # Wrappers for forms and inputs using the Bootstrap toolkit. + # Check the Bootstrap docs (http://getbootstrap.com) + # to learn about the different styles for forms and inputs, + # buttons and other elements. + config.default_wrapper = :vertical_form + config.wrapper_mappings = { + check_boxes: :vertical_radio_and_checkboxes, + radio_buttons: :vertical_radio_and_checkboxes, + file: :vertical_file_input, + boolean: :vertical_boolean, + datetime: :multi_select, + date: :multi_select, + time: :multi_select + } +end diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml new file mode 100644 index 0000000000..2374383342 --- /dev/null +++ b/config/locales/simple_form.en.yml @@ -0,0 +1,31 @@ +en: + simple_form: + "yes": 'Yes' + "no": 'No' + required: + text: 'required' + mark: '*' + # You can uncomment the line below if you need to overwrite the whole required html. + # When using html, text and mark won't be used. + # html: '*' + error_notification: + default_message: "Please review the problems below:" + # Examples + # labels: + # defaults: + # password: 'Password' + # user: + # new: + # email: 'E-mail to sign in.' + # edit: + # email: 'E-mail.' + # hints: + # defaults: + # username: 'User name to sign in.' + # password: 'No special characters, please.' + # include_blanks: + # defaults: + # age: 'Rather not say' + # prompts: + # defaults: + # age: 'Select your age' diff --git a/config/routes.rb b/config/routes.rb index ff3fe16257..ebaa1fccb2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,21 +2,14 @@ root 'home#index' - resources :users, :only => [:index, :new, :create] #do - - # resources :products, :only => [:show, :new] - # end + resources :users, :only => [:index, :new, :create] resources :products, :only => [:index, :show, :create] - get '/products/category/:animal' => 'products#show_animal', as: 'product_animal' - get '/products/animal/:category' => 'products#show_category', as: 'product_category' - get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' post '/users/:id/products' => 'products#create' get '/users/:id/products/:id/edit' => 'products#edit', as: 'edit_product' patch '/users/:user_id/products' => 'products#update', as: 'update_product' - get '/users/:id/products' => 'products#show_seller_products', as: 'user_product' resources :orders get '/users/:id/orders' => 'orders#show_seller_orders', as: 'show_seller_orders' @@ -33,4 +26,8 @@ patch "/orders/:id/checkout" => "orders#confirmation" get '/orders/:id/confirmation' => 'orders#confirmation', as: "order_confirmation" + get '/products/category/:animal' => 'products#show_animal', as: 'product_animal' + get '/users/:id/products' => 'products#show_seller_products', as: 'user_product' + get '/products/animal/:category' => 'products#show_category', as: 'product_category' + get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' end diff --git a/lib/templates/erb/scaffold/_form.html.erb b/lib/templates/erb/scaffold/_form.html.erb new file mode 100644 index 0000000000..201a069e2c --- /dev/null +++ b/lib/templates/erb/scaffold/_form.html.erb @@ -0,0 +1,13 @@ +<%%= simple_form_for(@<%= singular_table_name %>) do |f| %> + <%%= f.error_notification %> + +
+ <%- attributes.each do |attribute| -%> + <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %> + <%- end -%> +
+ +
+ <%%= f.button :submit %> +
+<%% end %> From 7277100f8fae2299a36b1c851322a2f411c41f55 Mon Sep 17 00:00:00 2001 From: Jessica Date: Sun, 8 May 2016 18:20:07 -0700 Subject: [PATCH 087/174] made a footer with super cute paw prints --- app/assets/images/dog_print.jpg | Bin 0 -> 3444 bytes app/assets/images/goat_paw.jpg | Bin 0 -> 84024 bytes app/assets/images/guinea_paw.jpg | Bin 0 -> 26668 bytes app/assets/stylesheets/application.css | 54 +++++++++++++++++++++--- app/views/home/index.html.erb | 18 ++++---- app/views/layouts/application.html.erb | 12 +++++- app/views/products/index.html.erb | 1 - app/views/products/show_animal.html.erb | 5 +-- 8 files changed, 70 insertions(+), 20 deletions(-) create mode 100644 app/assets/images/dog_print.jpg create mode 100644 app/assets/images/goat_paw.jpg create mode 100644 app/assets/images/guinea_paw.jpg diff --git a/app/assets/images/dog_print.jpg b/app/assets/images/dog_print.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5d03942ff3193d00f331f5896cdaa8a7410d518e GIT binary patch literal 3444 zcmV-)4U6)LP)=H`QggVoj5w6wIx$H&dh&GPc{Y;0^56%{Kh zE2pQY!NI{;SXfO>O?i2F;^N|xl9CP%4s&yJF)=Y8A0IwGJ~=r#P*6}^U0p^-MkFL8 zpP!$8etu(PV~L506B85b$_}jn01UKAL_t(|oYh^~V(K~!^a*8aC~JT=Kv_%s|6h1n z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MO&lobgU=O$yjnbharCfpDOTWRWQ1Lv z2iq4NrO(T^TL_z~Lc4ATLkH*eQ^r|IH{ps!kd=-nsO-|o`?qJzp+YL?Sw9%CC6IE1 zlKfUuEHs*rGfGO`D`RGA*!cQ!hB~md$I{Z${7Lb7PQiyM%1k#e$X9}<$azWjYrA>X-bqM2^IpkKOPc0LbMo&4l2i=9%QE&D ziHMMW>zkOU4VB5Di1*Q4nq-Nf$Nusk-)RHyYifTaTGlpgQ5r_K!g&V@heWS~-lhe( zxn#ES@eD7PX0OcaI$|kQ9 z=m_e?c4s}!OjIMoxQcwXcg7@&aImBK)$$>4oF1eWh+AJZ)iP^vO)Z3^C~G;p?A4^) zKBqYx^u&~z$V&`VhIGJTkF7NemW2{Bu)$9Br5Ld%`2__xL}yIK4nKg6!T`~LugUBKx8 literal 0 HcmV?d00001 diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 6b42467ce1..16fc4e6ade 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,10 +1,53 @@ * { + box-sizing: border-box; font-family: 'Lora', serif; letter-spacing: 1px; font-size: 20px; + margin: 0; } +html, body { +/* min-height: 100%; +*/ height: 100%; +} + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -3em; +} + +.footer, .push { + height: 3em; + clear: both; +} + +footer { + text-align: right; + padding-right: 5%; +} + +.footer-paws { + margin-top: 1%; + margin-bottom: 1%; + margin-left: 2%; + height: 30px; + width: 30px; +} + + +/*/*div.container { + margin-right: auto; + margin-left: auto; +}*/ + +/*.footer > div.container { + padding-right: 15px; + padding-left: 15px; +} +*/ h1{ text-align: center; } @@ -17,6 +60,10 @@ h1{ font-size: 25px; } +.front-description { + text-align: center; +} + div.header { float: right; display: inline; @@ -49,13 +96,6 @@ header { padding: 1% 2% 0 2%; } -div.container { - display:flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: space-between; -} - div.product { padding: 20px; margin-bottom: 20px; diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 35a1de8d30..992439eb60 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,4 +1,3 @@ -<%= link_to "View all costumes", products_path, class: "view-link" %> +<%= link_to "View all costumes", products_path, class: "view-link" %>

    Featured Costumes


    <% @product_picker.each do |product| %> @@ -34,12 +34,14 @@ <% end %>
-<%= link_to product.name, product_path(product.id) %> -$<%= number_with_precision product.price, precision: 2 %> - <%= form_tag '/orderitems' do %> - <%= hidden_field_tag :product_id, product.id %>
- <%= hidden_field_tag :quantity, 1 %> - <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
- <% end %> +
+ <%= link_to product.name, product_path(product.id) %>
+ $<%= number_with_precision product.price, precision: 2 %> + <%= form_tag '/orderitems' do %> + <%= hidden_field_tag :product_id, product.id %>
+ <%= hidden_field_tag :quantity, 1 %> + <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
+ <% end %> +
<% end %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6fa3592b5b..4742eb63d5 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -12,7 +12,7 @@ <%= csrf_meta_tags %> - +
+ +
+
+<%= image_tag("goat_paw.jpg", class: "footer-paws") %> Alysia +<%= image_tag("dog_print.jpg", class: "footer-paws") %> Deirdre +<%= image_tag("guinea_paw.jpg", class: "footer-paws") %> Jess +
+ diff --git a/app/views/products/index.html.erb b/app/views/products/index.html.erb index 9b9e09c43e..e45112293a 100644 --- a/app/views/products/index.html.erb +++ b/app/views/products/index.html.erb @@ -7,7 +7,6 @@ <% end %>
<%= link_to product.name, product_path(product.id) %>
- <%= product.description %>
$<%= number_with_precision product.price, precision: 2 %>
<%= form_tag '/orderitems' do %> diff --git a/app/views/products/show_animal.html.erb b/app/views/products/show_animal.html.erb index 2342183f1a..b864994c1b 100644 --- a/app/views/products/show_animal.html.erb +++ b/app/views/products/show_animal.html.erb @@ -7,11 +7,10 @@ <% end %>
-

<%= product.description %>

- $<%= number_with_precision product.price, precision: 2 %> <%= form_tag '/orderitems' do %> - <%= link_to product.name, product_path(product.id) %> + <%= link_to product.name, product_path(product.id) %>
+ $<%= number_with_precision product.price, precision: 2 %> <%= hidden_field_tag :product_id, product.id %>
<%= hidden_field_tag :quantity, 1 %> <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
From 6dbd7a4c07d29cbae5bc2032e4e46b92213530d3 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Sun, 8 May 2016 18:33:27 -0700 Subject: [PATCH 088/174] tried to fix weird issue with routes --- config/routes.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 12d6b6ab02..0d72fd24fb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,7 +9,9 @@ resources :products, :only => [:index, :show, :create] - get '/products/category/:category' => 'products#show_category', as: 'product_category' + + get '/products/category/:animal' => 'products#show_animal', as: 'product_animal' + get '/products/animal/:category' => 'products#show_category', as: 'product_category' get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' post '/users/:id/products' => 'products#create' From 7437dbd840944e28f58655796c1dc7f87cb74fd9 Mon Sep 17 00:00:00 2001 From: Jessica Date: Sun, 8 May 2016 19:17:09 -0700 Subject: [PATCH 089/174] css done for cart edit page --- app/assets/stylesheets/application.css | 36 ++++++++++++-------------- app/views/layouts/application.html.erb | 8 +++--- app/views/orders/edit.html.erb | 26 +++++++++++-------- app/views/sessions/new.html.erb | 22 ++++++++++------ 4 files changed, 50 insertions(+), 42 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 16fc4e6ade..a2d19bfb8f 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -8,8 +8,7 @@ } html, body { -/* min-height: 100%; -*/ height: 100%; + height: 100%; } .wrapper { @@ -27,6 +26,7 @@ html, body { footer { text-align: right; padding-right: 5%; + color: #003399; } .footer-paws { @@ -37,25 +37,20 @@ footer { width: 30px; } - -/*/*div.container { - margin-right: auto; - margin-left: auto; -}*/ - -/*.footer > div.container { - padding-right: 15px; - padding-left: 15px; -} -*/ h1{ text-align: center; } +h2.cart { + text-align: center; + margin-left: 30%; + font-weight: bolder; + color: #003399; +} + .view-link { text-decoration: none; float: right; - padding-top: 2%; padding-right: 10%; font-size: 25px; } @@ -81,7 +76,6 @@ li.logged-in { margin-left: 34%; } .sidebar { - border-right: solid 1px; margin: 2% 5% 2% 2%; } @@ -92,7 +86,6 @@ li.logged-in { header { height: 100px; width: 100%; - border-bottom: solid 1px; padding: 1% 2% 0 2%; } @@ -159,13 +152,13 @@ a { } .favoritepic img { + padding-top: 5%; width: 80%; display: block; margin: auto; } div.cart { - background-color:gray; width: 80%; margin: 10px 10px; } @@ -176,12 +169,17 @@ div.wholecart { } div.orderitem { - border: 2px solid black; - margin-top: 5px; + margin-top: 5%; + margin-left: 25%; } .orderitem img { height: 200px; } +.order-info { + float:right; + margin-right: 10%; +} + diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 4742eb63d5..d805a0b826 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -34,17 +34,17 @@
+
<%= yield %>
-
-<%= image_tag("goat_paw.jpg", class: "footer-paws") %> Alysia -<%= image_tag("dog_print.jpg", class: "footer-paws") %> Deirdre -<%= image_tag("guinea_paw.jpg", class: "footer-paws") %> Jess +<%= image_tag("goat_paw.jpg", class: "footer-paws") %> alysia +<%= image_tag("dog_print.jpg", class: "footer-paws") %> deirdre +<%= image_tag("guinea_paw.jpg", class: "footer-paws") %> jess
diff --git a/app/views/orders/edit.html.erb b/app/views/orders/edit.html.erb index 909b9d1bb5..b52908bb31 100644 --- a/app/views/orders/edit.html.erb +++ b/app/views/orders/edit.html.erb @@ -1,26 +1,30 @@
-

Cart:

+

Petsy Checkout!

<% @cart_price = 0 %>
<% @order.orderitems.each do |orderitem| %>
- <%= Product.find(orderitem.product_id).name %> - Price $<%=number_with_precision orderitem.total_price, precision: 2 %> +
+ <%= Product.find(orderitem.product_id).name %> +
Total Price $<%=number_with_precision orderitem.total_price, precision: 2 %> <% @cart_price += orderitem.total_price %> - <%=form_for orderitem do |f| %> - <%=f.label "Update Quantity" %> - <%=f.select 'quantity', options_for_select(@quantity_numbers, orderitem.quantity) %>
- <%=f.submit %> + <%= form_for orderitem do |f| %> + <%= f.label "Quantity" %> + <%= f.select 'quantity', options_for_select(@quantity_numbers, orderitem.quantity) %>
+ <%= f.submit "Update Quantity", class: "btn btn-info" %> <% end %> - <%= button_to "Remove from Cart", orderitem_path(orderitem.id), method: :delete %> - <% end %> +
+ <%= button_to "Remove from Cart", orderitem_path(orderitem.id), method: :delete, class: "btn btn-danger" %> +
+
+ <% end %> -

Total Price of Order: $<%= number_with_precision @cart_price , precision: 2 %>

- <%= button_to "Proceed to checkout", order_checkout_path(current_order.id), method: :get %> +

Total Price of Order: $<%= number_with_precision @cart_price , precision: 2 %> +

<%= button_to "Proceed to Checkout", order_checkout_path(current_order.id), method: :get, class: "btn btn-primary btn-lg" %>

diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 8752a490ff..a9930e2bed 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,12 +1,18 @@

Sign In

-<%= form_tag sessions_path, method: :post do %> - <%= label_tag :username, "Username:" %> - <%= text_field_tag :username %> -​ - <%= label_tag :password, "Password (secret):" %> - <%= password_field_tag :password %> -​ - <%= submit_tag "Sign In", class: "btn btn-success" %> +<%= form_for sessions_path, method: :post, :html => { :class => "form-horizontal center" } do |f| %> +
+ <%= f.label :username, "Username:", class: "col-xs-4 control-label" %> +
+ <%= f.text_field :username, class: "form-control" %> +
+​
+
+ <%= f.label :password, "Password (secret):", class: "col-xs-4 control-label" %> +
+ <%= f.password_field :password, class: "form-control" %> +​
+
+ <%= f.submit "Sign In", class: "btn btn-success" %> <% end %> From b0e0e0ee0efa4614a905461211b61ab972578ff9 Mon Sep 17 00:00:00 2001 From: Jessica Date: Sun, 8 May 2016 19:19:40 -0700 Subject: [PATCH 090/174] routes getting messed up - fixed them. there were duplicates at the end of the file --- config/routes.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index ac3fbf4780..4093ad9049 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -28,9 +28,4 @@ get "/orders/:id/checkout" => 'orders#checkout', as: 'order_checkout' patch "/orders/:id/checkout" => "orders#confirmation" get '/orders/:id/confirmation' => 'orders#confirmation', as: "order_confirmation" - - get '/products/category/:animal' => 'products#show_animal', as: 'product_animal' - get '/users/:id/products' => 'products#show_seller_products', as: 'user_product' - get '/products/animal/:category' => 'products#show_category', as: 'product_category' - get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' end From 98d9369dd38cde3f1a94b12aad87e0c2e27aa06c Mon Sep 17 00:00:00 2001 From: Jessica Date: Sun, 8 May 2016 20:25:23 -0700 Subject: [PATCH 091/174] removed a couple of useless files from a gem i tried to use earlier that was dumb and causing the server to not start. --- config/initializers/simple_form.rb | 165 ------------------- config/initializers/simple_form_bootstrap.rb | 149 ----------------- 2 files changed, 314 deletions(-) delete mode 100644 config/initializers/simple_form.rb delete mode 100644 config/initializers/simple_form_bootstrap.rb diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb deleted file mode 100644 index 934487af6a..0000000000 --- a/config/initializers/simple_form.rb +++ /dev/null @@ -1,165 +0,0 @@ -# Use this setup block to configure all options available in SimpleForm. -SimpleForm.setup do |config| - # Wrappers are used by the form builder to generate a - # complete input. You can remove any component from the - # wrapper, change the order or even add your own to the - # stack. The options given below are used to wrap the - # whole input. - config.wrappers :default, class: :input, - hint_class: :field_with_hint, error_class: :field_with_errors do |b| - ## Extensions enabled by default - # Any of these extensions can be disabled for a - # given input by passing: `f.input EXTENSION_NAME => false`. - # You can make any of these extensions optional by - # renaming `b.use` to `b.optional`. - - # Determines whether to use HTML5 (:email, :url, ...) - # and required attributes - b.use :html5 - - # Calculates placeholders automatically from I18n - # You can also pass a string as f.input placeholder: "Placeholder" - b.use :placeholder - - ## Optional extensions - # They are disabled unless you pass `f.input EXTENSION_NAME => true` - # to the input. If so, they will retrieve the values from the model - # if any exists. If you want to enable any of those - # extensions by default, you can change `b.optional` to `b.use`. - - # Calculates maxlength from length validations for string inputs - b.optional :maxlength - - # Calculates pattern from format validations for string inputs - b.optional :pattern - - # Calculates min and max from length validations for numeric inputs - b.optional :min_max - - # Calculates readonly automatically from readonly attributes - b.optional :readonly - - ## Inputs - b.use :label_input - b.use :hint, wrap_with: { tag: :span, class: :hint } - b.use :error, wrap_with: { tag: :span, class: :error } - - ## full_messages_for - # If you want to display the full error message for the attribute, you can - # use the component :full_error, like: - # - # b.use :full_error, wrap_with: { tag: :span, class: :error } - end - - # The default wrapper to be used by the FormBuilder. - config.default_wrapper = :default - - # Define the way to render check boxes / radio buttons with labels. - # Defaults to :nested for bootstrap config. - # inline: input + label - # nested: label > input - config.boolean_style = :nested - - # Default class for buttons - config.button_class = 'btn' - - # Method used to tidy up errors. Specify any Rails Array method. - # :first lists the first message for each field. - # Use :to_sentence to list all errors for each field. - # config.error_method = :first - - # Default tag used for error notification helper. - config.error_notification_tag = :div - - # CSS class to add for error notification helper. - config.error_notification_class = 'error_notification' - - # ID to add for error notification helper. - # config.error_notification_id = nil - - # Series of attempts to detect a default label method for collection. - # config.collection_label_methods = [ :to_label, :name, :title, :to_s ] - - # Series of attempts to detect a default value method for collection. - # config.collection_value_methods = [ :id, :to_s ] - - # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none. - # config.collection_wrapper_tag = nil - - # You can define the class to use on all collection wrappers. Defaulting to none. - # config.collection_wrapper_class = nil - - # You can wrap each item in a collection of radio/check boxes with a tag, - # defaulting to :span. - # config.item_wrapper_tag = :span - - # You can define a class to use in all item wrappers. Defaulting to none. - # config.item_wrapper_class = nil - - # How the label text should be generated altogether with the required text. - # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" } - - # You can define the class to use on all labels. Default is nil. - # config.label_class = nil - - # You can define the default class to be used on forms. Can be overriden - # with `html: { :class }`. Defaulting to none. - # config.default_form_class = nil - - # You can define which elements should obtain additional classes - # config.generate_additional_classes_for = [:wrapper, :label, :input] - - # Whether attributes are required by default (or not). Default is true. - # config.required_by_default = true - - # Tell browsers whether to use the native HTML5 validations (novalidate form option). - # These validations are enabled in SimpleForm's internal config but disabled by default - # in this configuration, which is recommended due to some quirks from different browsers. - # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations, - # change this configuration to true. - config.browser_validations = false - - # Collection of methods to detect if a file type was given. - # config.file_methods = [ :mounted_as, :file?, :public_filename ] - - # Custom mappings for input types. This should be a hash containing a regexp - # to match as key, and the input type that will be used when the field name - # matches the regexp as value. - # config.input_mappings = { /count/ => :integer } - - # Custom wrappers for input types. This should be a hash containing an input - # type as key and the wrapper that will be used for all inputs with specified type. - # config.wrapper_mappings = { string: :prepend } - - # Namespaces where SimpleForm should look for custom input classes that - # override default inputs. - # config.custom_inputs_namespaces << "CustomInputs" - - # Default priority for time_zone inputs. - # config.time_zone_priority = nil - - # Default priority for country inputs. - # config.country_priority = nil - - # When false, do not use translations for labels. - # config.translate_labels = true - - # Automatically discover new inputs in Rails' autoload path. - # config.inputs_discovery = true - - # Cache SimpleForm inputs discovery - # config.cache_discovery = !Rails.env.development? - - # Default class for inputs - # config.input_class = nil - - # Define the default class of the input wrapper of the boolean input. - config.boolean_label_class = 'checkbox' - - # Defines if the default input wrapper class should be included in radio - # collection wrappers. - # config.include_default_input_wrapper_class = true - - # Defines which i18n scope will be used in Simple Form. - # config.i18n_scope = 'simple_form' -end diff --git a/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb deleted file mode 100644 index 109d29a370..0000000000 --- a/config/initializers/simple_form_bootstrap.rb +++ /dev/null @@ -1,149 +0,0 @@ -# Use this setup block to configure all options available in SimpleForm. -SimpleForm.setup do |config| - config.error_notification_class = 'alert alert-danger' - config.button_class = 'btn btn-default' - config.boolean_label_class = nil - - config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.use :placeholder - b.optional :maxlength - b.optional :pattern - b.optional :min_max - b.optional :readonly - b.use :label, class: 'control-label' - - b.use :input, class: 'form-control' - b.use :error, wrap_with: { tag: 'span', class: 'help-block' } - b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - - config.wrappers :vertical_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.use :placeholder - b.optional :maxlength - b.optional :readonly - b.use :label, class: 'control-label' - - b.use :input - b.use :error, wrap_with: { tag: 'span', class: 'help-block' } - b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - - config.wrappers :vertical_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.optional :readonly - - b.wrapper tag: 'div', class: 'checkbox' do |ba| - ba.use :label_input - end - - b.use :error, wrap_with: { tag: 'span', class: 'help-block' } - b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - - config.wrappers :vertical_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.optional :readonly - b.use :label, class: 'control-label' - b.use :input - b.use :error, wrap_with: { tag: 'span', class: 'help-block' } - b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - - config.wrappers :horizontal_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.use :placeholder - b.optional :maxlength - b.optional :pattern - b.optional :min_max - b.optional :readonly - b.use :label, class: 'col-sm-3 control-label' - - b.wrapper tag: 'div', class: 'col-sm-9' do |ba| - ba.use :input, class: 'form-control' - ba.use :error, wrap_with: { tag: 'span', class: 'help-block' } - ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - end - - config.wrappers :horizontal_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.use :placeholder - b.optional :maxlength - b.optional :readonly - b.use :label, class: 'col-sm-3 control-label' - - b.wrapper tag: 'div', class: 'col-sm-9' do |ba| - ba.use :input - ba.use :error, wrap_with: { tag: 'span', class: 'help-block' } - ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - end - - config.wrappers :horizontal_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.optional :readonly - - b.wrapper tag: 'div', class: 'col-sm-offset-3 col-sm-9' do |wr| - wr.wrapper tag: 'div', class: 'checkbox' do |ba| - ba.use :label_input - end - - wr.use :error, wrap_with: { tag: 'span', class: 'help-block' } - wr.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - end - - config.wrappers :horizontal_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.optional :readonly - - b.use :label, class: 'col-sm-3 control-label' - - b.wrapper tag: 'div', class: 'col-sm-9' do |ba| - ba.use :input - ba.use :error, wrap_with: { tag: 'span', class: 'help-block' } - ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - end - - config.wrappers :inline_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.use :placeholder - b.optional :maxlength - b.optional :pattern - b.optional :min_max - b.optional :readonly - b.use :label, class: 'sr-only' - - b.use :input, class: 'form-control' - b.use :error, wrap_with: { tag: 'span', class: 'help-block' } - b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - - config.wrappers :multi_select, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.optional :readonly - b.use :label, class: 'control-label' - b.wrapper tag: 'div', class: 'form-inline' do |ba| - ba.use :input, class: 'form-control' - ba.use :error, wrap_with: { tag: 'span', class: 'help-block' } - ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - end - # Wrappers for forms and inputs using the Bootstrap toolkit. - # Check the Bootstrap docs (http://getbootstrap.com) - # to learn about the different styles for forms and inputs, - # buttons and other elements. - config.default_wrapper = :vertical_form - config.wrapper_mappings = { - check_boxes: :vertical_radio_and_checkboxes, - radio_buttons: :vertical_radio_and_checkboxes, - file: :vertical_file_input, - boolean: :vertical_boolean, - datetime: :multi_select, - date: :multi_select, - time: :multi_select - } -end From f0c44b6384deba3bdf495c4d0f07cdaf83a65bb1 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Mon, 9 May 2016 09:46:20 -0700 Subject: [PATCH 092/174] put user product path back in routes, it disappeared somehow --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 4093ad9049..e0f9bd0d9b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -13,6 +13,7 @@ post '/users/:id/products' => 'products#create' get '/users/:id/products/:id/edit' => 'products#edit', as: 'edit_product' patch '/users/:user_id/products' => 'products#update', as: 'update_product' + get '/users/:id/products' => 'products#show_seller_products', as: 'user_product' resources :orders get '/users/:id/orders' => 'orders#show_seller_orders', as: 'show_seller_orders' From 5a49eefaa9d064bbe5a92e55094dc17a68916c4e Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 9 May 2016 09:56:58 -0700 Subject: [PATCH 093/174] starting on css and form for checkout view. also added helper method for us states drop-down, and dropdowns for month and year od cc expiration date. --- app/assets/stylesheets/application.css | 4 ++ app/helpers/order_helper.rb | 55 +++++++++++++++++++ app/models/order.rb | 2 - app/views/orders/checkout.html.erb | 39 +++++++++---- app/views/sessions/new.html.erb | 2 +- ...63316_changg_c_cto_string_and_exp_to_dt.rb | 6 ++ db/schema.rb | 6 +- 7 files changed, 96 insertions(+), 18 deletions(-) create mode 100644 db/migrate/20160509163316_changg_c_cto_string_and_exp_to_dt.rb diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index a2d19bfb8f..de04e4897a 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -48,6 +48,10 @@ h2.cart { color: #003399; } +h4 { + text-align: center; +} + .view-link { text-decoration: none; float: right; diff --git a/app/helpers/order_helper.rb b/app/helpers/order_helper.rb index 05d197a0c1..a7488e7fee 100644 --- a/app/helpers/order_helper.rb +++ b/app/helpers/order_helper.rb @@ -1,2 +1,57 @@ module OrderHelper + def us_states + [ + ['AK', 'AK'], + ['AL', 'AL'], + ['AR', 'AR'], + ['AZ', 'AZ'], + ['CA', 'CA'], + ['CO', 'CO'], + ['CT', 'CT'], + ['DC', 'DC'], + ['DE', 'DE'], + ['FL', 'FL'], + ['GA', 'GA'], + ['HI', 'HI'], + ['IA', 'IA'], + ['ID', 'ID'], + ['IL', 'IL'], + ['IN', 'IN'], + ['KS', 'KS'], + ['KY', 'KY'], + ['LA', 'LA'], + ['MA', 'MA'], + ['MD', 'MD'], + ['ME', 'ME'], + ['MI', 'MI'], + ['MN', 'MN'], + ['MO', 'MO'], + ['MS', 'MS'], + ['MT', 'MT'], + ['NC', 'NC'], + ['ND', 'ND'], + ['NE', 'NE'], + ['NH', 'NH'], + ['NJ', 'NJ'], + ['NM', 'NM'], + ['NV', 'NV'], + ['NY', 'NY'], + ['OH', 'OH'], + ['OK', 'OK'], + ['OR', 'OR'], + ['PA', 'PA'], + ['RI', 'RI'], + ['SC', 'SC'], + ['SD', 'SD'], + ['TN', 'TN'], + ['TX', 'TX'], + ['UT', 'UT'], + ['VA', 'VA'], + ['VT', 'VT'], + ['WA', 'WA'], + ['WI', 'WI'], + ['WV', 'WV'], + ['WY', 'WY'] + ] +end end diff --git a/app/models/order.rb b/app/models/order.rb index cc1428becd..797da3a8f5 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -1,6 +1,4 @@ class Order < ActiveRecord::Base has_many :orderitems belongs_to :user - - end diff --git a/app/views/orders/checkout.html.erb b/app/views/orders/checkout.html.erb index 55dead4798..ce1581bd51 100644 --- a/app/views/orders/checkout.html.erb +++ b/app/views/orders/checkout.html.erb @@ -1,28 +1,43 @@

Complete your purchase:

-

To finish up, please provide all of the following information:

+

To finish up, please provide all of the following information:

<%= params %> -<%= form_for @order do |f|%> +<%= form_for @order, html: { :class => "form-horizontal center" } do |f| %> - - <%= f.label :email%> - <%= f.email_field :email %> - <%= f.label :street_address %> - <%= f.text_field :street_address %> +
+ <%= f.label :email, class: "col-xs-4 control-label" %> +
+ <%= f.email_field :email, class: "form-control" %> +
+​
+
+ <%= f.label :street_address, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :street_address, class: "form-control" %> +
+​
<%= f.label :city %> <%= f.text_field :city %> + <%= f.label :state %> - <%= f.text_field :state %> + <%= f.select(:state, options_for_select(us_states)) %> + <%= f.label :name_on_credit_card %> <%= f.text_field :name_on_credit_card%> + <%= f.label :credit_card_number %> <%= f.text_field :credit_card_number %> - <%= f.label :credit_card_exp_date %> - <%= f.text_field :credit_card_exp_date %> - <%= f.label :credit_card_cvv %> + + <%= f.label :credit_card_exp_date, "Credit Card Exp Date" %> + <%= f.date_select :credit_card_exp_date, :discard_day => true, :start_year => Date.today.year, :end_year => (Date.today.year + 10), order: [:month, :year] %> + + <%= f.label :"credit_card_cvv", "Credit Card CVV" %> <%= f.text_field :credit_card_cvv %> + <%= f.label :billing_zip %> <%= f.text_field :billing_zip %> - <%= f.hidden_field :status , :value => "Completed" %>
+ + <%= f.hidden_field :status , :value => "Completed" %> + <%= f.submit "Complete Purchase" %> <% end %> diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index a9930e2bed..d75d366a55 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,6 +1,6 @@

Sign In

-<%= form_for sessions_path, method: :post, :html => { :class => "form-horizontal center" } do |f| %> +<%= form_for sessions_path, method: :post, html: { :class => "form-horizontal center" } do |f| %>
<%= f.label :username, "Username:", class: "col-xs-4 control-label" %>
diff --git a/db/migrate/20160509163316_changg_c_cto_string_and_exp_to_dt.rb b/db/migrate/20160509163316_changg_c_cto_string_and_exp_to_dt.rb new file mode 100644 index 0000000000..d9a1d4790c --- /dev/null +++ b/db/migrate/20160509163316_changg_c_cto_string_and_exp_to_dt.rb @@ -0,0 +1,6 @@ +class ChanggCCtoStringAndExpToDt < ActiveRecord::Migration + def change + change_column :users, :cc_number, :string + change_column :users, :exp_date, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 2374adcd85..c53080a7c1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160507035811) do +ActiveRecord::Schema.define(version: 20160509163316) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -76,8 +76,8 @@ t.string "email" t.string "password" t.string "full_name" - t.integer "cc_number" - t.date "exp_date" + t.string "cc_number" + t.string "exp_date" t.integer "cvv" t.string "zip" t.datetime "created_at", null: false From 54bb29c4f7827447c1a6bba58b25b6bcc4d5fc81 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Mon, 9 May 2016 10:05:43 -0700 Subject: [PATCH 094/174] working on getting dropdowns to only show available quantity --- app/controllers/orders_controller.rb | 2 +- app/controllers/products_controller.rb | 3 ++- app/views/orders/edit.html.erb | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index f589f7b43a..f2cf8a2c69 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -11,7 +11,7 @@ def show_seller_orders def edit @order = Order.find(params[:id]) - @quantity_numbers = [1,2,3,4,5,6,7,8,9,10] + # @quantity_numbers = [1,2,3,4,5,6,7,8,9,10] @orderitems = Order.find(current_order.id).orderitems end diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 28797c9468..55185158ae 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -8,7 +8,8 @@ def index def show @product = Product.find(params[:id]) - @quantity_numbers = [1,2,3,4,5,6,7,8,9,10] + @quantity = @product.quantity + @quantity_numbers = (1..@quantity).to_a @rating = overall_rating(@product) end diff --git a/app/views/orders/edit.html.erb b/app/views/orders/edit.html.erb index b52908bb31..87f5b7aea1 100644 --- a/app/views/orders/edit.html.erb +++ b/app/views/orders/edit.html.erb @@ -11,6 +11,7 @@
Total Price $<%=number_with_precision orderitem.total_price, precision: 2 %> <% @cart_price += orderitem.total_price %> <%= form_for orderitem do |f| %> + <% @quantity_numbers = (1..orderitem.product.quantity).to_a %> <%= f.label "Quantity" %> <%= f.select 'quantity', options_for_select(@quantity_numbers, orderitem.quantity) %>
<%= f.submit "Update Quantity", class: "btn btn-info" %> From 6d5874a9940ef659b81ea04cabfcf22974adcc63 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 9 May 2016 10:23:26 -0700 Subject: [PATCH 095/174] bootstrap form for checkout done --- app/views/orders/checkout.html.erb | 69 +++++++++++++++++++----------- 1 file changed, 44 insertions(+), 25 deletions(-) diff --git a/app/views/orders/checkout.html.erb b/app/views/orders/checkout.html.erb index ce1581bd51..5a85b454db 100644 --- a/app/views/orders/checkout.html.erb +++ b/app/views/orders/checkout.html.erb @@ -1,7 +1,6 @@

Complete your purchase:

-

To finish up, please provide all of the following information:

-<%= params %> +

To finish up, please provide all of the following information:


<%= form_for @order, html: { :class => "form-horizontal center" } do |f| %>
@@ -16,28 +15,48 @@ <%= f.text_field :street_address, class: "form-control" %>
- <%= f.label :city %> - <%= f.text_field :city %> - - <%= f.label :state %> - <%= f.select(:state, options_for_select(us_states)) %> - - <%= f.label :name_on_credit_card %> - <%= f.text_field :name_on_credit_card%> - - <%= f.label :credit_card_number %> - <%= f.text_field :credit_card_number %> - - <%= f.label :credit_card_exp_date, "Credit Card Exp Date" %> - <%= f.date_select :credit_card_exp_date, :discard_day => true, :start_year => Date.today.year, :end_year => (Date.today.year + 10), order: [:month, :year] %> - - <%= f.label :"credit_card_cvv", "Credit Card CVV" %> - <%= f.text_field :credit_card_cvv %> - - <%= f.label :billing_zip %> - <%= f.text_field :billing_zip %> - - <%= f.hidden_field :status , :value => "Completed" %> +
+ <%= f.label :city, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :city, class: "form-control" %> +
+​
+
+ <%= f.label :state, class: "col-xs-4 control-label" %> +
+ <%= f.select :state, options_for_select(us_states),{}, class: "form-control" %> +
+​
+
+ <%= f.label :name_on_credit_card, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :name_on_credit_card, class: "form-control" %> +
+​
+
+ <%= f.label :credit_card_number, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :credit_card_number, class: "form-control" %> +
+​
+
+ <%= f.label :credit_card_exp_date, "Credit Card Exp Date", class: "col-xs-4 control-label" %> +
+ <%= f.date_select :credit_card_exp_date, discard_day: true,start_year: Date.today.year, end_year: (Date.today.year + 10), order: [:month, :year], class: "form-control" %> +
+​
+
+ <%= f.label :"credit_card_cvv", "Credit Card CVV", class: "col-xs-4 control-label" %> +
+ <%= f.text_field :credit_card_cvv, class: "form-control" %> +
+​
+
+ <%= f.label :billing_zip, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :billing_zip, class: "form-control" %> - <%= f.submit "Complete Purchase" %> + <%= f.hidden_field :status , value: "Completed" %> +
+ <%= f.submit "Complete Purchase", class:"btn btn-success btn-lg" %> <% end %> From 608a40c6ff08e2c1577c7a488924d7451b85a842 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 9 May 2016 10:26:55 -0700 Subject: [PATCH 096/174] deirdre again is awesome and solved my problem with creating and updating product woooo --- app/controllers/products_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 55185158ae..bfe67fce0c 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -66,10 +66,10 @@ def update private def product_create_params - params.permit(product: [:name, :description, :price, :quantity, :category, :photo_url, :user_id]) + params.permit(product: [:name, :description, :price, :quantity, :animal, :category, :photo_url, :user_id]) end def product_update_params - params.permit(product: [:name, :description, :price, :quantity, :category, :photo_url]) + params.permit(product: [:name, :description, :price, :quantity, :animal, :category, :photo_url]) end end From f3a0e92f1b99b908ee46a76432e55771153eecf4 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 9 May 2016 11:05:22 -0700 Subject: [PATCH 097/174] doing some weird stuff in products so probably should actually branch off... --- app/views/products/new.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/products/new.html.erb b/app/views/products/new.html.erb index c1344ecce5..afff49bb6e 100644 --- a/app/views/products/new.html.erb +++ b/app/views/products/new.html.erb @@ -18,7 +18,7 @@ <%= f.label(:animal, "Cat", :value => 'Cat') %>
<%= f.label :category %> - <%= f.select(:category, options_for_select(["Food"])) %> + <%= f.select(:category, options_for_select(["Food", "Create a Category"])) %>
<%= f.label :'Photo URL' %> <%= f.url_field(:photo_url) %> From faec1ddcd2b6c3e5ae8d0293f66b9dcf177e38f1 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Mon, 9 May 2016 12:20:52 -0700 Subject: [PATCH 098/174] committing so i can merge without conflict --- app/controllers/orders_controller.rb | 7 +++++++ app/controllers/products_controller.rb | 4 ++-- app/views/orders/confirmation.html.erb | 2 +- app/views/products/new.html.erb | 1 - db/seeds.rb | 26 +++++++++++++------------- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index f2cf8a2c69..7f90021a8d 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -17,6 +17,8 @@ def edit def update @order = current_order + @orderitems = @order.orderitems + remove_items_from_stock(@orderitems) @order.update(order_update_params[:order]) if @order.status == "Completed" redirect_to order_confirmation_path(@order.id) @@ -25,6 +27,11 @@ def update end end + def remove_items_from_stock(items) + + + end + def seller_items end diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 55185158ae..0ff6b3fffd 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -66,10 +66,10 @@ def update private def product_create_params - params.permit(product: [:name, :description, :price, :quantity, :category, :photo_url, :user_id]) + params.permit(product: [:name, :description, :price, :quantity, :category, :photo_url, :user_id, :animal]) end def product_update_params - params.permit(product: [:name, :description, :price, :quantity, :category, :photo_url]) + params.permit(product: [:name, :description, :price, :quantity, :category, :photo_url, :animal]) end end diff --git a/app/views/orders/confirmation.html.erb b/app/views/orders/confirmation.html.erb index 825e9f5104..59f5fe2cf9 100644 --- a/app/views/orders/confirmation.html.erb +++ b/app/views/orders/confirmation.html.erb @@ -5,7 +5,7 @@ <% @order.orderitems.each do |item| %> Item: <%= link_to Product.find(item.product_id).name , product_path(Product.find(item.product_id).id) %>
Quantity: <%= item.quantity %>
-Subtotal: <%= item.total_price %>

+Subtotal: $<%= number_with_precision item.total_price , precision: 2%>

<% @cart_price += item.total_price %> <% end %> diff --git a/app/views/products/new.html.erb b/app/views/products/new.html.erb index c1344ecce5..036d1cfa05 100644 --- a/app/views/products/new.html.erb +++ b/app/views/products/new.html.erb @@ -27,4 +27,3 @@ ​
<%= f.submit class: 'btn btn-success' %> <% end %> - diff --git a/db/seeds.rb b/db/seeds.rb index d65b79cb3a..5176b02de0 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -12,33 +12,33 @@ User.create(full_name: "Llama") User.create(full_name: "Puppy Party") -Product.create(name: 'Hot Dog', description: "Hot diggity dog. Mustard too!", price: 15, +Product.create(name: 'Hot Dog', quantity: 5, description: "Hot diggity dog. Mustard too!", price: 15, photo_url: "http://ecx.images-amazon.com/images/I/41qN0y-0FFL._SY300_.jpg", user_id: 2, animal: 'Dog', category: "Food") -Product.create(name: "Arrr Matey", description: "Whar be me treasure buried?", price: 20, user_id: 5, animal: 'Dog', category: "Misc", +Product.create(name: "Arrr Matey", quantity: 4, description: "Whar be me treasure buried?", price: 20, user_id: 5, animal: 'Dog', category: "Misc", photo_url: "http://s2.thisnext.com/media/largest_dimension/A1684071.jpg") # Product.create(name: "Alligator", price: 1, user_id: 1, animal: 'Dog', category: "Animal", # photo_url: "http://cdn1-www.dogtime.com/assets/uploads/gallery/cool-halloween-costumes/dog-halloween-costume-eaten_by_alligator.jpg") -Product.create(name: "Alligator", description: "Too cute to take a bite outta anyone!", price: 1, user_id: 1, animal: 'Dog', category: "Animal", +Product.create(name: "Alligator", quantity: 8, description: "Too cute to take a bite outta anyone!", price: 1, user_id: 1, animal: 'Dog', category: "Animal", photo_url: "http://pixel.brit.co/wp-content/uploads/2014/10/72-Gator-RADLAB.jpg") -Product.create(name: "Knight Guinea Pig", description: "Standing guard!", price: 56, user_id: 3, animal: "Guinea Pig", category: "Misc", +Product.create(name: "Knight Guinea Pig", quantity: 13, description: "Standing guard!", price: 56, user_id: 3, animal: "Guinea Pig", category: "Misc", photo_url: "http://www.thesundaytimes.co.uk/sto/multimedia/dynamic/00358/stg28minmagcheatshe_358537k.jpg") -Product.create(name: "St Patricks Dog", description: "Lucky 🍀 Dog.", price: 94, user_id: 4, animal: "Dog", category: "Holiday", +Product.create(name: "St Patricks Dog", quantity: 9, description: "Lucky 🍀 Dog.", price: 94, user_id: 4, animal: "Dog", category: "Holiday", photo_url: "https://s-media-cache-ak0.pinimg.com/736x/65/82/48/65824840727b14eb271524e4db3a69b0.jpg") # Product.create(name: "Ewok dog", price: 6, user_id: 2, animal: "Dog", category: "Star Wars", # photo_url: "https://s-media-cache-ak0.pinimg.com/736x/86/bb/c0/86bbc0780b0d655924868ed0b858d7d6.jpg") -Product.create(name: "Yoda Pup", description: "Use the force, you will.", price: 10, user_id: 1, animal: "Dog", category: "Star Wars", photo_url: "http://thissortofthing.com/storage/yoda_dog_costume.jpg?__SQUARESPACE_CACHEVERSION=1377883510952") -Product.create(name: "Sushi Roll Cat", description: "Wrapped up in cute. ", price: 14, user_id: 4, animal: "Cat", category: "Food", photo_url: "https://s-media-cache-ak0.pinimg.com/736x/10/a8/69/10a869497c6bc793ecfcbf3e0b842886.jpg") -Product.create(name: "RAWR", description: "Big roar, much cute.", price: 30, user_id: 3, animal: "Dog", category: "Animal", +Product.create(name: "Yoda Pup", quantity: 3, description: "Use the force, you will.", price: 10, user_id: 1, animal: "Dog", category: "Star Wars", photo_url: "http://thissortofthing.com/storage/yoda_dog_costume.jpg?__SQUARESPACE_CACHEVERSION=1377883510952") +Product.create(name: "Sushi Roll Cat", quantity: 7, description: "Wrapped up in cute. ", price: 14, user_id: 4, animal: "Cat", category: "Food", photo_url: "https://s-media-cache-ak0.pinimg.com/736x/10/a8/69/10a869497c6bc793ecfcbf3e0b842886.jpg") +Product.create(name: "RAWR", quantity: 8, description: "Big roar, much cute.", price: 30, user_id: 3, animal: "Dog", category: "Animal", photo_url: "http://ecx.images-amazon.com/images/I/51ELTYHPEBL._AC_UL320_SR228,320_.jpg" ) -Product.create(name: 'Martini Kitty', description: "Turn that cone into something fun!", price: 400, user_id: 1, animal: "Cat", category: "Food", +Product.create(name: 'Martini Kitty', quantity: 4, description: "Turn that cone into something fun!", price: 400, user_id: 1, animal: "Cat", category: "Food", photo_url: "http://pets.petsmart.com/content/assets/_images/expo/CONTENTTHUMB-EXPO-martini-Glass.jpg" ) -Product.create(name: 'Jockey', description: "Your dog is kind of like a horse, right?", price: 22, user_id: 1, animal: "Dog", category: "Misc", +Product.create(name: 'Jockey', quantity: 8, description: "Your dog is kind of like a horse, right?", price: 22, user_id: 1, animal: "Dog", category: "Misc", photo_url: "http://a.dilcdn.com/bl/wp-content/uploads/sites/13/2012/10/dog2.jpg") -Product.create(name: "Witch", description: "Your guinea pig should have fun too!", price: 16, user_id: 3, animal: "Guinea Pig", category: "Holiday", +Product.create(name: "Witch", quantity: 6, description: "Your guinea pig should have fun too!", price: 16, user_id: 3, animal: "Guinea Pig", category: "Holiday", photo_url: "http://mms.businesswire.com/media/20130905005372/en/381196/5/Guinea_Pig_Witch_Costume.jpg") -Product.create(name: "Sheepy", description: "Baaaahhh. Tiny sheep. Tiny cute.", price: 2, user_id: 1, animal: "Guinea Pig", category: "Animal", +Product.create(name: "Sheepy", quantity: 20, description: "Baaaahhh. Tiny sheep. Tiny cute.", price: 2, user_id: 1, animal: "Guinea Pig", category: "Animal", photo_url: "http://www.fuzzytoday.com/wp-content/uploads/2014/04/10173656_706647296068039_5966309383389001510_n.jpg") -Product.create(name: "Dewback", description: "Straight from Tatooine.", price: 52, user_id: 4, animal: "Dog", category: "Star Wars", +Product.create(name: "Dewback", quantity: 6, description: "Straight from Tatooine.", price: 52, user_id: 4, animal: "Dog", category: "Star Wars", photo_url: "http://www.officialstarwarscostumes.com/~/media/products/oc/star-wars-costumes/kids-star-wars-costumes/99886582-dewback-pet-costume-pet-star-wars-costumes-000.ashx?&w=600&h=600&bc=FFFFFF") From ae10b45bcbdf22d6487e3d337171b56d08d396a0 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Mon, 9 May 2016 12:46:01 -0700 Subject: [PATCH 099/174] grr routes are being terrible what happened?? --- config/routes.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index e0f9bd0d9b..9cfba12ade 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,7 +5,7 @@ resources :users, :only => [:index, :new, :create] resources :products, :only => [:index, :show, :create] - +​ get '/products/category/:animal' => 'products#show_animal', as: 'product_animal' get '/products/animal/:category' => 'products#show_category', as: 'product_category' get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' @@ -15,15 +15,15 @@ patch '/users/:user_id/products' => 'products#update', as: 'update_product' get '/users/:id/products' => 'products#show_seller_products', as: 'user_product' resources :orders - +​ get '/users/:id/orders' => 'orders#show_seller_orders', as: 'show_seller_orders' get '/users/:id/orders/seller_items' => 'orders#seller_items', as: 'seller_items' - +​ resources :orderitems - +​ get 'orders/order_fulfillment' => 'orders#index', as: 'order_fulfillment' - - +​ +​ resources :sessions, :only => [:new, :create] get "/logout" => "sessions#destroy" get "/orders/:id/checkout" => 'orders#checkout', as: 'order_checkout' From 9c1e84eced45b837449219bc19f829befd5e5318 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 9 May 2016 12:55:30 -0700 Subject: [PATCH 100/174] fixed sign in --- app/assets/javascripts/application.js | 1 + app/assets/stylesheets/application.css | 1 + app/controllers/products_controller.rb | 1 + app/models/product.rb | 1 + app/views/home/index.html.erb | 4 +-- app/views/products/new.html.erb | 4 ++- app/views/sessions/new.html.erb | 26 ++++++++----------- config/routes.rb | 5 ++-- .../20160509184941_new_category_products.rb | 5 ++++ db/schema.rb | 7 ++--- 10 files changed, 32 insertions(+), 23 deletions(-) create mode 100644 db/migrate/20160509184941_new_category_products.rb diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index e07c5a830f..6816d23dad 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -14,3 +14,4 @@ //= require jquery_ujs //= require turbolinks //= require_tree . + diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index de04e4897a..2c4cffe9fa 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -7,6 +7,7 @@ margin: 0; } + html, body { height: 100%; } diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index bfe67fce0c..d0175ee36e 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -45,6 +45,7 @@ def new def create @product = Product.new(product_create_params[:product]) + @product.category = params[:new_category] unless params[:new_category].nil? if @product.save redirect_to user_product_path(current_user.id) else diff --git a/app/models/product.rb b/app/models/product.rb index 2e30cec221..e86f94d5b8 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -3,4 +3,5 @@ class Product < ActiveRecord::Base has_many :reviews validates :name, presence: true, uniqueness: true validates :price, presence: true, numericality: {greater_than: 0} + end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 992439eb60..62613857a2 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -3,7 +3,7 @@
<%= f.submit "Sign In", class: "btn btn-success" %> <% end %> - diff --git a/config/routes.rb b/config/routes.rb index 9cfba12ade..ff11108481 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,9 +5,9 @@ resources :users, :only => [:index, :new, :create] resources :products, :only => [:index, :show, :create] -​ - get '/products/category/:animal' => 'products#show_animal', as: 'product_animal' - get '/products/animal/:category' => 'products#show_category', as: 'product_category' + + get '/products/animal/:animal' => 'products#show_animal', as: 'product_animal' + get '/products/category/:category' => 'products#show_category', as: 'product_category' get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' post '/users/:id/products' => 'products#create' @@ -15,18 +15,19 @@ patch '/users/:user_id/products' => 'products#update', as: 'update_product' get '/users/:id/products' => 'products#show_seller_products', as: 'user_product' resources :orders -​ + get '/users/:id/orders' => 'orders#show_seller_orders', as: 'show_seller_orders' get '/users/:id/orders/seller_items' => 'orders#seller_items', as: 'seller_items' -​ + resources :orderitems -​ + get 'orders/order_fulfillment' => 'orders#index', as: 'order_fulfillment' -​ -​ + + resources :sessions, :only => [:new, :create] get "/logout" => "sessions#destroy" get "/orders/:id/checkout" => 'orders#checkout', as: 'order_checkout' patch "/orders/:id/checkout" => "orders#confirmation" get '/orders/:id/confirmation' => 'orders#confirmation', as: "order_confirmation" + end From ef13ba31fcedc135e2dbba1304a54bd0e27dd396 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 9 May 2016 13:08:12 -0700 Subject: [PATCH 102/174] use these routes. all of them. --- config/routes.rb | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 18b621c8af..6c1bfcd7b9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,30 +6,26 @@ resources :products, :only => [:index, :show, :create] - - get '/products/animal/:animal' => 'products#show_animal', as: 'product_animal' - get '/products/category/:category' => 'products#show_category', as: 'product_category' - # get '/products/category/:new_category' => 'products#show_category', as: 'product_new_category' - + get '/products/category/:animal' => 'products#show_animal', as: 'product_animal' + get '/products/animal/:category' => 'products#show_category', as: 'product_category' get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' post '/users/:id/products' => 'products#create' get '/users/:id/products/:id/edit' => 'products#edit', as: 'edit_product' patch '/users/:user_id/products' => 'products#update', as: 'update_product' - get '/users/:id/products' => 'products#show_seller_products', as: 'user_product' resources :orders -​ + get '/users/:id/orders' => 'orders#show_seller_orders', as: 'show_seller_orders' get '/users/:id/orders/seller_items' => 'orders#seller_items', as: 'seller_items' -​ + resources :orderitems -​ + get 'orders/order_fulfillment' => 'orders#index', as: 'order_fulfillment' -​ -​ + + resources :sessions, :only => [:new, :create] get "/logout" => "sessions#destroy" get "/orders/:id/checkout" => 'orders#checkout', as: 'order_checkout' patch "/orders/:id/checkout" => "orders#confirmation" get '/orders/:id/confirmation' => 'orders#confirmation', as: "order_confirmation" -end +end \ No newline at end of file From 6403079a0a2a822fcb82a2db1cdc39de6cec4398 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Mon, 9 May 2016 13:11:48 -0700 Subject: [PATCH 103/174] hadn't fully fixed merge conflict, working now --- config/routes.rb | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index b0ad7a75b8..f46ded8e5e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,13 +6,10 @@ resources :products, :only => [:index, :show, :create] -<<<<<<< HEAD + get '/products/animal/:animal' => 'products#show_animal', as: 'product_animal' get '/products/category/:category' => 'products#show_category', as: 'product_category' -======= - get '/products/category/:animal' => 'products#show_animal', as: 'product_animal' - get '/products/animal/:category' => 'products#show_category', as: 'product_category' ->>>>>>> ef13ba31fcedc135e2dbba1304a54bd0e27dd396 + get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' post '/users/:id/products' => 'products#create' @@ -33,9 +30,5 @@ get "/orders/:id/checkout" => 'orders#checkout', as: 'order_checkout' patch "/orders/:id/checkout" => "orders#confirmation" get '/orders/:id/confirmation' => 'orders#confirmation', as: "order_confirmation" -<<<<<<< HEAD end -======= -end ->>>>>>> ef13ba31fcedc135e2dbba1304a54bd0e27dd396 From 9efb476334fd90d74f19ae3efe81897b9870fdd5 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 9 May 2016 13:16:07 -0700 Subject: [PATCH 104/174] added route that got left behind to make your store work --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 6c1bfcd7b9..eff44c27c7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -13,6 +13,7 @@ post '/users/:id/products' => 'products#create' get '/users/:id/products/:id/edit' => 'products#edit', as: 'edit_product' patch '/users/:user_id/products' => 'products#update', as: 'update_product' + get '/users/:id/products' => 'products#show_seller_products', as: 'user_product' resources :orders get '/users/:id/orders' => 'orders#show_seller_orders', as: 'show_seller_orders' From 02fc0c9206ee7e39d78b3302a3d125d0122331d8 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Mon, 9 May 2016 13:37:01 -0700 Subject: [PATCH 105/174] quantity of product now lowers after completed purchase --- app/controllers/orders_controller.rb | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 7f90021a8d..9880203855 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -18,8 +18,10 @@ def edit def update @order = current_order @orderitems = @order.orderitems - remove_items_from_stock(@orderitems) - @order.update(order_update_params[:order]) + continue = remove_items_from_stock(@orderitems) + unless continue + @order.update(order_update_params[:order]) + end if @order.status == "Completed" redirect_to order_confirmation_path(@order.id) else @@ -28,8 +30,17 @@ def update end def remove_items_from_stock(items) - - + items.each do |item| + product = item.product + quantity_being_bought = item.quantity + available_quantity = product.quantity + new_quantity = available_quantity - quantity_being_bought + if new_quantity > 0 + product.update(quantity: new_quantity) + else + return false + end + end end def seller_items From 3dfb948c00ffb35276f3f649c5507eec03ce159d Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Mon, 9 May 2016 13:57:22 -0700 Subject: [PATCH 106/174] trying to figure out why complete purchase page shows up twice --- app/controllers/orders_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 9880203855..b7fd96988f 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -11,7 +11,6 @@ def show_seller_orders def edit @order = Order.find(params[:id]) - # @quantity_numbers = [1,2,3,4,5,6,7,8,9,10] @orderitems = Order.find(current_order.id).orderitems end From f30bb051030e5a9d266e2ffb2b82e038217a6054 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Mon, 9 May 2016 14:08:36 -0700 Subject: [PATCH 107/174] updated product show page to reflect available quantities --- app/controllers/products_controller.rb | 1 - app/views/products/index.html.erb | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index b187d80fdf..b4cbda0b2e 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -3,7 +3,6 @@ class ProductsController < ApplicationController def index @products = Product.all - @quantity_numbers = [1,2,3,4,5,6,7,8,9,10] end def show diff --git a/app/views/products/index.html.erb b/app/views/products/index.html.erb index e45112293a..402d0c7328 100644 --- a/app/views/products/index.html.erb +++ b/app/views/products/index.html.erb @@ -10,10 +10,11 @@ $<%= number_with_precision product.price, precision: 2 %>
<%= form_tag '/orderitems' do %> + <% @quantity_numbers = (1..product.quantity).to_a %> <%= hidden_field_tag :product_id, product.id %>
<%= select_tag :quantity, options_for_select(@quantity_numbers) %>
<%= submit_tag "Add to Cart", class: 'btn btn-primary' %>

<% end %>
- <% end %> \ No newline at end of file + <% end %> From 5ed0c7d29348f0d6d371f4461cdcea48afa6b922 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 9 May 2016 14:13:53 -0700 Subject: [PATCH 108/174] product category working for text field but not drop-down --- app/controllers/products_controller.rb | 5 ++++- app/views/products/new.html.erb | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index b187d80fdf..22ff42823d 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -45,7 +45,6 @@ def new def create @product = Product.new(product_create_params[:product]) - @product.category = params[:new_category] unless params[:new_category].nil? if @product.save redirect_to user_product_path(current_user.id) else @@ -75,4 +74,8 @@ def product_update_params params.permit(product: [:name, :description, :price, :quantity, :animal, :category, :photo_url, :user_id]) end + # def category_params + # params.permit(:new_category).merge(category: :new_category) + # end + end diff --git a/app/views/products/new.html.erb b/app/views/products/new.html.erb index e5cc035b33..16576594f3 100644 --- a/app/views/products/new.html.erb +++ b/app/views/products/new.html.erb @@ -19,12 +19,11 @@
<%= f.label :category %> <%= f.select(:category, options_for_select(["Food", "Create a Category"]), :include_blank => true) %> - <%= f.label :new_category, "OR Create your own category:" %> - <%= f.text_field :new_category %> + <%= f.label :category, "OR Create your own category:" %> + <%= f.text_field :category %>
<%= f.label :'Photo URL' %> <%= f.url_field(:photo_url) %> - <%= f.hidden_field :user_id, value: @user.id %> ​
<%= f.submit class: 'btn btn-success' %> From cb33da4c9346be8ce56ae0cbabeda1166d55cd4d Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 9 May 2016 15:27:26 -0700 Subject: [PATCH 109/174] i dunno i think i removed an extra space somewhere --- app/views/orders/checkout.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/orders/checkout.html.erb b/app/views/orders/checkout.html.erb index 5a85b454db..fec08e73ed 100644 --- a/app/views/orders/checkout.html.erb +++ b/app/views/orders/checkout.html.erb @@ -56,7 +56,7 @@
<%= f.text_field :billing_zip, class: "form-control" %> - <%= f.hidden_field :status , value: "Completed" %> + <%= f.hidden_field :status, value: "Completed" %>
<%= f.submit "Complete Purchase", class:"btn btn-success btn-lg" %> <% end %> From c7d1a7858a406dc35ffd6b5f5b465679b4830e22 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Mon, 9 May 2016 15:51:31 -0700 Subject: [PATCH 110/174] commiting so i can branch out --- app/controllers/orders_controller.rb | 2 +- app/views/orders/checkout.html.erb | 2 +- app/views/orders/show.html.erb | 4 ++-- config/routes.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index b7fd96988f..ff8c1635a1 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -18,7 +18,7 @@ def update @order = current_order @orderitems = @order.orderitems continue = remove_items_from_stock(@orderitems) - unless continue + unless continue == false @order.update(order_update_params[:order]) end if @order.status == "Completed" diff --git a/app/views/orders/checkout.html.erb b/app/views/orders/checkout.html.erb index 5a85b454db..f04bdaef28 100644 --- a/app/views/orders/checkout.html.erb +++ b/app/views/orders/checkout.html.erb @@ -42,7 +42,7 @@
<%= f.label :credit_card_exp_date, "Credit Card Exp Date", class: "col-xs-4 control-label" %>
- <%= f.date_select :credit_card_exp_date, discard_day: true,start_year: Date.today.year, end_year: (Date.today.year + 10), order: [:month, :year], class: "form-control" %> + <%= f.date_select :credit_card_exp_date, discard_day: true, start_year: Date.today.year, end_year: (Date.today.year + 10), order: [:month, :year], class: "form-control" %>
diff --git a/app/views/orders/show.html.erb b/app/views/orders/show.html.erb index b67c47e657..db053388c9 100644 --- a/app/views/orders/show.html.erb +++ b/app/views/orders/show.html.erb @@ -1,4 +1,4 @@ -

Cart:

+ diff --git a/config/routes.rb b/config/routes.rb index 1466b26591..2ce91cd734 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -29,7 +29,7 @@ resources :sessions, :only => [:new, :create] get "/logout" => "sessions#destroy" get "/orders/:id/checkout" => 'orders#checkout', as: 'order_checkout' - patch "/orders/:id/checkout" => "orders#confirmation" + patch "/orders/:id/checkout" => "orders#checkout" get '/orders/:id/confirmation' => 'orders#confirmation', as: "order_confirmation" end From 6e39b5dfe19ef26d1d6e15563f87c4e7b15873e4 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 9 May 2016 15:55:52 -0700 Subject: [PATCH 111/174] got bootstrap for sign in form working --- app/views/products/show.html.erb | 9 +++++---- app/views/sessions/new.html.erb | 24 +++++++++++++++++------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb index 4e41aa9757..bc26ae2010 100644 --- a/app/views/products/show.html.erb +++ b/app/views/products/show.html.erb @@ -6,14 +6,15 @@ <%= form_tag '/orderitems' do %> <%= hidden_field_tag :product_id, @product.id %>
<%= select_tag :quantity, options_for_select(@quantity_numbers) %>
+

<%= @product.quantity %> Available!

<%= submit_tag "Add to Cart", class: 'btn btn-primary' %> <% end %> -

<%= @product.quantity %> Available


+

Overall Rating: <%= @rating %> / 5

-

Reviews:
<% @product.reviews.each do |review|%> - <%= review.description %>
- <% end %>

+

Reviews:

<% @product.reviews.each do |review| %> +

<%= review.description %>

+ <% end %>
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index f32634cce0..cae6eea278 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,15 +1,25 @@

Sign In

+
+<%= form_tag sessions_path, method: :post do %> +
+ <%= label_tag :username, "Username:", class: "col-xs-4 control-label" %> +
+ <%= text_field_tag :username, "", class: "form-control" %> +​
+
+
+ +
+ <%= label_tag :password, "Password (secret):", class: "col-xs-4 control-label" %> +
+ <%= password_field_tag :password, "", class: "form-control" %> +​
+
-<%= form_tag sessions_path, method: :post do %> - <%= label_tag :username, "Username:" %> - <%= text_field_tag :username %> -​ - <%= label_tag :password, "Password (secret):" %> - <%= password_field_tag :password %> -​ <%= submit_tag "Sign In", class: "btn btn-success" %> <% end %> +
From 41d65de5e3a066c52f3a3158f75f15ca206da1f0 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Mon, 9 May 2016 16:11:08 -0700 Subject: [PATCH 112/174] migration for making order cc exp into date datatype, and fixed weird routing issue with checkout --- .../20160509225218_change_data_type_for_cc_exp_date.rb | 6 ++++++ db/schema.rb | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20160509225218_change_data_type_for_cc_exp_date.rb diff --git a/db/migrate/20160509225218_change_data_type_for_cc_exp_date.rb b/db/migrate/20160509225218_change_data_type_for_cc_exp_date.rb new file mode 100644 index 0000000000..770214609a --- /dev/null +++ b/db/migrate/20160509225218_change_data_type_for_cc_exp_date.rb @@ -0,0 +1,6 @@ +class ChangeDataTypeForCcExpDate < ActiveRecord::Migration + def change + remove_column :orders, :credit_card_exp_date + add_column :orders, :credit_card_exp_date, :date + end +end diff --git a/db/schema.rb b/db/schema.rb index 66cbbfb488..d861162f1a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160509184941) do +ActiveRecord::Schema.define(version: 20160509225218) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -43,9 +43,9 @@ t.string "state" t.string "name_on_credit_card" t.integer "credit_card_number" - t.string "credit_card_exp_date" t.integer "credit_card_cvv" t.string "billing_zip" + t.date "credit_card_exp_date" end create_table "products", force: :cascade do |t| From 8ee022718b211f72edb6af1459834ef749bef60b Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 9 May 2016 16:13:29 -0700 Subject: [PATCH 113/174] got the quantity to work on each show pageincluding your store products --- app/views/products/show_animal.html.erb | 4 ++-- app/views/products/show_category.html.erb | 3 ++- app/views/products/show_merchant.html.erb | 4 ++-- app/views/products/show_seller_products.html.erb | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/views/products/show_animal.html.erb b/app/views/products/show_animal.html.erb index b864994c1b..46a2cfc7a6 100644 --- a/app/views/products/show_animal.html.erb +++ b/app/views/products/show_animal.html.erb @@ -12,11 +12,11 @@ <%= link_to product.name, product_path(product.id) %>
$<%= number_with_precision product.price, precision: 2 %> <%= hidden_field_tag :product_id, product.id %>
- <%= hidden_field_tag :quantity, 1 %> + <%= select_tag :quantity, options_for_select(1..product.quantity) %>
+

<%= product.quantity %> Available!

<%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
<% end %>
- <%= product.quantity %>
<% end %> diff --git a/app/views/products/show_category.html.erb b/app/views/products/show_category.html.erb index 0dc6fdad6f..473d8f1ed6 100644 --- a/app/views/products/show_category.html.erb +++ b/app/views/products/show_category.html.erb @@ -14,9 +14,10 @@ <%= form_tag '/orderitems' do %> <%= link_to product.name, product_path(product.id) %> <%= hidden_field_tag :product_id, product.id %>
+ <%= select_tag :quantity, options_for_select(1..product.quantity) %>
+

<%= product.quantity %> Available!

<%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
<% end %>
- <%= product.quantity %>
<% end %> diff --git a/app/views/products/show_merchant.html.erb b/app/views/products/show_merchant.html.erb index c0c58ee815..f24bcc1797 100644 --- a/app/views/products/show_merchant.html.erb +++ b/app/views/products/show_merchant.html.erb @@ -14,10 +14,10 @@ <%= form_tag '/orderitems' do %> <%= link_to product.name, product_path(product.id) %> <%= hidden_field_tag :product_id, product.id %>
- <%= hidden_field_tag :quantity, 1 %> + <%= select_tag :quantity, options_for_select(1..product.quantity) %>
+

<%= product.quantity %> Available!

<%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
<% end %> - <%= product.quantity %>
<% end %> diff --git a/app/views/products/show_seller_products.html.erb b/app/views/products/show_seller_products.html.erb index c158795ba3..c42130202c 100644 --- a/app/views/products/show_seller_products.html.erb +++ b/app/views/products/show_seller_products.html.erb @@ -18,7 +18,7 @@ <%= form_tag '/orderitems' do %> <%= hidden_field_tag :product_id, product.id %> <% end %> - <%= product.quantity %> +

Number in Stock: <%= product.quantity %>

<% end %>
<%= link_to "Edit", edit_product_path(@user, product), class: 'btn btn-primary' %> From f8c2bf1fa04e9d84f86a3638481d313a6eaf4831 Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 9 May 2016 16:15:36 -0700 Subject: [PATCH 114/174] quantity not working on home page as well --- app/views/home/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 62613857a2..4d39fcebe7 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -38,8 +38,8 @@ <%= link_to product.name, product_path(product.id) %>
$<%= number_with_precision product.price, precision: 2 %> <%= form_tag '/orderitems' do %> - <%= hidden_field_tag :product_id, product.id %>
- <%= hidden_field_tag :quantity, 1 %> + <%= select_tag :quantity, options_for_select(1..product.quantity) %>
+

<%= product.quantity %> Available!

<%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
<% end %> From 0282ddb26f55ac6c9a234ca2ee5266012ce8df12 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Mon, 9 May 2016 16:32:14 -0700 Subject: [PATCH 115/174] all order default to pending once they are created --- app/controllers/orders_controller.rb | 1 + app/controllers/sessions_controller.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index ff8c1635a1..504a3ac327 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -55,6 +55,7 @@ def confirmation @orderitems = @order.orderitems session.delete :order_id order = Order.create + order.update(status: "Pending") session[:order_id] = order.id end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 686e3cb06c..fd503248bf 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -5,6 +5,7 @@ def new def create user = User.log_in(params[:username], params[:password]) order = Order.create + order.update(status: "Pending") session[:order_id] = order.id if user session[:user_id] = user.id From 2988e316190fa7239430cb01246f90e9e7715833 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Mon, 9 May 2016 17:38:27 -0700 Subject: [PATCH 116/174] working on getting add a review form up and running --- app/assets/javascripts/reviews.coffee | 3 +++ app/assets/stylesheets/reviews.scss | 3 +++ app/controllers/reviews_controller.rb | 23 +++++++++++++++++++++ app/helpers/reviews_helper.rb | 2 ++ app/views/products/show.html.erb | 2 ++ app/views/reviews/new.html.erb | 19 +++++++++++++++++ config/routes.rb | 2 ++ test/controllers/reviews_controller_test.rb | 7 +++++++ 8 files changed, 61 insertions(+) create mode 100644 app/assets/javascripts/reviews.coffee create mode 100644 app/assets/stylesheets/reviews.scss create mode 100644 app/controllers/reviews_controller.rb create mode 100644 app/helpers/reviews_helper.rb create mode 100644 app/views/reviews/new.html.erb create mode 100644 test/controllers/reviews_controller_test.rb diff --git a/app/assets/javascripts/reviews.coffee b/app/assets/javascripts/reviews.coffee new file mode 100644 index 0000000000..24f83d18bb --- /dev/null +++ b/app/assets/javascripts/reviews.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/reviews.scss b/app/assets/stylesheets/reviews.scss new file mode 100644 index 0000000000..6ea2454d26 --- /dev/null +++ b/app/assets/stylesheets/reviews.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the reviews controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/reviews_controller.rb b/app/controllers/reviews_controller.rb new file mode 100644 index 0000000000..ab8082ef85 --- /dev/null +++ b/app/controllers/reviews_controller.rb @@ -0,0 +1,23 @@ +class ReviewsController < ApplicationController + + def new + @product = Product.find(params[:id]) + @review = @product.reviews.new + end + + def create + @review = Review.new(review_create_params[:review]) + if @review.save + redirect_to root_path + else + render :new + end + end + + private + + def review_create_params + params.permit(review: [:rating, :description]) + end + +end diff --git a/app/helpers/reviews_helper.rb b/app/helpers/reviews_helper.rb new file mode 100644 index 0000000000..682b7b1abc --- /dev/null +++ b/app/helpers/reviews_helper.rb @@ -0,0 +1,2 @@ +module ReviewsHelper +end diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb index bc26ae2010..eedff963c8 100644 --- a/app/views/products/show.html.erb +++ b/app/views/products/show.html.erb @@ -10,6 +10,8 @@ <%= submit_tag "Add to Cart", class: 'btn btn-primary' %> <% end %>
+

<%= link_to "Write a Review", new_review_path, class: "btn btn-primary" %>

+

Overall Rating: <%= @rating %> / 5

Reviews:

<% @product.reviews.each do |review| %> diff --git a/app/views/reviews/new.html.erb b/app/views/reviews/new.html.erb new file mode 100644 index 0000000000..e51c809985 --- /dev/null +++ b/app/views/reviews/new.html.erb @@ -0,0 +1,19 @@ +

Write a review!

+ +
<%= params %>
+<%= form_for @review do |f| %> + +
+ <%= f.label :rating, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :rating, class: "form-control" %> +
+
+ <%= f.label :description, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :description, class: "form-control" %> +
+ <%= f.hidden_field :product_id, value: @product.id %> +
+ <%= f.submit "Publish Review", class:"btn btn-success btn-lg" %> + <% end %> diff --git a/config/routes.rb b/config/routes.rb index 2ce91cd734..e8cd9f9c81 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,6 +6,8 @@ resources :products, :only => [:index, :show, :create] + get '/products/:id/reviews/new' => 'reviews#new' , as: "new_review" + post '/products/:id/reviews' => 'reviews#create' get '/products/animal/:animal' => 'products#show_animal', as: 'product_animal' get '/products/category/:category' => 'products#show_category', as: 'product_category' diff --git a/test/controllers/reviews_controller_test.rb b/test/controllers/reviews_controller_test.rb new file mode 100644 index 0000000000..9ab3149763 --- /dev/null +++ b/test/controllers/reviews_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ReviewsControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end From a7b35d5b685ae3cee151b7036e2849fe6d02214f Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 9 May 2016 18:43:06 -0700 Subject: [PATCH 117/174] I CHANGED ROUTES. be careful. got delete and edit working for product with better routes, but now to work on that damn category --- app/assets/stylesheets/application.css | 7 ++ app/controllers/products_controller.rb | 10 ++- app/views/home/index.html.erb | 1 + app/views/orders/show_seller_orders.html.erb | 14 ++-- app/views/products/edit.html.erb | 3 +- app/views/products/new.html.erb | 76 +++++++++++++------ app/views/products/show_animal.html.erb | 4 +- app/views/products/show_category.html.erb | 2 +- app/views/products/show_merchant.html.erb | 2 +- .../products/show_seller_products.html.erb | 20 +++-- config/routes.rb | 4 +- 11 files changed, 96 insertions(+), 47 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 2c4cffe9fa..03343c0dbe 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -60,6 +60,13 @@ h4 { font-size: 25px; } +.store-links { + text-decoration: none; + float: right; + padding-right: 20%; + font-size: 25px; +} + .front-description { text-align: center; } diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 5a798efdf1..3b909e329c 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -19,7 +19,7 @@ def overall_rating(product) end def show_seller_products - @user = User.find(params[:id]) + @user = User.find(current_user) @products = @user.products end @@ -54,6 +54,7 @@ def create def edit @product = Product.find(params[:id]) @user = User.find(current_user.id) + @quantity = @product.quantity end def update @@ -62,6 +63,13 @@ def update redirect_to user_product_path(current_user.id) end + def destroy + @product = Product.find(params[:id]) + @product.destroy + redirect_to user_product_path + + end + private def product_create_params diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 4d39fcebe7..e67c3fc2eb 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -38,6 +38,7 @@ <%= link_to product.name, product_path(product.id) %>
$<%= number_with_precision product.price, precision: 2 %> <%= form_tag '/orderitems' do %> + <%= hidden_field_tag :product_id, product.id %>
<%= select_tag :quantity, options_for_select(1..product.quantity) %>

<%= product.quantity %> Available!

<%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
diff --git a/app/views/orders/show_seller_orders.html.erb b/app/views/orders/show_seller_orders.html.erb index 2975532c64..f4ff58fd9f 100644 --- a/app/views/orders/show_seller_orders.html.erb +++ b/app/views/orders/show_seller_orders.html.erb @@ -1,14 +1,16 @@ -

Your Store

- -<%= link_to 'Current Products', user_product_path %> -<%= link_to 'Add a New Product', new_product_path %> - +

Welcome to your store, <%= @user.full_name %>!

+
+<%= link_to 'Add a New Product', new_product_path, class: "store-links" %> +<%= link_to 'Your Current Products', user_product_path, class: "store-links" %> +

Orders

<% @orders.each do |order| %> - <%= order %> + <%= order.id %> + <%= order.status %> + <%= order.price %>
<% end %>

Revenue

$<%= Orderitem.revenue(@user.id) %>0

diff --git a/app/views/products/edit.html.erb b/app/views/products/edit.html.erb index cfdd91ebdc..2b4e205ab2 100644 --- a/app/views/products/edit.html.erb +++ b/app/views/products/edit.html.erb @@ -1,4 +1,5 @@

Edit Product

+<%= params %> <%= form_for @product, method: :patch, url: update_product_path(@product) do |f| %> <%= f.label :name %> @@ -11,7 +12,7 @@ <%= f.number_field :price, step: 0.5 %>
<%= f.label :quantity %> - <%= f.select(:quantity, options_for_select(1..10)) %> + <%= f.select(:quantity, options_for_select(1..10, selected: @quantity)) %>
<%= f.label :animal %> <%= f.select(:animal, options_for_select(["Cat", "Dog", "Guinea Pig", "Goat"])) %> diff --git a/app/views/products/new.html.erb b/app/views/products/new.html.erb index 16576594f3..803a1b14c2 100644 --- a/app/views/products/new.html.erb +++ b/app/views/products/new.html.erb @@ -1,30 +1,56 @@
<%= params %>
-<%= form_for @product do |f| %> +

Add a Costume to Your Store!

- <%= f.label :name %> - <%= f.text_field :name %> -
-​ <%= f.label :description %> - <%= f.text_field :description %> -
- <%= f.label :price %> - <%= f.number_field :price, step: 0.5 %> -
- <%= f.label :quantity %> - <%= f.select(:quantity, options_for_select(1..10)) %> -
- <%= f.radio_button(:animal, "Cat") %> - <%= f.label(:animal, "Cat", :value => 'Cat') %> -
- <%= f.label :category %> - <%= f.select(:category, options_for_select(["Food", "Create a Category"]), :include_blank => true) %> - <%= f.label :category, "OR Create your own category:" %> - <%= f.text_field :category %> -
- <%= f.label :'Photo URL' %> - <%= f.url_field(:photo_url) %> +<%= form_for @product, :html => { :class => "form-horizontal center" } do |f| %> +
+ <%= f.label :name, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :name, class: "form-control" %> +
+
+
+​ <%= f.label :description, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :description, class: "form-control" %> +
+
+
+ <%= f.label :price, class: "col-xs-4 control-label" %> +
+ <%= f.number_field :price, step: 0.5, class: "form-control" %> +
+
+
+ <%= f.label :quantity, class: "col-xs-4 control-label" %> +
+ <%= f.select(:quantity, options_for_select(1..10), class: "form-control") %> +
+
+
+ <%= f.label :animal, class: "col-xs-4 control-label" %> +
+ <%= f.select(:animal, options_for_select(["Cat", "Dog", "Guinea Pig", "Goat"]), class: "form-control") %> +
+
+
+ <%= f.label :category, class: "col-xs-4 control-label" %> +
+ <%= f.select(:category, options_for_select(["Food", "Create a Category"]), :include_blank => true, class: "form-control") %> +
+
+
+ <%= f.label :category, "OR Create your own category:", class: "col-xs-4 control-label" %> +
+ <%= f.text_field :category, class: "form-control" %> +
+
+
+ <%= f.label :'Photo URL', class: "col-xs-4 control-label"%> +
+ <%= f.url_field :photo_url, class: "form-control" %> <%= f.hidden_field :user_id, value: @user.id %> -​
- <%= f.submit class: 'btn btn-success' %> +​
+
+ <%= f.submit "Add Costume!", class: 'btn btn-success' %> <% end %> diff --git a/app/views/products/show_animal.html.erb b/app/views/products/show_animal.html.erb index 46a2cfc7a6..e65b713c8a 100644 --- a/app/views/products/show_animal.html.erb +++ b/app/views/products/show_animal.html.erb @@ -10,8 +10,8 @@ <%= form_tag '/orderitems' do %> <%= link_to product.name, product_path(product.id) %>
- $<%= number_with_precision product.price, precision: 2 %> - <%= hidden_field_tag :product_id, product.id %>
+ $<%= number_with_precision product.price, precision: 2 %>
+ <%= hidden_field_tag :product_id, product.id %> <%= select_tag :quantity, options_for_select(1..product.quantity) %>

<%= product.quantity %> Available!

<%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
diff --git a/app/views/products/show_category.html.erb b/app/views/products/show_category.html.erb index 473d8f1ed6..bf703af13f 100644 --- a/app/views/products/show_category.html.erb +++ b/app/views/products/show_category.html.erb @@ -8,7 +8,7 @@ <% end %>

- <%= product.description %> + <%= product.description %>
$<%= number_with_precision product.price, precision: 2 %> <%= form_tag '/orderitems' do %> diff --git a/app/views/products/show_merchant.html.erb b/app/views/products/show_merchant.html.erb index f24bcc1797..f4dd277525 100644 --- a/app/views/products/show_merchant.html.erb +++ b/app/views/products/show_merchant.html.erb @@ -8,7 +8,7 @@ <% end %>

- <%= product.description %> + <%= product.description %>
$<%= number_with_precision product.price, precision: 2 %> <%= form_tag '/orderitems' do %> diff --git a/app/views/products/show_seller_products.html.erb b/app/views/products/show_seller_products.html.erb index c42130202c..933bf0eaee 100644 --- a/app/views/products/show_seller_products.html.erb +++ b/app/views/products/show_seller_products.html.erb @@ -1,18 +1,19 @@
<%= params %>

Current Products

-
-
<% @products.each do |product| %> - - +
+
+ <% unless product.photo_url.nil? %> + + <% end %>
+
<% if product.quantity == 0 %>

You have no products!

<% else %>
<%= product.name %>
- <%= product.description %> $<%= number_with_precision product.price, precision: 2 %> <%= form_tag '/orderitems' do %> @@ -21,7 +22,10 @@

Number in Stock: <%= product.quantity %>

<% end %>
- <%= link_to "Edit", edit_product_path(@user, product), class: 'btn btn-primary' %> +

<%= link_to "Edit Product", edit_product_path(product), class: 'btn btn-primary' %>

+

<%= link_to "Retire Costume", class: "btn btn-warning" %>

+

<%= link_to "Delete Product", product_path(product.id), method: :delete, class: "btn btn-danger" %>

+
+
<% end %> -
-
+ diff --git a/config/routes.rb b/config/routes.rb index 2ce91cd734..1d4e5c40cd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,7 +4,7 @@ resources :users, :only => [:index, :new, :create] - resources :products, :only => [:index, :show, :create] + resources :products, :except => [:new] get '/products/animal/:animal' => 'products#show_animal', as: 'product_animal' @@ -13,7 +13,7 @@ get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' post '/users/:id/products' => 'products#create' - get '/users/:id/products/:id/edit' => 'products#edit', as: 'edit_product' + # get '/users/:id/products/:id/edit' => 'products#edit', as: 'edit_product' patch '/users/:user_id/products' => 'products#update', as: 'update_product' get '/users/:id/products' => 'products#show_seller_products', as: 'user_product' resources :orders From fe122f4246623872379efe7132c7b4db648f8f4c Mon Sep 17 00:00:00 2001 From: Jessica Date: Mon, 9 May 2016 21:35:23 -0700 Subject: [PATCH 118/174] tried fixing adding new category but going to create a separate page instead. --- app/assets/javascripts/application.js | 1 - app/assets/stylesheets/application.css | 3 +++ app/models/product.rb | 1 - app/views/products/index.html.erb | 6 +++--- app/views/products/new.html.erb | 6 ------ 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 6816d23dad..e07c5a830f 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -14,4 +14,3 @@ //= require jquery_ujs //= require turbolinks //= require_tree . - diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 03343c0dbe..a935ad8000 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -7,6 +7,9 @@ margin: 0; } +#product_new_category { + display: none; +} html, body { height: 100%; diff --git a/app/models/product.rb b/app/models/product.rb index e86f94d5b8..2e30cec221 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -3,5 +3,4 @@ class Product < ActiveRecord::Base has_many :reviews validates :name, presence: true, uniqueness: true validates :price, presence: true, numericality: {greater_than: 0} - end diff --git a/app/views/products/index.html.erb b/app/views/products/index.html.erb index 402d0c7328..8e6a81c67a 100644 --- a/app/views/products/index.html.erb +++ b/app/views/products/index.html.erb @@ -10,10 +10,10 @@ $<%= number_with_precision product.price, precision: 2 %>
<%= form_tag '/orderitems' do %> - <% @quantity_numbers = (1..product.quantity).to_a %> <%= hidden_field_tag :product_id, product.id %>
- <%= select_tag :quantity, options_for_select(@quantity_numbers) %>
- <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
+ <%= select_tag :quantity, options_for_select(1..product.quantity) %>
+

<%= product.quantity %> Available!

+ <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>

<% end %> diff --git a/app/views/products/new.html.erb b/app/views/products/new.html.erb index 803a1b14c2..3323ca5b34 100644 --- a/app/views/products/new.html.erb +++ b/app/views/products/new.html.erb @@ -38,12 +38,6 @@
<%= f.select(:category, options_for_select(["Food", "Create a Category"]), :include_blank => true, class: "form-control") %>
- -
- <%= f.label :category, "OR Create your own category:", class: "col-xs-4 control-label" %> -
- <%= f.text_field :category, class: "form-control" %> -
<%= f.label :'Photo URL', class: "col-xs-4 control-label"%> From c5cd1fc584b7580a91759aee0af2d649ea5f3491 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Mon, 9 May 2016 22:00:05 -0700 Subject: [PATCH 119/174] wahoo we can now write descriptions for products --- app/controllers/reviews_controller.rb | 4 ++-- app/views/reviews/new.html.erb | 29 +++++++++++++++------------ config/routes.rb | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/app/controllers/reviews_controller.rb b/app/controllers/reviews_controller.rb index ab8082ef85..0eccde17e3 100644 --- a/app/controllers/reviews_controller.rb +++ b/app/controllers/reviews_controller.rb @@ -8,7 +8,7 @@ def new def create @review = Review.new(review_create_params[:review]) if @review.save - redirect_to root_path + redirect_to product_path(@review.product_id) else render :new end @@ -17,7 +17,7 @@ def create private def review_create_params - params.permit(review: [:rating, :description]) + params.permit(review: [:rating, :description, :product_id]) end end diff --git a/app/views/reviews/new.html.erb b/app/views/reviews/new.html.erb index e51c809985..3c8db8d6fa 100644 --- a/app/views/reviews/new.html.erb +++ b/app/views/reviews/new.html.erb @@ -1,19 +1,22 @@

Write a review!

<%= params %>
-<%= form_for @review do |f| %> +<%= form_for @review, :url => product_review_path(@product.id) do |f| %>
- <%= f.label :rating, class: "col-xs-4 control-label" %> -
- <%= f.text_field :rating, class: "form-control" %> -
-
- <%= f.label :description, class: "col-xs-4 control-label" %> -
- <%= f.text_field :description, class: "form-control" %> + <%= f.label :rating, class: "col-xs-4 control-label" %> + +
+ <%= f.select :rating, options_for_select((1..5).to_a) %>
+
+ +
+ <%= f.label :description, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :description, class: "form-control" %> +
+ <%= f.hidden_field :product_id, value: @product.id %> +
+<%= f.submit "Publish Review", class:"btn btn-success btn-lg" %>
- <%= f.hidden_field :product_id, value: @product.id %> -
- <%= f.submit "Publish Review", class:"btn btn-success btn-lg" %> - <% end %> +<% end %> diff --git a/config/routes.rb b/config/routes.rb index e8cd9f9c81..cd42057f82 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,7 +7,7 @@ resources :products, :only => [:index, :show, :create] get '/products/:id/reviews/new' => 'reviews#new' , as: "new_review" - post '/products/:id/reviews' => 'reviews#create' + post '/products/:id/reviews' => 'reviews#create', as: "product_review" get '/products/animal/:animal' => 'products#show_animal', as: 'product_animal' get '/products/category/:category' => 'products#show_category', as: 'product_category' From 1dca41d5fc202afaf54cc1a4f579223d17f7445b Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 10 May 2016 09:03:43 -0700 Subject: [PATCH 120/174] changed something --- app/views/products/new.html.erb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/views/products/new.html.erb b/app/views/products/new.html.erb index 3323ca5b34..ec3e991293 100644 --- a/app/views/products/new.html.erb +++ b/app/views/products/new.html.erb @@ -1,5 +1,3 @@ -
<%= params %>
-

Add a Costume to Your Store!

<%= form_for @product, :html => { :class => "form-horizontal center" } do |f| %> From ffc6484720abd47f99ff1fee53b10d4fa2424610 Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 10 May 2016 09:28:36 -0700 Subject: [PATCH 121/174] adding new category now works like it should and is available as category for browsing and for creating new products --- app/assets/stylesheets/application.css | 4 ---- app/controllers/products_controller.rb | 6 +++++- app/views/products/new.html.erb | 10 ++++++++-- config/routes.rb | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index a935ad8000..69b609d2f9 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -7,10 +7,6 @@ margin: 0; } -#product_new_category { - display: none; -} - html, body { height: 100%; } diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 3b909e329c..603d75077d 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -40,10 +40,14 @@ def new @user = User.find(params[:id]) @product = @user.products.new @category = Product.uniq.pluck(:category) + @animal = Product.uniq.pluck(:animal) end def create @product = Product.new(product_create_params[:product]) + if @product.category == "Create a Category" + @product.category = params[:product][:new_category] + end if @product.save redirect_to user_product_path(current_user.id) else @@ -74,7 +78,7 @@ def destroy def product_create_params - params.permit(product: [:name, :description, :price, :quantity, :category, :photo_url, :user_id, :animal]) + params.permit(product: [:name, :description, :price, :quantity, :category, :new_category, :photo_url, :user_id, :animal]) end def product_update_params diff --git a/app/views/products/new.html.erb b/app/views/products/new.html.erb index ec3e991293..e7ee77005d 100644 --- a/app/views/products/new.html.erb +++ b/app/views/products/new.html.erb @@ -28,13 +28,19 @@
<%= f.label :animal, class: "col-xs-4 control-label" %>
- <%= f.select(:animal, options_for_select(["Cat", "Dog", "Guinea Pig", "Goat"]), class: "form-control") %> + <%= f.select(:animal, options_for_select(@animal), class: "form-control") %>
<%= f.label :category, class: "col-xs-4 control-label" %>
- <%= f.select(:category, options_for_select(["Food", "Create a Category"]), :include_blank => true, class: "form-control") %> + <%= f.select(:category, options_for_select(@category), :include_blank => true, class: "form-control") %> +
+
+
+ <%= f.label :new_category, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :new_category, class: "form-control" %>
diff --git a/config/routes.rb b/config/routes.rb index 1d4e5c40cd..2c436b49e0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,7 +9,7 @@ get '/products/animal/:animal' => 'products#show_animal', as: 'product_animal' get '/products/category/:category' => 'products#show_category', as: 'product_category' - + # get '/products/category/new' => 'products#new_category', as: 'new_category' get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' post '/users/:id/products' => 'products#create' From 165a37ec7e8b554b9ff9b295f86635d7bb1e95ea Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 10 May 2016 10:02:44 -0700 Subject: [PATCH 122/174] edit for product working with category and animal in there plus bootstrap --- app/controllers/products_controller.rb | 3 ++ app/views/products/edit.html.erb | 62 +++++++++++++++++--------- 2 files changed, 45 insertions(+), 20 deletions(-) diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 603d75077d..0ef15fd69f 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -41,6 +41,7 @@ def new @product = @user.products.new @category = Product.uniq.pluck(:category) @animal = Product.uniq.pluck(:animal) + @category << "Create a Category" end def create @@ -59,6 +60,8 @@ def edit @product = Product.find(params[:id]) @user = User.find(current_user.id) @quantity = @product.quantity + @animal = Product.uniq.pluck(:animal) + @category = Product.uniq.pluck(:category) end def update diff --git a/app/views/products/edit.html.erb b/app/views/products/edit.html.erb index 2b4e205ab2..d991fec1ff 100644 --- a/app/views/products/edit.html.erb +++ b/app/views/products/edit.html.erb @@ -1,24 +1,46 @@ -

Edit Product

-<%= params %> +

Edit <%= @product.name %> Costume

-<%= form_for @product, method: :patch, url: update_product_path(@product) do |f| %> - <%= f.label :name %> - <%= f.text_field :name %> -
-​ <%= f.label :description %> - <%= f.text_field :description %> -
- <%= f.label :price %> - <%= f.number_field :price, step: 0.5 %> -
- <%= f.label :quantity %> - <%= f.select(:quantity, options_for_select(1..10, selected: @quantity)) %> -
- <%= f.label :animal %> - <%= f.select(:animal, options_for_select(["Cat", "Dog", "Guinea Pig", "Goat"])) %> -
- <%= f.label :'Photo URL' %> - <%= f.url_field(:photo_url) %> +<%= form_for @product, method: :patch, url: update_product_path(@product), :html => { :class => "form-horizontal center" } do |f| %> +
+ <%= f.label :name, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :name, class: "form-control" %> +
+
+
+​ <%= f.label :description, class: "col-xs-4 control-label" %> +
+ <%= f.text_field :description, class: "form-control" %> +
+
+
+ <%= f.label :price, class: "col-xs-4 control-label" %> +
+ <%= f.number_field :price, step: 0.5, class: "form-control" %> +
+
+
+ <%= f.label :quantity, class: "col-xs-4 control-label" %> +
+ <%= f.select(:quantity, options_for_select(1..10, selected: @quantity), class: "form-control") %> +
+
+
+ <%= f.label :animal, class: "col-xs-4 control-label" %> +
+ <%= f.select(:animal, options_for_select(@animal, :selected => @product.animal), class: "form-control") %> +
+
+
+ <%= f.label :category, class: "col-xs-4 control-label" %> +
+ <%= f.select(:category, options_for_select(@category, :selected => @product.category), class: "form-control") %> +
+
+
+ <%= f.label :'Photo URL', class: "col-xs-4 control-label" %> +
+ <%= f.url_field :photo_url, class: "form-control" %> <%= f.hidden_field :user_id, value: @user.id %> ​
From 47063e508880d7faf92b10dc1ff111dea5d6eee9 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Tue, 10 May 2016 10:25:28 -0700 Subject: [PATCH 123/174] every time a review gets created it updated the products rating attribute --- app/controllers/reviews_controller.rb | 16 ++++++++++++++++ ...60510171855_change_product_rating_to_float.rb | 5 +++++ db/schema.rb | 4 ++-- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20160510171855_change_product_rating_to_float.rb diff --git a/app/controllers/reviews_controller.rb b/app/controllers/reviews_controller.rb index 0eccde17e3..6624317300 100644 --- a/app/controllers/reviews_controller.rb +++ b/app/controllers/reviews_controller.rb @@ -8,16 +8,32 @@ def new def create @review = Review.new(review_create_params[:review]) if @review.save + update_product_rating(Product.find(@review.product_id)) redirect_to product_path(@review.product_id) else render :new end end + private + def update_product_rating(product) + ratings = product.reviews.collect { |a| a.rating.to_f } + overall = ratings.reduce(:+)/ratings.length + product.update(rating: overall) + end + def review_create_params params.permit(review: [:rating, :description, :product_id]) end end + + + # def show + # @product = Product.find(params[:id]) + # @quantity = @product.quantity + # @quantity_numbers = (1..@quantity).to_a + # @rating = overall_rating(@product) + # end diff --git a/db/migrate/20160510171855_change_product_rating_to_float.rb b/db/migrate/20160510171855_change_product_rating_to_float.rb new file mode 100644 index 0000000000..f1007891ad --- /dev/null +++ b/db/migrate/20160510171855_change_product_rating_to_float.rb @@ -0,0 +1,5 @@ +class ChangeProductRatingToFloat < ActiveRecord::Migration + def change + change_column :products, :rating, :float + end +end diff --git a/db/schema.rb b/db/schema.rb index d861162f1a..1d1e022426 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160509225218) do +ActiveRecord::Schema.define(version: 20160510171855) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -52,7 +52,7 @@ t.string "name" t.float "price" t.integer "quantity" - t.integer "rating" + t.float "rating" t.string "description" t.string "category" t.string "photo_url" From 2228646cf274322fe20e4b29e5b9d198fb2d7604 Mon Sep 17 00:00:00 2001 From: Alysia Brown Date: Tue, 10 May 2016 10:38:43 -0700 Subject: [PATCH 124/174] Merge commit. --- app/views/orders/seller_items.html.erb | 26 +++++++++++++++++++- app/views/orders/show_seller_orders.html.erb | 3 --- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/app/views/orders/seller_items.html.erb b/app/views/orders/seller_items.html.erb index ff8feb5034..4b117532ad 100644 --- a/app/views/orders/seller_items.html.erb +++ b/app/views/orders/seller_items.html.erb @@ -1 +1,25 @@ -

Hello, World!

+

Order Number <%= order_id %>

+ + + + + + + + + + + <% order_items = Orderitem.where(order_id: @order.id) && Orderitem.where(seller_id: user_id) %> + <% orders = order_items.collect(&:order_id).uniq %> + <% orders.each do |order| %> + <% orders = Orderitem.where(order_id: order.id) %> + + <% orders.each do |order| %> + + + + + + <% end %> + <% end %> +
ItemQuantityItem PriceItem Total
<%= order.product.name %><%= order.quantity %>$<%= order.price %>0$<%= order.price * order.quantity %>0
diff --git a/app/views/orders/show_seller_orders.html.erb b/app/views/orders/show_seller_orders.html.erb index 2975532c64..4fc6a4a227 100644 --- a/app/views/orders/show_seller_orders.html.erb +++ b/app/views/orders/show_seller_orders.html.erb @@ -14,7 +14,6 @@

$<%= Orderitem.revenue(@user.id) %>0

Orders Containing Your Products

-
    @@ -39,8 +38,6 @@ <% end %> <% end %> -
    - From 599a7b9fede7b43dec412e2fc1fddb03b52c4e08 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Tue, 10 May 2016 10:44:03 -0700 Subject: [PATCH 125/174] added method to only take last 4 digits of credit card and display all user information on confirmation page --- app/controllers/orders_controller.rb | 1 + app/views/orders/confirmation.html.erb | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 504a3ac327..e0eda9cd16 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -67,6 +67,7 @@ def orderitem_edit_params end def order_update_params + params[:order][:credit_card_number] = params[:order][:credit_card_number][-4..-1] params.permit(order: [:name_on_credit_card, :city, :state, :billing_zip, :email, :status, :stree_address, :credit_card_cvv, :credit_card_number, :credit_card_exp_date]) end diff --git a/app/views/orders/confirmation.html.erb b/app/views/orders/confirmation.html.erb index 59f5fe2cf9..9d7371ceb6 100644 --- a/app/views/orders/confirmation.html.erb +++ b/app/views/orders/confirmation.html.erb @@ -1,6 +1,12 @@

    Congratulations! You bought some stuff!

    Details of Order # <%= @order.id %>

    +Sold To: <%= @order.name_on_credit_card %>
    +Shipping To: +<%= @order.street_address %>
    +<%= @order.city %>
    +<%= @order.state %>, <%= @order.billing_zip %>
    +Credit Card : **** **** **** **** <%= @order.credit_card_number %>

    <% @cart_price = 0 %> <% @order.orderitems.each do |item| %> Item: <%= link_to Product.find(item.product_id).name , product_path(Product.find(item.product_id).id) %>
    From d01fb976464b4bcdfa286d1012ebaa1e08542f82 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Tue, 10 May 2016 11:17:31 -0700 Subject: [PATCH 126/174] added attribute to review so we can know who wrote it, it shows up on show page for product --- app/assets/stylesheets/application.css | 4 +++- app/controllers/reviews_controller.rb | 10 +-------- app/views/products/show.html.erb | 22 ++++++++++++++----- app/views/reviews/new.html.erb | 3 ++- .../20160510181025_add_user_to_review.rb | 5 +++++ db/schema.rb | 3 ++- 6 files changed, 30 insertions(+), 17 deletions(-) create mode 100644 db/migrate/20160510181025_add_user_to_review.rb diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 69b609d2f9..7ee1de9ddc 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -193,4 +193,6 @@ div.orderitem { margin-right: 10%; } - +span.review-description { + color: blue; +} diff --git a/app/controllers/reviews_controller.rb b/app/controllers/reviews_controller.rb index 6624317300..c06aa15cc1 100644 --- a/app/controllers/reviews_controller.rb +++ b/app/controllers/reviews_controller.rb @@ -25,15 +25,7 @@ def update_product_rating(product) end def review_create_params - params.permit(review: [:rating, :description, :product_id]) + params.permit(review: [:rating, :description, :product_id, :user_id]) end end - - - # def show - # @product = Product.find(params[:id]) - # @quantity = @product.quantity - # @quantity_numbers = (1..@quantity).to_a - # @rating = overall_rating(@product) - # end diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb index eedff963c8..35d62d238a 100644 --- a/app/views/products/show.html.erb +++ b/app/views/products/show.html.erb @@ -1,4 +1,4 @@ -
    +

    <%= @product.description %>


    $<%= number_with_precision @product.price, precision: 2 %> @@ -13,11 +13,23 @@

    <%= link_to "Write a Review", new_review_path, class: "btn btn-primary" %>

    -

    Overall Rating: <%= @rating %> / 5

    -

    Reviews:

    <% @product.reviews.each do |review| %> -

    <%= review.description %>

    +

    Overall Rating: <%= number_with_precision @rating , precision: 1 %> / 5

    + +
    +

    Reviews:

    + <% @product.reviews.each do |review| %> + <% unless review.user_id.nil? %> +

    Reviewed By: <%= User.find(review.user_id).full_name %>

    + <% end %> +

    Review Date: <%= review.created_at.strftime("%m/%d/%Y at %I:%M%p") %> +

    Rating: <%= review.rating %>/5

    +

    <%= review.description %>

    +
    <% end %> -
    +
+ + +

<%= @product.name %>

diff --git a/app/views/reviews/new.html.erb b/app/views/reviews/new.html.erb index 3c8db8d6fa..f28e4bbf96 100644 --- a/app/views/reviews/new.html.erb +++ b/app/views/reviews/new.html.erb @@ -9,13 +9,14 @@
<%= f.select :rating, options_for_select((1..5).to_a) %>
- +
<%= f.label :description, class: "col-xs-4 control-label" %>
<%= f.text_field :description, class: "form-control" %>
<%= f.hidden_field :product_id, value: @product.id %> + <%= f.hidden_field :user_id, value: current_user.id %>
<%= f.submit "Publish Review", class:"btn btn-success btn-lg" %>
diff --git a/db/migrate/20160510181025_add_user_to_review.rb b/db/migrate/20160510181025_add_user_to_review.rb new file mode 100644 index 0000000000..ccaf81190e --- /dev/null +++ b/db/migrate/20160510181025_add_user_to_review.rb @@ -0,0 +1,5 @@ +class AddUserToReview < ActiveRecord::Migration + def change + add_column :reviews, :user_id, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 1d1e022426..31a2d5e71e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160510171855) do +ActiveRecord::Schema.define(version: 20160510181025) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -70,6 +70,7 @@ t.string "description" t.string "rating" t.string "product_id" + t.string "user_id" end create_table "users", force: :cascade do |t| From 6bb0bf6e6d3d1111b1e5ac9827833a608304c631 Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 10 May 2016 11:19:53 -0700 Subject: [PATCH 127/174] retire product button working. now to work on making them not show up on any pages --- app/assets/stylesheets/application.css | 6 +++++- app/controllers/products_controller.rb | 7 +++++++ app/views/products/show_seller_products.html.erb | 10 +++++++++- config/routes.rb | 6 +++--- db/migrate/20160510170700_add_retired_prod_column.rb | 5 +++++ .../20160510171306_make_retired_false_as_default.rb | 5 +++++ db/schema.rb | 7 ++++--- 7 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 db/migrate/20160510170700_add_retired_prod_column.rb create mode 100644 db/migrate/20160510171306_make_retired_false_as_default.rb diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 69b609d2f9..4ab2934d6a 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -193,4 +193,8 @@ div.orderitem { margin-right: 10%; } - +.retired { + text-align: center; + color: #b30000; + font-weight: bold; +} diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 0ef15fd69f..85ee2f8cb8 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -70,6 +70,13 @@ def update redirect_to user_product_path(current_user.id) end + def retire + @product = Product.find(params[:id]) + @product.retired = true + @product.save + redirect_to user_product_path + end + def destroy @product = Product.find(params[:id]) @product.destroy diff --git a/app/views/products/show_seller_products.html.erb b/app/views/products/show_seller_products.html.erb index 933bf0eaee..bd6f8d18b2 100644 --- a/app/views/products/show_seller_products.html.erb +++ b/app/views/products/show_seller_products.html.erb @@ -6,8 +6,12 @@
<% unless product.photo_url.nil? %> + <% if product.retired == true %> +

PRODUCT RETIRED

+ <% end %> <% end %>
+ <% if product.retired == false %> <% if product.quantity == 0 %>

You have no products!

<% else %> @@ -21,11 +25,15 @@ <% end %>

Number in Stock: <%= product.quantity %>

<% end %> + <% end %>
+ <% if product.retired == false %>

<%= link_to "Edit Product", edit_product_path(product), class: 'btn btn-primary' %>

-

<%= link_to "Retire Costume", class: "btn btn-warning" %>

+

<%= link_to "Retire Costume", retire_product_path(product.id), method: :patch, class: "btn btn-warning" %>

+ <% end %>

<%= link_to "Delete Product", product_path(product.id), method: :delete, class: "btn btn-danger" %>


+ <% end %> diff --git a/config/routes.rb b/config/routes.rb index 041b77c767..372df211a4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,16 +8,16 @@ get '/products/:id/reviews/new' => 'reviews#new' , as: "new_review" post '/products/:id/reviews' => 'reviews#create', as: "product_review" + get '/users/:id/products' => 'products#show_seller_products', as: 'user_product' + patch '/products/:id/retire' => 'products#retire', as: 'retire_product' get '/products/animal/:animal' => 'products#show_animal', as: 'product_animal' get '/products/category/:category' => 'products#show_category', as: 'product_category' - # get '/products/category/new' => 'products#new_category', as: 'new_category' get '/products/:full_name/:id' => 'products#show_merchant', as: 'product_merchant' get '/users/:id/products/new' => 'products#new', as: 'new_product' post '/users/:id/products' => 'products#create' - # get '/users/:id/products/:id/edit' => 'products#edit', as: 'edit_product' patch '/users/:user_id/products' => 'products#update', as: 'update_product' - get '/users/:id/products' => 'products#show_seller_products', as: 'user_product' + resources :orders get '/users/:id/orders' => 'orders#show_seller_orders', as: 'show_seller_orders' diff --git a/db/migrate/20160510170700_add_retired_prod_column.rb b/db/migrate/20160510170700_add_retired_prod_column.rb new file mode 100644 index 0000000000..da4511e0b6 --- /dev/null +++ b/db/migrate/20160510170700_add_retired_prod_column.rb @@ -0,0 +1,5 @@ +class AddRetiredProdColumn < ActiveRecord::Migration + def change + add_column :products, :retired, :boolean + end +end diff --git a/db/migrate/20160510171306_make_retired_false_as_default.rb b/db/migrate/20160510171306_make_retired_false_as_default.rb new file mode 100644 index 0000000000..2c88850555 --- /dev/null +++ b/db/migrate/20160510171306_make_retired_false_as_default.rb @@ -0,0 +1,5 @@ +class MakeRetiredFalseAsDefault < ActiveRecord::Migration + def change + change_column :products, :retired, :boolean, default: false + end +end diff --git a/db/schema.rb b/db/schema.rb index d861162f1a..cc69fbcd8c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160509225218) do +ActiveRecord::Schema.define(version: 20160510171306) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -58,10 +58,11 @@ t.string "photo_url" t.string "status" t.integer "user_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "animal" t.string "new_category" + t.boolean "retired", default: false end create_table "reviews", force: :cascade do |t| From 63ea79771058b886fbba641d90f4e0bc5976be1e Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 10 May 2016 11:29:31 -0700 Subject: [PATCH 128/174] controller methods to show only products that are not retired --- app/controllers/home_controller.rb | 4 ++-- app/controllers/products_controller.rb | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index d9c69362fc..b1325a8208 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,7 +1,7 @@ class HomeController < ApplicationController def index - @products = Product.all - @product_picker = Product.where.not(id: nil).sample(3) + @products = Product.where(retired: false) + @product_picker = Product.where(retired: false).where.not(id: nil).sample(3) @animals = Product.uniq.pluck(:animal) @categories = Product.uniq.pluck(:category) @users = User.all diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 85ee2f8cb8..06264acdc8 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -2,7 +2,7 @@ class ProductsController < ApplicationController before_action :require_login, only: [:new, :create] def index - @products = Product.all + @products = Product.where(retired: false) end def show @@ -25,15 +25,15 @@ def show_seller_products def show_merchant @user = User.find(params[:id]) - @products = @user.products + @products = @user.products.where(retired: false) end def show_animal - @products = Product.where(animal: params[:animal]) + @products = Product.where(animal: params[:animal]).where(retired: false) end def show_category - @products = Product.where(category: params[:category]) + @products = Product.where(category: params[:category]).where(retired: false) end def new @@ -95,8 +95,4 @@ def product_update_params params.permit(product: [:name, :description, :price, :quantity, :animal, :category, :photo_url, :user_id]) end - # def category_params - # params.permit(:new_category).merge(category: :new_category) - # end - end From 0f2ffe101f9f015df06110f9408e66b2662305e2 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Tue, 10 May 2016 13:17:48 -0700 Subject: [PATCH 129/174] starting validations for order --- app/controllers/orders_controller.rb | 2 +- app/models/order.rb | 11 +++++++++++ app/views/orders/checkout.html.erb | 11 +++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index e0eda9cd16..1c0cc82758 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -69,7 +69,7 @@ def orderitem_edit_params def order_update_params params[:order][:credit_card_number] = params[:order][:credit_card_number][-4..-1] params.permit(order: [:name_on_credit_card, :city, :state, :billing_zip, - :email, :status, :stree_address, :credit_card_cvv, :credit_card_number, :credit_card_exp_date]) + :email, :status, :street_address, :credit_card_cvv, :credit_card_number, :credit_card_exp_date]) end diff --git a/app/models/order.rb b/app/models/order.rb index 797da3a8f5..9a6397d61d 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -1,4 +1,15 @@ class Order < ActiveRecord::Base has_many :orderitems belongs_to :user + + # validates :email, presence: true + # validates :street_address, presence: true + # validates :city, presence: true + # validates :state, presence: true + # validates :name_on_credit_card, presence: true + # validates :credit_card_number, presence: true, numericality: {only_integer: true } + # validates :credit_card_cvv, presence: true, numericality: {only_integer: true } + # validates :billing_zip, presence: true, numericality: {only_integer: true } + # validates :credit_card_exp_date, presence: true + end diff --git a/app/views/orders/checkout.html.erb b/app/views/orders/checkout.html.erb index 7e8c5f3c41..b595502a6f 100644 --- a/app/views/orders/checkout.html.erb +++ b/app/views/orders/checkout.html.erb @@ -1,5 +1,16 @@

Complete your purchase:

+<% if @order.errors.any? %> +
    + <% @order.errors.each do |column, message| %> +
  • + <%= column.capitalize %> <%= message %> +
  • +
+ <% end %> +<% end %> + +

To finish up, please provide all of the following information:


<%= form_for @order, html: { :class => "form-horizontal center" } do |f| %> From 201cbe6913eb7a7a0a4f8a603033e34dfe1673d9 Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 10 May 2016 13:20:00 -0700 Subject: [PATCH 130/174] products controller edits --- app/controllers/products_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb index 06264acdc8..fb00085448 100644 --- a/app/controllers/products_controller.rb +++ b/app/controllers/products_controller.rb @@ -1,5 +1,5 @@ class ProductsController < ApplicationController - before_action :require_login, only: [:new, :create] + before_action :require_login, only: [:new, :create, :show_seller_products, :edit, :update, :retire, :destroy] def index @products = Product.where(retired: false) From 18f90ff1c233a75ab8bb6b01ca2f03db4ab230e4 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Tue, 10 May 2016 13:52:39 -0700 Subject: [PATCH 131/174] added some details to checkout forms to make certain parts mandatory and restrict character limit for some fields --- app/controllers/orders_controller.rb | 2 +- app/models/order.rb | 13 ++++--------- app/views/orders/checkout.html.erb | 29 +++++++++------------------- app/views/reviews/new.html.erb | 4 +++- 4 files changed, 17 insertions(+), 31 deletions(-) diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 1c0cc82758..97d90fea07 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -34,7 +34,7 @@ def remove_items_from_stock(items) quantity_being_bought = item.quantity available_quantity = product.quantity new_quantity = available_quantity - quantity_being_bought - if new_quantity > 0 + if new_quantity >= 0 product.update(quantity: new_quantity) else return false diff --git a/app/models/order.rb b/app/models/order.rb index 9a6397d61d..2de1e80e7c 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -2,14 +2,9 @@ class Order < ActiveRecord::Base has_many :orderitems belongs_to :user - # validates :email, presence: true - # validates :street_address, presence: true - # validates :city, presence: true - # validates :state, presence: true - # validates :name_on_credit_card, presence: true - # validates :credit_card_number, presence: true, numericality: {only_integer: true } - # validates :credit_card_cvv, presence: true, numericality: {only_integer: true } - # validates :billing_zip, presence: true, numericality: {only_integer: true } - # validates :credit_card_exp_date, presence: true + # validates :credit_card_number, length: { is: 16} + # validates :credit_card_cvv, length: { is: 3 } + # validates :billing_zip, length: { is: 5 } + end diff --git a/app/views/orders/checkout.html.erb b/app/views/orders/checkout.html.erb index b595502a6f..55a48ace48 100644 --- a/app/views/orders/checkout.html.erb +++ b/app/views/orders/checkout.html.erb @@ -1,71 +1,60 @@

Complete your purchase:

-<% if @order.errors.any? %> -
    - <% @order.errors.each do |column, message| %> -
  • - <%= column.capitalize %> <%= message %> -
  • -
- <% end %> -<% end %> - -

To finish up, please provide all of the following information:


<%= form_for @order, html: { :class => "form-horizontal center" } do |f| %>
<%= f.label :email, class: "col-xs-4 control-label" %>
- <%= f.email_field :email, class: "form-control" %> + <%= f.email_field :email, class: "form-control", required: true %>
<%= f.label :street_address, class: "col-xs-4 control-label" %>
- <%= f.text_field :street_address, class: "form-control" %> + <%= f.text_field :street_address, class: "form-control", required: true %>
<%= f.label :city, class: "col-xs-4 control-label" %>
- <%= f.text_field :city, class: "form-control" %> + <%= f.text_field :city, class: "form-control", required: true %>
<%= f.label :state, class: "col-xs-4 control-label" %>
- <%= f.select :state, options_for_select(us_states),{}, class: "form-control" %> + <%= f.select :state, options_for_select(us_states),{}, class: "form-control", required: true %>
<%= f.label :name_on_credit_card, class: "col-xs-4 control-label" %>
- <%= f.text_field :name_on_credit_card, class: "form-control" %> + <%= f.text_field :name_on_credit_card, class: "form-control", required: true %>
<%= f.label :credit_card_number, class: "col-xs-4 control-label" %>
- <%= f.text_field :credit_card_number, class: "form-control" %> + <%= f.text_field :credit_card_number, class: "form-control", maxlength: 16, required: true %>
<%= f.label :credit_card_exp_date, "Credit Card Exp Date", class: "col-xs-4 control-label" %>
- <%= f.date_select :credit_card_exp_date, discard_day: true, start_year: Date.today.year, end_year: (Date.today.year + 10), order: [:month, :year], class: "form-control" %> + <%= f.date_select :credit_card_exp_date, discard_day: true, start_year: Date.today.year, end_year: (Date.today.year + 10), order: [:month, :year], class: "form-control" , required: true %>
<%= f.label :"credit_card_cvv", "Credit Card CVV", class: "col-xs-4 control-label" %>
- <%= f.text_field :credit_card_cvv, class: "form-control" %> + <%= f.text_field :credit_card_cvv, class: "form-control", maxlength: 3, required: true %>
<%= f.label :billing_zip, class: "col-xs-4 control-label" %>
- <%= f.text_field :billing_zip, class: "form-control" %> + <%= f.text_field :billing_zip, class: "form-control" , maxlength: 5, required: true %> <%= f.hidden_field :status, value: "Completed" %>
diff --git a/app/views/reviews/new.html.erb b/app/views/reviews/new.html.erb index f28e4bbf96..7663ebd4e5 100644 --- a/app/views/reviews/new.html.erb +++ b/app/views/reviews/new.html.erb @@ -16,7 +16,9 @@ <%= f.text_field :description, class: "form-control" %>
<%= f.hidden_field :product_id, value: @product.id %> - <%= f.hidden_field :user_id, value: current_user.id %> + <% if current_user %> + <%= f.hidden_field :user_id, value: current_user.id %> + <% end %>
<%= f.submit "Publish Review", class:"btn btn-success btn-lg" %>
From d8d32a7007206601325fc52ba0219ea5b129d13b Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Tue, 10 May 2016 15:07:43 -0700 Subject: [PATCH 132/174] added required fields to forms and asterisks, so pretty --- app/assets/stylesheets/application.css | 5 +++++ app/views/orders/checkout.html.erb | 18 +++++++++--------- app/views/sessions/new.html.erb | 4 ++-- app/views/users/new.html.erb | 10 +++++----- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index e8c1323775..5445126198 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -203,3 +203,8 @@ div.orderitem { span.review-description { color: blue; } + +label.required:after { + content: " *"; + color: red; +} diff --git a/app/views/orders/checkout.html.erb b/app/views/orders/checkout.html.erb index 55a48ace48..eda2f99cb3 100644 --- a/app/views/orders/checkout.html.erb +++ b/app/views/orders/checkout.html.erb @@ -4,55 +4,55 @@ <%= form_for @order, html: { :class => "form-horizontal center" } do |f| %>
- <%= f.label :email, class: "col-xs-4 control-label" %> + <%= f.label :email, class: "col-xs-4 control-label required" %>
<%= f.email_field :email, class: "form-control", required: true %>
- <%= f.label :street_address, class: "col-xs-4 control-label" %> + <%= f.label :street_address, class: "col-xs-4 control-label required" %>
<%= f.text_field :street_address, class: "form-control", required: true %>
- <%= f.label :city, class: "col-xs-4 control-label" %> + <%= f.label :city, class: "col-xs-4 control-label required" %>
<%= f.text_field :city, class: "form-control", required: true %>
- <%= f.label :state, class: "col-xs-4 control-label" %> + <%= f.label :state, class: "col-xs-4 control-label required" %>
<%= f.select :state, options_for_select(us_states),{}, class: "form-control", required: true %>
- <%= f.label :name_on_credit_card, class: "col-xs-4 control-label" %> + <%= f.label :name_on_credit_card, class: "col-xs-4 control-label required" %>
<%= f.text_field :name_on_credit_card, class: "form-control", required: true %>
- <%= f.label :credit_card_number, class: "col-xs-4 control-label" %> + <%= f.label :credit_card_number, class: "col-xs-4 control-label required" %>
<%= f.text_field :credit_card_number, class: "form-control", maxlength: 16, required: true %>
- <%= f.label :credit_card_exp_date, "Credit Card Exp Date", class: "col-xs-4 control-label" %> + <%= f.label :credit_card_exp_date, "Credit Card Exp Date", class: "col-xs-4 control-label required" %>
<%= f.date_select :credit_card_exp_date, discard_day: true, start_year: Date.today.year, end_year: (Date.today.year + 10), order: [:month, :year], class: "form-control" , required: true %>
- <%= f.label :"credit_card_cvv", "Credit Card CVV", class: "col-xs-4 control-label" %> + <%= f.label :"credit_card_cvv", "Credit Card CVV", class: "col-xs-4 control-label required " %>
<%= f.text_field :credit_card_cvv, class: "form-control", maxlength: 3, required: true %>
- <%= f.label :billing_zip, class: "col-xs-4 control-label" %> + <%= f.label :billing_zip, class: "col-xs-4 control-label required" %>
<%= f.text_field :billing_zip, class: "form-control" , maxlength: 5, required: true %> diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index cae6eea278..dc2bd5402b 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -5,7 +5,7 @@ <%= form_tag sessions_path, method: :post do %>
- <%= label_tag :username, "Username:", class: "col-xs-4 control-label" %> + <%= label_tag :username, "Username:", class: "col-xs-4 control-label required" %>
<%= text_field_tag :username, "", class: "form-control" %> ​
@@ -13,7 +13,7 @@
- <%= label_tag :password, "Password (secret):", class: "col-xs-4 control-label" %> + <%= label_tag :password, "Password (secret):", class: "col-xs-4 control-label required" %>
<%= password_field_tag :password, "", class: "form-control" %> ​
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index a2b1fad55b..914bbb4fd0 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -12,31 +12,31 @@ ​ <%= form_for @user, :html => { :class => "form-horizontal center" } do |f| %>
- <%= f.label :username, class: "col-xs-4 control-label" %> + <%= f.label :username, class: "col-xs-4 control-label required" %>
<%= f.text_field :username, class: "form-control" %>
- <%= f.label :full_name, class: "col-xs-4 control-label" %> + <%= f.label :full_name, class: "col-xs-4 control-label required" %>
<%= f.text_field :full_name, class: "form-control" %> ​
- <%= f.label :email, class: "col-xs-4 control-label" %> + <%= f.label :email, class: "col-xs-4 control-label required" %>
<%= f.email_field :email, class: "form-control" %> ​
- <%= f.label :password, class: "col-xs-4 control-label" %> + <%= f.label :password, class: "col-xs-4 control-label required" %>
<%= f.password_field :password, class: "form-control" %> ​
- <%= f.label :password_confirmation, class: "col-xs-4 control-label" %> + <%= f.label :password_confirmation, class: "col-xs-4 control-label required" %>
<%= f.password_field :password_confirmation, class: "form-control" %>
From 9a28786e4de44abb97fa9965a5d321fe2f45a056 Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 10 May 2016 15:23:05 -0700 Subject: [PATCH 133/174] all show pages now updated to say when items are out of stock. signed in user can still see product and update the quantity to add stock. --- app/assets/stylesheets/application.css | 2 +- app/controllers/orders_controller.rb | 2 +- app/views/home/index.html.erb | 6 +++++- app/views/products/index.html.erb | 7 ++++++- app/views/products/show.html.erb | 6 +++++- app/views/products/show_animal.html.erb | 5 +++++ app/views/products/show_category.html.erb | 7 ++++++- app/views/products/show_merchant.html.erb | 5 +++++ app/views/products/show_seller_products.html.erb | 6 ++---- 9 files changed, 36 insertions(+), 10 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index e8c1323775..b1f79b876c 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -194,7 +194,7 @@ div.orderitem { } -.retired { +.retired-empty { text-align: center; color: #b30000; font-weight: bold; diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 1c0cc82758..97d90fea07 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -34,7 +34,7 @@ def remove_items_from_stock(items) quantity_being_bought = item.quantity available_quantity = product.quantity new_quantity = available_quantity - quantity_being_bought - if new_quantity > 0 + if new_quantity >= 0 product.update(quantity: new_quantity) else return false diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index e67c3fc2eb..6b13bf3b83 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -40,8 +40,12 @@ <%= form_tag '/orderitems' do %> <%= hidden_field_tag :product_id, product.id %>
<%= select_tag :quantity, options_for_select(1..product.quantity) %>
+ <% if product.quantity == 0 %> +

OUT OF STOCK!

+ <% else %>

<%= product.quantity %> Available!

- <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
+ <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
+ <% end %> <% end %>
diff --git a/app/views/products/index.html.erb b/app/views/products/index.html.erb index 8e6a81c67a..89866e08d4 100644 --- a/app/views/products/index.html.erb +++ b/app/views/products/index.html.erb @@ -12,8 +12,13 @@ <%= form_tag '/orderitems' do %> <%= hidden_field_tag :product_id, product.id %>
<%= select_tag :quantity, options_for_select(1..product.quantity) %>
-

<%= product.quantity %> Available!

+ <% if product.quantity == 0 %> +

OUT OF STOCK!

+ <% else %> +

<%= product.quantity %> Available!

+ <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
+ <% end %>
<% end %>
diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb index 35d62d238a..fe4f93a2e3 100644 --- a/app/views/products/show.html.erb +++ b/app/views/products/show.html.erb @@ -6,8 +6,12 @@ <%= form_tag '/orderitems' do %> <%= hidden_field_tag :product_id, @product.id %>
<%= select_tag :quantity, options_for_select(@quantity_numbers) %>
+ <% if @product.quantity == 0 %> +

OUT OF STOCK!

+ <% else %>

<%= @product.quantity %> Available!

- <%= submit_tag "Add to Cart", class: 'btn btn-primary' %> + <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
+ <% end %> <% end %>

<%= link_to "Write a Review", new_review_path, class: "btn btn-primary" %>

diff --git a/app/views/products/show_animal.html.erb b/app/views/products/show_animal.html.erb index e65b713c8a..8468f764f0 100644 --- a/app/views/products/show_animal.html.erb +++ b/app/views/products/show_animal.html.erb @@ -13,9 +13,14 @@ $<%= number_with_precision product.price, precision: 2 %>
<%= hidden_field_tag :product_id, product.id %> <%= select_tag :quantity, options_for_select(1..product.quantity) %>
+ <% if product.quantity == 0 %> +

OUT OF STOCK!

+ <% else %>

<%= product.quantity %> Available!

+ <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
<% end %> + <% end %>
<% end %> diff --git a/app/views/products/show_category.html.erb b/app/views/products/show_category.html.erb index bf703af13f..240c8f3e37 100644 --- a/app/views/products/show_category.html.erb +++ b/app/views/products/show_category.html.erb @@ -15,8 +15,13 @@ <%= link_to product.name, product_path(product.id) %> <%= hidden_field_tag :product_id, product.id %>
<%= select_tag :quantity, options_for_select(1..product.quantity) %>
+ <% if product.quantity == 0 %> +

OUT OF STOCK!

+ <% else %>

<%= product.quantity %> Available!

- <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
+ + <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
+ <% end %> <% end %>
diff --git a/app/views/products/show_merchant.html.erb b/app/views/products/show_merchant.html.erb index f4dd277525..12dbcfe9b8 100644 --- a/app/views/products/show_merchant.html.erb +++ b/app/views/products/show_merchant.html.erb @@ -15,9 +15,14 @@ <%= link_to product.name, product_path(product.id) %> <%= hidden_field_tag :product_id, product.id %>
<%= select_tag :quantity, options_for_select(1..product.quantity) %>
+ <% if product.quantity == 0 %> +

OUT OF STOCK!

+ <% else %>

<%= product.quantity %> Available!

+ <%= submit_tag "Add to Cart", class: 'btn btn-primary' %>
<% end %> + <% end %>
<% end %> diff --git a/app/views/products/show_seller_products.html.erb b/app/views/products/show_seller_products.html.erb index bd6f8d18b2..90fe223de2 100644 --- a/app/views/products/show_seller_products.html.erb +++ b/app/views/products/show_seller_products.html.erb @@ -1,5 +1,3 @@ - -
<%= params %>

Current Products

<% @products.each do |product| %>
@@ -7,13 +5,13 @@ <% unless product.photo_url.nil? %> <% if product.retired == true %> -

PRODUCT RETIRED

+

PRODUCT RETIRED

<% end %> <% end %>
<% if product.retired == false %> <% if product.quantity == 0 %> -

You have no products!

+

You have no stock left!

<% else %>
<%= product.name %> From 1f8ab3894248c744eacd3a6cf70d8688612d1b76 Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 10 May 2016 15:39:16 -0700 Subject: [PATCH 134/174] added a test that passed --- test/fixtures/homes.yml | 11 ----------- test/fixtures/orderitems.yml | 11 ----------- test/fixtures/orders.yml | 11 ----------- test/fixtures/products.yml | 11 ----------- test/fixtures/reviews.yml | 12 ------------ test/fixtures/users.yml | 3 ++- test/models/product_test.rb | 6 +++--- 7 files changed, 5 insertions(+), 60 deletions(-) diff --git a/test/fixtures/homes.yml b/test/fixtures/homes.yml index 937a0c002e..e69de29bb2 100644 --- a/test/fixtures/homes.yml +++ b/test/fixtures/homes.yml @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value diff --git a/test/fixtures/orderitems.yml b/test/fixtures/orderitems.yml index aef58af322..7f140e64fb 100644 --- a/test/fixtures/orderitems.yml +++ b/test/fixtures/orderitems.yml @@ -1,14 +1,3 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value first_orderitem: quantity: 2 diff --git a/test/fixtures/orders.yml b/test/fixtures/orders.yml index af85f42934..f19f4d3427 100644 --- a/test/fixtures/orders.yml +++ b/test/fixtures/orders.yml @@ -1,14 +1,3 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value first_order: status: "pending" diff --git a/test/fixtures/products.yml b/test/fixtures/products.yml index b88dd51e03..44018e39a5 100644 --- a/test/fixtures/products.yml +++ b/test/fixtures/products.yml @@ -1,14 +1,3 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value dog_pirate: name: Dog Pirate diff --git a/test/fixtures/reviews.yml b/test/fixtures/reviews.yml index e1bb22c894..1910a41627 100644 --- a/test/fixtures/reviews.yml +++ b/test/fixtures/reviews.yml @@ -1,15 +1,3 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -# This model initially had no columns defined. If you add columns to the -# model remove the '{}' from the fixture names and add the columns immediately -# below each fixture, per the syntax in the comments below -# -one: {} -# column: value -# -two: {} -# column: value - dog_pirate_review1: description: Dog Pirate is the best. rating: 3 diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index e027bd09d8..fea437990b 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -1,6 +1,6 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html dog_merchant: + id: 3 username: dogs_yes email: dog@dog.com password_digest: <%= BCrypt::Password.create('password', cost: 1) %> @@ -11,6 +11,7 @@ dog_merchant: zip: 11111 cat_merchant: + id: 4 username: cats_yes email: cat@cat.com password_digest: <%= BCrypt::Password.create('other_password', cost: 1) %> diff --git a/test/models/product_test.rb b/test/models/product_test.rb index 211cdd0b4a..77cf556dc8 100644 --- a/test/models/product_test.rb +++ b/test/models/product_test.rb @@ -1,7 +1,7 @@ require 'test_helper' class ProductTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end + test "user can have many products" do + assert_includes users(:dog_merchant).products, products(:sushi_cat) + end end From 681fd226f9aa964803d1983bd530539fa2327a7b Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Tue, 10 May 2016 15:39:28 -0700 Subject: [PATCH 135/174] added logic to make sure user can't review their own product --- app/assets/stylesheets/application.css | 11 +++++++++++ app/controllers/reviews_controller.rb | 4 ++++ app/views/layouts/application.html.erb | 8 ++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 5445126198..ea3de20425 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -208,3 +208,14 @@ label.required:after { content: " *"; color: red; } + +div.flash { + background-color: rgba(159, 47, 247, .7); + color: white; + text-align: center; + width: 80%; + border-radius: 20px; + margin-left: 10%; + + +} diff --git a/app/controllers/reviews_controller.rb b/app/controllers/reviews_controller.rb index c06aa15cc1..35e2e04e48 100644 --- a/app/controllers/reviews_controller.rb +++ b/app/controllers/reviews_controller.rb @@ -2,6 +2,10 @@ class ReviewsController < ApplicationController def new @product = Product.find(params[:id]) + if @product.user_id == current_user.id + redirect_to product_path(@product.id), alert: "You can't review your own product." + end + @review = @product.reviews.new end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index d805a0b826..a7863fbbac 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -6,7 +6,7 @@ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> - + <%= csrf_meta_tags %> @@ -35,7 +35,11 @@
- +
+ <% flash.each do |name, msg| -%> + <%= content_tag :div, msg, class: name %> + <% end -%> +
<%= yield %>
From 9ced0aef6b96242049c3f5f5113d6428aef84a83 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Tue, 10 May 2016 16:03:33 -0700 Subject: [PATCH 136/174] everything is a link. click everything....ha ha --- app/views/layouts/application.html.erb | 2 +- app/views/orders/edit.html.erb | 4 ++-- app/views/products/index.html.erb | 2 +- app/views/products/show.html.erb | 3 ++- app/views/products/show_seller_products.html.erb | 7 +++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index a7863fbbac..f8754834cd 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -39,7 +39,7 @@ <% flash.each do |name, msg| -%> <%= content_tag :div, msg, class: name %> <% end -%> -
+
<%= yield %>
diff --git a/app/views/orders/edit.html.erb b/app/views/orders/edit.html.erb index 87f5b7aea1..d5ccd06f54 100644 --- a/app/views/orders/edit.html.erb +++ b/app/views/orders/edit.html.erb @@ -5,9 +5,9 @@
<% @order.orderitems.each do |orderitem| %>
- + <%= link_to (image_tag Product.find(orderitem.product_id).photo_url), product_path(orderitem.product_id) %>
- <%= Product.find(orderitem.product_id).name %> + <%= link_to Product.find(orderitem.product_id).name, product_path(orderitem.product_id) %>
Total Price $<%=number_with_precision orderitem.total_price, precision: 2 %> <% @cart_price += orderitem.total_price %> <%= form_for orderitem do |f| %> diff --git a/app/views/products/index.html.erb b/app/views/products/index.html.erb index 89866e08d4..dc56025565 100644 --- a/app/views/products/index.html.erb +++ b/app/views/products/index.html.erb @@ -3,7 +3,7 @@
<% unless product.photo_url.nil? %> - + <%= link_to (image_tag product.photo_url), product_path(product.id) %> <% end %>
<%= link_to product.name, product_path(product.id) %>
diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb index fe4f93a2e3..4be3c868f0 100644 --- a/app/views/products/show.html.erb +++ b/app/views/products/show.html.erb @@ -37,7 +37,8 @@

<%= @product.name %>

- + <%= link_to (image_tag @product.photo_url), product_path(@product.id) %> +
diff --git a/app/views/products/show_seller_products.html.erb b/app/views/products/show_seller_products.html.erb index 90fe223de2..e87f3ee9e8 100644 --- a/app/views/products/show_seller_products.html.erb +++ b/app/views/products/show_seller_products.html.erb @@ -3,7 +3,7 @@
<% unless product.photo_url.nil? %> - + <%= link_to (image_tag product.photo_url), product_path(product.id) %> <% if product.retired == true %>

PRODUCT RETIRED

<% end %> @@ -14,7 +14,7 @@

You have no stock left!

<% else %>
- <%= product.name %> + <%= link_to product.name, product_path(product.id) %>
$<%= number_with_precision product.price, precision: 2 %> @@ -32,6 +32,5 @@

<%= link_to "Delete Product", product_path(product.id), method: :delete, class: "btn btn-danger" %>


- - <% end %> + <% end %> From 97c6f66e554c20e699e610bffb79f656cbd0e7ea Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Tue, 10 May 2016 16:45:17 -0700 Subject: [PATCH 137/174] added some tests for order model --- test/fixtures/orderitems.yml | 2 +- test/fixtures/orders.yml | 8 ++++---- test/fixtures/reviews.yml | 2 ++ test/models/order_test.rb | 12 +++++++++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/test/fixtures/orderitems.yml b/test/fixtures/orderitems.yml index 7f140e64fb..0c6d4be2d0 100644 --- a/test/fixtures/orderitems.yml +++ b/test/fixtures/orderitems.yml @@ -2,5 +2,5 @@ first_orderitem: quantity: 2 price: 12 - order_id: 5 + order: first_order product_id: 1 diff --git a/test/fixtures/orders.yml b/test/fixtures/orders.yml index f19f4d3427..961ac1217b 100644 --- a/test/fixtures/orders.yml +++ b/test/fixtures/orders.yml @@ -1,8 +1,8 @@ first_order: - status: "pending" + status: pending price: 5 - user_id: + user: dog_merchant email: user@user.com street_address: 128 Petsy Blvd city: Petville @@ -14,9 +14,9 @@ first_order: billing_zip: 12345 second_order: - status: "complete" + status: Completed price: 90 - user_id: 2 + user: email: other_user@user.com street_address: 4 Dog Road city: Dogville diff --git a/test/fixtures/reviews.yml b/test/fixtures/reviews.yml index 1910a41627..30b14752f6 100644 --- a/test/fixtures/reviews.yml +++ b/test/fixtures/reviews.yml @@ -2,8 +2,10 @@ dog_pirate_review1: description: Dog Pirate is the best. rating: 3 product_id: 1 + user_id: 3 dog_pirate_review2: description: I love my dog pirate. rating: 5 product_id: 1 + user_id: 2 diff --git a/test/models/order_test.rb b/test/models/order_test.rb index 15b8ed1348..8124e5b392 100644 --- a/test/models/order_test.rb +++ b/test/models/order_test.rb @@ -1,7 +1,13 @@ require 'test_helper' class OrderTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end + + test "order can has orderitems" do + assert_includes orders(:first_order).orderitems, orderitems(:first_orderitem) + end + + test "order belongs to user" do + assert_includes users(:dog_merchant).orders, orders(:first_order) + end + end From b83de0e5f593e5b378b4d5e2e4bb74b1f250539c Mon Sep 17 00:00:00 2001 From: Jessica Date: Tue, 10 May 2016 16:45:25 -0700 Subject: [PATCH 138/174] added some tests for products model and users model --- Gemfile | 2 +- Gemfile.lock | 7 + coverage/.last_run.json | 5 + coverage/.resultset.json | 510 +++ coverage/.resultset.json.lock | 0 coverage/assets/0.10.0/application.css | 799 ++++ coverage/assets/0.10.0/application.js | 1707 +++++++ coverage/assets/0.10.0/colorbox/border.png | Bin 0 -> 163 bytes coverage/assets/0.10.0/colorbox/controls.png | Bin 0 -> 2033 bytes coverage/assets/0.10.0/colorbox/loading.gif | Bin 0 -> 9427 bytes .../0.10.0/colorbox/loading_background.png | Bin 0 -> 166 bytes coverage/assets/0.10.0/favicon_green.png | Bin 0 -> 1009 bytes coverage/assets/0.10.0/favicon_red.png | Bin 0 -> 1009 bytes coverage/assets/0.10.0/favicon_yellow.png | Bin 0 -> 1009 bytes coverage/assets/0.10.0/loading.gif | Bin 0 -> 7247 bytes coverage/assets/0.10.0/magnify.png | Bin 0 -> 1301 bytes .../images/ui-bg_flat_0_aaaaaa_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_flat_75_ffffff_40x100.png | Bin 0 -> 178 bytes .../images/ui-bg_glass_55_fbf9ee_1x400.png | Bin 0 -> 120 bytes .../images/ui-bg_glass_65_ffffff_1x400.png | Bin 0 -> 105 bytes .../images/ui-bg_glass_75_dadada_1x400.png | Bin 0 -> 111 bytes .../images/ui-bg_glass_75_e6e6e6_1x400.png | Bin 0 -> 110 bytes .../images/ui-bg_glass_95_fef1ec_1x400.png | Bin 0 -> 119 bytes .../ui-bg_highlight-soft_75_cccccc_1x100.png | Bin 0 -> 101 bytes .../images/ui-icons_222222_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_2e83ff_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_454545_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_888888_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_cd0a0a_256x240.png | Bin 0 -> 4369 bytes coverage/index.html | 3910 +++++++++++++++++ test/fixtures/orders.yml | 4 +- test/fixtures/products.yml | 4 +- test/fixtures/users.yml | 4 +- test/models/product_test.rb | 15 +- test/models/user_test.rb | 27 +- test/test_helper.rb | 2 + 36 files changed, 6986 insertions(+), 10 deletions(-) create mode 100644 coverage/.last_run.json create mode 100644 coverage/.resultset.json create mode 100644 coverage/.resultset.json.lock create mode 100644 coverage/assets/0.10.0/application.css create mode 100644 coverage/assets/0.10.0/application.js create mode 100644 coverage/assets/0.10.0/colorbox/border.png create mode 100644 coverage/assets/0.10.0/colorbox/controls.png create mode 100644 coverage/assets/0.10.0/colorbox/loading.gif create mode 100644 coverage/assets/0.10.0/colorbox/loading_background.png create mode 100644 coverage/assets/0.10.0/favicon_green.png create mode 100644 coverage/assets/0.10.0/favicon_red.png create mode 100644 coverage/assets/0.10.0/favicon_yellow.png create mode 100644 coverage/assets/0.10.0/loading.gif create mode 100644 coverage/assets/0.10.0/magnify.png create mode 100644 coverage/assets/0.10.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png create mode 100644 coverage/assets/0.10.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png create mode 100644 coverage/assets/0.10.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png create mode 100644 coverage/assets/0.10.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png create mode 100644 coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png create mode 100644 coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png create mode 100644 coverage/assets/0.10.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png create mode 100644 coverage/assets/0.10.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png create mode 100644 coverage/assets/0.10.0/smoothness/images/ui-icons_222222_256x240.png create mode 100644 coverage/assets/0.10.0/smoothness/images/ui-icons_2e83ff_256x240.png create mode 100644 coverage/assets/0.10.0/smoothness/images/ui-icons_454545_256x240.png create mode 100644 coverage/assets/0.10.0/smoothness/images/ui-icons_888888_256x240.png create mode 100644 coverage/assets/0.10.0/smoothness/images/ui-icons_cd0a0a_256x240.png create mode 100644 coverage/index.html diff --git a/Gemfile b/Gemfile index 1417edec6f..420b0085c7 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,7 @@ gem 'turbolinks' gem 'jbuilder', '~> 2.0' # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', '~> 0.4.0', group: :doc - +gem 'simplecov', :require => false, :group => :test # Use ActiveModel has_secure_password gem 'bcrypt', '~> 3.1.7' diff --git a/Gemfile.lock b/Gemfile.lock index 6b8ba30bc0..b53228f0a4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -52,6 +52,7 @@ GEM coffee-script-source (1.10.0) concurrent-ruby (1.0.1) debug_inspector (0.0.2) + docile (1.1.5) erubis (2.7.0) execjs (2.6.0) globalid (0.3.6) @@ -123,6 +124,11 @@ GEM sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) + simplecov (0.11.2) + docile (~> 1.1.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) slop (3.6.0) spring (1.7.1) sprockets (3.6.0) @@ -161,6 +167,7 @@ DEPENDENCIES rails (= 4.2.6) sass-rails (~> 5.0) sdoc (~> 0.4.0) + simplecov spring turbolinks uglifier (>= 1.3.0) diff --git a/coverage/.last_run.json b/coverage/.last_run.json new file mode 100644 index 0000000000..751ca7956f --- /dev/null +++ b/coverage/.last_run.json @@ -0,0 +1,5 @@ +{ + "result": { + "covered_percent": 6.73 + } +} diff --git a/coverage/.resultset.json b/coverage/.resultset.json new file mode 100644 index 0000000000..d4a148af8b --- /dev/null +++ b/coverage/.resultset.json @@ -0,0 +1,510 @@ +{ + "MiniTest": { + "coverage": { + "/Users/Jessica/C5/projects/betsy/app/models/home.rb": [ + 1, + null, + null + ], + "/Users/Jessica/C5/projects/betsy/app/models/orderitem.rb": [ + 1, + 1, + 1, + 1, + null, + 1, + 0, + null, + null, + 1, + 0, + 0, + 0, + 0, + 0, + null, + null, + 0, + null, + null, + null + ], + "/Users/Jessica/C5/projects/betsy/app/models/order.rb": [ + 1, + 1, + 1, + null, + null, + null, + null, + null, + null, + null + ], + "/Users/Jessica/C5/projects/betsy/app/models/product.rb": [ + 1, + 1, + 1, + 1, + 1, + null + ], + "/Users/Jessica/C5/projects/betsy/app/models/review.rb": [ + 1, + 1, + 1, + 1, + null + ], + "/Users/Jessica/C5/projects/betsy/app/models/user.rb": [ + 1, + 1, + null, + 1, + 1, + 1, + null, + null, + 1, + 1, + null, + 1, + 3, + 3, + null, + null, + null + ], + "/Users/Jessica/C5/projects/betsy/app/controllers/application_controller.rb": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/controllers/home_controller.rb": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/controllers/orderitems_controller.rb": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/controllers/orders_controller.rb": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/controllers/products_controller.rb": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/controllers/reviews_controller.rb": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/controllers/sessions_controller.rb": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/controllers/users_controller.rb": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/helpers/application_helper.rb": [ + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/helpers/home_helper.rb": [ + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/helpers/order_helper.rb": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/helpers/orderitems_helper.rb": [ + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/helpers/orders_helper.rb": [ + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/helpers/products_helper.rb": [ + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/helpers/reviews_helper.rb": [ + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/helpers/sessions_helper.rb": [ + 0, + 0 + ], + "/Users/Jessica/C5/projects/betsy/app/helpers/users_helper.rb": [ + 0, + 0 + ] + }, + "timestamp": 1462923839 + } +} diff --git a/coverage/.resultset.json.lock b/coverage/.resultset.json.lock new file mode 100644 index 0000000000..e69de29bb2 diff --git a/coverage/assets/0.10.0/application.css b/coverage/assets/0.10.0/application.css new file mode 100644 index 0000000000..d86560434d --- /dev/null +++ b/coverage/assets/0.10.0/application.css @@ -0,0 +1,799 @@ +/* ----------------------------------------------------------------------- + + + Blueprint CSS Framework 0.9 + http://blueprintcss.org + + * Copyright (c) 2007-Present. See LICENSE for more info. + * See README for instructions on how to use Blueprint. + * For credits and origins, see AUTHORS. + * This is a compressed file. See the sources in the 'src' directory. + +----------------------------------------------------------------------- */ + +/* reset.css */ + +html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;} +article, aside, dialog, figure, footer, header, hgroup, nav, section {display:block;} +body {line-height:1.5;} +table {border-collapse:separate;border-spacing:0;} +caption, th, td {text-align:left;font-weight:normal;} +table, td, th {vertical-align:middle;} +blockquote:before, blockquote:after, q:before, q:after {content:"";} +blockquote, q {quotes:"" "";} +a img {border:none;} + +/* typography.css */ +html {font-size:100.01%;} +body {font-size:82%;color:#222;background:#fff;font-family:"Helvetica Neue", Arial, Helvetica, sans-serif;} +h1, h2, h3, h4, h5, h6 {font-weight:normal;color:#111;} +h1 {font-size:3em;line-height:1;margin-bottom:0.5em;} +h2 {font-size:2em;margin-bottom:0.75em;} +h3 {font-size:1.5em;line-height:1;margin-bottom:1em;} +h4 {font-size:1.2em;line-height:1.25;margin-bottom:1.25em;} +h5 {font-size:1em;font-weight:bold;margin-bottom:1.5em;} +h6 {font-size:1em;font-weight:bold;} +h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;} +p {margin:0 0 1.5em;} +p img.left {float:left;margin:1.5em 1.5em 1.5em 0;padding:0;} +p img.right {float:right;margin:1.5em 0 1.5em 1.5em;} +a:focus, a:hover {color:#000;} +a {color:#009;text-decoration:underline;} +blockquote {margin:1.5em;color:#666;font-style:italic;} +strong {font-weight:bold;} +em, dfn {font-style:italic;} +dfn {font-weight:bold;} +sup, sub {line-height:0;} +abbr, acronym {border-bottom:1px dotted #666;} +address {margin:0 0 1.5em;font-style:italic;} +del {color:#666;} +pre {margin:1.5em 0;white-space:pre;} +pre, code, tt {font:1em 'andale mono', 'lucida console', monospace;line-height:1.5;} +li ul, li ol {margin:0;} +ul, ol {margin:0 1.5em 1.5em 0;padding-left:3.333em;} +ul {list-style-type:disc;} +ol {list-style-type:decimal;} +dl {margin:0 0 1.5em 0;} +dl dt {font-weight:bold;} +dd {margin-left:1.5em;} +table {margin-bottom:1.4em;width:100%;} +th {font-weight:bold;} +thead th {background:#c3d9ff;} +th, td, caption {padding:4px 10px 4px 5px;} +tr.even td {background:#efefef;} +tfoot {font-style:italic;} +caption {background:#eee;} +.small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;} +.large {font-size:1.2em;line-height:2.5em;margin-bottom:1.25em;} +.hide {display:none;} +.quiet {color:#666;} +.loud {color:#000;} +.highlight {background:#ff0;} +.added {background:#060;color:#fff;} +.removed {background:#900;color:#fff;} +.first {margin-left:0;padding-left:0;} +.last {margin-right:0;padding-right:0;} +.top {margin-top:0;padding-top:0;} +.bottom {margin-bottom:0;padding-bottom:0;} + +/* forms.css */ +label {font-weight:bold;} +fieldset {padding:1.4em;margin:0 0 1.5em 0;border:1px solid #ccc;} +legend {font-weight:bold;font-size:1.2em;} +input[type=text], input[type=password], input.text, input.title, textarea, select {background-color:#fff;border:1px solid #bbb;} +input[type=text]:focus, input[type=password]:focus, input.text:focus, input.title:focus, textarea:focus, select:focus {border-color:#666;} +input[type=text], input[type=password], input.text, input.title, textarea, select {margin:0.5em 0;} +input.text, input.title {width:300px;padding:5px;} +input.title {font-size:1.5em;} +textarea {width:390px;height:250px;padding:5px;} +input[type=checkbox], input[type=radio], input.checkbox, input.radio {position:relative;top:.25em;} +form.inline {line-height:3;} +form.inline p {margin-bottom:0;} +.error, .notice, .success {padding:.8em;margin-bottom:1em;border:2px solid #ddd;} +.error {background:#FBE3E4;color:#8a1f11;border-color:#FBC2C4;} +.notice {background:#FFF6BF;color:#514721;border-color:#FFD324;} +.success {background:#E6EFC2;color:#264409;border-color:#C6D880;} +.error a {color:#8a1f11;} +.notice a {color:#514721;} +.success a {color:#264409;} +.box {padding:1.5em;margin-bottom:1.5em;background:#E5ECF9;} +hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:.1em;margin:0 0 1.45em;border:none;} +hr.space {background:#fff;color:#fff;visibility:hidden;} +.clearfix:after, .container:after {content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflow:hidden;} +.clearfix, .container {display:block;} +.clear {clear:both;} +/* +github.com style (c) Vasily Polovnyov +*/ + + +pre code { +} + +pre .comment, +pre .template_comment, +pre .diff .header, +pre .javadoc { + color: #998; + font-style: italic +} + +pre .keyword, +pre .css .rule .keyword, +pre .winutils, +pre .javascript .title, +pre .lisp .title { + color: #000; + font-weight: bold +} + +pre .number, +pre .hexcolor { + color: #458 +} + + +pre .string, +pre .tag .value, +pre .phpdoc, +pre .tex .formula { + color: #d14 +} + +pre .subst { + color: #712; +} + +pre .constant, +pre .title, +pre .id { + color: #900; + font-weight: bold +} + +pre .javascript .title, +pre .lisp .title, +pre .subst { + font-weight: normal +} + +pre .class .title, +pre .haskell .label, +pre .tex .command { + color: #458; + font-weight: bold +} + +pre .tag, +pre .tag .title, +pre .rules .property, +pre .django .tag .keyword { + color: #000080; + font-weight: normal +} + +pre .attribute, +pre .variable, +pre .instancevar, +pre .lisp .body { + color: #008080 +} + +pre .regexp { + color: #009926 +} + +pre .class { + color: #458; + font-weight: bold +} + +pre .symbol, +pre .ruby .symbol .string, +pre .ruby .symbol .keyword, +pre .ruby .symbol .keymethods, +pre .lisp .keyword, +pre .tex .special, +pre .input_number { + color: #990073 +} + +pre .builtin, +pre .built_in, +pre .lisp .title { + color: #0086b3 +} + +pre .preprocessor, +pre .pi, +pre .doctype, +pre .shebang, +pre .cdata { + color: #999; + font-weight: bold +} + +pre .deletion { + background: #fdd +} + +pre .addition { + background: #dfd +} + +pre .diff .change { + background: #0086b3 +} + +pre .chunk { + color: #aaa +} + +pre .tex .formula { + opacity: 0.5; +} +/* + * jQuery UI CSS Framework @VERSION + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* Layout helpers +----------------------------------*/ + +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + +/* + * jQuery UI CSS Framework @VERSION + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px + */ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget-content a { color: #222222; } +.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } +.ui-widget-header a { color: #222222; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } +.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; } +/* + ColorBox Core Style: + The following CSS is consistent between example themes and should not be altered. +*/ +#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} +#cboxOverlay{position:fixed; width:100%; height:100%;} +#cboxMiddleLeft, #cboxBottomLeft{clear:left;} +#cboxContent{position:relative;} +#cboxLoadedContent{overflow:auto;} +#cboxTitle{margin:0;} +#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} +#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} +.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;} +.cboxIframe{width:100%; height:100%; display:block; border:0;} +#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box;} + +/* + User Style: + Change the following styles to modify the appearance of ColorBox. They are + ordered & tabbed in a way that represents the nesting of the generated HTML. +*/ +#cboxOverlay{background:#000;} +#colorbox{} + #cboxTopLeft{width:14px; height:14px; background:url(colorbox/controls.png) no-repeat 0 0;} + #cboxTopCenter{height:14px; background:url(colorbox/border.png) repeat-x top left;} + #cboxTopRight{width:14px; height:14px; background:url(colorbox/controls.png) no-repeat -36px 0;} + #cboxBottomLeft{width:14px; height:43px; background:url(colorbox/controls.png) no-repeat 0 -32px;} + #cboxBottomCenter{height:43px; background:url(colorbox/border.png) repeat-x bottom left;} + #cboxBottomRight{width:14px; height:43px; background:url(colorbox/controls.png) no-repeat -36px -32px;} + #cboxMiddleLeft{width:14px; background:url(colorbox/controls.png) repeat-y -175px 0;} + #cboxMiddleRight{width:14px; background:url(colorbox/controls.png) repeat-y -211px 0;} + #cboxContent{background:#fff; overflow:visible;} + .cboxIframe{background:#fff;} + #cboxError{padding:50px; border:1px solid #ccc;} + #cboxLoadedContent{margin-bottom:5px;} + #cboxLoadingOverlay{background:url(colorbox/loading_background.png) no-repeat center center;} + #cboxLoadingGraphic{background:url(colorbox/loading.gif) no-repeat center center;} + #cboxTitle{position:absolute; bottom:-25px; left:0; text-align:center; width:100%; font-weight:bold; color:#7C7C7C;} + #cboxCurrent{position:absolute; bottom:-25px; left:58px; font-weight:bold; color:#7C7C7C;} + + #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{position:absolute; bottom:-29px; background:url(colorbox/controls.png) no-repeat 0px 0px; width:23px; height:23px; text-indent:-9999px;} + #cboxPrevious{left:0px; background-position: -51px -25px;} + #cboxPrevious:hover{background-position:-51px 0px;} + #cboxNext{left:27px; background-position:-75px -25px;} + #cboxNext:hover{background-position:-75px 0px;} + #cboxClose{right:0; background-position:-100px -25px;} + #cboxClose:hover{background-position:-100px 0px;} + + .cboxSlideshow_on #cboxSlideshow{background-position:-125px 0px; right:27px;} + .cboxSlideshow_on #cboxSlideshow:hover{background-position:-150px 0px;} + .cboxSlideshow_off #cboxSlideshow{background-position:-150px -25px; right:27px;} + .cboxSlideshow_off #cboxSlideshow:hover{background-position:-125px 0px;} +#loading { + position: fixed; + left: 40%; + top: 50%; } + +a { + color: #333333; + text-decoration: none; } + a:hover { + color: black; + text-decoration: underline; } + +body { + font-family: "Lucida Grande", Helvetica, "Helvetica Neue", Arial, sans-serif; + padding: 12px; + background-color: #333333; } + +h1, h2, h3, h4 { + color: #1c2324; + margin: 0; + padding: 0; + margin-bottom: 12px; } + +table { + width: 100%; } + +#content { + clear: left; + background-color: white; + border: 2px solid #dddddd; + border-top: 8px solid #dddddd; + padding: 18px; + -webkit-border-bottom-left-radius: 5px; + -webkit-border-bottom-right-radius: 5px; + -webkit-border-top-right-radius: 5px; + -moz-border-radius-bottomleft: 5px; + -moz-border-radius-bottomright: 5px; + -moz-border-radius-topright: 5px; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; + border-top-right-radius: 5px; } + +.dataTables_filter, .dataTables_info { + padding: 2px 6px; } + +abbr.timeago { + text-decoration: none; + border: none; + font-weight: bold; } + +.timestamp { + float: right; + color: #dddddd; } + +.group_tabs { + list-style: none; + float: left; + margin: 0; + padding: 0; } + .group_tabs li { + display: inline; + float: left; } + .group_tabs li a { + font-family: Helvetica, Arial, sans-serif; + display: block; + float: left; + text-decoration: none; + padding: 4px 8px; + background-color: #aaaaaa; + background: -webkit-gradient(linear, 0 0, 0 bottom, from(#dddddd), to(#aaaaaa)); + background: -moz-linear-gradient(#dddddd, #aaaaaa); + background: linear-gradient(#dddddd, #aaaaaa); + text-shadow: #e5e5e5 1px 1px 0px; + border-bottom: none; + color: #333333; + font-weight: bold; + margin-right: 8px; + border-top: 1px solid #efefef; + -webkit-border-top-left-radius: 2px; + -webkit-border-top-right-radius: 2px; + -moz-border-radius-topleft: 2px; + -moz-border-radius-topright: 2px; + border-top-left-radius: 2px; + border-top-right-radius: 2px; } + .group_tabs li a:hover { + background-color: #cccccc; + background: -webkit-gradient(linear, 0 0, 0 bottom, from(#eeeeee), to(#aaaaaa)); + background: -moz-linear-gradient(#eeeeee, #aaaaaa); + background: linear-gradient(#eeeeee, #aaaaaa); } + .group_tabs li a:active { + padding-top: 5px; + padding-bottom: 3px; } + .group_tabs li.active a { + color: black; + text-shadow: white 1px 1px 0px; + background-color: #dddddd; + background: -webkit-gradient(linear, 0 0, 0 bottom, from(white), to(#dddddd)); + background: -moz-linear-gradient(white, #dddddd); + background: linear-gradient(white, #dddddd); } + +.file_list { + margin-bottom: 18px; } + +a.src_link { + background: url("./magnify.png") no-repeat left 50%; + padding-left: 18px; } + +tr, td { + margin: 0; + padding: 0; } + +th { + white-space: nowrap; } + th.ui-state-default { + cursor: pointer; } + th span.ui-icon { + float: left; } + +td { + padding: 4px 8px; } + td.strong { + font-weight: bold; } + +.source_table h3, .source_table h4 { + padding: 0; + margin: 0; + margin-bottom: 4px; } +.source_table .header { + padding: 10px; } +.source_table pre { + margin: 0; + padding: 0; + white-space: normal; + color: black; + font-family: "Monaco", "Inconsolata", "Consolas", monospace; } +.source_table code { + color: black; + font-family: "Monaco", "Inconsolata", "Consolas", monospace; } +.source_table pre { + background-color: #333333; } + .source_table pre ol { + margin: 0px; + padding: 0px; + margin-left: 45px; + font-size: 12px; + color: white; } + .source_table pre li { + margin: 0px; + padding: 2px 6px; + border-left: 5px solid white; } + .source_table pre li code { + white-space: pre; + white-space: pre-wrap; } + .source_table pre .hits { + float: right; + margin-left: 10px; + padding: 2px 4px; + background-color: #444444; + background: -webkit-gradient(linear, 0 0, 0 bottom, from(#222222), to(#666666)); + background: -moz-linear-gradient(#222222, #666666); + background: linear-gradient(#222222, #666666); + color: white; + font-family: Helvetica, "Helvetica Neue", Arial, sans-serif; + font-size: 10px; + font-weight: bold; + text-align: center; + border-radius: 6px; } + +#footer { + color: #dddddd; + font-size: 12px; + font-weight: bold; + margin-top: 12px; + text-align: right; } + #footer a { + color: #eeeeee; + text-decoration: underline; } + #footer a:hover { + color: white; + text-decoration: none; } + +.green { + color: #009900; } + +.red { + color: #990000; } + +.yellow { + color: #ddaa00; } + +.source_table .covered { + border-color: #009900; } +.source_table .missed { + border-color: #990000; } +.source_table .never { + border-color: black; } +.source_table .skipped { + border-color: #ffcc00; } +.source_table .covered:nth-child(odd) { + background-color: #cdf2cd; } +.source_table .covered:nth-child(even) { + background-color: #dbf2db; } +.source_table .missed:nth-child(odd) { + background-color: #f7c0c0; } +.source_table .missed:nth-child(even) { + background-color: #f7cfcf; } +.source_table .never:nth-child(odd) { + background-color: #efefef; } +.source_table .never:nth-child(even) { + background-color: #f4f4f4; } +.source_table .skipped:nth-child(odd) { + background-color: #fbf0c0; } +.source_table .skipped:nth-child(even) { + background-color: #fbffcf; } + + + diff --git a/coverage/assets/0.10.0/application.js b/coverage/assets/0.10.0/application.js new file mode 100644 index 0000000000..fe65d88219 --- /dev/null +++ b/coverage/assets/0.10.0/application.js @@ -0,0 +1,1707 @@ +/*! + * jQuery JavaScript Library v1.6.2 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Jun 30 14:16:56 2011 -0400 + */ + +(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i. +shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j +)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); +var hljs=new function(){function l(o){return o.replace(/&/gm,"&").replace(/"}while(x.length||y.length){var u=t().splice(0,1)[0];v+=l(w.substr(q,u.offset-q));q=u.offset;if(u.event=="start"){v+=r(u.node);s.push(u.node)}else{if(u.event=="stop"){var p=s.length;do{p--;var o=s[p];v+=("")}while(o!=u.node);s.splice(p,1);while(p'+l(K[0])+""}else{M+=l(K[0])}O=N.lR.lastIndex;K=N.lR.exec(L)}M+=l(L.substr(O,L.length-O));return M}function J(r,L){if(L.sL&&d[L.sL]){var K=f(L.sL,r);s+=K.keyword_count;return K.value}else{return E(r,L)}}function H(L,r){var K=L.cN?'':"";if(L.rB){p+=K;L.buffer=""}else{if(L.eB){p+=l(r)+K;L.buffer=""}else{p+=K;L.buffer=r}}B.push(L);A+=L.r}function D(N,K,P){var Q=B[B.length-1];if(P){p+=J(Q.buffer+N,Q);return false}var L=y(K,Q);if(L){p+=J(Q.buffer+N,Q);H(L,K);return L.rB}var r=v(B.length-1,K);if(r){var M=Q.cN?"":"";if(Q.rE){p+=J(Q.buffer+N,Q)+M}else{if(Q.eE){p+=J(Q.buffer+N,Q)+M+l(K)}else{p+=J(Q.buffer+N+K,Q)+M}}while(r>1){M=B[B.length-2].cN?"":"";p+=M;r--;B.length--}var O=B[B.length-1];B.length--;B[B.length-1].buffer="";if(O.starts){H(O.starts,"")}return Q.rE}if(w(K,Q)){throw"Illegal"}}var G=d[I];var B=[G.dM];var A=0;var s=0;var p="";try{var u=0;G.dM.buffer="";do{var x=q(C,u);var t=D(x[0],x[1],x[2]);u+=x[0].length;if(!t){u+=x[1].length}}while(!x[2]);if(B.length>1){throw"Illegal"}return{language:I,r:A,keyword_count:s,value:p}}catch(F){if(F=="Illegal"){return{language:null,r:0,keyword_count:0,value:l(C)}}else{throw F}}}function h(){function o(t,s,u){if(t.compiled){return}if(!u){t.bR=c(s,t.b?t.b:"\\B|\\b");if(!t.e&&!t.eW){t.e="\\B|\\b"}if(t.e){t.eR=c(s,t.e)}}if(t.i){t.iR=c(s,t.i)}if(t.r==undefined){t.r=1}if(t.k){t.lR=c(s,t.l||hljs.IR,true)}for(var r in t.k){if(!t.k.hasOwnProperty(r)){continue}if(t.k[r] instanceof Object){t.kG=t.k}else{t.kG={keyword:t.k}}break}if(!t.c){t.c=[]}t.compiled=true;for(var q=0;qx.keyword_count+x.r){x=u}if(u.keyword_count+u.r>w.keyword_count+w.r){x=w;w=u}}}var s=t.className;if(!s.match(w.language)){s=s?(s+" "+w.language):w.language}var o=b(t);if(o.length){var q=document.createElement("pre");q.innerHTML=w.value;w.value=k(o,b(q),A)}if(y){w.value=w.value.replace(/^((<[^>]+>|\t)+)/gm,function(B,E,D,C){return E.replace(/\t/g,y)})}if(p){w.value=w.value.replace(/\n/g,"
")}if(/MSIE [678]/.test(navigator.userAgent)&&t.tagName=="CODE"&&t.parentNode.tagName=="PRE"){var q=t.parentNode;var v=document.createElement("div");v.innerHTML="
"+w.value+"
";t=v.firstChild.firstChild;v.firstChild.cN=q.cN;q.parentNode.replaceChild(v.firstChild,q)}else{t.innerHTML=w.value}t.className=s;t.dataset={};t.dataset.result={language:w.language,kw:w.keyword_count,re:w.r};if(x&&x.language){t.dataset.second_best={language:x.language,kw:x.keyword_count,re:x.r}}}function j(){if(j.called){return}j.called=true;e();var q=document.getElementsByTagName("pre");for(var o=0;o|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\.",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.inherit=function(o,r){var q={};for(var p in o){q[p]=o[p]}if(r){for(var p in r){q[p]=r[p]}}return q}}();hljs.LANGUAGES.ruby=function(){var g="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?";var a="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var n={keyword:{and:1,"false":1,then:1,defined:1,module:1,"in":1,"return":1,redo:1,"if":1,BEGIN:1,retry:1,end:1,"for":1,"true":1,self:1,when:1,next:1,until:1,"do":1,begin:1,unless:1,END:1,rescue:1,nil:1,"else":1,"break":1,undef:1,not:1,"super":1,"class":1,"case":1,require:1,yield:1,alias:1,"while":1,ensure:1,elsif:1,or:1,def:1},keymethods:{__id__:1,__send__:1,abort:1,abs:1,"all?":1,allocate:1,ancestors:1,"any?":1,arity:1,assoc:1,at:1,at_exit:1,autoload:1,"autoload?":1,"between?":1,binding:1,binmode:1,"block_given?":1,call:1,callcc:1,caller:1,capitalize:1,"capitalize!":1,casecmp:1,"catch":1,ceil:1,center:1,chomp:1,"chomp!":1,chop:1,"chop!":1,chr:1,"class":1,class_eval:1,"class_variable_defined?":1,class_variables:1,clear:1,clone:1,close:1,close_read:1,close_write:1,"closed?":1,coerce:1,collect:1,"collect!":1,compact:1,"compact!":1,concat:1,"const_defined?":1,const_get:1,const_missing:1,const_set:1,constants:1,count:1,crypt:1,"default":1,default_proc:1,"delete":1,"delete!":1,delete_at:1,delete_if:1,detect:1,display:1,div:1,divmod:1,downcase:1,"downcase!":1,downto:1,dump:1,dup:1,each:1,each_byte:1,each_index:1,each_key:1,each_line:1,each_pair:1,each_value:1,each_with_index:1,"empty?":1,entries:1,eof:1,"eof?":1,"eql?":1,"equal?":1,"eval":1,exec:1,exit:1,"exit!":1,extend:1,fail:1,fcntl:1,fetch:1,fileno:1,fill:1,find:1,find_all:1,first:1,flatten:1,"flatten!":1,floor:1,flush:1,for_fd:1,foreach:1,fork:1,format:1,freeze:1,"frozen?":1,fsync:1,getc:1,gets:1,global_variables:1,grep:1,gsub:1,"gsub!":1,"has_key?":1,"has_value?":1,hash:1,hex:1,id:1,include:1,"include?":1,included_modules:1,index:1,indexes:1,indices:1,induced_from:1,inject:1,insert:1,inspect:1,instance_eval:1,instance_method:1,instance_methods:1,"instance_of?":1,"instance_variable_defined?":1,instance_variable_get:1,instance_variable_set:1,instance_variables:1,"integer?":1,intern:1,invert:1,ioctl:1,"is_a?":1,isatty:1,"iterator?":1,join:1,"key?":1,keys:1,"kind_of?":1,lambda:1,last:1,length:1,lineno:1,ljust:1,load:1,local_variables:1,loop:1,lstrip:1,"lstrip!":1,map:1,"map!":1,match:1,max:1,"member?":1,merge:1,"merge!":1,method:1,"method_defined?":1,method_missing:1,methods:1,min:1,module_eval:1,modulo:1,name:1,nesting:1,"new":1,next:1,"next!":1,"nil?":1,nitems:1,"nonzero?":1,object_id:1,oct:1,open:1,pack:1,partition:1,pid:1,pipe:1,pop:1,popen:1,pos:1,prec:1,prec_f:1,prec_i:1,print:1,printf:1,private_class_method:1,private_instance_methods:1,"private_method_defined?":1,private_methods:1,proc:1,protected_instance_methods:1,"protected_method_defined?":1,protected_methods:1,public_class_method:1,public_instance_methods:1,"public_method_defined?":1,public_methods:1,push:1,putc:1,puts:1,quo:1,raise:1,rand:1,rassoc:1,read:1,read_nonblock:1,readchar:1,readline:1,readlines:1,readpartial:1,rehash:1,reject:1,"reject!":1,remainder:1,reopen:1,replace:1,require:1,"respond_to?":1,reverse:1,"reverse!":1,reverse_each:1,rewind:1,rindex:1,rjust:1,round:1,rstrip:1,"rstrip!":1,scan:1,seek:1,select:1,send:1,set_trace_func:1,shift:1,singleton_method_added:1,singleton_methods:1,size:1,sleep:1,slice:1,"slice!":1,sort:1,"sort!":1,sort_by:1,split:1,sprintf:1,squeeze:1,"squeeze!":1,srand:1,stat:1,step:1,store:1,strip:1,"strip!":1,sub:1,"sub!":1,succ:1,"succ!":1,sum:1,superclass:1,swapcase:1,"swapcase!":1,sync:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,taint:1,"tainted?":1,tell:1,test:1,"throw":1,times:1,to_a:1,to_ary:1,to_f:1,to_hash:1,to_i:1,to_int:1,to_io:1,to_proc:1,to_s:1,to_str:1,to_sym:1,tr:1,"tr!":1,tr_s:1,"tr_s!":1,trace_var:1,transpose:1,trap:1,truncate:1,"tty?":1,type:1,ungetc:1,uniq:1,"uniq!":1,unpack:1,unshift:1,untaint:1,untrace_var:1,upcase:1,"upcase!":1,update:1,upto:1,"value?":1,values:1,values_at:1,warn:1,write:1,write_nonblock:1,"zero?":1,zip:1}};var h={cN:"yardoctag",b:"@[A-Za-z]+"};var d={cN:"comment",b:"#",e:"$",c:[h]};var c={cN:"comment",b:"^\\=begin",e:"^\\=end",c:[h],r:10};var b={cN:"comment",b:"^__END__",e:"\\n$"};var u={cN:"subst",b:"#\\{",e:"}",l:g,k:n};var p=[hljs.BE,u];var s={cN:"string",b:"'",e:"'",c:p,r:0};var r={cN:"string",b:'"',e:'"',c:p,r:0};var q={cN:"string",b:"%[qw]?\\(",e:"\\)",c:p,r:10};var o={cN:"string",b:"%[qw]?\\[",e:"\\]",c:p,r:10};var m={cN:"string",b:"%[qw]?{",e:"}",c:p,r:10};var l={cN:"string",b:"%[qw]?<",e:">",c:p,r:10};var k={cN:"string",b:"%[qw]?/",e:"/",c:p,r:10};var j={cN:"string",b:"%[qw]?%",e:"%",c:p,r:10};var i={cN:"string",b:"%[qw]?-",e:"-",c:p,r:10};var t={cN:"string",b:"%[qw]?\\|",e:"\\|",c:p,r:10};var e={cN:"function",b:"\\bdef\\s+",e:" |$|;",l:g,k:n,c:[{cN:"title",b:a,l:g,k:n},{cN:"params",b:"\\(",e:"\\)",l:g,k:n},d,c,b]};var f={cN:"identifier",b:g,l:g,k:n,r:0};var v=[d,c,b,s,r,q,o,m,l,k,j,i,t,{cN:"class",b:"\\b(class|module)\\b",e:"$|;",k:{"class":1,module:1},c:[{cN:"title",b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",r:0},{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+hljs.IR+"::)?"+hljs.IR}]},d,c,b]},e,{cN:"constant",b:"(::)?([A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:[s,r,q,o,m,l,k,j,i,t,f],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"number",b:"\\?\\w"},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},f,{b:"("+hljs.RSR+")\\s*",c:[d,c,b,{cN:"regexp",b:"/",e:"/[a-z]*",i:"\\n",c:[hljs.BE]}],r:0}];u.c=v;e.c[1].c=v;return{dM:{l:g,k:n,c:v}}}(); +/*! + Colorbox v1.5.13 - 2014-08-04 + jQuery lightbox and modal window plugin + (c) 2014 Jack Moore - http://www.jacklmoore.com/colorbox + license: http://www.opensource.org/licenses/mit-license.php + */ + +(function ($, document, window) { + var + // Default settings object. + // See http://jacklmoore.com/colorbox for details. + defaults = { + // data sources + html: false, + photo: false, + iframe: false, + inline: false, + + // behavior and appearance + transition: "elastic", + speed: 300, + fadeOut: 300, + width: false, + initialWidth: "600", + innerWidth: false, + maxWidth: false, + height: false, + initialHeight: "450", + innerHeight: false, + maxHeight: false, + scalePhotos: true, + scrolling: true, + opacity: 0.9, + preloading: true, + className: false, + overlayClose: true, + escKey: true, + arrowKey: true, + top: false, + bottom: false, + left: false, + right: false, + fixed: false, + data: undefined, + closeButton: true, + fastIframe: true, + open: false, + reposition: true, + loop: true, + slideshow: false, + slideshowAuto: true, + slideshowSpeed: 2500, + slideshowStart: "start slideshow", + slideshowStop: "stop slideshow", + photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i, + + // alternate image paths for high-res displays + retinaImage: false, + retinaUrl: false, + retinaSuffix: '@2x.$1', + + // internationalization + current: "image {current} of {total}", + previous: "previous", + next: "next", + close: "close", + xhrError: "This content failed to load.", + imgError: "This image failed to load.", + + // accessbility + returnFocus: true, + trapFocus: true, + + // callbacks + onOpen: false, + onLoad: false, + onComplete: false, + onCleanup: false, + onClosed: false, + + rel: function() { + return this.rel; + }, + href: function() { + // using this.href would give the absolute url, when the href may have been inteded as a selector (e.g. '#container') + return $(this).attr('href'); + }, + title: function() { + return this.title; + } + }, + + // Abstracting the HTML and event identifiers for easy rebranding + colorbox = 'colorbox', + prefix = 'cbox', + boxElement = prefix + 'Element', + + // Events + event_open = prefix + '_open', + event_load = prefix + '_load', + event_complete = prefix + '_complete', + event_cleanup = prefix + '_cleanup', + event_closed = prefix + '_closed', + event_purge = prefix + '_purge', + + // Cached jQuery Object Variables + $overlay, + $box, + $wrap, + $content, + $topBorder, + $leftBorder, + $rightBorder, + $bottomBorder, + $related, + $window, + $loaded, + $loadingBay, + $loadingOverlay, + $title, + $current, + $slideshow, + $next, + $prev, + $close, + $groupControls, + $events = $(''), // $({}) would be prefered, but there is an issue with jQuery 1.4.2 + + // Variables for cached values or use across multiple functions + settings, + interfaceHeight, + interfaceWidth, + loadedHeight, + loadedWidth, + index, + photo, + open, + active, + closing, + loadingTimer, + publicMethod, + div = "div", + requests = 0, + previousCSS = {}, + init; + + // **************** + // HELPER FUNCTIONS + // **************** + + // Convenience function for creating new jQuery objects + function $tag(tag, id, css) { + var element = document.createElement(tag); + + if (id) { + element.id = prefix + id; + } + + if (css) { + element.style.cssText = css; + } + + return $(element); + } + + // Get the window height using innerHeight when available to avoid an issue with iOS + // http://bugs.jquery.com/ticket/6724 + function winheight() { + return window.innerHeight ? window.innerHeight : $(window).height(); + } + + function Settings(element, options) { + if (options !== Object(options)) { + options = {}; + } + + this.cache = {}; + this.el = element; + + this.value = function(key) { + var dataAttr; + + if (this.cache[key] === undefined) { + dataAttr = $(this.el).attr('data-cbox-'+key); + + if (dataAttr !== undefined) { + this.cache[key] = dataAttr; + } else if (options[key] !== undefined) { + this.cache[key] = options[key]; + } else if (defaults[key] !== undefined) { + this.cache[key] = defaults[key]; + } + } + + return this.cache[key]; + }; + + this.get = function(key) { + var value = this.value(key); + return $.isFunction(value) ? value.call(this.el, this) : value; + }; + } + + // Determine the next and previous members in a group. + function getIndex(increment) { + var + max = $related.length, + newIndex = (index + increment) % max; + + return (newIndex < 0) ? max + newIndex : newIndex; + } + + // Convert '%' and 'px' values to integers + function setSize(size, dimension) { + return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10)); + } + + // Checks an href to see if it is a photo. + // There is a force photo option (photo: true) for hrefs that cannot be matched by the regex. + function isImage(settings, url) { + return settings.get('photo') || settings.get('photoRegex').test(url); + } + + function retinaUrl(settings, url) { + return settings.get('retinaUrl') && window.devicePixelRatio > 1 ? url.replace(settings.get('photoRegex'), settings.get('retinaSuffix')) : url; + } + + function trapFocus(e) { + if ('contains' in $box[0] && !$box[0].contains(e.target) && e.target !== $overlay[0]) { + e.stopPropagation(); + $box.focus(); + } + } + + function setClass(str) { + if (setClass.str !== str) { + $box.add($overlay).removeClass(setClass.str).addClass(str); + setClass.str = str; + } + } + + function getRelated(rel) { + index = 0; + + if (rel && rel !== false && rel !== 'nofollow') { + $related = $('.' + boxElement).filter(function () { + var options = $.data(this, colorbox); + var settings = new Settings(this, options); + return (settings.get('rel') === rel); + }); + index = $related.index(settings.el); + + // Check direct calls to Colorbox. + if (index === -1) { + $related = $related.add(settings.el); + index = $related.length - 1; + } + } else { + $related = $(settings.el); + } + } + + function trigger(event) { + // for external use + $(document).trigger(event); + // for internal use + $events.triggerHandler(event); + } + + var slideshow = (function(){ + var active, + className = prefix + "Slideshow_", + click = "click." + prefix, + timeOut; + + function clear () { + clearTimeout(timeOut); + } + + function set() { + if (settings.get('loop') || $related[index + 1]) { + clear(); + timeOut = setTimeout(publicMethod.next, settings.get('slideshowSpeed')); + } + } + + function start() { + $slideshow + .html(settings.get('slideshowStop')) + .unbind(click) + .one(click, stop); + + $events + .bind(event_complete, set) + .bind(event_load, clear); + + $box.removeClass(className + "off").addClass(className + "on"); + } + + function stop() { + clear(); + + $events + .unbind(event_complete, set) + .unbind(event_load, clear); + + $slideshow + .html(settings.get('slideshowStart')) + .unbind(click) + .one(click, function () { + publicMethod.next(); + start(); + }); + + $box.removeClass(className + "on").addClass(className + "off"); + } + + function reset() { + active = false; + $slideshow.hide(); + clear(); + $events + .unbind(event_complete, set) + .unbind(event_load, clear); + $box.removeClass(className + "off " + className + "on"); + } + + return function(){ + if (active) { + if (!settings.get('slideshow')) { + $events.unbind(event_cleanup, reset); + reset(); + } + } else { + if (settings.get('slideshow') && $related[1]) { + active = true; + $events.one(event_cleanup, reset); + if (settings.get('slideshowAuto')) { + start(); + } else { + stop(); + } + $slideshow.show(); + } + } + }; + + }()); + + + function launch(element) { + var options; + + if (!closing) { + + options = $(element).data(colorbox); + + settings = new Settings(element, options); + + getRelated(settings.get('rel')); + + if (!open) { + open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys. + + setClass(settings.get('className')); + + // Show colorbox so the sizes can be calculated in older versions of jQuery + $box.css({visibility:'hidden', display:'block', opacity:''}); + + $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden; visibility:hidden'); + $content.css({width:'', height:''}).append($loaded); + + // Cache values needed for size calculations + interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height(); + interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width(); + loadedHeight = $loaded.outerHeight(true); + loadedWidth = $loaded.outerWidth(true); + + // Opens inital empty Colorbox prior to content being loaded. + var initialWidth = setSize(settings.get('initialWidth'), 'x'); + var initialHeight = setSize(settings.get('initialHeight'), 'y'); + var maxWidth = settings.get('maxWidth'); + var maxHeight = settings.get('maxHeight'); + + settings.w = (maxWidth !== false ? Math.min(initialWidth, setSize(maxWidth, 'x')) : initialWidth) - loadedWidth - interfaceWidth; + settings.h = (maxHeight !== false ? Math.min(initialHeight, setSize(maxHeight, 'y')) : initialHeight) - loadedHeight - interfaceHeight; + + $loaded.css({width:'', height:settings.h}); + publicMethod.position(); + + trigger(event_open); + settings.get('onOpen'); + + $groupControls.add($title).hide(); + + $box.focus(); + + if (settings.get('trapFocus')) { + // Confine focus to the modal + // Uses event capturing that is not supported in IE8- + if (document.addEventListener) { + + document.addEventListener('focus', trapFocus, true); + + $events.one(event_closed, function () { + document.removeEventListener('focus', trapFocus, true); + }); + } + } + + // Return focus on closing + if (settings.get('returnFocus')) { + $events.one(event_closed, function () { + $(settings.el).focus(); + }); + } + } + + var opacity = parseFloat(settings.get('opacity')); + $overlay.css({ + opacity: opacity === opacity ? opacity : '', + cursor: settings.get('overlayClose') ? 'pointer' : '', + visibility: 'visible' + }).show(); + + if (settings.get('closeButton')) { + $close.html(settings.get('close')).appendTo($content); + } else { + $close.appendTo('
'); // replace with .detach() when dropping jQuery < 1.4 + } + + load(); + } + } + + // Colorbox's markup needs to be added to the DOM prior to being called + // so that the browser will go ahead and load the CSS background images. + function appendHTML() { + if (!$box && document.body) { + init = false; + $window = $(window); + $box = $tag(div).attr({ + id: colorbox, + 'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS. + role: 'dialog', + tabindex: '-1' + }).hide(); + $overlay = $tag(div, "Overlay").hide(); + $loadingOverlay = $([$tag(div, "LoadingOverlay")[0],$tag(div, "LoadingGraphic")[0]]); + $wrap = $tag(div, "Wrapper"); + $content = $tag(div, "Content").append( + $title = $tag(div, "Title"), + $current = $tag(div, "Current"), + $prev = $('
- - From 076edafd6c23be9c7623d828c55e62878b1aa6c4 Mon Sep 17 00:00:00 2001 From: Jessica Date: Fri, 13 May 2016 14:13:58 -0700 Subject: [PATCH 166/174] added many seeds of awesome things --- db/seeds.rb | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/db/seeds.rb b/db/seeds.rb index 735138feae..206438f421 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -35,7 +35,18 @@ photo_url: "http://www.fuzzytoday.com/wp-content/uploads/2014/04/10173656_706647296068039_5966309383389001510_n.jpg") Product.create(name: "Dewback", quantity: 6, description: "Straight from Tatooine.", price: 52, user_id: 4, animal: "Dog", category: "Star Wars", photo_url: "http://www.officialstarwarscostumes.com/~/media/products/oc/star-wars-costumes/kids-star-wars-costumes/99886582-dewback-pet-costume-pet-star-wars-costumes-000.ashx?&w=600&h=600&bc=FFFFFF") - +Product.create(name: "Octopus Cat", description: "Purple Catapus", quantity: 8, price: 6, user_id: 2, animal: "Cat", category: "Animal", photo_url: "https://s-media-cache-ak0.pinimg.com/236x/26/8b/5f/268b5f4ec59098edbb5233f7aceec4c1.jpg") +Product.create(name: "Ballerina Guinea", description: "Do a twirl!", quantity: 4, price: 3, user_id: 4, animal: "Guinea Pig", category: "Misc", photo_url: "http://petus.imageg.net/PETNA_36/pimg/pPETNA-5237935_main_t300x300.jpg") +Product.create(name: "Bantha Pup", description: "Carrying the sand people", quantity: 5, price: 80, user_id: 5, animal: "Dog", category: "Star Wars", photo_url: "http://images.halloweencostumes.com/products/14360/1-1/bantha-pet-costume.jpg") +Product.create(name: "Mermaid Kitty Cat", description: "Like the fishies in the sea", quantity: 3, price: 15, user_id: 4, animal: "Cat", category: "Misc", photo_url: "https://allergicpet.files.wordpress.com/2013/10/800443182352cs1.jpg") +Product.create(name: "T-Rex Doggy", description: "RAAWWWR TINY ARMS", quantity: 9, price: 18, user_id: 5, animal: "Dog", category: "Animal", photo_url: "http://ecx.images-amazon.com/images/I/91gA22a8aVL._SX522_.jpg") +Product.create(name: "Arf-2 D-2", description: "Beep beeeep beep", quantity: 6, price: 50, animal: "Dog", category: "Star Wars", photo_url: "http://ecx.images-amazon.com/images/I/41yXoIPBXPL._AC_UL320_SR232,320_.jpg") +Product.create(name: "Imperial Walker", description: "Armored and ready", quantity: 10, price: 32, animal: "Dog", category: "Star Wars", photo_url: "http://cdn.earthporm.com/wp-content/uploads/2014/10/pet-halloween-costume-361__605.jpg") +Product.create(name: "Minion", description: "Butt", quantity: 5, price: 11, animal: "Dog", category: "Misc", photo_url: "http://media2.s-nbcnews.com/j/newscms/2015_38/785541/party_city_minion_756c437715c409cfdf0dbf4149c9449d.today-inline-large.jpeg") +Product.create(name: "Rodeo Dog", description: "Yeehaw!", quantity: 7, price: 33, animal: "Dog", category: "Misc", photo_url: "http://shutupandtakemymoney.com/wp-content/uploads/2012/08/dog-rodeo-costume.jpg") +Product.create(name: "Freddy Krueger Guinea", description: "Nightmare on Piggy Street", quantity: 8, price: 33, animal: "Guinea Pig", category: "Holiday", photo_url: "https://wagsandwhiskershouston.files.wordpress.com/2014/10/freddy-guinea.png?w=300&h=223") +Product.create(name: "Baked Potato", description: "Butter pat included", animal: "Guinea Pig", category: "Food", quantity: 22, price: 400, photo_url: "http://mydisguises.com/wp-content/uploads/2012/06/VSiOB.jpg") +Product.create(name: "Bunny Guinea", description: "Will hop into your ❤️", animal: "Guinea Pig", category: "Animal", quantity: 12, price: 42, photo_url: "http://petus.imageg.net/PETNA_36/pimg/pPETNA-5246083_main_r200.jpg") Review.create(rating: 1, description: 'Amazing!', product_id: 1) Review.create(rating: 2, description: 'Wonderful', product_id: 1) @@ -56,6 +67,18 @@ Review.create(rating: 4, description: 'Cute.', product_id: 11) Review.create(rating: 4, description: 'I LOVE IT.', product_id: 12) Review.create(rating: 4, description: 'Fit perfectly.', product_id: 13) +Review.create(rating: 3, description: "Funky cool", product_id: 14) +Review.create(rating: 5, description: "My guinea pig is so cute running around squeaking in this", product_id: 15) +Review.create(rating: 5, description: "Epic", product_id: 16) +Review.create(rating: 3, description: "So sparkly", product_id: 17) +Review.create(rating: 3, description: "The arms are so funny!", product_id: 18) +Review.create(rating: 5, description: "Needs C3PO!", product_id: 19) +Review.create(rating: 4, description: "So large!", product_id: 20) +Review.create(rating: 4, description: "HAHAHA BUTT", product_id: 21) +Review.create(rating: 3, description: "This is weird.", product_id: 22) +Review.create(rating: 2, description: "This scares my kids.", product_id: 23) +Review.create(rating: 1, description: "WTF ARE YOU SELLING?", product_id: 24) +Review.create(rating: 5, description: "So cute and fluffy!", product_id: 25) @products = Product.all @products.each do |product| From 48ba82a829d97537532e1fc125ce06e30753cf35 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Fri, 13 May 2016 14:15:06 -0700 Subject: [PATCH 167/174] updated review stuff so it doesn't display unless there is a review --- app/views/products/show.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb index 6275718a08..ec588c79f1 100644 --- a/app/views/products/show.html.erb +++ b/app/views/products/show.html.erb @@ -15,6 +15,7 @@

Rating: <%= review.rating %>/5

<%= review.description %>


+
<% end %> <% end %>
From 175189414b521a2d647ae4b1d6d2dfc89d28fb1c Mon Sep 17 00:00:00 2001 From: Jessica Date: Fri, 13 May 2016 14:21:10 -0700 Subject: [PATCH 168/174] adding user ids to seeds --- db/seeds.rb | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 206438f421..175605b6d2 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,6 +1,3 @@ -# This file should contain all the record creation needed to seed the database with its default values. -# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). - User.create(full_name: "Jess") User.create(full_name: "Alysia") User.create(full_name: "Deirdre") @@ -11,16 +8,12 @@ photo_url: "http://ecx.images-amazon.com/images/I/41qN0y-0FFL._SY300_.jpg", user_id: 2, animal: 'Dog', category: "Food") Product.create(name: "Arrr Matey", quantity: 4, description: "Whar be me treasure buried?", price: 20, user_id: 5, animal: 'Dog', category: "Misc", photo_url: "http://s2.thisnext.com/media/largest_dimension/A1684071.jpg") -# Product.create(name: "Alligator", price: 1, user_id: 1, animal: 'Dog', category: "Animal", -# photo_url: "http://cdn1-www.dogtime.com/assets/uploads/gallery/cool-halloween-costumes/dog-halloween-costume-eaten_by_alligator.jpg") Product.create(name: "Alligator", quantity: 8, description: "Too cute to take a bite outta anyone!", price: 1, user_id: 1, animal: 'Dog', category: "Animal", photo_url: "http://pixel.brit.co/wp-content/uploads/2014/10/72-Gator-RADLAB.jpg") Product.create(name: "Knight Guinea Pig", quantity: 13, description: "Standing guard!", price: 56, user_id: 3, animal: "Guinea Pig", category: "Misc", photo_url: "http://www.thesundaytimes.co.uk/sto/multimedia/dynamic/00358/stg28minmagcheatshe_358537k.jpg") Product.create(name: "St Patricks Dog", quantity: 9, description: "Lucky 🍀 Dog.", price: 94, user_id: 4, animal: "Dog", category: "Holiday", photo_url: "https://s-media-cache-ak0.pinimg.com/736x/65/82/48/65824840727b14eb271524e4db3a69b0.jpg") -# Product.create(name: "Ewok dog", price: 6, user_id: 2, animal: "Dog", category: "Star Wars", -# photo_url: "https://s-media-cache-ak0.pinimg.com/736x/86/bb/c0/86bbc0780b0d655924868ed0b858d7d6.jpg") Product.create(name: "Yoda Pup", quantity: 3, description: "Use the force, you will.", price: 10, user_id: 1, animal: "Dog", category: "Star Wars", photo_url: "http://thissortofthing.com/storage/yoda_dog_costume.jpg?__SQUARESPACE_CACHEVERSION=1377883510952") Product.create(name: "Sushi Roll Cat", quantity: 7, description: "Wrapped up in cute. ", price: 14, user_id: 4, animal: "Cat", category: "Food", photo_url: "https://s-media-cache-ak0.pinimg.com/736x/10/a8/69/10a869497c6bc793ecfcbf3e0b842886.jpg") Product.create(name: "RAWR", quantity: 8, description: "Big roar, much cute.", price: 30, user_id: 3, animal: "Dog", category: "Animal", @@ -40,13 +33,13 @@ Product.create(name: "Bantha Pup", description: "Carrying the sand people", quantity: 5, price: 80, user_id: 5, animal: "Dog", category: "Star Wars", photo_url: "http://images.halloweencostumes.com/products/14360/1-1/bantha-pet-costume.jpg") Product.create(name: "Mermaid Kitty Cat", description: "Like the fishies in the sea", quantity: 3, price: 15, user_id: 4, animal: "Cat", category: "Misc", photo_url: "https://allergicpet.files.wordpress.com/2013/10/800443182352cs1.jpg") Product.create(name: "T-Rex Doggy", description: "RAAWWWR TINY ARMS", quantity: 9, price: 18, user_id: 5, animal: "Dog", category: "Animal", photo_url: "http://ecx.images-amazon.com/images/I/91gA22a8aVL._SX522_.jpg") -Product.create(name: "Arf-2 D-2", description: "Beep beeeep beep", quantity: 6, price: 50, animal: "Dog", category: "Star Wars", photo_url: "http://ecx.images-amazon.com/images/I/41yXoIPBXPL._AC_UL320_SR232,320_.jpg") -Product.create(name: "Imperial Walker", description: "Armored and ready", quantity: 10, price: 32, animal: "Dog", category: "Star Wars", photo_url: "http://cdn.earthporm.com/wp-content/uploads/2014/10/pet-halloween-costume-361__605.jpg") -Product.create(name: "Minion", description: "Butt", quantity: 5, price: 11, animal: "Dog", category: "Misc", photo_url: "http://media2.s-nbcnews.com/j/newscms/2015_38/785541/party_city_minion_756c437715c409cfdf0dbf4149c9449d.today-inline-large.jpeg") -Product.create(name: "Rodeo Dog", description: "Yeehaw!", quantity: 7, price: 33, animal: "Dog", category: "Misc", photo_url: "http://shutupandtakemymoney.com/wp-content/uploads/2012/08/dog-rodeo-costume.jpg") -Product.create(name: "Freddy Krueger Guinea", description: "Nightmare on Piggy Street", quantity: 8, price: 33, animal: "Guinea Pig", category: "Holiday", photo_url: "https://wagsandwhiskershouston.files.wordpress.com/2014/10/freddy-guinea.png?w=300&h=223") -Product.create(name: "Baked Potato", description: "Butter pat included", animal: "Guinea Pig", category: "Food", quantity: 22, price: 400, photo_url: "http://mydisguises.com/wp-content/uploads/2012/06/VSiOB.jpg") -Product.create(name: "Bunny Guinea", description: "Will hop into your ❤️", animal: "Guinea Pig", category: "Animal", quantity: 12, price: 42, photo_url: "http://petus.imageg.net/PETNA_36/pimg/pPETNA-5246083_main_r200.jpg") +Product.create(name: "Arf-2 D-2", description: "Beep beeeep beep", quantity: 6, price: 50, user_id: 3, animal: "Dog", category: "Star Wars", photo_url: "http://ecx.images-amazon.com/images/I/41yXoIPBXPL._AC_UL320_SR232,320_.jpg") +Product.create(name: "Imperial Walker", description: "Armored and ready", quantity: 10, user_id: 1, price: 32, animal: "Dog", category: "Star Wars", photo_url: "http://cdn.earthporm.com/wp-content/uploads/2014/10/pet-halloween-costume-361__605.jpg") +Product.create(name: "Minion", description: "Butt", quantity: 5, price: 11, animal: "Dog", user_id: 5, category: "Misc", photo_url: "http://media2.s-nbcnews.com/j/newscms/2015_38/785541/party_city_minion_756c437715c409cfdf0dbf4149c9449d.today-inline-large.jpeg") +Product.create(name: "Rodeo Dog", description: "Yeehaw!", quantity: 7, price: 33, animal: "Dog", user_id: 2, category: "Misc", photo_url: "http://shutupandtakemymoney.com/wp-content/uploads/2012/08/dog-rodeo-costume.jpg") +Product.create(name: "Freddy Krueger Guinea", description: "Nightmare on Piggy Street", quantity: 8, user_id: 4, price: 33, animal: "Guinea Pig", category: "Holiday", photo_url: "https://wagsandwhiskershouston.files.wordpress.com/2014/10/freddy-guinea.png?w=300&h=223") +Product.create(name: "Baked Potato", description: "Butter pat included", animal: "Guinea Pig", user_id: 3, category: "Food", quantity: 22, price: 400, photo_url: "http://mydisguises.com/wp-content/uploads/2012/06/VSiOB.jpg") +Product.create(name: "Bunny Guinea", description: "Will hop into your ❤️", animal: "Guinea Pig", user_id: 4, category: "Animal", quantity: 12, price: 42, photo_url: "http://petus.imageg.net/PETNA_36/pimg/pPETNA-5246083_main_r200.jpg") Review.create(rating: 1, description: 'Amazing!', product_id: 1) Review.create(rating: 2, description: 'Wonderful', product_id: 1) From 2edfc79307f45635e3abcbf629b630077d83fda2 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Fri, 13 May 2016 14:43:29 -0700 Subject: [PATCH 169/174] fixed a rewiew bug and added some css to seller order page --- app/assets/stylesheets/application.css | 5 ++++ app/controllers/reviews_controller.rb | 2 +- app/views/orders/show_seller_orders.html.erb | 26 +++++++++++--------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 4b3f70e6eb..96adc4e94d 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -244,3 +244,8 @@ div.deets { .purple { color: purple; } + +div.order { + margin-left: 5%; + margin-right: 5%; +} diff --git a/app/controllers/reviews_controller.rb b/app/controllers/reviews_controller.rb index 35e2e04e48..438aa432a7 100644 --- a/app/controllers/reviews_controller.rb +++ b/app/controllers/reviews_controller.rb @@ -2,7 +2,7 @@ class ReviewsController < ApplicationController def new @product = Product.find(params[:id]) - if @product.user_id == current_user.id + if current_user && @product.user_id == current_user.id redirect_to product_path(@product.id), alert: "You can't review your own product." end diff --git a/app/views/orders/show_seller_orders.html.erb b/app/views/orders/show_seller_orders.html.erb index 690193e9a8..e0c4f86f1c 100644 --- a/app/views/orders/show_seller_orders.html.erb +++ b/app/views/orders/show_seller_orders.html.erb @@ -1,14 +1,15 @@ - -

Welcome to your store, <%= @user.full_name %>!

-
-<%= link_to 'Add a New Product', new_product_path, class: "store-links" %> -<%= link_to 'Your Current Products', user_product_path, class: "store-links" %> -
-

Total Revenue: <%= number_to_currency @revenue %>

-

Completed Orders Revenue: <%= number_to_currency @completed_revenue %> -

Pending Orders Revenue: <%= number_to_currency @pending_revenue %>

-

Number of Completed Orders: <%= @completed_count %>

-

Number of Pending Orders: <%= @pending_count %>

+
+

Welcome to your store, <%= @user.full_name %>!

+
+ <%= link_to 'Add a New Product', new_product_path, class: "store-links" %> + <%= link_to 'Your Current Products', user_product_path, class: "store-links" %> +
+
+

Total Revenue: <%= number_to_currency @revenue %>

+

Completed Orders Revenue: <%= number_to_currency @completed_revenue %> +

Pending Orders Revenue: <%= number_to_currency @pending_revenue %>

+

Number of Completed Orders: <%= @completed_count %>

+

Number of Pending Orders: <%= @pending_count %>

Orders Containing Your Products

@@ -25,7 +26,7 @@ <%= order.id %> <%= order.status %> <% if order.status == "Completed" %> - + <%= link_to "View Order Details", order_deets_path(id: current_user.id, order_id: order.id), class: "btn btn-primary"%> <% else %> Not Completed Yet @@ -34,3 +35,4 @@ <% end %> +
From bd9e2ce7a7789a1d2600bcae75a1a94c1ad97288 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Fri, 13 May 2016 14:48:27 -0700 Subject: [PATCH 170/174] fixed display on category page --- app/views/products/show_category.html.erb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/products/show_category.html.erb b/app/views/products/show_category.html.erb index 240c8f3e37..524622dc7f 100644 --- a/app/views/products/show_category.html.erb +++ b/app/views/products/show_category.html.erb @@ -8,11 +8,10 @@ <% end %>

- <%= product.description %>
- $<%= number_with_precision product.price, precision: 2 %> <%= form_tag '/orderitems' do %> - <%= link_to product.name, product_path(product.id) %> + <%= link_to product.name, product_path(product.id) %>
+ $<%= number_with_precision product.price, precision: 2 %> <%= hidden_field_tag :product_id, product.id %>
<%= select_tag :quantity, options_for_select(1..product.quantity) %>
<% if product.quantity == 0 %> From 90b18d16476bce81cc548e50c20bd92cea78ec10 Mon Sep 17 00:00:00 2001 From: Deirdre Storck Date: Thu, 26 May 2016 11:37:47 -0700 Subject: [PATCH 171/174] updated state to be a dropdown so we can't put in long state names and break things --- app/controllers/application_controller.rb | 2 - app/controllers/sessions_controller.rb | 6 +-- app/helpers/order_helper.rb | 57 ----------------------- app/helpers/orders_helper.rb | 3 +- app/views/orders/checkout.html.erb | 5 +- 5 files changed, 6 insertions(+), 67 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1e231230c7..d7011df0ca 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -13,8 +13,6 @@ def current_order @current_order ||= Order.find_or_create_by(id: session[:order_id]) end - - def require_login if current_user.nil? flash[:error] = "You must be logged in to view this section" diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index fd503248bf..f40cf4e370 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -4,9 +4,9 @@ def new def create user = User.log_in(params[:username], params[:password]) - order = Order.create - order.update(status: "Pending") - session[:order_id] = order.id + # order = Order.create + # order.update(status: "Pending") + # session[:order_id] = order.id if user session[:user_id] = user.id redirect_to root_path diff --git a/app/helpers/order_helper.rb b/app/helpers/order_helper.rb index a7488e7fee..e69de29bb2 100644 --- a/app/helpers/order_helper.rb +++ b/app/helpers/order_helper.rb @@ -1,57 +0,0 @@ -module OrderHelper - def us_states - [ - ['AK', 'AK'], - ['AL', 'AL'], - ['AR', 'AR'], - ['AZ', 'AZ'], - ['CA', 'CA'], - ['CO', 'CO'], - ['CT', 'CT'], - ['DC', 'DC'], - ['DE', 'DE'], - ['FL', 'FL'], - ['GA', 'GA'], - ['HI', 'HI'], - ['IA', 'IA'], - ['ID', 'ID'], - ['IL', 'IL'], - ['IN', 'IN'], - ['KS', 'KS'], - ['KY', 'KY'], - ['LA', 'LA'], - ['MA', 'MA'], - ['MD', 'MD'], - ['ME', 'ME'], - ['MI', 'MI'], - ['MN', 'MN'], - ['MO', 'MO'], - ['MS', 'MS'], - ['MT', 'MT'], - ['NC', 'NC'], - ['ND', 'ND'], - ['NE', 'NE'], - ['NH', 'NH'], - ['NJ', 'NJ'], - ['NM', 'NM'], - ['NV', 'NV'], - ['NY', 'NY'], - ['OH', 'OH'], - ['OK', 'OK'], - ['OR', 'OR'], - ['PA', 'PA'], - ['RI', 'RI'], - ['SC', 'SC'], - ['SD', 'SD'], - ['TN', 'TN'], - ['TX', 'TX'], - ['UT', 'UT'], - ['VA', 'VA'], - ['VT', 'VT'], - ['WA', 'WA'], - ['WI', 'WI'], - ['WV', 'WV'], - ['WY', 'WY'] - ] -end -end diff --git a/app/helpers/orders_helper.rb b/app/helpers/orders_helper.rb index 443227fd48..8b13789179 100644 --- a/app/helpers/orders_helper.rb +++ b/app/helpers/orders_helper.rb @@ -1,2 +1 @@ -module OrdersHelper -end + diff --git a/app/views/orders/checkout.html.erb b/app/views/orders/checkout.html.erb index b116087ec8..2b130269d4 100644 --- a/app/views/orders/checkout.html.erb +++ b/app/views/orders/checkout.html.erb @@ -21,11 +21,10 @@ <%= f.text_field :city, class: "form-control", required: true %>
-
+ <%= f.label :state, class: "col-xs-4 control-label required" %> -
+
<%= f.select :state, options_for_select(us_states),{}, class: "form-control", required: true %> -
<%= f.label :name_on_credit_card, class: "col-xs-4 control-label required" %> From 4cbe85694875167f5679b82c4652b27b15fa42e6 Mon Sep 17 00:00:00 2001 From: Jessica Date: Wed, 15 Jun 2016 18:54:02 -0700 Subject: [PATCH 172/174] adding lisa's fix to our cart --- app/controllers/application_controller.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1e231230c7..0f3864c3c2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,7 +10,14 @@ def current_user end def current_order - @current_order ||= Order.find_or_create_by(id: session[:order_id]) + order ||= Order.find_by(id: session[:order_id]) + + if order.nil? + order = Order.create(status: "Pending") + session[:order_id] = order.id + end + + order end From a9059aa4e387acdab72494b4cfb6d5012d5cff8d Mon Sep 17 00:00:00 2001 From: Jessica Date: Sat, 2 Jul 2016 11:01:48 -0700 Subject: [PATCH 173/174] fixing order helpers bc somehow they disappeared. --- app/helpers/order_helper.rb | 54 ++++++++++++++++++++++++++++++++++++ app/helpers/orders_helper.rb | 3 +- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/app/helpers/order_helper.rb b/app/helpers/order_helper.rb index e69de29bb2..07385dfbd0 100644 --- a/app/helpers/order_helper.rb +++ b/app/helpers/order_helper.rb @@ -0,0 +1,54 @@ +module OrderHelper + df us_states + [ ['AK', 'AK'], + ['AL', 'AL'], + ['AR', 'AR'], + ['AZ', 'AZ'], + ['CA', 'CA'], + ['CO', 'CO'], + ['CT', 'CT'], + ['DC', 'DC'], + ['DE', 'DE'], + ['FL', 'FL'], + ['GA', 'GA'], + ['HI', 'HI'], + ['IA', 'IA'], + ['ID', 'ID'], + ['IL', 'IL'], + ['IN', 'IN'], + ['KS', 'KS'], + ['KY', 'KY'], + ['LA', 'LA'], + ['MA', 'MA'], + ['MD', 'MD'], + ['ME', 'ME'], + ['MI', 'MI'], + ['MN', 'MN'], + ['MO', 'MO'], + ['MS', 'MS'], + ['MT', 'MT'], + ['NC', 'NC'], + ['ND', 'ND'], + ['NE', 'NE'], + ['NH', 'NH'], + ['NJ', 'NJ'], + ['NM', 'NM'], + ['NV', 'NV'], + ['NY', 'NY'], + ['OH', 'OH'], + ['OK', 'OK'], + ['OR', 'OR'], + ['PA', 'PA'], + ['RI', 'RI'], + ['SC', 'SC'], + ['SD', 'SD'], + ['TN', 'TN'], + ['TX', 'TX'], + ['UT', 'UT'], + ['VA', 'VA'], + ['VT', 'VT'], + ['WA', 'WA'], + ['WI', 'WI'], + ['WV', 'WV'], + ['WY', 'WY'] + ] \ No newline at end of file diff --git a/app/helpers/orders_helper.rb b/app/helpers/orders_helper.rb index 8b13789179..443227fd48 100644 --- a/app/helpers/orders_helper.rb +++ b/app/helpers/orders_helper.rb @@ -1 +1,2 @@ - +module OrdersHelper +end From 6dc1e630ddf6b05df2189150fa7b6aefe6647380 Mon Sep 17 00:00:00 2001 From: Jessica Date: Sat, 2 Jul 2016 11:03:24 -0700 Subject: [PATCH 174/174] fixed syntax error --- app/helpers/order_helper.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/helpers/order_helper.rb b/app/helpers/order_helper.rb index 07385dfbd0..e918f69220 100644 --- a/app/helpers/order_helper.rb +++ b/app/helpers/order_helper.rb @@ -1,5 +1,5 @@ module OrderHelper - df us_states + def us_states [ ['AK', 'AK'], ['AL', 'AL'], ['AR', 'AR'], @@ -51,4 +51,6 @@ module OrderHelper ['WI', 'WI'], ['WV', 'WV'], ['WY', 'WY'] - ] \ No newline at end of file + ] +end +end \ No newline at end of file