Skip to content
Browse files

including an app stack

  • Loading branch information...
1 parent 0a4d166 commit db6be757638a593a53c2b3fc3f3e023fa91d89b3 @beaucollins committed Sep 17, 2009
View
5 generators/power_reviews/power_reviews_generator.rb
@@ -9,6 +9,11 @@ def manifest
m.file 'config/power_reviews.yml', 'config/power_reviews.yml'
m.file 'config/initializers/power_reviews.rb', 'config/initializers/power_reviews.rb'
m.file 'config/schedule.rb', 'config/schedule.rb'
+
+ m.directory 'app/controllers'
+ m.directory 'app/views'
+ m.directory 'app/helpers'
+
end
end
end
View
7 generators/power_reviews/templates/app/controllers/power_reviews_controller.rb
@@ -0,0 +1,7 @@
+class PowerReviewsController < ApplicationController
+
+ def index
+
+ end
+
+end
View
38 generators/power_reviews/templates/app/helpers/power_reviews_helper.rb
@@ -0,0 +1,38 @@
+class PowerReviewsHelper
+ def power_reviews_javascript_tag
+ javascript_include_tag('/system/pwr/engine/js/full')
+ end
+
+ def power_reviews_javascript_variables
+ javascript_tag do
+ <<-eos
+ var pr_locale= "en_US";
+ var pr_zip_location= "/system/";
+ //var pr_style_sheet= "http://www.yoursite.com/css/pr_override.css";
+ eos
+ end
+ end
+
+ def power_reviews_snippet(page_id, review_anchor = '#ReviewHeader')
+ javascript_tag do
+ <<-eos
+ POWERREVIEWS.display.snippet(document, {
+ pr_page_id : '#{page_id}',
+ pr_write_review : '#',
+ pr_read_review : '#{review_anchor}'
+ });
+ eos
+ end
+ end
+
+ def power_reviews_display(page_id)
+ javascript_tag do
+ <<-eos
+ POWERREVIEWS.display.engine(document, {
+ pr_page_id : '#{page_id}',
+ pr_write_review : '#'
+ });
+ eos
+ end
+ end
+end
View
3 generators/power_reviews/templates/app/views/power_reviews/index.html.erb
@@ -0,0 +1,3 @@
+<div id="power_reviews_wrapper">
+
+</div>
View
3 install.rb
@@ -1,3 +0,0 @@
-# Install hook code here
-
-# generate a power review config file
View
5 lib/power_reviews.rb
@@ -2,4 +2,7 @@
require 'power_reviews/feed_item'
require 'power_reviews/feed'
-require 'power_reviews/sync'
+require 'power_reviews/sync'
+require 'power_reviews/view_helpers'
+
+ActionView::Base.send :include, PowerReviews::ViewHelpers if defined?(ActionView::Base)
View
9 lib/power_reviews/routes.rb
@@ -0,0 +1,9 @@
+module PowerReviews #:nodoc:
+ module Routes
+ def power_reviews
+ @set.add_route("/reviews", {:controller => "power_reviews_controller", :action => "index"})
+ end
+ end
+end
+
+ActionController::Routing::RouteSet::Mapper.send :include, PowerReviews::Routes
View
38 lib/power_reviews/view_helpers.rb
@@ -0,0 +1,38 @@
+class PowerReviewsHelper
+ def power_reviews_javascript_tag
+ javascript_include_tag('/system/pwr/engine/js/full')
+ end
+
+ def power_reviews_javascript_variables
+ javascript_tag do
+ <<-eos
+ var pr_locale= "en_US";
+ var pr_zip_location= "/system/";
+ //var pr_style_sheet= "http://www.yoursite.com/css/pr_override.css";
+ eos
+ end
+ end
+
+ def power_reviews_snippet(page_id, review_anchor = '#ReviewHeader')
+ javascript_tag do
+ <<-eos
+ POWERREVIEWS.display.snippet(document, {
+ pr_page_id : '#{page_id}',
+ pr_write_review : '#',
+ pr_read_review : '#{review_anchor}'
+ });
+ eos
+ end
+ end
+
+ def power_reviews_display(page_id)
+ javascript_tag do
+ <<-eos
+ POWERREVIEWS.display.engine(document, {
+ pr_page_id : '#{page_id}',
+ pr_write_review : '#'
+ });
+ eos
+ end
+ end
+end
View
1 uninstall.rb
@@ -1 +0,0 @@
-# Uninstall hook code here

0 comments on commit db6be75

Please sign in to comment.
Something went wrong with that request. Please try again.