rich_cms 2.1.7 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/{CHANGELOG → CHANGELOG.rdoc} +24 -0
- data/README.textile +49 -33
- data/Rakefile +92 -10
- data/VERSION +1 -1
- data/app/controllers/rich/cms_controller.rb +10 -39
- data/app/controllers/rich/cms_sessions_controller.rb +31 -0
- data/app/views/rich/cms/dock/_menu.html.erb +10 -8
- data/app/views/rich/cms/dock/_panel.html.erb +1 -1
- data/app/views/rich/cms/dock/panel/edit/_rails2.html.erb +5 -3
- data/app/views/rich/cms/dock/panel/edit/_rails3.html.erb +4 -2
- data/app/views/rich/cms/dock/panel/login/_rails2.html.erb +18 -12
- data/app/views/rich/cms/dock/panel/login/_rails3.html.erb +18 -12
- data/app/views/rich_cms.html.erb +1 -1
- data/assets/jzip/jquery/cleditor.js +1132 -1132
- data/assets/jzip/jquery/extensions/browser_detect.js +1 -2
- data/assets/jzip/native/extensions.js +41 -0
- data/assets/jzip/rich/cms/editor.js +41 -7
- data/assets/jzip/rich_cms.jz +2 -1
- data/assets/sass/rich_cms/_panel.sass +11 -1
- data/config/routes.rb +12 -11
- data/lib/generators/rich/cms_admin/cms_admin_generator.rb +82 -0
- data/lib/generators/rich/{authlogic_user/templates → cms_admin/templates/authlogic}/migration.rb +0 -0
- data/lib/generators/rich/{authlogic_user/templates → cms_admin/templates/authlogic}/model.rb +0 -0
- data/lib/generators/rich/{authlogic_user/templates → cms_admin/templates/authlogic}/session.rb +0 -0
- data/lib/rich/cms/actionpack/action_controller/base.rb +3 -44
- data/lib/rich/cms/actionpack/action_view/base.rb +32 -10
- data/lib/rich/cms/actionpack.rb +1 -2
- data/lib/rich/cms/auth.rb +110 -0
- data/lib/rich/cms/content/group.rb +1 -2
- data/lib/rich/cms/content/item.rb +2 -3
- data/lib/rich/cms/core/string/html_safe.rb +1 -2
- data/lib/rich/cms/core/string.rb +1 -2
- data/lib/rich/cms/engine.rb +23 -51
- data/lib/rich/cms/rails/engine.rb +1 -2
- data/lib/rich/cms/version.rb +11 -0
- data/lib/rich_cms.rb +2 -2
- data/rails_generators/rich_cms_admin/lib/devise/route_devise.rb +32 -0
- data/rails_generators/rich_cms_admin/rich_cms_admin_generator.rb +113 -0
- data/rails_generators/{rich_authlogic_user/templates → rich_cms_admin/templates/authlogic}/migration.rb +0 -0
- data/rails_generators/{rich_authlogic_user/templates → rich_cms_admin/templates/authlogic}/model.rb +0 -0
- data/rails_generators/{rich_authlogic_user/templates → rich_cms_admin/templates/authlogic}/session.rb +0 -0
- data/rails_generators/{rich_authlogic_user → rich_cms_admin}/templates/config.rb +0 -0
- data/rails_generators/rich_cms_admin/templates/devise/README +23 -0
- data/rails_generators/rich_cms_admin/templates/devise/devise.rb +105 -0
- data/rails_generators/rich_cms_admin/templates/devise/en.yml +35 -0
- data/rails_generators/rich_cms_admin/templates/devise/migration.rb +23 -0
- data/rails_generators/rich_cms_admin/templates/devise/model.rb +9 -0
- data/rails_generators/rich_cms_content/rich_cms_content_generator.rb +18 -12
- data/rich_cms.gemspec +295 -105
- data/test/integrator.rb +89 -0
- data/test/rails-2/dummy/.bundle/config +2 -0
- data/test/rails-2/dummy/Gemfile +15 -0
- data/test/rails-2/dummy/Gemfile.lock +97 -0
- data/test/rails-2/dummy/Rakefile +10 -0
- data/test/rails-2/dummy/app/controllers/application_controller.rb +10 -0
- data/test/rails-2/dummy/app/helpers/application_helper.rb +3 -0
- data/test/rails-2/dummy/config/boot.rb +124 -0
- data/test/rails-2/dummy/config/database.yml +23 -0
- data/test/rails-2/dummy/config/environment.rb +41 -0
- data/test/rails-2/dummy/config/environments/development.rb +17 -0
- data/test/rails-2/dummy/config/environments/production.rb +28 -0
- data/test/rails-2/dummy/config/environments/test.rb +28 -0
- data/test/rails-2/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails-2/dummy/config/initializers/cookie_verification_secret.rb +7 -0
- data/test/rails-2/dummy/config/initializers/devise.rb +105 -0
- data/test/rails-2/dummy/config/initializers/enrichments.rb +5 -0
- data/test/rails-2/dummy/config/initializers/inflections.rb +10 -0
- data/test/rails-2/dummy/config/initializers/mime_types.rb +5 -0
- data/test/rails-2/dummy/config/initializers/new_rails_defaults.rb +21 -0
- data/test/rails-2/dummy/config/initializers/session_store.rb +15 -0
- data/test/rails-2/dummy/config/locales/en.yml +5 -0
- data/test/rails-2/dummy/config/preinitializer.rb +20 -0
- data/test/rails-2/dummy/config/routes.rb +44 -0
- data/test/rails-2/dummy/db/schema.rb +49 -0
- data/test/rails-2/dummy/db/seeds.rb +10 -0
- data/test/rails-2/dummy/public/404.html +30 -0
- data/test/rails-2/dummy/public/422.html +30 -0
- data/test/rails-2/dummy/public/500.html +30 -0
- data/test/rails-2/dummy/public/favicon.ico +0 -0
- data/test/rails-2/dummy/public/images/rails.png +0 -0
- data/test/rails-2/dummy/public/images/rich/cms/cleditor/buttons.gif +0 -0
- data/test/rails-2/dummy/public/images/rich/cms/cleditor/toolbar.gif +0 -0
- data/test/rails-2/dummy/public/javascripts/jquery/core.js +158 -0
- data/test/rails-2/dummy/public/javascripts/jquery/ui/rich_cms/core.js +1207 -0
- data/test/rails-2/dummy/public/javascripts/jquery/ui/rich_cms/draggable.js +798 -0
- data/test/rails-2/dummy/public/javascripts/jquery/ui/rich_cms/mouse.js +950 -0
- data/test/rails-2/dummy/public/javascripts/jquery/ui/rich_cms/widget.js +1188 -0
- data/test/rails-2/dummy/public/javascripts/rich_cms.js +1746 -0
- data/test/rails-2/dummy/public/robots.txt +5 -0
- data/test/rails-2/dummy/script/about +4 -0
- data/test/rails-2/dummy/script/console +3 -0
- data/test/rails-2/dummy/script/dbconsole +3 -0
- data/test/rails-2/dummy/script/destroy +3 -0
- data/test/rails-2/dummy/script/generate +3 -0
- data/test/rails-2/dummy/script/performance/benchmarker +3 -0
- data/test/rails-2/dummy/script/performance/profiler +3 -0
- data/test/rails-2/dummy/script/plugin +3 -0
- data/test/rails-2/dummy/script/runner +3 -0
- data/test/rails-2/dummy/script/server +3 -0
- data/test/rails-2/dummy/test/fixtures/authlogic_users.yml +6 -0
- data/test/rails-2/dummy/test/fixtures/devise_users.yml +5 -0
- data/test/rails-2/pending.rb +88 -0
- data/test/rails-2/test_helper.rb +13 -0
- data/test/rails-3/dummy/.bundle/config +2 -0
- data/test/rails-3/dummy/Gemfile +15 -0
- data/test/rails-3/dummy/Gemfile.lock +139 -0
- data/test/rails-3/dummy/Rakefile +7 -0
- data/test/rails-3/dummy/app/controllers/application_controller.rb +3 -0
- data/test/rails-3/dummy/app/helpers/application_helper.rb +2 -0
- data/test/rails-3/dummy/config/application.rb +42 -0
- data/test/rails-3/dummy/config/boot.rb +13 -0
- data/test/rails-3/dummy/config/database.yml +23 -0
- data/test/rails-3/dummy/config/environment.rb +5 -0
- data/test/rails-3/dummy/config/environments/development.rb +26 -0
- data/test/rails-3/dummy/config/environments/production.rb +49 -0
- data/test/rails-3/dummy/config/environments/test.rb +35 -0
- data/test/rails-3/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails-3/dummy/config/initializers/devise.rb +142 -0
- data/test/rails-3/dummy/config/initializers/enrichments.rb +5 -0
- data/test/rails-3/dummy/config/initializers/inflections.rb +10 -0
- data/test/rails-3/dummy/config/initializers/mime_types.rb +5 -0
- data/test/rails-3/dummy/config/initializers/secret_token.rb +7 -0
- data/test/rails-3/dummy/config/initializers/session_store.rb +8 -0
- data/test/rails-3/dummy/config/locales/en.yml +5 -0
- data/test/rails-3/dummy/config/routes.rb +59 -0
- data/test/rails-3/dummy/config.ru +4 -0
- data/test/rails-3/dummy/db/schema.rb +49 -0
- data/test/rails-3/dummy/db/seeds.rb +10 -0
- data/test/rails-3/dummy/public/404.html +26 -0
- data/test/rails-3/dummy/public/422.html +26 -0
- data/test/rails-3/dummy/public/500.html +26 -0
- data/test/rails-3/dummy/public/favicon.ico +0 -0
- data/test/rails-3/dummy/public/images/rich/cms/cleditor/buttons.gif +0 -0
- data/test/rails-3/dummy/public/images/rich/cms/cleditor/toolbar.gif +0 -0
- data/test/rails-3/dummy/public/javascripts/jquery/core.js +158 -0
- data/test/rails-3/dummy/public/javascripts/jquery/ui/rich_cms/core.js +1207 -0
- data/test/rails-3/dummy/public/javascripts/jquery/ui/rich_cms/draggable.js +798 -0
- data/test/rails-3/dummy/public/javascripts/jquery/ui/rich_cms/mouse.js +950 -0
- data/test/rails-3/dummy/public/javascripts/jquery/ui/rich_cms/widget.js +1188 -0
- data/test/rails-3/dummy/public/javascripts/rich_cms.js +1746 -0
- data/test/rails-3/dummy/script/rails +6 -0
- data/test/rails-3/dummy/test/fixtures/authlogic_users.yml +6 -0
- data/test/rails-3/dummy/test/fixtures/devise_users.yml +5 -0
- data/test/rails-3/test_helper.rb +17 -0
- data/test/shared/dummy/db/schema.rb +49 -0
- data/test/shared/dummy/db/seeds.rb +10 -0
- data/test/shared/dummy/fixtures/authlogic_users.yml +6 -0
- data/test/shared/dummy/models/authlogic_user.rb +8 -0
- data/test/shared/dummy/models/authlogic_user_session.rb +10 -0
- data/test/shared/dummy/models/cms_content.rb +2 -0
- data/test/shared/dummy/models/devise_user.rb +3 -0
- data/test/shared/dummy/stylesheets/app.css +100 -0
- data/test/shared/dummy/stylesheets/rich_cms.css +159 -0
- data/test/shared/dummy/views/application/index.html.erb +13 -0
- data/test/shared/dummy/views/layouts/application.html.erb +12 -0
- data/test/shared/support/action_controller/integration.rb +55 -0
- data/test/shared/support/action_controller/test_case.rb +28 -0
- data/test/shared/support/capybara/setup.rb +14 -0
- data/test/shared/support/test_helper.rb +1 -0
- data/test/shared/tests/actionpack/action_controller/base_test.rb +14 -0
- data/test/shared/tests/actionpack/action_view/base_test.rb +19 -0
- data/test/shared/tests/activesupport/active_support/dependencies_test.rb +15 -0
- data/test/shared/tests/app/integration/authenticated/authlogic.rb +88 -0
- data/test/shared/tests/app/integration/authenticated/devise_test.rb +89 -0
- data/test/shared/tests/app/integration/non_authenticated.rb +63 -0
- data/test/shared/tests/app/routing_test.rb +31 -0
- data/test/shared/tests/auth_test.rb +11 -0
- data/test/shared/tests/content/group.rb +10 -0
- data/test/shared/tests/content/item.rb +10 -0
- data/test/shared/tests/core/string/html_safe.rb +15 -0
- data/test/shared/tests/dummy_app.rb +228 -0
- data/test/shared/tests/engine_test.rb +19 -0
- data/test/shared/tests/rails/engine_test.rb +13 -0
- data/test/shared/tests/readme_test.rb +13 -0
- metadata +231 -63
- data/.gitignore +0 -2
- data/lib/generators/rich/authlogic_user/authlogic_user_generator.rb +0 -64
- data/rails_generators/rich_authlogic_user/rich_authlogic_user_generator.rb +0 -64
- data/test/test_helper.rb +0 -6
@@ -0,0 +1,10 @@
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
+
|
4
|
+
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
|
5
|
+
|
6
|
+
require 'rake'
|
7
|
+
require 'rake/testtask'
|
8
|
+
require 'rake/rdoctask'
|
9
|
+
|
10
|
+
require 'tasks/rails'
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Filters added to this controller apply to all controllers in the application.
|
2
|
+
# Likewise, all the methods added will be available for all controllers.
|
3
|
+
|
4
|
+
class ApplicationController < ActionController::Base
|
5
|
+
helper :all # include all helpers, all the time
|
6
|
+
protect_from_forgery # See ActionController::RequestForgeryProtection for details
|
7
|
+
|
8
|
+
# Scrub sensitive parameters from your log
|
9
|
+
# filter_parameter_logging :password
|
10
|
+
end
|
@@ -0,0 +1,124 @@
|
|
1
|
+
# Don't change this file!
|
2
|
+
# Configure your app in config/environment.rb and config/environments/*.rb
|
3
|
+
|
4
|
+
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
5
|
+
|
6
|
+
module Rails
|
7
|
+
class << self
|
8
|
+
def boot!
|
9
|
+
unless booted?
|
10
|
+
preinitialize
|
11
|
+
pick_boot.run
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def booted?
|
16
|
+
defined? Rails::Initializer
|
17
|
+
end
|
18
|
+
|
19
|
+
def pick_boot
|
20
|
+
(vendor_rails? ? VendorBoot : GemBoot).new
|
21
|
+
end
|
22
|
+
|
23
|
+
def vendor_rails?
|
24
|
+
File.exist?("#{RAILS_ROOT}/vendor/rails")
|
25
|
+
end
|
26
|
+
|
27
|
+
def preinitialize
|
28
|
+
load(preinitializer_path) if File.exist?(preinitializer_path)
|
29
|
+
end
|
30
|
+
|
31
|
+
def preinitializer_path
|
32
|
+
"#{RAILS_ROOT}/config/preinitializer.rb"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class Boot
|
37
|
+
def run
|
38
|
+
load_initializer
|
39
|
+
Rails::Initializer.run(:set_load_path)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
class VendorBoot < Boot
|
44
|
+
def load_initializer
|
45
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
46
|
+
Rails::Initializer.run(:install_gem_spec_stubs)
|
47
|
+
Rails::GemDependency.add_frozen_gem_path
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
class GemBoot < Boot
|
52
|
+
def load_initializer
|
53
|
+
self.class.load_rubygems
|
54
|
+
load_rails_gem
|
55
|
+
require 'initializer'
|
56
|
+
end
|
57
|
+
|
58
|
+
def load_rails_gem
|
59
|
+
if version = self.class.gem_version
|
60
|
+
gem 'rails', version
|
61
|
+
else
|
62
|
+
gem 'rails'
|
63
|
+
end
|
64
|
+
rescue Gem::LoadError => load_error
|
65
|
+
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
66
|
+
exit 1
|
67
|
+
end
|
68
|
+
|
69
|
+
class << self
|
70
|
+
def rubygems_version
|
71
|
+
Gem::RubyGemsVersion rescue nil
|
72
|
+
end
|
73
|
+
|
74
|
+
def gem_version
|
75
|
+
if defined? RAILS_GEM_VERSION
|
76
|
+
RAILS_GEM_VERSION
|
77
|
+
elsif ENV.include?('RAILS_GEM_VERSION')
|
78
|
+
ENV['RAILS_GEM_VERSION']
|
79
|
+
else
|
80
|
+
parse_gem_version(read_environment_rb)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def load_rubygems
|
85
|
+
min_version = '1.3.2'
|
86
|
+
require 'rubygems'
|
87
|
+
unless rubygems_version >= min_version
|
88
|
+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
89
|
+
exit 1
|
90
|
+
end
|
91
|
+
|
92
|
+
rescue LoadError
|
93
|
+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
94
|
+
exit 1
|
95
|
+
end
|
96
|
+
|
97
|
+
def parse_gem_version(text)
|
98
|
+
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
99
|
+
end
|
100
|
+
|
101
|
+
private
|
102
|
+
def read_environment_rb
|
103
|
+
File.read("#{RAILS_ROOT}/config/environment.rb")
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
class Rails::Boot
|
110
|
+
def run
|
111
|
+
load_initializer
|
112
|
+
|
113
|
+
Rails::Initializer.class_eval do
|
114
|
+
def load_gems
|
115
|
+
@bundler_loaded ||= Bundler.require :default, Rails.env
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
Rails::Initializer.run(:set_load_path)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
# All that for this:
|
124
|
+
Rails.boot!
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3-ruby (not necessary on OS X Leopard)
|
3
|
+
development:
|
4
|
+
adapter: sqlite3
|
5
|
+
database: db/development.sqlite3
|
6
|
+
pool: 5
|
7
|
+
timeout: 5000
|
8
|
+
|
9
|
+
# Warning: The database defined as "test" will be erased and
|
10
|
+
# re-generated from your development database when you run "rake".
|
11
|
+
# Do not set this db to the same as development or production.
|
12
|
+
test:
|
13
|
+
adapter: mysql2
|
14
|
+
database: rich_cms_test
|
15
|
+
username: root
|
16
|
+
password:
|
17
|
+
host: 127.0.0.1
|
18
|
+
|
19
|
+
production:
|
20
|
+
adapter: sqlite3
|
21
|
+
database: db/production.sqlite3
|
22
|
+
pool: 5
|
23
|
+
timeout: 5000
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file
|
2
|
+
|
3
|
+
# Specifies gem version of Rails to use when vendor/rails is not present
|
4
|
+
RAILS_GEM_VERSION = '2.3.10' unless defined? RAILS_GEM_VERSION
|
5
|
+
|
6
|
+
# Bootstrap the Rails environment, frameworks, and default configuration
|
7
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
8
|
+
|
9
|
+
Rails::Initializer.run do |config|
|
10
|
+
# Settings in config/environments/* take precedence over those specified here.
|
11
|
+
# Application configuration should go into files in config/initializers
|
12
|
+
# -- all .rb files in that directory are automatically loaded.
|
13
|
+
|
14
|
+
# Add additional load paths for your own custom dirs
|
15
|
+
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
16
|
+
|
17
|
+
# Specify gems that this application depends on and have them installed with rake gems:install
|
18
|
+
# config.gem "bj"
|
19
|
+
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
|
20
|
+
# config.gem "sqlite3-ruby", :lib => "sqlite3"
|
21
|
+
# config.gem "aws-s3", :lib => "aws/s3"
|
22
|
+
|
23
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
24
|
+
# :all can be used as a placeholder for all plugins not explicitly named
|
25
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
26
|
+
|
27
|
+
# Skip frameworks you're not going to use. To use Rails without a database,
|
28
|
+
# you must remove the Active Record framework.
|
29
|
+
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
|
30
|
+
|
31
|
+
# Activate observers that should always be running
|
32
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
33
|
+
|
34
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
35
|
+
# Run "rake -D time" for a list of tasks for finding time zone names.
|
36
|
+
# config.time_zone = 'UTC'
|
37
|
+
|
38
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
39
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
|
40
|
+
# config.i18n.default_locale = :de
|
41
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# In the development environment your application's code is reloaded on
|
4
|
+
# every request. This slows down response time but is perfect for development
|
5
|
+
# since you don't have to restart the webserver when you make code changes.
|
6
|
+
config.cache_classes = false
|
7
|
+
|
8
|
+
# Log error messages when you accidentally call methods on nil.
|
9
|
+
config.whiny_nils = true
|
10
|
+
|
11
|
+
# Show full error reports and disable caching
|
12
|
+
config.action_controller.consider_all_requests_local = true
|
13
|
+
config.action_view.debug_rjs = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# The production environment is meant for finished, "live" apps.
|
4
|
+
# Code is not reloaded between requests
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Full error reports are disabled and caching is turned on
|
8
|
+
config.action_controller.consider_all_requests_local = false
|
9
|
+
config.action_controller.perform_caching = true
|
10
|
+
config.action_view.cache_template_loading = true
|
11
|
+
|
12
|
+
# See everything in the log (default is :info)
|
13
|
+
# config.log_level = :debug
|
14
|
+
|
15
|
+
# Use a different logger for distributed setups
|
16
|
+
# config.logger = SyslogLogger.new
|
17
|
+
|
18
|
+
# Use a different cache store in production
|
19
|
+
# config.cache_store = :mem_cache_store
|
20
|
+
|
21
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
22
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
23
|
+
|
24
|
+
# Disable delivery errors, bad email addresses will be ignored
|
25
|
+
# config.action_mailer.raise_delivery_errors = false
|
26
|
+
|
27
|
+
# Enable threaded mode
|
28
|
+
# config.threadsafe!
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# The test environment is used exclusively to run your application's
|
4
|
+
# test suite. You never need to work with it otherwise. Remember that
|
5
|
+
# your test database is "scratch space" for the test suite and is wiped
|
6
|
+
# and recreated between test runs. Don't rely on the data there!
|
7
|
+
config.cache_classes = true
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.action_controller.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
config.action_view.cache_template_loading = true
|
16
|
+
|
17
|
+
# Disable request forgery protection in test environment
|
18
|
+
config.action_controller.allow_forgery_protection = false
|
19
|
+
|
20
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
21
|
+
# The :test delivery method accumulates sent emails in the
|
22
|
+
# ActionMailer::Base.deliveries array.
|
23
|
+
config.action_mailer.delivery_method = :test
|
24
|
+
|
25
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
26
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
27
|
+
# like if you have constraints or database-specific column types
|
28
|
+
# config.active_record.schema_format = :sql
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
ActionController::Base.cookie_verifier_secret = 'c9f2251e6e94cc3f9dea4113fbe1ab710cc207d9ef6df15fd72fe7a21110a84ed026e46f02cdefedbc114c9e67a1b7cf0497ea64761845665a7ee0cf6f8adf38';
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# Use this hook to configure devise mailer, warden hooks and so forth. The first
|
2
|
+
# four configuration values can also be set straight in your models.
|
3
|
+
Devise.setup do |config|
|
4
|
+
# Configure the e-mail address which will be shown in DeviseMailer.
|
5
|
+
config.mailer_sender = "noreply@codehero.es"
|
6
|
+
|
7
|
+
# Configure the content type of DeviseMailer mails (defaults to text/html")
|
8
|
+
# config.mailer_content_type = "text/plain"
|
9
|
+
|
10
|
+
# ==> Configuration for :authenticatable
|
11
|
+
# Invoke `rake secret` and use the printed value to setup a pepper to generate
|
12
|
+
# the encrypted password. By default no pepper is used.
|
13
|
+
# config.pepper = "rake secret output"
|
14
|
+
|
15
|
+
# Configure how many times you want the password is reencrypted. Default is 10.
|
16
|
+
# config.stretches = 10
|
17
|
+
|
18
|
+
# Define which will be the encryption algorithm. Supported algorithms are :sha1
|
19
|
+
# (default), :sha512 and :bcrypt. Devise also supports encryptors from others
|
20
|
+
# authentication tools as :clearance_sha1, :authlogic_sha512 (then you should set
|
21
|
+
# stretches above to 20 for default behavior) and :restful_authentication_sha1
|
22
|
+
# (then you should set stretches to 10, and copy REST_AUTH_SITE_KEY to pepper)
|
23
|
+
# config.encryptor = :sha1
|
24
|
+
|
25
|
+
# Configure which keys are used when authenticating an user. By default is
|
26
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
27
|
+
# authenticating an user, both parameters are required. Remember that those
|
28
|
+
# parameters are used only when authenticating and not when retrieving from
|
29
|
+
# session. If you need permissions, you should implement that in a before filter.
|
30
|
+
# config.authentication_keys = [ :email ]
|
31
|
+
|
32
|
+
# The realm used in Http Basic Authentication
|
33
|
+
config.http_authentication_realm = "Rich-CMS"
|
34
|
+
|
35
|
+
# ==> Configuration for :confirmable
|
36
|
+
# The time you want give to your user to confirm his account. During this time
|
37
|
+
# he will be able to access your application without confirming. Default is nil.
|
38
|
+
# config.confirm_within = 2.days
|
39
|
+
|
40
|
+
# ==> Configuration for :rememberable
|
41
|
+
# The time the user will be remembered without asking for credentials again.
|
42
|
+
# config.remember_for = 2.weeks
|
43
|
+
|
44
|
+
# ==> Configuration for :timeoutable
|
45
|
+
# The time you want to timeout the user session without activity. After this
|
46
|
+
# time the user will be asked for credentials again.
|
47
|
+
# config.timeout_in = 10.minutes
|
48
|
+
|
49
|
+
# ==> Configuration for :lockable
|
50
|
+
# Number of authentication tries before locking an account.
|
51
|
+
# config.maximum_attempts = 20
|
52
|
+
|
53
|
+
# Defines which strategy will be used to unlock an account.
|
54
|
+
# :email = Sends an unlock link to the user email
|
55
|
+
# :time = Reanables login after a certain ammount of time (see :unlock_in below)
|
56
|
+
# :both = enables both strategies
|
57
|
+
# config.unlock_strategy = :both
|
58
|
+
|
59
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
60
|
+
# config.unlock_in = 1.hour
|
61
|
+
|
62
|
+
# ==> Configuration for :token_authenticatable
|
63
|
+
# Defines name of the authentication token params key
|
64
|
+
# config.token_authentication_key = :auth_token
|
65
|
+
|
66
|
+
# ==> General configuration
|
67
|
+
# Load and configure the ORM. Supports :active_record (default), :mongo_mapper
|
68
|
+
# (requires mongo_ext installed) and :data_mapper (experimental).
|
69
|
+
# require 'devise/orm/mongo_mapper'
|
70
|
+
# config.orm = :mongo_mapper
|
71
|
+
|
72
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
73
|
+
# "sessions/users/new". It's turned off by default because it's slower if you
|
74
|
+
# are using only default views.
|
75
|
+
# config.scoped_views = true
|
76
|
+
|
77
|
+
# By default, devise detects the role accessed based on the url. So whenever
|
78
|
+
# accessing "/users/sign_in", it knows you are accessing an User. This makes
|
79
|
+
# routes as "/sign_in" not possible, unless you tell Devise to use the default
|
80
|
+
# scope, setting true below.
|
81
|
+
# config.use_default_scope = true
|
82
|
+
|
83
|
+
# Configure the default scope used by Devise. By default it's the first devise
|
84
|
+
# role declared in your routes.
|
85
|
+
# config.default_scope = :user
|
86
|
+
|
87
|
+
# If you want to use other strategies, that are not (yet) supported by Devise,
|
88
|
+
# you can configure them inside the config.warden block. The example below
|
89
|
+
# allows you to setup OAuth, using http://github.com/roman/warden_oauth
|
90
|
+
#
|
91
|
+
# config.warden do |manager|
|
92
|
+
# manager.oauth(:twitter) do |twitter|
|
93
|
+
# twitter.consumer_secret = <YOUR CONSUMER SECRET>
|
94
|
+
# twitter.consumer_key = <YOUR CONSUMER KEY>
|
95
|
+
# twitter.options :site => 'http://twitter.com'
|
96
|
+
# end
|
97
|
+
# manager.default_strategies.unshift :twitter_oauth
|
98
|
+
# end
|
99
|
+
|
100
|
+
# Configure default_url_options if you are using dynamic segments in :path_prefix
|
101
|
+
# for devise_for.
|
102
|
+
# config.default_url_options do
|
103
|
+
# { :locale => I18n.locale }
|
104
|
+
# end
|
105
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# These settings change the behavior of Rails 2 apps and will be defaults
|
4
|
+
# for Rails 3. You can remove this initializer when Rails 3 is released.
|
5
|
+
|
6
|
+
if defined?(ActiveRecord)
|
7
|
+
# Include Active Record class name as root for JSON serialized output.
|
8
|
+
ActiveRecord::Base.include_root_in_json = true
|
9
|
+
|
10
|
+
# Store the full class name (including module namespace) in STI type column.
|
11
|
+
ActiveRecord::Base.store_full_sti_class = true
|
12
|
+
end
|
13
|
+
|
14
|
+
ActionController::Routing.generate_best_match = false
|
15
|
+
|
16
|
+
# Use ISO 8601 format for JSON serialized times and dates.
|
17
|
+
ActiveSupport.use_standard_json_time_format = true
|
18
|
+
|
19
|
+
# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
|
20
|
+
# if you're including raw json in an HTML page.
|
21
|
+
ActiveSupport.escape_html_entities_in_json = false
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying cookie session data integrity.
|
4
|
+
# If you change this key, all old sessions will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
ActionController::Base.session = {
|
8
|
+
:key => '_dummy_session',
|
9
|
+
:secret => '59a8732ab5f3dee5015582556d2bbd232ac41de5f2bef8a505d2828fb0fbf87be8b8741af974b1c303ac3d321ff5d2f895c10926a4d923f7c0836b8b7be45405'
|
10
|
+
}
|
11
|
+
|
12
|
+
# Use the database for sessions instead of the cookie-based default,
|
13
|
+
# which shouldn't be used to store highly confidential information
|
14
|
+
# (create the session table with "rake db:sessions:create")
|
15
|
+
# ActionController::Base.session_store = :active_record_store
|
@@ -0,0 +1,20 @@
|
|
1
|
+
begin
|
2
|
+
require "rubygems"
|
3
|
+
require "bundler"
|
4
|
+
rescue LoadError
|
5
|
+
raise "Could not load the bundler gem. Install it with `gem install bundler`."
|
6
|
+
end
|
7
|
+
|
8
|
+
if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
|
9
|
+
raise RuntimeError, "Your bundler version is too old for Rails 2.3." +
|
10
|
+
"Run `gem install bundler` to upgrade."
|
11
|
+
end
|
12
|
+
|
13
|
+
begin
|
14
|
+
# Set up load paths for all bundled gems
|
15
|
+
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
|
16
|
+
Bundler.setup
|
17
|
+
rescue Bundler::GemNotFound
|
18
|
+
raise RuntimeError, "Bundler couldn't find some gems." +
|
19
|
+
"Did you run `bundle install`?"
|
20
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
ActionController::Routing::Routes.draw do |map|
|
2
|
+
map.devise_for :devise_users
|
3
|
+
# The priority is based upon order of creation: first created -> highest priority.
|
4
|
+
|
5
|
+
# Sample of regular route:
|
6
|
+
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
|
7
|
+
# Keep in mind you can assign values other than :controller and :action
|
8
|
+
|
9
|
+
# Sample of named route:
|
10
|
+
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
|
11
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
12
|
+
|
13
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
14
|
+
# map.resources :products
|
15
|
+
|
16
|
+
# Sample resource route with options:
|
17
|
+
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
|
18
|
+
|
19
|
+
# Sample resource route with sub-resources:
|
20
|
+
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
|
21
|
+
|
22
|
+
# Sample resource route with more complex sub-resources
|
23
|
+
# map.resources :products do |products|
|
24
|
+
# products.resources :comments
|
25
|
+
# products.resources :sales, :collection => { :recent => :get }
|
26
|
+
# end
|
27
|
+
|
28
|
+
# Sample resource route within a namespace:
|
29
|
+
# map.namespace :admin do |admin|
|
30
|
+
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
|
31
|
+
# admin.resources :products
|
32
|
+
# end
|
33
|
+
|
34
|
+
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
|
35
|
+
map.root :controller => "application"
|
36
|
+
|
37
|
+
# See how all your routes lay out with "rake routes"
|
38
|
+
|
39
|
+
# Install the default routes as the lowest priority.
|
40
|
+
# Note: These default routes make all actions in every controller accessible via GET requests. You should
|
41
|
+
# consider removing or commenting them out if you're using named routes and resources.
|
42
|
+
map.connect ':controller/:action/:id'
|
43
|
+
map.connect ':controller/:action/:id.:format'
|
44
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
ActiveRecord::Schema.define(:version => 19820801180828) do
|
2
|
+
|
3
|
+
create_table "authlogic_users", :force => true do |t|
|
4
|
+
t.string "name"
|
5
|
+
t.string "email"
|
6
|
+
t.string "crypted_password"
|
7
|
+
t.string "password_salt"
|
8
|
+
t.string "persistence_token"
|
9
|
+
t.string "single_access_token"
|
10
|
+
t.string "perishable_token"
|
11
|
+
t.integer "login_count"
|
12
|
+
t.datetime "created_at"
|
13
|
+
t.datetime "updated_at"
|
14
|
+
t.datetime "current_login_at"
|
15
|
+
t.datetime "last_login_at"
|
16
|
+
t.datetime "last_request_at"
|
17
|
+
end
|
18
|
+
|
19
|
+
add_index "authlogic_users", ["email"], :name => "index_authlogic_users_on_email"
|
20
|
+
|
21
|
+
create_table "devise_users", :force => true do |t|
|
22
|
+
t.string "email", :default => "", :null => false
|
23
|
+
t.string "encrypted_password", :limit => 128, :default => "", :null => false
|
24
|
+
t.string "password_salt", :default => "", :null => false
|
25
|
+
t.string "reset_password_token"
|
26
|
+
t.string "remember_token"
|
27
|
+
t.datetime "remember_created_at"
|
28
|
+
t.integer "sign_in_count", :default => 0
|
29
|
+
t.datetime "current_sign_in_at"
|
30
|
+
t.datetime "last_sign_in_at"
|
31
|
+
t.string "current_sign_in_ip"
|
32
|
+
t.string "last_sign_in_ip"
|
33
|
+
t.datetime "created_at"
|
34
|
+
t.datetime "updated_at"
|
35
|
+
end
|
36
|
+
|
37
|
+
add_index "devise_users", ["email"], :name => "index_devise_users_on_email", :unique => true
|
38
|
+
add_index "devise_users", ["reset_password_token"], :name => "index_devise_users_on_reset_password_token", :unique => true
|
39
|
+
|
40
|
+
create_table "cms_contents", :force => true do |t|
|
41
|
+
t.string "key"
|
42
|
+
t.text "value"
|
43
|
+
t.datetime "created_at"
|
44
|
+
t.datetime "updated_at"
|
45
|
+
end
|
46
|
+
|
47
|
+
add_index "cms_contents", ["key"], :name => "index_cms_contents_on_key"
|
48
|
+
|
49
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
+
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
3
|
+
#
|
4
|
+
# Examples:
|
5
|
+
#
|
6
|
+
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
|
7
|
+
# Major.create(:name => 'Daley', :city => cities.first)
|
8
|
+
|
9
|
+
AuthlogicUser.create :email => "paul.engel@holder.nl", :password => "testrichcms", :password_confirmation => "testrichcms"
|
10
|
+
DeviseUser .create :email => "paul.engel@holder.nl", :password => "testrichcms"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
|
6
|
+
<head>
|
7
|
+
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
8
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
9
|
+
<style type="text/css">
|
10
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
11
|
+
div.dialog {
|
12
|
+
width: 25em;
|
13
|
+
padding: 0 4em;
|
14
|
+
margin: 4em auto 0 auto;
|
15
|
+
border: 1px solid #ccc;
|
16
|
+
border-right-color: #999;
|
17
|
+
border-bottom-color: #999;
|
18
|
+
}
|
19
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
20
|
+
</style>
|
21
|
+
</head>
|
22
|
+
|
23
|
+
<body>
|
24
|
+
<!-- This file lives in public/404.html -->
|
25
|
+
<div class="dialog">
|
26
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
27
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
28
|
+
</div>
|
29
|
+
</body>
|
30
|
+
</html>
|