flag_promotions 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ Redistribution and use in source and binary forms, with or without modification,
2
+ are permitted provided that the following conditions are met:
3
+
4
+ * Redistributions of source code must retain the above copyright notice,
5
+ this list of conditions and the following disclaimer.
6
+ * Redistributions in binary form must reproduce the above copyright notice,
7
+ this list of conditions and the following disclaimer in the documentation
8
+ and/or other materials provided with the distribution.
9
+ * Neither the name of the Rails Dog LLC nor the names of its
10
+ contributors may be used to endorse or promote products derived from this
11
+ software without specific prior written permission.
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
14
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
15
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
16
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,13 @@
1
+ FlagPromotions
2
+ ==============
3
+
4
+ Introduction goes here.
5
+
6
+
7
+ Example
8
+ =======
9
+
10
+ Example goes here.
11
+
12
+
13
+ Copyright (c) 2011 [name of extension creator], released under the New BSD License
@@ -0,0 +1,4 @@
1
+ # flag_promotions/app/controllers/admin/promoted_items_controller.rb
2
+ class Admin::PromotedItemsController < Admin::BaseController
3
+ resource_controller
4
+ end
@@ -0,0 +1,5 @@
1
+ # flag_promotions/app/models/promoted_item.rb
2
+
3
+ class PromotedItem < ActiveRecord::Base
4
+
5
+ end
@@ -0,0 +1 @@
1
+ <h1><%= t(:change_my) %></h1>
@@ -0,0 +1 @@
1
+ <h1><%= t(:change) %></h1>
@@ -0,0 +1,29 @@
1
+ <% content_for :sidebar do %>
2
+ <%= hook :homepage_sidebar_navigation do %>
3
+ <% if "products" == @current_controller && @taxon %>
4
+ <%= render "shared/filters" %>
5
+ <% else %>
6
+ <%= render "shared/taxonomies" %>
7
+ <% end %>
8
+ <% end %>
9
+ <% end %>
10
+
11
+
12
+ <% if params[:keywords] %>
13
+
14
+ <%= hook :search_results do %>
15
+ <% if @products.empty? %>
16
+ <%= t(:no_products_found) %>
17
+ <% else %>
18
+ <%= render "shared/products", :products => @products, :taxon => @taxon %>
19
+ <% end %>
20
+ <% end %>
21
+
22
+ <% else %>
23
+
24
+ <%= hook :homepage_products do %>
25
+ <%= render "shared/products", :products => @products, :taxon => @taxon %>
26
+ <% end %>
27
+
28
+
29
+ <% end %>
@@ -0,0 +1,17 @@
1
+ require 'spree_core'
2
+ require 'flag_promotions_hooks'
3
+
4
+ module FlagPromotions
5
+ class Engine < Rails::Engine
6
+
7
+ config.autoload_paths += %W(#{config.root}/lib)
8
+
9
+ def self.activate
10
+ Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
11
+ Rails.env.production? ? require(c) : load(c)
12
+ end
13
+ end
14
+
15
+ config.to_prepare &method(:activate).to_proc
16
+ end
17
+ end
@@ -0,0 +1,8 @@
1
+ class FlagPromotionsHooks < Spree::ThemeSupport::HookListener
2
+ # custom hooks go here
3
+
4
+ insert_after :admin_tabs do
5
+ #%(<%= tab(:promoted_items) %>)
6
+ end
7
+
8
+ end
@@ -0,0 +1 @@
1
+ # add custom rake tasks here
@@ -0,0 +1,25 @@
1
+ namespace :flag_promotions do
2
+ desc "Copies all migrations and assets (NOTE: This will be obsolete with Rails 3.1)"
3
+ task :install do
4
+ Rake::Task['flag_promotions:install:migrations'].invoke
5
+ Rake::Task['flag_promotions:install:assets'].invoke
6
+ end
7
+
8
+ namespace :install do
9
+ desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
10
+ task :migrations do
11
+ source = File.join(File.dirname(__FILE__), '..', '..', 'db')
12
+ destination = File.join(Rails.root, 'db')
13
+ Spree::FileUtilz.mirror_files(source, destination)
14
+ end
15
+
16
+ desc "Copies all assets (NOTE: This will be obsolete with Rails 3.1)"
17
+ task :assets do
18
+ source = File.join(File.dirname(__FILE__), '..', '..', 'public')
19
+ destination = File.join(Rails.root, 'public')
20
+ puts "INFO: Mirroring assets from #{source} to #{destination}"
21
+ Spree::FileUtilz.mirror_files(source, destination)
22
+ end
23
+ end
24
+
25
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: flag_promotions
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 0
8
+ - 1
9
+ version: 1.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Thomas Chan
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-01-11 00:00:00 -08:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: spree_core
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 0
30
+ - 40
31
+ - 0
32
+ version: 0.40.0
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ description: How does spree extension works. Now i know
36
+ email: thomasjoyce@gmail.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files: []
42
+
43
+ files:
44
+ - README.md
45
+ - LICENSE
46
+ - lib/flag_promotions.rb
47
+ - lib/flag_promotions_hooks.rb
48
+ - lib/tasks/flag_promotions.rake
49
+ - lib/tasks/install.rake
50
+ - app/controllers/admin/promoted_items_controller.rb
51
+ - app/models/promoted_item.rb
52
+ - app/views/admin/promoted_items/index.html.erb
53
+ - app/views/admin/promoted_items/new.html.erb
54
+ - app/views/admin/promoted_items_controller.html.erb
55
+ - app/views/products/index.html.erb
56
+ has_rdoc: true
57
+ homepage: http://www.rubyonrails.org
58
+ licenses: []
59
+
60
+ post_install_message:
61
+ rdoc_options: []
62
+
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ segments:
71
+ - 1
72
+ - 8
73
+ - 7
74
+ version: 1.8.7
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ none: false
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ segments:
81
+ - 0
82
+ version: "0"
83
+ requirements:
84
+ - none
85
+ rubyforge_project:
86
+ rubygems_version: 1.3.7
87
+ signing_key:
88
+ specification_version: 3
89
+ summary: This is a fake gem test aka flag_promotions
90
+ test_files: []
91
+