deluxe_publisher 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +29 -0
- data/LICENSE +20 -0
- data/README.rdoc +127 -0
- data/Rakefile +61 -0
- data/VERSION +1 -0
- data/app/controllers/deluxe_publisher/comments_controller.rb +93 -0
- data/app/controllers/deluxe_publisher/page_types_controller.rb +115 -0
- data/app/controllers/deluxe_publisher/pages_controller.rb +191 -0
- data/app/controllers/deluxe_publisher/presenter_controller.rb +185 -0
- data/app/controllers/deluxe_publisher/redirects_controller.rb +90 -0
- data/app/controllers/deluxe_publisher/sitemap_controller.rb +10 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/helpers/deluxe_publisher/comments_helper.rb +2 -0
- data/app/helpers/deluxe_publisher/page_types_helper.rb +13 -0
- data/app/helpers/deluxe_publisher/pages_helper.rb +41 -0
- data/app/helpers/deluxe_publisher/presenter_helper.rb +111 -0
- data/app/helpers/deluxe_publisher/redirects_helper.rb +2 -0
- data/app/helpers/deluxe_publisher/sitemap_helper.rb +2 -0
- data/app/models/ckeditor/asset.rb +88 -0
- data/app/models/ckeditor/attachment_file.rb +40 -0
- data/app/models/ckeditor/picture.rb +23 -0
- data/app/models/deluxe_publisher/comment.rb +6 -0
- data/app/models/deluxe_publisher/content.rb +6 -0
- data/app/models/deluxe_publisher/content_descriptor.rb +4 -0
- data/app/models/deluxe_publisher/page.rb +206 -0
- data/app/models/deluxe_publisher/page_type.rb +55 -0
- data/app/models/deluxe_publisher/redirect.rb +6 -0
- data/app/models/deluxe_publisher.rb +5 -0
- data/app/views/deluxe_publisher/comments/_form.html.erb +31 -0
- data/app/views/deluxe_publisher/comments/edit.html.erb +6 -0
- data/app/views/deluxe_publisher/comments/index.html.erb +31 -0
- data/app/views/deluxe_publisher/comments/new.html.erb +6 -0
- data/app/views/deluxe_publisher/comments/show.html.erb +30 -0
- data/app/views/deluxe_publisher/page_types/_content_descriptors.html.erb +15 -0
- data/app/views/deluxe_publisher/page_types/_form.html.erb +59 -0
- data/app/views/deluxe_publisher/page_types/content_areas_change.js.erb +3 -0
- data/app/views/deluxe_publisher/page_types/edit.html.erb +8 -0
- data/app/views/deluxe_publisher/page_types/index.html.erb +29 -0
- data/app/views/deluxe_publisher/page_types/new.html.erb +7 -0
- data/app/views/deluxe_publisher/page_types/show.html.erb +45 -0
- data/app/views/deluxe_publisher/pages/_form.html.erb +39 -0
- data/app/views/deluxe_publisher/pages/_general.html.erb +108 -0
- data/app/views/deluxe_publisher/pages/_page.html.erb +23 -0
- data/app/views/deluxe_publisher/pages/_page_content.html.erb +16 -0
- data/app/views/deluxe_publisher/pages/_page_links.html.erb +9 -0
- data/app/views/deluxe_publisher/pages/_seo.html.erb +27 -0
- data/app/views/deluxe_publisher/pages/edit.html.erb +5 -0
- data/app/views/deluxe_publisher/pages/index.html.erb +11 -0
- data/app/views/deluxe_publisher/pages/new.html.erb +6 -0
- data/app/views/deluxe_publisher/pages/page_type_change.js.erb +3 -0
- data/app/views/deluxe_publisher/pages/show.html.erb +115 -0
- data/app/views/deluxe_publisher/presenter/create_comment.js.erb +3 -0
- data/app/views/deluxe_publisher/presenter/create_comment_failed.js.erb +1 -0
- data/app/views/deluxe_publisher/presenter/new_comment.js.erb +7 -0
- data/app/views/deluxe_publisher/presenter/preview.html.erb +2 -0
- data/app/views/deluxe_publisher/redirects/_form.html.erb +29 -0
- data/app/views/deluxe_publisher/redirects/edit.html.erb +6 -0
- data/app/views/deluxe_publisher/redirects/index.html.erb +27 -0
- data/app/views/deluxe_publisher/redirects/new.html.erb +5 -0
- data/app/views/deluxe_publisher/redirects/show.html.erb +20 -0
- data/app/views/deluxe_publisher/sitemap/index.xml.builder +12 -0
- data/app/views/deluxe_publisher/templates/simple_blog.html.erb +19 -0
- data/app/views/deluxe_publisher/templates/simple_blog.rss.builder +23 -0
- data/app/views/deluxe_publisher/templates/simple_blog_story.html.erb +9 -0
- data/app/views/deluxe_publisher/templates/simple_page.html.erb +4 -0
- data/app/views/layouts/_deluxe_publisher_comment_form.html.erb +29 -0
- data/app/views/layouts/_deluxe_publisher_comments_list.html.erb +8 -0
- data/app/views/layouts/application.html.erb +14 -0
- data/app/views/layouts/deluxe_publisher.html.erb +36 -0
- data/app/views/layouts/deluxe_publisher_blog.html.erb +63 -0
- data/app/views/layouts/deluxe_publisher_simple.html.erb +30 -0
- data/config/routes.rb +49 -0
- data/deluxe_publisher.gemspec +466 -0
- data/lib/deluxe_publisher/deluxe_publisher_authentication.rb +37 -0
- data/lib/deluxe_publisher/engine.rb +5 -0
- data/lib/deluxe_publisher.rb +40 -0
- data/lib/generators/deluxe_publisher/base/USAGE +8 -0
- data/lib/generators/deluxe_publisher/base/base_generator.rb +45 -0
- data/lib/generators/deluxe_publisher/base/templates/images/add.png +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/btn_addNewPage.gif +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/btn_cancel.gif +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/btn_preview.gif +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/btn_save.gif +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/bullet.gif +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/content_bg.jpg +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/delete.png +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/edit.png +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/header_background.jpg +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/icon_published.gif +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/icon_unpublished.gif +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/logo.gif +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/minus.gif +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/plus.gif +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/show.png +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/tab_bg.gif +0 -0
- data/lib/generators/deluxe_publisher/base/templates/images/tabs_bg.jpg +0 -0
- data/lib/generators/deluxe_publisher/base/templates/initializer.rb +23 -0
- data/lib/generators/deluxe_publisher/base/templates/javascripts/deluxe_presenter.js +25 -0
- data/lib/generators/deluxe_publisher/base/templates/javascripts/deluxe_publisher.js +86 -0
- data/lib/generators/deluxe_publisher/base/templates/javascripts/jquery-rails.js +158 -0
- data/lib/generators/deluxe_publisher/base/templates/layouts/_deluxe_publisher_comment_form.html.erb +29 -0
- data/lib/generators/deluxe_publisher/base/templates/layouts/_deluxe_publisher_comments_list.html.erb +8 -0
- data/lib/generators/deluxe_publisher/base/templates/layouts/deluxe_publisher_blog.html.erb +74 -0
- data/lib/generators/deluxe_publisher/base/templates/layouts/deluxe_publisher_simple.html.erb +47 -0
- data/lib/generators/deluxe_publisher/base/templates/stylesheets/deluxe_presenter.css +458 -0
- data/lib/generators/deluxe_publisher/base/templates/stylesheets/deluxe_publisher.css +202 -0
- data/lib/generators/deluxe_publisher/base/templates/templates/simple_blog.html.erb +19 -0
- data/lib/generators/deluxe_publisher/base/templates/templates/simple_blog.rss.builder +23 -0
- data/lib/generators/deluxe_publisher/base/templates/templates/simple_blog_story.html.erb +12 -0
- data/lib/generators/deluxe_publisher/base/templates/templates/simple_page.html.erb +4 -0
- data/lib/generators/deluxe_publisher/migration/USAGE +0 -0
- data/lib/generators/deluxe_publisher/migration/migration_generator.rb +18 -0
- data/lib/generators/deluxe_publisher/migration/templates/migration.rb +98 -0
- data/lib/generators/deluxe_publisher/sample_site/sample_site_generator.rb +316 -0
- data/spec/controllers/deluxe_publisher/comments_controller_spec.rb +129 -0
- data/spec/controllers/deluxe_publisher/page_types_controller_spec.rb +125 -0
- data/spec/controllers/deluxe_publisher/pages_controller_spec.rb +129 -0
- data/spec/controllers/deluxe_publisher/presenter_controller_spec.rb +19 -0
- data/spec/controllers/deluxe_publisher/redirects_controller_spec.rb +118 -0
- data/spec/deluxe_publisher_spec.rb +7 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/deluxe_publisher/comments/_form.html.erb +31 -0
- data/spec/dummy/app/views/deluxe_publisher/comments/edit.html.erb +6 -0
- data/spec/dummy/app/views/deluxe_publisher/comments/index.html.erb +31 -0
- data/spec/dummy/app/views/deluxe_publisher/comments/new.html.erb +6 -0
- data/spec/dummy/app/views/deluxe_publisher/comments/show.html.erb +30 -0
- data/spec/dummy/app/views/deluxe_publisher/page_types/_content_descriptors.html.erb +15 -0
- data/spec/dummy/app/views/deluxe_publisher/page_types/_form.html.erb +59 -0
- data/spec/dummy/app/views/deluxe_publisher/page_types/content_areas_change.js.erb +3 -0
- data/spec/dummy/app/views/deluxe_publisher/page_types/edit.html.erb +8 -0
- data/spec/dummy/app/views/deluxe_publisher/page_types/index.html.erb +29 -0
- data/spec/dummy/app/views/deluxe_publisher/page_types/new.html.erb +7 -0
- data/spec/dummy/app/views/deluxe_publisher/page_types/show.html.erb +45 -0
- data/spec/dummy/app/views/deluxe_publisher/pages/_form.html.erb +36 -0
- data/spec/dummy/app/views/deluxe_publisher/pages/_general.html.erb +108 -0
- data/spec/dummy/app/views/deluxe_publisher/pages/_page.html.erb +23 -0
- data/spec/dummy/app/views/deluxe_publisher/pages/_page_content.html.erb +16 -0
- data/spec/dummy/app/views/deluxe_publisher/pages/_page_links.html.erb +9 -0
- data/spec/dummy/app/views/deluxe_publisher/pages/_seo.html.erb +27 -0
- data/spec/dummy/app/views/deluxe_publisher/pages/edit.html.erb +7 -0
- data/spec/dummy/app/views/deluxe_publisher/pages/index.html.erb +10 -0
- data/spec/dummy/app/views/deluxe_publisher/pages/new.html.erb +7 -0
- data/spec/dummy/app/views/deluxe_publisher/pages/page_type_change.js.erb +3 -0
- data/spec/dummy/app/views/deluxe_publisher/pages/show.html.erb +115 -0
- data/spec/dummy/app/views/deluxe_publisher/presenter/create_comment.js.erb +3 -0
- data/spec/dummy/app/views/deluxe_publisher/presenter/create_comment_failed.js.erb +1 -0
- data/spec/dummy/app/views/deluxe_publisher/presenter/new_comment.js.erb +7 -0
- data/spec/dummy/app/views/deluxe_publisher/presenter/preview.html.erb +2 -0
- data/spec/dummy/app/views/deluxe_publisher/templates/simple_blog.html.erb +19 -0
- data/spec/dummy/app/views/deluxe_publisher/templates/simple_blog.rss.builder +23 -0
- data/spec/dummy/app/views/deluxe_publisher/templates/simple_blog_story.html.erb +9 -0
- data/spec/dummy/app/views/deluxe_publisher/templates/simple_page.html.erb +4 -0
- data/spec/dummy/app/views/layouts/_deluxe_publisher_comment_form.html.erb +29 -0
- data/spec/dummy/app/views/layouts/_deluxe_publisher_comments_list.html.erb +8 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/layouts/deluxe_publisher.html.erb +31 -0
- data/spec/dummy/app/views/layouts/deluxe_publisher_blog.html.erb +63 -0
- data/spec/dummy/app/views/layouts/deluxe_publisher_simple.html.erb +30 -0
- data/spec/dummy/config/application.rb +45 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +22 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +26 -0
- data/spec/dummy/config/environments/production.rb +49 -0
- data/spec/dummy/config/environments/test.rb +35 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/deluxe_publisher.rb +23 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +104 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/migrate/20110405190943_create_deluxe_publisher.rb +135 -0
- data/spec/dummy/db/schema.rb +130 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/application.js +2 -0
- data/spec/dummy/public/javascripts/controls.js +965 -0
- data/spec/dummy/public/javascripts/dragdrop.js +974 -0
- data/spec/dummy/public/javascripts/effects.js +1123 -0
- data/spec/dummy/public/javascripts/prototype.js +6001 -0
- data/spec/dummy/public/javascripts/rails.js +191 -0
- data/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/factories/comment_factory.rb +4 -0
- data/spec/factories/content_descriptor_factory.rb +5 -0
- data/spec/factories/content_factory.rb +24 -0
- data/spec/factories/page_factory.rb +26 -0
- data/spec/factories/page_type_factory.rb +10 -0
- data/spec/factories/redirect_factory.rb +4 -0
- data/spec/helpers/deluxe_publisher/comments_helper_spec.rb +15 -0
- data/spec/helpers/deluxe_publisher/page_types_helper_spec.rb +26 -0
- data/spec/helpers/deluxe_publisher/pages_helper_spec.rb +65 -0
- data/spec/helpers/deluxe_publisher/presenter_helper_spec.rb +19 -0
- data/spec/helpers/deluxe_publisher/redirects_helper_spec.rb +15 -0
- data/spec/integration/navigation_spec.rb +9 -0
- data/spec/models/deluxe_publisher/comment_spec.rb +5 -0
- data/spec/models/deluxe_publisher/content_descriptor_spec.rb +5 -0
- data/spec/models/deluxe_publisher/content_spec.rb +5 -0
- data/spec/models/deluxe_publisher/page_spec.rb +358 -0
- data/spec/models/deluxe_publisher/page_type_spec.rb +62 -0
- data/spec/models/deluxe_publisher/redirect_spec.rb +17 -0
- data/spec/requests/deluxe_publisher/deluxe_publisher_comments_spec.rb +11 -0
- data/spec/requests/deluxe_publisher/deluxe_publisher_page_types_spec.rb +11 -0
- data/spec/requests/deluxe_publisher/deluxe_publisher_redirects_spec.rb +11 -0
- data/spec/requests/deluxe_publisher/pages_spec.rb +11 -0
- data/spec/routing/deluxe_publisher/comments_routing_spec.rb +35 -0
- data/spec/routing/deluxe_publisher/page_types_routing_spec.rb +47 -0
- data/spec/routing/deluxe_publisher/pages_routing_spec.rb +47 -0
- data/spec/routing/deluxe_publisher/presenter_routing_spec.rb +66 -0
- data/spec/routing/deluxe_publisher/redirects_routing_spec.rb +35 -0
- data/spec/spec_helper.rb +234 -0
- data/spec/views/deluxe_publisher/comments/edit.html.erb_spec.rb +24 -0
- data/spec/views/deluxe_publisher/comments/index.html.erb_spec.rb +32 -0
- data/spec/views/deluxe_publisher/comments/new.html.erb_spec.rb +24 -0
- data/spec/views/deluxe_publisher/comments/show.html.erb_spec.rb +24 -0
- data/spec/views/deluxe_publisher/page_types/edit.html.erb_spec.rb +32 -0
- data/spec/views/deluxe_publisher/page_types/index.html.erb_spec.rb +48 -0
- data/spec/views/deluxe_publisher/page_types/new.html.erb_spec.rb +32 -0
- data/spec/views/deluxe_publisher/page_types/show.html.erb_spec.rb +36 -0
- data/spec/views/deluxe_publisher/pages/edit.html.erb_spec.rb +58 -0
- data/spec/views/deluxe_publisher/pages/index.html.erb_spec.rb +100 -0
- data/spec/views/deluxe_publisher/pages/new.html.erb_spec.rb +81 -0
- data/spec/views/deluxe_publisher/pages/show.html.erb_spec.rb +75 -0
- data/spec/views/deluxe_publisher/presenter/present.html.erb_spec.rb +5 -0
- data/spec/views/deluxe_publisher/presenter/preview.html.erb_spec.rb +5 -0
- data/spec/views/deluxe_publisher/redirects/edit.html.erb_spec.rb +22 -0
- data/spec/views/deluxe_publisher/redirects/index.html.erb_spec.rb +28 -0
- data/spec/views/deluxe_publisher/redirects/new.html.erb_spec.rb +22 -0
- data/spec/views/deluxe_publisher/redirects/show.html.erb_spec.rb +21 -0
- metadata +1006 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
module DeluxePublisher
|
2
|
+
require "deluxe_publisher/engine"
|
3
|
+
require "deluxe_publisher/deluxe_publisher_authentication"
|
4
|
+
|
5
|
+
|
6
|
+
# Custom title for editor pages
|
7
|
+
mattr_accessor :publisher_title
|
8
|
+
@@publisher_title = "Deluxe Publisher"
|
9
|
+
|
10
|
+
# authentication procedure for public facing pages
|
11
|
+
#use :none, :basic, :method
|
12
|
+
mattr_accessor :publisher_authorization_procedure
|
13
|
+
@@publisher_authorization_procedure = :none
|
14
|
+
#for :basic authorization procedure
|
15
|
+
mattr_accessor :publisher_username
|
16
|
+
@@publisher_username = "Bob"
|
17
|
+
mattr_accessor :publisher_password
|
18
|
+
@@publisher_password = "isyouruncle"
|
19
|
+
#for :method authorization procedure
|
20
|
+
mattr_accessor :publisher_authorization_method
|
21
|
+
@@publisher_authorization_method = :publisher_authorization
|
22
|
+
|
23
|
+
#DeluxePublisherAuthentication procedure for deluxe publisher admin pages
|
24
|
+
#use :none, :basic, :method
|
25
|
+
mattr_accessor :admin_authorization_procedure
|
26
|
+
@@admin_authorization_procedure = :basic
|
27
|
+
#for :basic authorization procedure
|
28
|
+
mattr_accessor :admin_username
|
29
|
+
@@admin_username = "admin"
|
30
|
+
mattr_accessor :admin_password
|
31
|
+
@@admin_password = "nimda"
|
32
|
+
#for :method authorization procedure
|
33
|
+
mattr_accessor :admin_authorization_method
|
34
|
+
@@admin_authorization_method = :authenticate_admin!
|
35
|
+
|
36
|
+
|
37
|
+
def self.setup
|
38
|
+
yield self
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module DeluxePublisher
|
2
|
+
class BaseGenerator < Rails::Generators::Base
|
3
|
+
source_root File.expand_path('../templates', __FILE__)
|
4
|
+
# To change this template use File | Settings | File Templates.
|
5
|
+
|
6
|
+
def copy_initializer
|
7
|
+
copy_file "#{BaseGenerator.source_root}/initializer.rb", "#{Rails.root}/config/initializers/deluxe_publisher.rb"
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
def copy_layouts
|
12
|
+
Dir["#{BaseGenerator.source_root}/layouts/*"].each do |file|
|
13
|
+
copy_file file, "#{Rails.root}/app/views/layouts/#{File.basename(file)}", :verbose => true
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def copy_templates
|
18
|
+
Dir["#{BaseGenerator.source_root}/templates/*"].each do |file|
|
19
|
+
copy_file file, "#{Rails.root}/app/views/deluxe_publisher/templates/#{File.basename(file)}", :verbose => true
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def copy_javascripts
|
24
|
+
Dir["#{BaseGenerator.source_root}/javascripts/*"].each do |file|
|
25
|
+
copy_file file, "#{Rails.root}/public/javascripts/#{File.basename(file)}", :verbose => true
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def copy_style_sheets
|
30
|
+
Dir["#{BaseGenerator.source_root}/stylesheets/*"].each do |file|
|
31
|
+
copy_file file, "#{Rails.root}/public/stylesheets/#{File.basename(file)}", :verbose => true
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def copy_images
|
36
|
+
Dir["#{BaseGenerator.source_root}/images/*"].each do |file|
|
37
|
+
copy_file file, "#{Rails.root}/public/images/deluxe_publisher/#{File.basename(file)}", :verbose => true
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# config for deluxe publisher
|
2
|
+
DeluxePublisher.setup do |config|
|
3
|
+
config.publisher_title = "Deluxe Publisher"
|
4
|
+
|
5
|
+
# authentication procedure for public facing pages
|
6
|
+
#use :none, :basic, :method
|
7
|
+
config.publisher_authorization_procedure = :none
|
8
|
+
#for :basic authorization procedure
|
9
|
+
config.publisher_username = "Bob"
|
10
|
+
config.publisher_password = "isyouruncle"
|
11
|
+
#for :method authorization procedure
|
12
|
+
config.publisher_authorization_method = :your_authorization_method
|
13
|
+
|
14
|
+
#Authentication procedure for deluxe publisher admin pages
|
15
|
+
#use :none, :basic, :method
|
16
|
+
config.admin_authorization_procedure = :basic
|
17
|
+
#for :basic authorization procedure
|
18
|
+
config.admin_username = "admin" ########## Please Please Please ##########
|
19
|
+
config.admin_password = "nimda" ########## Change username and password ##########
|
20
|
+
#for :method authorization procedure ########## Or better yet use ##########
|
21
|
+
config.admin_authorization_method = :authenticate_admin! ########## an Authorization method ##########
|
22
|
+
|
23
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
$(function(){
|
2
|
+
$("#new_comment").html("<a href='new_comment' id='new_comment_btn'>Comment</a>");
|
3
|
+
apply_new_comment_action();
|
4
|
+
})
|
5
|
+
|
6
|
+
|
7
|
+
function apply_new_comment_action(){
|
8
|
+
$("#new_comment_btn").click(function(){
|
9
|
+
var location = window.location.pathname;
|
10
|
+
if (location.charAt(location.length-1) == "/") {
|
11
|
+
var url = location + "new_comment"
|
12
|
+
} else {
|
13
|
+
var url = location + "/new_comment"
|
14
|
+
}
|
15
|
+
|
16
|
+
$.get(url, {}, null, "script");
|
17
|
+
return false;
|
18
|
+
})
|
19
|
+
|
20
|
+
}
|
21
|
+
|
22
|
+
//function create_comment() {
|
23
|
+
// $.post(this.action, this.serialize(), null, "script");
|
24
|
+
// return(false);
|
25
|
+
//}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
$(function(){
|
2
|
+
apply_page_directory_actions();
|
3
|
+
apply_tabs();
|
4
|
+
apply_number_of_content_areas_change();
|
5
|
+
apply_page_type_change();
|
6
|
+
apply_preview_button();
|
7
|
+
})
|
8
|
+
|
9
|
+
function apply_preview_button() {
|
10
|
+
$(".btn_preview").click (
|
11
|
+
function () {
|
12
|
+
for (instance in CKEDITOR.instances){
|
13
|
+
CKEDITOR.instances[instance].updateElement();
|
14
|
+
}
|
15
|
+
var action_stash = $("form.deluxe_publisher_page").attr("action");
|
16
|
+
$("form.deluxe_publisher_page").attr("target", "_blank");
|
17
|
+
$("form.deluxe_publisher_page").attr("action", "/deluxe_publisher/pages/preview");
|
18
|
+
$("form.deluxe_publisher_page").submit();
|
19
|
+
$("form.deluxe_publisher_page").attr("target", "");
|
20
|
+
$("form.deluxe_publisher_page").attr("action", action_stash);
|
21
|
+
return false;
|
22
|
+
}
|
23
|
+
)
|
24
|
+
}
|
25
|
+
|
26
|
+
function apply_page_directory_actions() {
|
27
|
+
$(".page_leaf_title").click(
|
28
|
+
function () {
|
29
|
+
$($(this).siblings(".page_directory")).slideToggle();
|
30
|
+
$("img", this).toggle();
|
31
|
+
}
|
32
|
+
)
|
33
|
+
}
|
34
|
+
|
35
|
+
function apply_tabs() {
|
36
|
+
$("#tab_general a").click(
|
37
|
+
function () {
|
38
|
+
$("article#general").show();
|
39
|
+
$("#tab_general").addClass("on");
|
40
|
+
$("article#page_content").hide();
|
41
|
+
$("#tab_content").removeClass("on");
|
42
|
+
$("article#seo").hide();
|
43
|
+
$("#tab_seo").removeClass("on");
|
44
|
+
return(false);
|
45
|
+
}
|
46
|
+
)
|
47
|
+
$("#tab_content a").click(
|
48
|
+
function () {
|
49
|
+
$("article#general").hide();
|
50
|
+
$("#tab_general").removeClass("on");
|
51
|
+
$("article#page_content").show();
|
52
|
+
$("#tab_content").addClass("on");
|
53
|
+
$("article#seo").hide();
|
54
|
+
$("#tab_seo").removeClass("on");
|
55
|
+
return(false);
|
56
|
+
}
|
57
|
+
)
|
58
|
+
$("#tab_seo a").click(
|
59
|
+
function () {
|
60
|
+
$("article#general").hide();
|
61
|
+
$("#tab_general").removeClass("on");
|
62
|
+
$("article#page_content").hide();
|
63
|
+
$("#tab_content").removeClass("on");
|
64
|
+
$("article#seo").show();
|
65
|
+
$("#tab_seo").addClass("on");
|
66
|
+
return(false);
|
67
|
+
}
|
68
|
+
)
|
69
|
+
|
70
|
+
}
|
71
|
+
|
72
|
+
function apply_number_of_content_areas_change() {
|
73
|
+
|
74
|
+
$("#deluxe_publisher_page_type_number_of_content_areas").change(function() {
|
75
|
+
$.post(this.form.action + '/content_areas_change.js', $(this.form).serialize(), null, "script" );
|
76
|
+
})
|
77
|
+
}
|
78
|
+
|
79
|
+
function apply_page_type_change() {
|
80
|
+
$("#deluxe_publisher_page_page_type_id").change(function(){
|
81
|
+
for (instance in CKEDITOR.instances){
|
82
|
+
CKEDITOR.instances[instance].updateElement();
|
83
|
+
}
|
84
|
+
$.post(this.form.action + "/page_type_change.js", $(this.form).serialize(), null, "script" );
|
85
|
+
})
|
86
|
+
}
|
@@ -0,0 +1,158 @@
|
|
1
|
+
/**
|
2
|
+
* Unobtrusive scripting adapter for jQuery
|
3
|
+
*
|
4
|
+
* Requires jQuery 1.4.3 or later.
|
5
|
+
* https://github.com/rails/jquery-ujs
|
6
|
+
*/
|
7
|
+
|
8
|
+
(function($) {
|
9
|
+
// Make sure that every Ajax request sends the CSRF token
|
10
|
+
function CSRFProtection(xhr) {
|
11
|
+
var token = $('meta[name="csrf-token"]').attr('content');
|
12
|
+
if (token) xhr.setRequestHeader('X-CSRF-Token', token);
|
13
|
+
}
|
14
|
+
if ('ajaxPrefilter' in $) $.ajaxPrefilter(function(options, originalOptions, xhr){ CSRFProtection(xhr) });
|
15
|
+
else $(document).ajaxSend(function(e, xhr){ CSRFProtection(xhr) });
|
16
|
+
|
17
|
+
// Triggers an event on an element and returns the event result
|
18
|
+
function fire(obj, name, data) {
|
19
|
+
var event = $.Event(name);
|
20
|
+
obj.trigger(event, data);
|
21
|
+
return event.result !== false;
|
22
|
+
}
|
23
|
+
|
24
|
+
// Submits "remote" forms and links with ajax
|
25
|
+
function handleRemote(element) {
|
26
|
+
var method, url, data,
|
27
|
+
dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType);
|
28
|
+
|
29
|
+
if (fire(element, 'ajax:before')) {
|
30
|
+
if (element.is('form')) {
|
31
|
+
method = element.attr('method');
|
32
|
+
url = element.attr('action');
|
33
|
+
data = element.serializeArray();
|
34
|
+
// memoized value from clicked submit button
|
35
|
+
var button = element.data('ujs:submit-button');
|
36
|
+
if (button) {
|
37
|
+
data.push(button);
|
38
|
+
element.data('ujs:submit-button', null);
|
39
|
+
}
|
40
|
+
} else {
|
41
|
+
method = element.data('method');
|
42
|
+
url = element.attr('href');
|
43
|
+
data = null;
|
44
|
+
}
|
45
|
+
$.ajax({
|
46
|
+
url: url, type: method || 'GET', data: data, dataType: dataType,
|
47
|
+
// stopping the "ajax:beforeSend" event will cancel the ajax request
|
48
|
+
beforeSend: function(xhr, settings) {
|
49
|
+
if (settings.dataType === undefined) {
|
50
|
+
xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
|
51
|
+
}
|
52
|
+
return fire(element, 'ajax:beforeSend', [xhr, settings]);
|
53
|
+
},
|
54
|
+
success: function(data, status, xhr) {
|
55
|
+
element.trigger('ajax:success', [data, status, xhr]);
|
56
|
+
},
|
57
|
+
complete: function(xhr, status) {
|
58
|
+
element.trigger('ajax:complete', [xhr, status]);
|
59
|
+
},
|
60
|
+
error: function(xhr, status, error) {
|
61
|
+
element.trigger('ajax:error', [xhr, status, error]);
|
62
|
+
}
|
63
|
+
});
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
// Handles "data-method" on links such as:
|
68
|
+
// <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
|
69
|
+
function handleMethod(link) {
|
70
|
+
var href = link.attr('href'),
|
71
|
+
method = link.data('method'),
|
72
|
+
csrf_token = $('meta[name=csrf-token]').attr('content'),
|
73
|
+
csrf_param = $('meta[name=csrf-param]').attr('content'),
|
74
|
+
form = $('<form method="post" action="' + href + '"></form>'),
|
75
|
+
metadata_input = '<input name="_method" value="' + method + '" type="hidden" />';
|
76
|
+
|
77
|
+
if (csrf_param !== undefined && csrf_token !== undefined) {
|
78
|
+
metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
|
79
|
+
}
|
80
|
+
|
81
|
+
form.hide().append(metadata_input).appendTo('body');
|
82
|
+
form.submit();
|
83
|
+
}
|
84
|
+
|
85
|
+
function disableFormElements(form) {
|
86
|
+
form.find('input[data-disable-with]').each(function() {
|
87
|
+
var input = $(this);
|
88
|
+
input.data('ujs:enable-with', input.val())
|
89
|
+
.val(input.data('disable-with'))
|
90
|
+
.attr('disabled', 'disabled');
|
91
|
+
});
|
92
|
+
}
|
93
|
+
|
94
|
+
function enableFormElements(form) {
|
95
|
+
form.find('input[data-disable-with]').each(function() {
|
96
|
+
var input = $(this);
|
97
|
+
input.val(input.data('ujs:enable-with')).removeAttr('disabled');
|
98
|
+
});
|
99
|
+
}
|
100
|
+
|
101
|
+
function allowAction(element) {
|
102
|
+
var message = element.data('confirm');
|
103
|
+
return !message || (fire(element, 'confirm') && confirm(message));
|
104
|
+
}
|
105
|
+
|
106
|
+
function requiredValuesMissing(form) {
|
107
|
+
var missing = false;
|
108
|
+
form.find('input[name][required]').each(function() {
|
109
|
+
if (!$(this).val()) missing = true;
|
110
|
+
});
|
111
|
+
return missing;
|
112
|
+
}
|
113
|
+
|
114
|
+
$('a[data-confirm], a[data-method], a[data-remote]').live('click.rails', function(e) {
|
115
|
+
var link = $(this);
|
116
|
+
if (!allowAction(link)) return false;
|
117
|
+
|
118
|
+
if (link.data('remote') != undefined) {
|
119
|
+
handleRemote(link);
|
120
|
+
return false;
|
121
|
+
} else if (link.data('method')) {
|
122
|
+
handleMethod(link);
|
123
|
+
return false;
|
124
|
+
}
|
125
|
+
});
|
126
|
+
|
127
|
+
$('form').live('submit.rails', function(e) {
|
128
|
+
var form = $(this), remote = form.data('remote') != undefined;
|
129
|
+
if (!allowAction(form)) return false;
|
130
|
+
|
131
|
+
// skip other logic when required values are missing
|
132
|
+
if (requiredValuesMissing(form)) return !remote;
|
133
|
+
|
134
|
+
if (remote) {
|
135
|
+
handleRemote(form);
|
136
|
+
return false;
|
137
|
+
} else {
|
138
|
+
// slight timeout so that the submit button gets properly serialized
|
139
|
+
setTimeout(function(){ disableFormElements(form) }, 13);
|
140
|
+
}
|
141
|
+
});
|
142
|
+
|
143
|
+
$('form input[type=submit], form button[type=submit], form button:not([type])').live('click.rails', function() {
|
144
|
+
var button = $(this);
|
145
|
+
if (!allowAction(button)) return false;
|
146
|
+
// register the pressed submit button
|
147
|
+
var name = button.attr('name'), data = name ? {name:name, value:button.val()} : null;
|
148
|
+
button.closest('form').data('ujs:submit-button', data);
|
149
|
+
});
|
150
|
+
|
151
|
+
$('form').live('ajax:beforeSend.rails', function(event) {
|
152
|
+
if (this == event.target) disableFormElements($(this));
|
153
|
+
});
|
154
|
+
|
155
|
+
$('form').live('ajax:complete.rails', function(event) {
|
156
|
+
if (this == event.target) enableFormElements($(this));
|
157
|
+
});
|
158
|
+
})( jQuery );
|
data/lib/generators/deluxe_publisher/base/templates/layouts/_deluxe_publisher_comment_form.html.erb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
<%= form_for(@deluxe_publisher_comment, :url => create_comment_path(@page.path_wo_leading_slash)) do |f| %>
|
2
|
+
|
3
|
+
<% if @deluxe_publisher_comment.errors.any? %>
|
4
|
+
<div id="error_explanation">
|
5
|
+
<h2><%= pluralize(@deluxe_publisher_comment.errors.count, "error") %> prohibited this Comment from being saved:</h2>
|
6
|
+
|
7
|
+
<ul>
|
8
|
+
<% @deluxe_publisher_comment.errors.full_messages.each do |msg| %>
|
9
|
+
<li><%= msg %></li>
|
10
|
+
<% end %>
|
11
|
+
</ul>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
|
16
|
+
<div class="field">
|
17
|
+
<%= f.label :body, "Comment" %><br />
|
18
|
+
<%= f.text_area :body %>
|
19
|
+
</div>
|
20
|
+
<div class="field">
|
21
|
+
<%= f.label :author, "Name" %><br />
|
22
|
+
<%= f.text_field :author %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class="actions">
|
26
|
+
<%= f.submit "Comment" %>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<% end %>
|
@@ -0,0 +1,74 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
|
4
|
+
<head>
|
5
|
+
<link rel="alternate" type="application/rss+xml" title="<%= @blog.browser_title%>" href="<%= deluxe_publisher_present_url(:page_path => @blog.path[1..-1], :format => "rss") %>" />
|
6
|
+
<title><%= @page.browser_title %></title>
|
7
|
+
<%= stylesheet_link_tag "deluxe_presenter" %>
|
8
|
+
<%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js", "application", "rails" %>
|
9
|
+
<!--[if lt IE 9]>
|
10
|
+
<script type="text/javascript">
|
11
|
+
document.createElement("nav");
|
12
|
+
document.createElement("header");
|
13
|
+
document.createElement("footer");
|
14
|
+
document.createElement("section");
|
15
|
+
document.createElement("aside");
|
16
|
+
document.createElement("article");
|
17
|
+
</script>
|
18
|
+
<![endif]-->
|
19
|
+
|
20
|
+
<%= csrf_meta_tag %>
|
21
|
+
</head>
|
22
|
+
|
23
|
+
<body id="template4" class="clearfix">
|
24
|
+
<section id="wrap">
|
25
|
+
<header id="header">
|
26
|
+
<h1><%= @page.page_title %></h1>
|
27
|
+
<nav id="primary_nav">
|
28
|
+
<%=raw main_navigation(@root_page, @page, 2 ) %>
|
29
|
+
</nav>
|
30
|
+
</header>
|
31
|
+
|
32
|
+
<section class="blog">
|
33
|
+
<section id="content_wrapper" class="clearfix">
|
34
|
+
<%= yield %>
|
35
|
+
<section id="blog_sidebar">
|
36
|
+
<nav class="blog_feeds">
|
37
|
+
<%= link_to "RSS", deluxe_publisher_present_path(:page_path => @blog.path[1..-1], :format => "rss") %>
|
38
|
+
</nav>
|
39
|
+
<nav class="blog_archive">
|
40
|
+
<h4>Archive</h4>
|
41
|
+
<%= raw blog_archive_list(@blog) %>
|
42
|
+
</nav>
|
43
|
+
<nav class="blog_tags">
|
44
|
+
<h4>Tags</h4>
|
45
|
+
<% tag_cloud(@tags, %w(tag1 tag2 tag3 tag4)) do |tag, css_class| %>
|
46
|
+
<%= link_to tag.name, blog_tag_path(:page_path => @blog.path[1..-1], :tag => tag.name), :class => css_class %>
|
47
|
+
<% end %>
|
48
|
+
</nav>
|
49
|
+
</section>
|
50
|
+
<section class="comments">
|
51
|
+
<article id="comments_list">
|
52
|
+
<%= render :partial => '/layouts/deluxe_publisher_comments_list' %>
|
53
|
+
</article>
|
54
|
+
<article id="new_comment">
|
55
|
+
<%# Start with link to new comment inserted via ajax to slow spammers %>
|
56
|
+
</article>
|
57
|
+
</section>
|
58
|
+
</section>
|
59
|
+
|
60
|
+
|
61
|
+
<section class="secondary_nav">
|
62
|
+
<nav class="secondary">
|
63
|
+
<%=raw secondary_navigation(@page, @page, 2 ) %>
|
64
|
+
</nav>
|
65
|
+
</section>
|
66
|
+
|
67
|
+
<footer id="footer">
|
68
|
+
<%= raw footer_navigation %>
|
69
|
+
</footer>
|
70
|
+
|
71
|
+
</section>
|
72
|
+
</section>
|
73
|
+
</body>
|
74
|
+
</html>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5
|
+
<title><%= @page.browser_title %></title>
|
6
|
+
<!--[if lt IE 9]>
|
7
|
+
<script type="text/javascript">
|
8
|
+
document.createElement("nav");
|
9
|
+
document.createElement("header");
|
10
|
+
document.createElement("footer");
|
11
|
+
document.createElement("section");
|
12
|
+
document.createElement("aside");
|
13
|
+
document.createElement("article");
|
14
|
+
</script>
|
15
|
+
<![endif]-->
|
16
|
+
|
17
|
+
<%= stylesheet_link_tag "deluxe_presenter" %>
|
18
|
+
<%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js", "application", "rails" %>
|
19
|
+
<%= csrf_meta_tag %>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body id="template4" class="clearfix">
|
23
|
+
<div id="wrap">
|
24
|
+
|
25
|
+
<header id="header">
|
26
|
+
<h1><%= @page.page_title %></h1>
|
27
|
+
<nav id="primary_nav">
|
28
|
+
<%=raw main_navigation(@root_page, @page, 3 ) %>
|
29
|
+
</nav>
|
30
|
+
</header>
|
31
|
+
|
32
|
+
<section id="content_wrapper" class="clearfix">
|
33
|
+
|
34
|
+
<div id="sidebar">
|
35
|
+
<nav id="secondary_nav">
|
36
|
+
<%=raw secondary_navigation(@page, @page, 2 ) %>
|
37
|
+
</nav>
|
38
|
+
</div>
|
39
|
+
<%= yield %>
|
40
|
+
</section>
|
41
|
+
<footer id="footer">
|
42
|
+
<%= raw footer_navigation %>
|
43
|
+
</footer>
|
44
|
+
|
45
|
+
</div>
|
46
|
+
</body>
|
47
|
+
</html>
|