Permalink
Browse files

Accidentally did a reset o_O .....

  • Loading branch information...
1 parent 287ee25 commit 721a6c0a1eec46b36c3e860ad4065f14784b8962 @florida committed Nov 16, 2012
Showing with 620 additions and 466 deletions.
  1. BIN app/assets/images/Untitled-1.psd
  2. BIN app/assets/images/footer_amplifier.png
  3. BIN app/assets/images/logo.png
  4. 0 app/assets/javascripts/{store.js.coffee → sessions.js.coffee}
  5. +3 −0 app/assets/javascripts/users.js.coffee
  6. +17 −0 app/assets/stylesheets/application.css
  7. +0 −110 app/assets/stylesheets/application.css.scss
  8. +1 −1 app/assets/stylesheets/scaffolds.css.scss
  9. +3 −0 app/assets/stylesheets/sessions.css.scss
  10. +1 −1 app/assets/stylesheets/{store.css.scss → users.css.scss}
  11. +3 −3 app/controllers/admin/orders_controller.rb
  12. +3 −3 app/controllers/admin/products_controller.rb
  13. +0 −1 app/controllers/application_controller.rb
  14. +0 −83 app/controllers/orders_controller.rb
  15. +19 −0 app/controllers/sessions_controller.rb
  16. +0 −33 app/controllers/store_controller.rb
  17. +15 −0 app/controllers/users_controller.rb
  18. +2 −0 app/helpers/sessions_helper.rb
  19. +0 −2 app/helpers/store_helper.rb
  20. +2 −0 app/helpers/users_helper.rb
  21. +0 −36 app/models/cart.rb
  22. +0 −11 app/models/lineitem.rb
  23. +1 −7 app/models/order.rb
  24. +1 −13 app/models/product.rb
  25. +10 −0 app/models/user.rb
  26. +13 −17 app/views/admin/orders/_form.html.erb
  27. +1 −1 app/views/admin/orders/index.html.erb
  28. +13 −22 app/views/admin/products/_form.html.erb
  29. +17 −36 app/views/layouts/application.html.erb
  30. +18 −0 app/views/sessions/new.html.erb
  31. +0 −13 app/views/store/_product.html.erb
  32. +0 −1 app/views/store/index.html.erb
  33. +0 −11 app/views/store/shoppingcart.html.erb
  34. +0 −5 app/views/store/show.html.erb
  35. +29 −0 app/views/users/new.html.erb
  36. +398 −0 config/initializers/sorcery.rb
  37. +6 −12 config/routes.rb
  38. +16 −0 db/migrate/20121113171320_sorcery_core.rb
  39. +0 −5 db/migrate/20121114035955_add_image_url_column_to_products.rb
  40. +0 −5 db/migrate/20121114042640_add_availability_column_to_products.rb
  41. +0 −9 db/migrate/20121114043900_rename_column_availability_to_available_in_products.rb
  42. +0 −8 db/migrate/20121116044216_create_carts.rb
  43. +1 −3 db/schema.rb
  44. 0 test/fixtures/{carts.yml → users.yml}
  45. +9 −0 test/functional/sessions_controller_test.rb
  46. +0 −9 test/functional/store_controller_test.rb
  47. +9 −0 test/functional/users_controller_test.rb
  48. +4 −0 test/unit/helpers/sessions_helper_test.rb
  49. +0 −4 test/unit/helpers/store_helper_test.rb
  50. +4 −0 test/unit/helpers/users_helper_test.rb
  51. +1 −1 test/unit/{cart_test.rb → user_test.rb}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Deleted file not rendered
@@ -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/
@@ -0,0 +1,17 @@
+/*
+ * 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 vendor/assets/stylesheets of plugins, if any, 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 top of the
+ * compiled file, but it's generally better to create a new file per style scope.
+ *
+ *= require_self
+ *= require_tree .
+ */
+
+ body{
+ background-image: url(bg.png);
+ }
@@ -1,110 +0,0 @@
-/*
- * 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 vendor/assets/stylesheets of plugins, if any, 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 top of the
- * compiled file, but it's generally better to create a new file per style scope.
- *
- *= require_self
- *= require_tree .
- */
-
- $footer_link_background: #d5d5d5;
- $footer_background_color: #202020;
- $footer_link_shadow: rgba(0,0,0,0.2);
- @mixin footer_links{
- box-shadow: 1px 1px 0px $footer_link_shadow, 2px 2px 0px $footer_link_shadow, 3px 3px 0px $footer_link_shadow, 4px 4px 0px $footer_link_shadow, 5px 5px 0px $footer_link_shadow, 6px 6px 0px $footer_link_shadow;
- background-color: $footer_link_background;
- padding: 20px;
- height: 70px;
- width: 70px;
- border-radius: 70px;
- }
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
-
- body{
- background-image: url('bg.png');
- width: 80%;
- margin: 0 auto;
- font-family: "Arial Narrow", sans-serif;
- }
-
-header.main {
- background: rgba(0,0,0,0.6);
- clear: both;
-}
-
-#logo > img {
- width: 80px;
- height: 80px;
- float: left;
-}
-
-nav.main {
- padding: 20px;
- ul {
- list-style-type: none;
- padding-bottom: 10px;
- border-bottom: 7px double #FFF;
- margin-left: 70px;
- padding-left: 10px;
- li {
- display: inline;
- padding: 30px 10px 10px 10px;
- a{
- color: #FFF;
- text-decoration: none;
- font-size: 25px;
- letter-spacing: 1px;
- background: none;
- }
- &:hover{
- background: rgba(0,0,0,0.2);
- }
- }
- }
-}
-section#footer_amplifier {
- background-image: url('footer_amplifier.png');
- background-size:100%;
- background-repeat: no-repeat;
- height: 64px;
-}
-
-footer {
- font-color: #fff;
- section#footer_container{
- background-color: $footer_background_color;
- padding: 0 20px 0 20px;
- }
- ul{
- list-style-type: none;
- background-image: url('footer_background.png');
- padding: 10px;
- margin: 0 auto;
- border-radius: 20px 20px 0 0;
- height: 150px;
- display: block;
- text-align:center;
- li{
- @include footer_links;
- display: inline-block;
- font-color: #fff;
- margin: 20px 5% 0px 5%;
- a{
- text-decoration: none;
- vertical-align: center;
- }
- }
- }
-}
-
-
-
@@ -29,7 +29,7 @@ a {
}
}
-section {
+div {
&.field, &.actions {
margin-bottom: 10px;
}
@@ -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/
@@ -1,3 +1,3 @@
-// Place all the styles related to the store controller here.
+// 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/
@@ -44,7 +44,7 @@ def create
respond_to do |format|
if @order.save
- format.html { redirect_to admin_order_path(@order), notice: 'Order was successfully created.' }
+ format.html { redirect_to @order, notice: 'Order was successfully created.' }
format.json { render json: @order, status: :created, location: @order }
else
format.html { render action: "new" }
@@ -60,7 +60,7 @@ def update
respond_to do |format|
if @order.update_attributes(params[:order])
- format.html { redirect_to admin_order_path(@order), notice: 'Order was successfully updated.' }
+ format.html { redirect_to @order, notice: 'Order was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
@@ -76,7 +76,7 @@ def destroy
@order.destroy
respond_to do |format|
- format.html { redirect_to admin_orders_url }
+ format.html { redirect_to orders_url }
format.json { head :no_content }
end
end
@@ -44,7 +44,7 @@ def create
respond_to do |format|
if @product.save
- format.html { redirect_to admin_product_path(@product), notice: 'Product was successfully created.' }
+ format.html { redirect_to @product, notice: 'Product was successfully created.' }
format.json { render json: @product, status: :created, location: @product }
else
format.html { render action: "new" }
@@ -60,7 +60,7 @@ def update
respond_to do |format|
if @product.update_attributes(params[:product])
- format.html { redirect_to admin_product_path(@product), notice: 'Product was successfully updated.' }
+ format.html { redirect_to @product, notice: 'Product was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
@@ -76,7 +76,7 @@ def destroy
@product.destroy
respond_to do |format|
- format.html { redirect_to admin_products_url }
+ format.html { redirect_to products_url }
format.json { head :no_content }
end
end
@@ -1,4 +1,3 @@
class ApplicationController < ActionController::Base
protect_from_forgery
-
end
@@ -1,83 +0,0 @@
-class OrdersController < ApplicationController
- # GET /orders
- # GET /orders.json
- def index
- @orders = Order.all
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @orders }
- end
- end
-
- # GET /orders/1
- # GET /orders/1.json
- def show
- @order = Order.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.json { render json: @order }
- end
- end
-
- # GET /orders/new
- # GET /orders/new.json
- def new
- @order = Order.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @order }
- end
- end
-
- # GET /orders/1/edit
- def edit
- @order = Order.find(params[:id])
- end
-
- # POST /orders
- # POST /orders.json
- def create
- @order = Order.new(params[:order])
-
- respond_to do |format|
- if @order.save
- format.html { redirect_to @order, notice: 'Order was successfully created.' }
- format.json { render json: @order, status: :created, location: @order }
- else
- format.html { render action: "new" }
- format.json { render json: @order.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # PUT /orders/1
- # PUT /orders/1.json
- def update
- @order = Order.find(params[:id])
-
- respond_to do |format|
- if @order.update_attributes(params[:order])
- format.html { redirect_to @order, notice: 'Order was successfully updated.' }
- format.json { head :no_content }
- else
- format.html { render action: "edit" }
- format.json { render json: @order.errors, status: :unprocessable_entity }
- end
- end
- end
-
- # DELETE /orders/1
- # DELETE /orders/1.json
- def destroy
- @order = Order.find(params[:id])
- @order.destroy
-
- respond_to do |format|
- format.html { redirect_to orders_url }
- format.json { head :no_content }
- end
- end
-end
@@ -0,0 +1,19 @@
+class SessionsController < ApplicationController
+ def new
+ end
+
+ def create
+ user = login(params[:email], params[:password], params[:remember_me])
+ if user
+ redirect_back_or_to root_url, :notice => "Logged in!"
+ end
+ flash.now.alert = "Email or Password was invalid"
+ render :new
+ end
+
+ def destroy
+ logout
+ redirect_to root_url, :notice => "Logged Out!"
+ end
+
+end
@@ -1,33 +0,0 @@
-class StoreController < ApplicationController
- def index
- @products = Product.available_items
- end
-
- def add_to_cart
- product = Product.find(params[:id])
- @cart = get_cart
- @cart.add_line_item(product)
-
- redirect_to store_path
- end
-
- def show_cart
- @cart = get_cart
- @items = @cart.items
- render 'shoppingcart'
- end
-
- def empty_cart
- @cart = get_cart
- @cart.empty_cart_contents!
- flash[:notice] = ' Your cart is now empty'
- redirect_to store_path
- end
-
-private
-
- def get_cart
- session[:cart] ||= Cart.new
- end
-
-end
@@ -0,0 +1,15 @@
+class UsersController < ApplicationController
+ def new
+ @user = User.new
+ end
+
+ def create
+ @user = User.new(params[:user])
+ if @user.save
+ redirect_to root_url, :notice => "Signed Up"
+
+ else
+ render :new
+ end
+ end
+end
@@ -0,0 +1,2 @@
+module SessionsHelper
+end
@@ -1,2 +0,0 @@
-module StoreHelper
-end
@@ -0,0 +1,2 @@
+module UsersHelper
+end
Oops, something went wrong.

0 comments on commit 721a6c0

Please sign in to comment.