Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

HKN Store Project Milestone #76

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ nbproject
coverage/
.sass-cache/
.vagrant/

.DS_Store
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ group :development, :test do
# webrat is needed to make some specs pass
gem 'webrat'
gem 'yard'
gem 'nifty-generators'
end
gem "mocha", :group => :test
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,15 @@ GEM
nokogiri (~> 1.4)
ntlm-http (~> 0.1, >= 0.1.1)
webrobots (~> 0.0, >= 0.0.9)
metaclass (0.0.1)
mime-types (1.19)
mocha (0.14.0)
metaclass (~> 0.0.1)
multi_json (1.2.0)
net-http-digest_auth (1.2.1)
net-http-persistent (2.8)
net-ldap (0.3.1)
nifty-generators (0.4.6)
nokogiri (1.5.6)
ntlm-http (0.1.1)
pg (0.14.1)
Expand Down Expand Up @@ -185,7 +189,9 @@ DEPENDENCIES
haml-rails
jquery-rails (>= 0.2.6)
mechanize
mocha
net-ldap
nifty-generators
nokogiri
pg
rails (~> 3.1)
Expand Down
Binary file added app/.DS_Store
Binary file not shown.
Binary file added app/assets/.DS_Store
Binary file not shown.
Binary file added app/assets/images/.DS_Store
Binary file not shown.
Binary file added app/assets/images/icons/.DS_Store
Binary file not shown.
Binary file added app/assets/images/store/add_to_cart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/store/paypal_checkout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/javascripts/product.js.coffee
Original file line number Diff line number Diff line change
@@ -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://jashkenas.github.com/coffee-script/
3 changes: 3 additions & 0 deletions app/assets/javascripts/store.js.coffee
Original file line number Diff line number Diff line change
@@ -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://jashkenas.github.com/coffee-script/
Binary file added app/assets/jquery-ui/.DS_Store
Binary file not shown.
44 changes: 44 additions & 0 deletions app/assets/stylesheets/carts.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Place all the styles related to the Store controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

.store-banner-area{
position: relative;
}

#store-banner-welcome-msg{
}

#store-banner-subtitle{
font-style: italic;
}

.store-content-area{
position: relative;
margin-top: 50px;
}


@mixin default-left{
position: relative;
float: left;
width: 75%;
padding-right: 10px;
}


.store-cart-area{
@include default-left;

#checkout-button{
float: right;
}
}


.store-sidebar{
position: relative;
float: right;
width: 20%;
padding-left: 10px;
}
131 changes: 131 additions & 0 deletions app/assets/stylesheets/product.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
// Place all the styles related to the Store controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

.store-banner-area{
position: relative;
}

#store-banner-welcome-msg{
}

#store-banner-subtitle{
font-style: italic;
}

.store-content-area{
position: relative;
margin-top: 50px;
}


@mixin default-left{
position: relative;
float: left;
width: 75%;
padding-right: 10px;
}

.store-product-listings{
@include default-left;
}


.single-product-listings{
@include default-left;

.single-product-image{
position: relative;
.image{max-width: 100%;}
}


.left-info{
position: relative;
float: left;
width: 70%;

.product-name{
font-size: 40px;
}
}

.right-info{
position: relative;
float: right;;
width: 20%;

.product-price{
font-size: 40px;
}

}

.description{
clear: both;
position: relative;
float: left;
}

.checkout{
position: relative;
float: right;
}
}

.store-sidebar{
position: relative;
float: right;
width: 20%;
padding-left: 10px;
}

.product-box{
position: relative;
float: left;
width: 250px;
height: 156px;
background-color: BLACK;
margin: 10px;
overflow: hidden;

.product-info-box{
position: absolute;
bottom: 0px;
left: 0;
width: 100%;
padding: 0 10px;
background-color: WHITE;
opacity: 0.7;

.product-name{
font-weight: bold;
font: bold 20px Cuprum;
color: #403f3f;
}

.product-description{
text-overflow: ellipsis;
/* need following for ellipsis effect */
display: block;
white-space: nowrap;
overflow: hidden;
}

.product-price{
font-size: 20px;
}
}

.product-image{
position: relative;
width: 250px;
height: 156px;
z-index: 0;
}

}




84 changes: 84 additions & 0 deletions app/assets/stylesheets/store.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Place all the styles related to the Store controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

.store-banner-area{
position: relative;
}

#store-banner-welcome-msg{
}

#store-banner-subtitle{
font-style: italic;
}

.store-content-area{
position: relative;
margin-top: 50px;
}

.store-product-listings{
position: relative;
float: left;
width: 75%;
padding-right: 10px;

}

.store-sidebar{
position: relative;
float: right;
width: 20%;
padding-left: 10px;
}

.product-box{
position: relative;
float: left;
width: 250px;
height: 156px;
background-color: BLACK;
margin: 10px;
overflow: hidden;

.product-info-box{
position: absolute;
bottom: 0px;
left: 0;
width: 100%;
padding: 0 10px;
background-color: WHITE;
opacity: 0.7;

.product-name{
font-weight: bold;
font: bold 20px Cuprum;
color: #403f3f;
}

.product-description{
text-overflow: ellipsis;
/* need following for ellipsis effect */
display: block;
white-space: nowrap;
overflow: hidden;
}

.product-price{
font-size: 20px;
}
}

.product-image{
position: relative;
width: 250px;
height: 156px;
z-index: 0;
}

}




Binary file added app/controllers/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion app/controllers/admin/admin_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Admin::AdminController < ApplicationController
#before_filter :authorize_officers, :except=>[:signup_slots, :signup_courses, :update_slots, :add_course, :find_courses]
before_filter :authorize_officers, :except=>[:signup_slots, :signup_courses, :update_slots, :add_course, :find_courses]
before_filter :authorize_comms, :except=>[:signup_slots, :signup_courses, :update_slots, :add_course, :find_courses]

def super_page
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,10 @@ def redirect_back_or_default(path, *args)
send(:redirect_to, request.referer || path, *args)
end

def current_cart
session[:cart_id] ||= Cart.create!.id
@current_cart ||= Cart.find(session[:cart_id])
return @current_cart
end

end
19 changes: 19 additions & 0 deletions app/controllers/carts_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class CartsController < ApplicationController
# def new
# @cart = Cart.new
# end

# def create
# @cart = Cart.new(params[:cart])
# if @cart.save
# redirect_to root_url, :notice => "Successfully created cart."
# else
# render :action => 'new'
# end
# end

def show
@cart = current_cart
end

end
10 changes: 10 additions & 0 deletions app/controllers/line_items_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class LineItemsController < ApplicationController

def create
@product = Sellable.find(params[:pid])
@line_item = LineItem.create!(:cart => current_cart, :sellable => @product, :quantity => 1, :unit_price => @product.price)
flash[:notice] = "Added #{@product.name} to cart."
redirect_to cart_path(id: current_cart.id)
end

end
14 changes: 14 additions & 0 deletions app/controllers/orders_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class OrdersController < ApplicationController
def new
@order = Order.new
end

def create
@order = Order.new(params[:order])
if @order.save
redirect_to root_url, :notice => "Successfully created order."
else
render :action => 'new'
end
end
end
Loading