browsercms 3.3.0.beta → 3.3.0
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/.yardopts +5 -0
- data/README.markdown +11 -11
- data/app/helpers/cms/page_helper.rb +1 -1
- data/app/models/page_route.rb +9 -0
- data/app/models/portlet.rb +2 -2
- data/app/models/section.rb +1 -1
- data/app/views/cms/form_builder/_cms_text_area.html.erb +2 -5
- data/app/views/cms/form_builder/_cms_text_editor.html.erb +1 -0
- data/app/views/cms/pages/_form.html.erb +2 -10
- data/bin/bcms +114 -3
- data/bin/browsercms +3 -72
- data/browsercms.gemspec +4 -2
- data/lib/cms/behaviors/soft_deleting.rb +4 -5
- data/lib/cms/extensions/active_record/base.rb +22 -1
- data/lib/cms/routes.rb +2 -5
- data/lib/cms/version.rb +1 -1
- data/lib/generators/browser_cms/cms/cms_generator.rb +1 -0
- data/lib/generators/browser_cms/demo_site/demo_site_generator.rb +1 -1
- data/lib/generators/browser_cms/demo_site/templates/demo_site.rake +3 -0
- data/lib/generators/cms/upgrade_module/templates/COPYRIGHT.txt +23 -0
- data/{templates/module.rb → lib/generators/cms/upgrade_module/templates/GPL.txt} +2 -223
- data/lib/generators/cms/upgrade_module/templates/LICENSE.txt +165 -0
- data/lib/tasks/db.rake +3 -0
- data/public/stylesheets/cms/sitemap.css +5 -5
- metadata +8 -74
- data/doc/guides/html/authentication.html +0 -457
- data/doc/guides/html/build_it_yourself.html +0 -457
- data/doc/guides/html/building_modules.html +0 -480
- data/doc/guides/html/building_templates.html +0 -457
- data/doc/guides/html/content_blocks.html +0 -457
- data/doc/guides/html/customizing_browsercms.html +0 -457
- data/doc/guides/html/deployment_guide.html +0 -568
- data/doc/guides/html/files/bcmsorg.js +0 -28
- data/doc/guides/html/files/clearfix.css +0 -8
- data/doc/guides/html/files/cufon.js +0 -7
- data/doc/guides/html/files/global.css +0 -190
- data/doc/guides/html/files/helvetica.js +0 -91
- data/doc/guides/html/files/javascripts/code_highlighter.js +0 -188
- data/doc/guides/html/files/javascripts/guides.js +0 -7
- data/doc/guides/html/files/javascripts/highlighters.js +0 -90
- data/doc/guides/html/files/jquery.js +0 -11
- data/doc/guides/html/files/stylesheets/main.css +0 -441
- data/doc/guides/html/files/stylesheets/reset.css +0 -43
- data/doc/guides/html/files/stylesheets/style.css +0 -13
- data/doc/guides/html/files/stylesheets/syntax.css +0 -31
- data/doc/guides/html/getting_started.html +0 -457
- data/doc/guides/html/images/bg.png +0 -0
- data/doc/guides/html/images/bottom_cap.png +0 -0
- data/doc/guides/html/images/browsercms_logo.png +0 -0
- data/doc/guides/html/images/content_blocks/add_field_to_form.png +0 -0
- data/doc/guides/html/images/content_blocks/add_second_block.png +0 -0
- data/doc/guides/html/images/dot.png +0 -0
- data/doc/guides/html/images/icons/README +0 -5
- data/doc/guides/html/images/icons/callouts/1.png +0 -0
- data/doc/guides/html/images/icons/callouts/10.png +0 -0
- data/doc/guides/html/images/icons/callouts/11.png +0 -0
- data/doc/guides/html/images/icons/callouts/12.png +0 -0
- data/doc/guides/html/images/icons/callouts/13.png +0 -0
- data/doc/guides/html/images/icons/callouts/14.png +0 -0
- data/doc/guides/html/images/icons/callouts/15.png +0 -0
- data/doc/guides/html/images/icons/callouts/2.png +0 -0
- data/doc/guides/html/images/icons/callouts/3.png +0 -0
- data/doc/guides/html/images/icons/callouts/4.png +0 -0
- data/doc/guides/html/images/icons/callouts/5.png +0 -0
- data/doc/guides/html/images/icons/callouts/6.png +0 -0
- data/doc/guides/html/images/icons/callouts/7.png +0 -0
- data/doc/guides/html/images/icons/callouts/8.png +0 -0
- data/doc/guides/html/images/icons/callouts/9.png +0 -0
- data/doc/guides/html/images/icons/caution.png +0 -0
- data/doc/guides/html/images/icons/example.png +0 -0
- data/doc/guides/html/images/icons/home.png +0 -0
- data/doc/guides/html/images/icons/important.png +0 -0
- data/doc/guides/html/images/icons/next.png +0 -0
- data/doc/guides/html/images/icons/note.png +0 -0
- data/doc/guides/html/images/icons/prev.png +0 -0
- data/doc/guides/html/images/icons/tip.png +0 -0
- data/doc/guides/html/images/icons/up.png +0 -0
- data/doc/guides/html/images/icons/warning.png +0 -0
- data/doc/guides/html/images/nfl_sitemap.png +0 -0
- data/doc/guides/html/images/top_cap.png +0 -0
- data/doc/guides/html/images/top_cap_content.png +0 -0
- data/doc/guides/html/index.html +0 -457
- data/doc/guides/html/installing_modules.html +0 -457
- data/doc/guides/html/portlets.html +0 -457
- data/doc/guides/html/user_guide.html +0 -457
- data/doc/guides/html/writing_guides.html +0 -457
- data/lib/initial_data.rb +0 -30
- data/lib/tasks/build_gem.rake +0 -1
- data/lib/tasks/cms.rake +0 -69
- data/lib/tasks/cucumber.rake +0 -53
- data/lib/tasks/dev.rake +0 -20
- data/templates/blank.rb +0 -48
- data/templates/demo.rb +0 -48
data/lib/initial_data.rb
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
class InitialData
|
|
2
|
-
|
|
3
|
-
extend Cms::DataLoader
|
|
4
|
-
|
|
5
|
-
#Fixture-like way of creating initial data, except that it actually calls the real model methods
|
|
6
|
-
#This way things like acts_as_list and versioning get setup properly for these records
|
|
7
|
-
#The syntax is that you call create_whatever(:something, ...), where whatever is the model name,
|
|
8
|
-
#something is the identifier you give this record, and the ... is the hash of options to pass
|
|
9
|
-
#to the model constructor. By calling the create_ method, you can then refer to the record later
|
|
10
|
-
#in the same way you would with fixtures, by saying whatevers(:something)
|
|
11
|
-
def self.load_demo
|
|
12
|
-
eval open("#{Rails.root}/db/demo/data.rb"){|f| f.read}
|
|
13
|
-
|
|
14
|
-
Dir["#{Rails.root}/db/demo/page_partials/*.erb"].map do |f|
|
|
15
|
-
name, format, handler = File.basename(f).split('.')
|
|
16
|
-
create_page_partial(name.to_sym,
|
|
17
|
-
:name => name, :format => format, :handler => handler,
|
|
18
|
-
:body => open(f){|f| f.read})
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
Dir["#{Rails.root}/db/demo/page_templates/*.erb"].map do |f|
|
|
22
|
-
name, format, handler = File.basename(f).split('.')
|
|
23
|
-
create_page_template(name.to_sym,
|
|
24
|
-
:name => name, :format => format, :handler => handler,
|
|
25
|
-
:body => open(f){|f| f.read})
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
end
|
data/lib/tasks/build_gem.rake
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Add any tasks from your Rake file here.
|
data/lib/tasks/cms.rake
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
namespace :test do
|
|
2
|
-
|
|
3
|
-
desc 'Runs all Tests (Test::Unit) and Features (cucumber)'
|
|
4
|
-
task :all => ["test", "cucumber"]
|
|
5
|
-
|
|
6
|
-
# Could be improved somewhat to get rid of unneeded warnings.
|
|
7
|
-
desc "run tests against sqlite database"
|
|
8
|
-
task :sqlite3 do
|
|
9
|
-
cp(File.join('config', 'database.sqlite3.yml'), File.join('config', 'database.yml'), :verbose => true)
|
|
10
|
-
Rake::Task['db:drop'].invoke
|
|
11
|
-
Rake::Task['db:create'].invoke
|
|
12
|
-
system "rake db:migrate test"
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
# Could be improved somewhat to get rid of unneeded warnings.
|
|
16
|
-
desc "run tests against mysql database"
|
|
17
|
-
task :mysql do
|
|
18
|
-
cp(File.join('config', 'database.mysql.yml'), File.join('config', 'database.yml'), :verbose => true)
|
|
19
|
-
Rake::Task['db:drop'].invoke
|
|
20
|
-
Rake::Task['db:create'].invoke
|
|
21
|
-
system "rake db:migrate test"
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# When Jeweler builds the gem, make sure the guides are also rebuilt.
|
|
26
|
-
#task :build => ['cms:guides']
|
|
27
|
-
|
|
28
|
-
namespace :cms do
|
|
29
|
-
|
|
30
|
-
desc "Generate guides for the CMS"
|
|
31
|
-
task :guides do
|
|
32
|
-
require 'rubygems'
|
|
33
|
-
|
|
34
|
-
gem "actionpack", '>= 2.3'
|
|
35
|
-
require "action_controller"
|
|
36
|
-
require "action_view"
|
|
37
|
-
|
|
38
|
-
gem 'RedCloth', '>= 4.1.1'
|
|
39
|
-
require 'redcloth'
|
|
40
|
-
|
|
41
|
-
$: << File.join(File.dirname(__FILE__), '../../doc/guides')
|
|
42
|
-
|
|
43
|
-
module CmsGuides
|
|
44
|
-
autoload :Generator, "cms_guides/generator"
|
|
45
|
-
autoload :Indexer, "cms_guides/indexer"
|
|
46
|
-
autoload :Helpers, "cms_guides/helpers"
|
|
47
|
-
autoload :TextileExtensions, "cms_guides/textile_extensions"
|
|
48
|
-
autoload :Levenshtein, "cms_guides/levenshtein"
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
RedCloth.send(:include, CmsGuides::TextileExtensions)
|
|
52
|
-
|
|
53
|
-
CmsGuides::Generator.new.generate
|
|
54
|
-
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
desc "Rebuild the browsercms gem locally and install it, Useful for testing releases."
|
|
58
|
-
task :gem => ["browsercms.gemspec", :build, :install]
|
|
59
|
-
|
|
60
|
-
task :install do
|
|
61
|
-
puts "installing..."
|
|
62
|
-
if RUBY_PLATFORM =~ /mswin32/
|
|
63
|
-
system("cmd /c gem install pkg/browsercms-3.1.0")
|
|
64
|
-
else
|
|
65
|
-
sh("sudo gem install pkg/browsercms-3.1.0")
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
data/lib/tasks/cucumber.rake
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
|
2
|
-
# It is recommended to regenerate this file in the future when you upgrade to a
|
|
3
|
-
# newer version of cucumber-rails. Consider adding your own code to a new file
|
|
4
|
-
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
|
5
|
-
# files.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
|
|
9
|
-
|
|
10
|
-
vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
|
|
11
|
-
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
|
|
12
|
-
|
|
13
|
-
begin
|
|
14
|
-
require 'cucumber/rake/task'
|
|
15
|
-
|
|
16
|
-
namespace :cucumber do
|
|
17
|
-
Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
|
|
18
|
-
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
|
|
19
|
-
t.fork = true # You may get faster startup if you set this to false
|
|
20
|
-
t.profile = 'default'
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
|
|
24
|
-
t.binary = vendored_cucumber_bin
|
|
25
|
-
t.fork = true # You may get faster startup if you set this to false
|
|
26
|
-
t.profile = 'wip'
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
|
|
30
|
-
t.binary = vendored_cucumber_bin
|
|
31
|
-
t.fork = true # You may get faster startup if you set this to false
|
|
32
|
-
t.profile = 'rerun'
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
desc 'Run all features'
|
|
36
|
-
task :all => [:ok, :wip]
|
|
37
|
-
end
|
|
38
|
-
desc 'Alias for cucumber:ok'
|
|
39
|
-
task :cucumber => 'cucumber:ok'
|
|
40
|
-
|
|
41
|
-
task :default => :cucumber
|
|
42
|
-
|
|
43
|
-
task :features => :cucumber do
|
|
44
|
-
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
|
|
45
|
-
end
|
|
46
|
-
rescue LoadError
|
|
47
|
-
desc 'cucumber rake task not available (cucumber not installed)'
|
|
48
|
-
task :cucumber do
|
|
49
|
-
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
end
|
data/lib/tasks/dev.rake
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#These are tasks used for the development of CMS as a standalone rails app, not to be included into a CMS project
|
|
2
|
-
|
|
3
|
-
desc "Reset the DB, run the migrations, load the fixtures, run the specs"
|
|
4
|
-
task :reset => ["db:reload_demo_data", "test:all"]
|
|
5
|
-
|
|
6
|
-
namespace :db do
|
|
7
|
-
# This task needs to somehow be packaged as part of the CMS gem, so that users can use the demo.rb template to install the data.
|
|
8
|
-
|
|
9
|
-
desc "Installs sample data for a demo site, including several templates and sample pages."
|
|
10
|
-
task :load_demo_data => :environment do
|
|
11
|
-
t0 = Time.now
|
|
12
|
-
puts "== Demo Data: creating ====================================================="
|
|
13
|
-
InitialData.load_demo
|
|
14
|
-
puts "== Demo Data: created (%0.4fs) ============================================\n" % (Time.now - t0)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
desc "Wipes database, and reinstalls the demo data."
|
|
19
|
-
task :reload_demo_data => ["db:migrate:reset", "db:load_demo_data"]
|
|
20
|
-
end
|
data/templates/blank.rb
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# Remove the file on both *unix and Windows
|
|
2
|
-
if Gem.win_platform?
|
|
3
|
-
run "del public\\index.html"
|
|
4
|
-
run "db/seeds.rb"
|
|
5
|
-
else
|
|
6
|
-
run "rm public/index.html"
|
|
7
|
-
run 'rm db/seeds.rb'
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
# Loads the version, so we can explicitly set in the generated cms project.
|
|
11
|
-
template_root = File.dirname(__FILE__)
|
|
12
|
-
require File.join(template_root, '..', 'lib', 'cms', 'version.rb')
|
|
13
|
-
gem "browsercms", :version=>Cms::VERSION
|
|
14
|
-
|
|
15
|
-
generate :jdbc if defined?(JRUBY_VERSION)
|
|
16
|
-
|
|
17
|
-
if Gem.win_platform?
|
|
18
|
-
puts " rake db:create"
|
|
19
|
-
`rake.cmd db:create`
|
|
20
|
-
else
|
|
21
|
-
rake "db:create"
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
route "routes_for_browser_cms"
|
|
25
|
-
|
|
26
|
-
generate "browser_cms:cms"
|
|
27
|
-
environment 'SITE_DOMAIN="localhost:3000"', :env => "development"
|
|
28
|
-
environment 'SITE_DOMAIN="localhost:3000"', :env => "test"
|
|
29
|
-
environment 'SITE_DOMAIN="localhost:3000"', :env => "production"
|
|
30
|
-
environment 'config.action_view.cache_template_loading = false', :env => "production"
|
|
31
|
-
environment 'config.action_controller.page_cache_directory = Rails.root + "/public/cache/"', :env => "production"
|
|
32
|
-
initializer 'browsercms.rb', <<-CODE
|
|
33
|
-
Cms.attachment_file_permission = 0640
|
|
34
|
-
CODE
|
|
35
|
-
|
|
36
|
-
require File.join(template_root, '..', 'app', 'models', 'templates.rb')
|
|
37
|
-
file 'app/views/layouts/templates/default.html.erb', Templates.default_body
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if Gem.win_platform?
|
|
42
|
-
puts " rake db:migrate"
|
|
43
|
-
`rake.cmd db:migrate`
|
|
44
|
-
`rake.cmd db:seed`
|
|
45
|
-
else
|
|
46
|
-
rake "db:migrate"
|
|
47
|
-
rake "db:seed"
|
|
48
|
-
end
|
data/templates/demo.rb
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# Remove the file on both *unix and Windows
|
|
2
|
-
if Gem.win_platform?
|
|
3
|
-
run "del public\\index.html"
|
|
4
|
-
run "db/seeds.rb"
|
|
5
|
-
else
|
|
6
|
-
run "rm public/index.html"
|
|
7
|
-
run 'rm db/seeds.rb'
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
# Loads the version, so we can explicitly set in the generated cms project.
|
|
11
|
-
template_root = File.dirname(__FILE__)
|
|
12
|
-
require File.join(template_root, '..', 'lib', 'cms', 'version.rb')
|
|
13
|
-
gem "browsercms", :version=>Cms::VERSION
|
|
14
|
-
|
|
15
|
-
generate :jdbc if defined?(JRUBY_VERSION)
|
|
16
|
-
|
|
17
|
-
if Gem.win_platform?
|
|
18
|
-
puts " rake db:create"
|
|
19
|
-
`rake.cmd db:create`
|
|
20
|
-
else
|
|
21
|
-
rake "db:create"
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
generate "browser_cms:cms"
|
|
25
|
-
|
|
26
|
-
environment 'SITE_DOMAIN="localhost:3000"', :env => "development"
|
|
27
|
-
environment 'SITE_DOMAIN="localhost:3000"', :env => "test"
|
|
28
|
-
environment 'SITE_DOMAIN="localhost:3000"', :env => "production"
|
|
29
|
-
environment 'config.action_view.cache_template_loading = false', :env => "production"
|
|
30
|
-
environment 'config.action_controller.page_cache_directory = Rails.root + "/public/cache/"', :env => "production"
|
|
31
|
-
generate "browser_cms:demo_site"
|
|
32
|
-
|
|
33
|
-
require File.join(template_root, '..', 'app', 'models', 'templates.rb')
|
|
34
|
-
file 'app/views/layouts/templates/default.html.erb', Templates.default_body
|
|
35
|
-
|
|
36
|
-
if Gem.win_platform?
|
|
37
|
-
puts " rake db:migrate"
|
|
38
|
-
`rake.cmd db:migrate`
|
|
39
|
-
`rake.cmd db:seed`
|
|
40
|
-
`rake.cmd db:seed_demo_site`
|
|
41
|
-
else
|
|
42
|
-
rake "db:migrate"
|
|
43
|
-
rake "db:seed"
|
|
44
|
-
rake "db:seed_demo_site"
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
#add routes after demo generation - otherwise there are weird errors
|
|
48
|
-
route "routes_for_browser_cms"
|