Skip to content

Commit

Permalink
ajax cart
Browse files Browse the repository at this point in the history
  • Loading branch information
ButuzGOL committed Feb 26, 2012
1 parent d0efa5c commit 07feea3
Show file tree
Hide file tree
Showing 68 changed files with 1,047 additions and 250 deletions.
2 changes: 1 addition & 1 deletion .idea/.rakeTasks

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/dataSources.ids

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/dataSources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions app/assets/javascripts/carts.js.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://jashkenas.github.com/coffee-script/
3 changes: 3 additions & 0 deletions app/assets/javascripts/line_items.js.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://jashkenas.github.com/coffee-script/
3 changes: 3 additions & 0 deletions app/assets/javascripts/orders.js.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://jashkenas.github.com/coffee-script/
3 changes: 3 additions & 0 deletions app/assets/javascripts/store.js.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://jashkenas.github.com/coffee-script/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/carts.css.scss
@@ -0,0 +1,3 @@
// Place all the styles related to the carts controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
65 changes: 64 additions & 1 deletion app/assets/stylesheets/depot.css
Expand Up @@ -109,4 +109,67 @@
color: #44a;
font-weight: bold;
margin-right: 2em;
}
}

#banner {
background: #9c9;
padding-top: 10px;
padding-bottom: 10px;
border-bottom: 2px solid;
font: small-caps 40px/40px "Times New Roman" , serif;
color: #282;
text-align: center;
}
#banner img {
float: left;
}
#columns {
background: #141;
}
#main {
margin-left: 17em;
padding-top: 4ex;
padding-left: 2em;
background: white;
}
#side {
float: left;
padding-top: 1em;
padding-left: 1em;
padding-bottom: 1em;
width: 16em;
background: #141;
}
#side a {
color: #bfb;
font-size: small;
}

#store .entry form, #store .entry form div {
display: inline;
}

/* Styles for the cart in the main page */
#store .cart_title {
font: 120% bold;
}
#store .item_price, #store .total_line {
text-align: right;
}
#store .total_line .total_cell {
font-weight: bold;
border-top: 1px solid #595;
}

/* Styles for the cart in the sidebar */
#cart, #cart table {
font-size: smaller;
color:
white;
}
#cart table {
border-top:
1px dotted #595;
border-bottom: 1px dotted #595;
margin-bottom: 10px;
}
3 changes: 3 additions & 0 deletions app/assets/stylesheets/line_items.css.scss
@@ -0,0 +1,3 @@
// Place all the styles related to the line_items controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/orders.css.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/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/store.css.scss
@@ -0,0 +1,3 @@
// 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/
10 changes: 10 additions & 0 deletions app/controllers/application_controller.rb
@@ -1,3 +1,13 @@
class ApplicationController < ActionController::Base
protect_from_forgery

private

def current_cart
Cart.find(session[:cart_id])
rescue ActiveRecord::RecordNotFound
cart = Cart.create
session[:cart_id] = cart.id
cart
end
end

0 comments on commit 07feea3

Please sign in to comment.