Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

working on home page

  • Loading branch information...
commit 134e0d553cb1c813c8772ea67f6d8135282f3726 1 parent 798cf3b
JD_home authored
39 Gemfile
View
@@ -1,44 +1,25 @@
source 'http://rubygems.org'
gem 'rails', '3.2.3'
-
-# Bundle edge Rails instead:
-# gem 'rails', :git => 'git://github.com/rails/rails.git'
-
-#gem 'mysql2'
gem 'pg'
-gem 'execjs'
-gem 'therubyracer'
+gem 'spree'
+
#gem 'rvm-capistrano'
#gem 'capistrano'
-gem 'spree'
-
-# Gems used only for assets and not required
-# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
-
- # See https://github.com/sstephenson/execjs#readme for more supported runtimes
+ gem 'execjs'
gem 'therubyracer', :platform => :ruby
-
gem 'uglifier', '>= 1.0.3'
end
-gem 'jquery-rails'
-
-# To use ActiveModel has_secure_password
-# gem 'bcrypt-ruby', '~> 3.0.0'
-
-# To use Jbuilder templates for JSON
-# gem 'jbuilder'
-
-# Use unicorn as the app server
-# gem 'unicorn'
-
-# Deploy with Capistrano
-#gem 'capistrano'
+group :development do
+ gem 'debugger'
+end
-# To use debugger
-# gem 'ruby-debug19', :require => 'ruby-debug'
+gem 'jquery-rails'
+gem 'bootstrap-sass-rails'
+gem 'haml-rails'
+gem 'spree_slider'
23 Gemfile.lock
View
@@ -47,6 +47,9 @@ GEM
nokogiri (>= 1.4.4)
uuidtools (~> 2.1)
bcrypt-ruby (3.0.1)
+ bootstrap-sass-rails (2.0.4.1)
+ rails (~> 3.1)
+ sass-rails (~> 3.1)
braintree (2.16.0)
builder (>= 2.0.0)
builder (3.0.0)
@@ -59,6 +62,14 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.3.1)
+ columnize (0.3.6)
+ debugger (1.1.4)
+ columnize (>= 0.3.1)
+ debugger-linecache (~> 1.1.1)
+ debugger-ruby_core_source (~> 1.1.3)
+ debugger-linecache (1.1.1)
+ debugger-ruby_core_source (>= 1.1.1)
+ debugger-ruby_core_source (1.1.3)
deface (0.8.0)
nokogiri (~> 1.5.0)
rails (>= 3.0.9)
@@ -71,6 +82,12 @@ GEM
execjs (1.3.1)
multi_json (~> 1.0)
ffaker (1.12.1)
+ haml (3.1.6)
+ haml-rails (0.3.4)
+ actionpack (~> 3.0)
+ activesupport (~> 3.0)
+ haml (~> 3.0)
+ railties (~> 3.0)
highline (1.6.11)
hike (1.2.1)
httparty (0.8.3)
@@ -188,6 +205,8 @@ GEM
spree_core (= 1.1.0)
spree_sample (1.1.0)
spree_core (= 1.1.0)
+ spree_slider (1.1.0)
+ spree_core (~> 1.1.0)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
@@ -213,12 +232,16 @@ PLATFORMS
ruby
DEPENDENCIES
+ bootstrap-sass-rails
coffee-rails (~> 3.2.1)
+ debugger
execjs
+ haml-rails
jquery-rails
pg
rails (= 3.2.3)
sass-rails (~> 3.2.3)
spree
+ spree_slider
therubyracer
uglifier (>= 1.0.3)
BIN  app/assets/images/jcobb_banner.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  app/assets/images/test.jpg
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1  app/assets/javascripts/application.js
View
@@ -12,4 +12,5 @@
//
//= require jquery
//= require jquery_ujs
+//= require twitter/bootstrap
//= require_tree .
2  app/assets/javascripts/store/all.js
View
@@ -10,5 +10,7 @@
//= require store/spree_core
//= require store/spree_auth
//= require store/spree_promo
+//= require twitter/bootstrap
//= require_tree .
+//= require jquery.nivo.slider.pack.js
11 app/assets/stylesheets/application.css
View
@@ -9,5 +9,16 @@
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
+ *= require twitter/bootstrap
*= require_tree .
*/
+
+.imgshadow {
+ background:#FFFFFF;
+ padding:4px;
+ border:1px solid #777777;
+ margin-top:5px;
+ -moz-box-shadow:0px 0px 5px #666666;
+ -webkit-box-shadow:0px 0px 5px #666666;
+ box-shadow:0px 0px 5px #666666;
+}
15 app/assets/stylesheets/store/all.css
View
@@ -7,7 +7,22 @@
*= require store/spree_core
*= require store/spree_auth
*= require store/spree_promo
+ *= require twitter/bootstrap
*= require_self
*= require_tree .
+ *= require themes/default/default
+ *= require themes/pascal/pascal
+ *= require themes/orman/orman
+ *= require nivo-slider
*/
+
+.imgshadow {
+ background:#FFFFFF;
+ padding:4px;
+ border:1px solid #777777;
+ margin-top:5px;
+ -moz-box-shadow:0px 0px 5px #666666;
+ -webkit-box-shadow:0px 0px 5px #666666;
+ box-shadow:0px 0px 5px #666666;
+}
8 app/controllers/spree/home/home_controller_decorator.rb
View
@@ -0,0 +1,8 @@
+Spree::HomeController.class_eval do
+
+ def index
+ @recent_products = Spree::Product.last(3)
+ @featured_products = Spree::Product.featured_products.last(3)
+ end
+
+end
3  app/models/spree/product_decorator.rb
View
@@ -0,0 +1,3 @@
+Spree::Product.class_eval do
+ scope :featured_products, where(:featured => true)
+end
31 app/overrides/main_overrides.rb
View
@@ -1,7 +1,33 @@
Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
+ :name => "header_override",
+ :insert_before => "#header",
+ :partial => "shared/logo",
+ :disabled => false)
+
+Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
+ :name => "menu_override",
+ :insert_after => "#jcobb-logo",
+ :partial => "shared/menu",
+ :disabled => false)
+
+Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
+ :name => "head_override",
+ :remove => "#header",
+ :disabled => true)
+
+Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
:name => "logo_override",
- :replace => "#logo",
- :text => "",
+ :remove => "#logo",
+ :disabled => false)
+
+Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
+ :name => "main_nav_override",
+ :remove => "#main-nav-bar",
+ :disabled => false)
+
+Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
+ :name => "top_nav_override",
+ :remove => "#top-nav-bar",
:disabled => false)
Deface::Override.new(:virtual_path => "spree/layouts/spree_application",
@@ -9,3 +35,4 @@
:replace => "#footer-left",
:text => "jcobbdesigns.com",
:disabled => false)
+
0  app/overrides/other_overrides.rb
View
No changes.
2  app/views/layouts/application.html.erb
View
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <title>Jcobb</title>
+ <title>Jcobb Designs</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
4 app/views/shared/_logo.html.haml
View
@@ -0,0 +1,4 @@
+.container#jcobb-logo
+ .row
+ .span12
+ = link_to image_tag('jcobb_banner.jpg'), root_path
12 app/views/shared/_menu.html.haml
View
@@ -0,0 +1,12 @@
+.container
+ .row
+ .span12
+ %ul.nav.nav-pills
+ %li= link_to "Home", root_path
+ %li= link_to "Products", products_path
+ %li= link_to "Retailers", root_path
+ %li= link_to "Framed Art", root_path
+ %li= link_to "Show Schedules", root_path
+ %li= link_to "Victory's Art", root_path
+ %li= link_to "Contact", root_path
+ %li= link_to "About", root_path
18 app/views/spree/home/index.html.haml
View
@@ -0,0 +1,18 @@
+.container
+ .row
+ .span12
+ .row
+ .span12
+ = render 'spree/shared/slider'
+ - if @recent_products.present?
+ .row
+ - @recent_products.each do |product|
+ .span4
+ %center
+ - if Spree::Config[:show_zero_stock_products] || product.has_stock?
+ .product-image
+ = link_to image_tag('test.jpg', :size => '100x100', :class => 'imgshadow'), root_path
+ %br
+ = link_to truncate(product.name, :length => 50), product, :class => 'info', :itemprop => "name", :title => product.name
+ %br
+ %span.price.selling= number_to_currency product.price
38 app/views/spree/shared/_slider.html.erb
View
@@ -0,0 +1,38 @@
+<% if Spree::Slide.published.count > 0 %>
+ <style type="text/css">
+ .theme-default #slider {
+ margin:0 auto 0 auto;
+ width:940px; /* Make sure your images are the same size */
+ height:375px; /* Make sure your images are the same size */
+ }
+ .slider-wrapper {
+ margin:0 auto 50px auto;
+ }
+ </style>
+
+ <div class="slider-wrapper theme-default">
+ <div class="ribbon"></div>
+ <div id="slider" class="nivoSlider">
+ <% Spree::Slide.published.each do |s| %>
+ <% if s.body != "" %>
+ <%= link_to image_tag(s.image.url, :title => '#' + s.name.to_url), s.link_url %>
+ <% else %>
+ <%= link_to image_tag(s.image.url), s.link_url %>
+ <% end %>
+ <% end %>
+ </div>
+
+ <% Spree::Slide.published.each do |s| %>
+ <div id='<%= s.name.to_url %>' class='nivo-html-caption'>
+ <%= s.body.html_safe %>
+ </div>
+ <% end %>
+ </div>
+
+ <script type="text/javascript">
+ $(window).load(function() {
+ $('#slider').nivoSlider();
+ });
+ </script>
+<% end %>
+
61 config/routes.rb
View
@@ -1,65 +1,4 @@
Jcobb::Application.routes.draw do
- # This line mounts Spree's routes at the root of your application.
- # This means, any requests to URLs such as /products, will go to Spree::ProductsController.
- # If you would like to change where this engine is mounted, simply change the :at option to something different.
- #
- # We ask that you don't use the :as option here, as Spree relies on it being the default of "spree"
mount Spree::Core::Engine, :at => '/'
- # The priority is based upon order of creation:
- # first created -> highest priority.
-
- # Sample of regular route:
- # match 'products/:id' => 'catalog#view'
- # Keep in mind you can assign values other than :controller and :action
-
- # Sample of named route:
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
- # This route can be invoked with purchase_url(:id => product.id)
-
- # Sample resource route (maps HTTP verbs to controller actions automatically):
- # resources :products
-
- # Sample resource route with options:
- # resources :products do
- # member do
- # get 'short'
- # post 'toggle'
- # end
- #
- # collection do
- # get 'sold'
- # end
- # end
-
- # Sample resource route with sub-resources:
- # resources :products do
- # resources :comments, :sales
- # resource :seller
- # end
-
- # Sample resource route with more complex sub-resources
- # resources :products do
- # resources :comments
- # resources :sales do
- # get 'recent', :on => :collection
- # end
- # end
-
- # Sample resource route within a namespace:
- # namespace :admin do
- # # Directs /admin/products/* to Admin::ProductsController
- # # (app/controllers/admin/products_controller.rb)
- # resources :products
- # end
-
- # You can have the root of your site routed with "root"
- # just remember to delete public/index.html.
- # root :to => 'welcome#index'
-
- # See how all your routes lay out with "rake routes"
-
- # This is a legacy wild controller route that's not recommended for RESTful applications.
- # Note: This route will make all actions in every controller accessible via GET requests.
- # match ':controller(/:action(/:id))(.:format)'
end
17 db/migrate/20120629233627_create_slides.spree_slider.rb
View
@@ -0,0 +1,17 @@
+# This migration comes from spree_slider (originally 20120222184238)
+class CreateSlides < ActiveRecord::Migration
+ def change
+ create_table :spree_slides do |t|
+ t.string :name
+ t.text :body
+ t.string :link_url
+ t.boolean :published
+ t.string :image_file_name
+ t.string :image_content_type
+ t.integer :image_file_size
+ t.datetime :image_updated_at
+
+ t.timestamps
+ end
+ end
+end
5 db/migrate/20120630020038_add_featured_to_spree_products.rb
View
@@ -0,0 +1,5 @@
+class AddFeaturedToSpreeProducts < ActiveRecord::Migration
+ def change
+ add_column :spree_products, :featured, :boolean
+ end
+end
16 db/schema.rb
View
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120502170746) do
+ActiveRecord::Schema.define(:version => 20120630020038) do
create_table "spree_activators", :force => true do |t|
t.string "description"
@@ -310,6 +310,7 @@
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "count_on_hand", :default => 0, :null => false
+ t.boolean "featured"
end
add_index "spree_products", ["available_on"], :name => "index_products_on_available_on"
@@ -438,6 +439,19 @@
t.boolean "match_one"
end
+ create_table "spree_slides", :force => true do |t|
+ t.string "name"
+ t.text "body"
+ t.string "link_url"
+ t.boolean "published"
+ t.string "image_file_name"
+ t.string "image_content_type"
+ t.integer "image_file_size"
+ t.datetime "image_updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
create_table "spree_state_changes", :force => true do |t|
t.string "name"
t.string "previous_state"
Please sign in to comment.
Something went wrong with that request. Please try again.