compages 0.4.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/.project +18 -0
- data/README +180 -0
- data/Rakefile +10 -0
- data/app/controllers/application.rb +4 -0
- data/app/controllers/contents_controller.rb +116 -0
- data/app/controllers/pages_controller.rb +59 -0
- data/app/controllers/render_controller.rb +24 -0
- data/app/helpers/application_helper.rb +6 -0
- data/app/helpers/contents_helper.rb +5 -0
- data/app/helpers/pages_helper.rb +5 -0
- data/app/helpers/render_helper.rb +2 -0
- data/app/models/content.rb +26 -0
- data/app/models/meta_data.rb +3 -0
- data/app/models/page.rb +106 -0
- data/app/models/page_element.rb +9 -0
- data/app/views/contents/_content_preview.rhtml +1 -0
- data/app/views/contents/_contents_list.rhtml +3 -0
- data/app/views/contents/_show_library.rhtml +60 -0
- data/app/views/contents/_write_now.rhtml +42 -0
- data/app/views/layouts/pages.rhtml +24 -0
- data/app/views/layouts/render.rhtml +11 -0
- data/app/views/pages/_change_theme.rhtml +0 -0
- data/app/views/pages/_edit_menu.rhtml +62 -0
- data/app/views/pages/_page_listed.rhtml +13 -0
- data/app/views/pages/_select_theme.rhtml +4 -0
- data/app/views/pages/edit.rhtml +35 -0
- data/app/views/pages/index.rhtml +45 -0
- data/app/views/pages/list.rhtml +41 -0
- data/app/views/pages/list_a.rhtml +40 -0
- data/app/views/pages/welcome.rhtml +27 -0
- data/app/views/render/_blank.rhtml +3 -0
- data/app/views/render/show.rhtml +1 -0
- data/bin/compages +14 -0
- data/config/boot.rb +44 -0
- data/config/database.yml.home +35 -0
- data/config/environment.rb +53 -0
- data/config/environments/development.rb +21 -0
- data/config/environments/production.rb +18 -0
- data/config/environments/test.rb +19 -0
- data/config/routes.rb +32 -0
- data/db/Copia di schema.rb +48 -0
- data/db/migrate/001_create_pages.rb +12 -0
- data/db/migrate/002_create_contents.rb +12 -0
- data/db/migrate/003_create_meta_datas.rb +14 -0
- data/db/migrate/004_create_page_elements.rb +17 -0
- data/db/migrate/005_add_urlnames.rb +15 -0
- data/db/migrate/006_add_sessions.rb +15 -0
- data/db/schema.mysql.sql +65 -0
- data/db/schema.postgresql.sql +65 -0
- data/db/schema.rb +49 -0
- data/db/schema.sqlite.sql +65 -0
- data/db/schema.sqlserver.sql +71 -0
- data/db/schema_version +1 -0
- data/doc/ER-model/v1.dia +0 -0
- data/doc/ER-model/v2.dia +0 -0
- data/doc/ER-model/v3.dia +0 -0
- data/doc/README_FOR_APP +2 -0
- data/doc/esempi/doc-vir/ecds.htm +2362 -0
- data/doc/esempi/doc-vir/ecds_files/search.gif +0 -0
- data/doc/esempi/doc-vir/ecds_files/upld.gif +0 -0
- data/doc/esempi/doc-vir/ecds_files/upld.jpg +0 -0
- data/installer/apache13.conf.example.template +33 -0
- data/installer/apache20.conf.example.template +40 -0
- data/installer/lighttpd.conf.example.template +6 -0
- data/installer/rails_installer_defaults.yml +5 -0
- data/lib/redcloth.rb +1130 -0
- data/lib/render_engine.rb +94 -0
- data/lib/tasks/release.rake +46 -0
- data/public/.htaccess +41 -0
- data/public/404.html +8 -0
- data/public/500.html +8 -0
- data/public/_index.html +277 -0
- data/public/favicon.ico +0 -0
- data/public/images/body_bg.gif +0 -0
- data/public/images/body_bg_short.gif +0 -0
- data/public/images/ie_shadow.png +0 -0
- data/public/images/journal_reflex.gif +0 -0
- data/public/images/journal_shadow.gif +0 -0
- data/public/images/logo_journal_small.bmp +0 -0
- data/public/images/logo_journal_small.png +0 -0
- data/public/images/page_edit_shadow.png +0 -0
- data/public/images/restore_bar.png +0 -0
- data/public/images/spinner.gif +0 -0
- data/public/javascripts/application.js +23 -0
- data/public/javascripts/controls.js +815 -0
- data/public/javascripts/dragdrop.js +913 -0
- data/public/javascripts/effects.js +958 -0
- data/public/javascripts/lowpro.js +307 -0
- data/public/javascripts/prototype.js +2006 -0
- data/public/robots.txt +1 -0
- data/public/stylesheets/compages.css +196 -0
- data/public/stylesheets/editing.css +180 -0
- data/public/stylesheets/editing_ie_filth.css +36 -0
- data/public/themes/Doc_basic/_script.js +342 -0
- data/public/themes/Doc_basic/images/Thumbs.db +0 -0
- data/public/themes/Doc_basic/images/search.gif +0 -0
- data/public/themes/Doc_basic/images/upld.gif +0 -0
- data/public/themes/Doc_basic/images/upld.jpg +0 -0
- data/public/themes/Doc_basic/index.html +114 -0
- data/public/themes/Doc_basic/style.css +1743 -0
- data/public/themes/color7boxes/default2.css +42 -0
- data/public/themes/color7boxes/index.html +40 -0
- data/public/themes/prova/index.html +12 -0
- data/public/zDoc/images/search.gif +0 -0
- data/public/zDoc/images/upld.gif +0 -0
- data/public/zDoc/images/upld.jpg +0 -0
- data/public/zDoc/index.html +176 -0
- data/public/zDoc/script.js +342 -0
- data/public/zDoc/style.css +1741 -0
- data/script/about +3 -0
- data/script/breakpointer +3 -0
- data/script/console +3 -0
- data/script/destroy +3 -0
- data/script/generate +3 -0
- data/script/performance/benchmarker +3 -0
- data/script/performance/profiler +3 -0
- data/script/plugin +3 -0
- data/script/process/reaper +3 -0
- data/script/process/spawner +3 -0
- data/script/runner +3 -0
- data/script/server +3 -0
- data/test/fixtures/contents.yml +5 -0
- data/test/fixtures/meta_datas.yml +5 -0
- data/test/fixtures/page_elements.yml +5 -0
- data/test/fixtures/pages.yml +5 -0
- data/test/functional/contents_controller_test.rb +18 -0
- data/test/functional/pages_controller_test.rb +18 -0
- data/test/functional/render_controller_test.rb +18 -0
- data/test/test_helper.rb +28 -0
- data/test/unit/content_test.rb +10 -0
- data/test/unit/meta_data_test.rb +10 -0
- data/test/unit/page_element_test.rb +10 -0
- data/test/unit/page_test.rb +10 -0
- data/tmp/sessions/ruby_sess.0ced4c30e36477ab +0 -0
- data/tmp/sessions/ruby_sess.20fbe26671422e70 +0 -0
- data/tmp/sessions/ruby_sess.2c72521f3a7e2ba9 +0 -0
- data/tmp/sessions/ruby_sess.4107a69d982a2eb7 +0 -0
- data/tmp/sessions/ruby_sess.573ded9c7fdd9035 +0 -0
- data/tmp/sessions/ruby_sess.5a9767815bb96258 +0 -0
- data/tmp/sessions/ruby_sess.85d723b794005388 +0 -0
- data/tmp/sessions/ruby_sess.875b3b3e3529afdb +0 -0
- data/tmp/sessions/ruby_sess.936766f3a397c88b +0 -0
- data/tmp/sessions/ruby_sess.984e2e4c9a2e7891 +0 -0
- data/tmp/sessions/ruby_sess.a1faebd7448bc45d +0 -0
- data/tmp/sessions/ruby_sess.a415768c7635bc15 +0 -0
- data/tmp/sessions/ruby_sess.b2dadcbe6c1b0add +0 -0
- data/tmp/sessions/ruby_sess.ca9100beb103a428 +0 -0
- data/tmp/sessions/ruby_sess.d649c800a046efde +0 -0
- data/tmp/sessions/ruby_sess.db73bbfafd5a537c +0 -0
- data/tmp/sessions/ruby_sess.e32487b847524df1 +0 -0
- data/tmp/sessions/ruby_sess.f4e45d67828cc437 +0 -0
- data/tmp/sessions/ruby_sess.f5a3f064f2f7a26f +0 -0
- data/tmp/sessions/ruby_sess.ff0c47b35f238cda +0 -0
- data/vendor/plugins/acts_as_urlnameable.tar.gz +0 -0
- data/vendor/plugins/acts_as_urlnameable/LICENSE +19 -0
- data/vendor/plugins/acts_as_urlnameable/README +193 -0
- data/vendor/plugins/acts_as_urlnameable/Rakefile +25 -0
- data/vendor/plugins/acts_as_urlnameable/TODO +5 -0
- data/vendor/plugins/acts_as_urlnameable/db/00x_add_urlnames_table.rb +15 -0
- data/vendor/plugins/acts_as_urlnameable/db/urlnames_table.sql +7 -0
- data/vendor/plugins/acts_as_urlnameable/doc/classes/ActiveRecord/Acts/Urlnameable/ClassMethods.html +167 -0
- data/vendor/plugins/acts_as_urlnameable/doc/classes/ActiveRecord/Acts/Urlnameable/InstanceMethods.html +213 -0
- data/vendor/plugins/acts_as_urlnameable/doc/classes/ActiveRecord/Acts/Urlnameable/SingletonMethods.html +189 -0
- data/vendor/plugins/acts_as_urlnameable/doc/created.rid +1 -0
- data/vendor/plugins/acts_as_urlnameable/doc/files/LICENSE.html +129 -0
- data/vendor/plugins/acts_as_urlnameable/doc/files/README.html +333 -0
- data/vendor/plugins/acts_as_urlnameable/doc/files/TODO.html +121 -0
- data/vendor/plugins/acts_as_urlnameable/doc/files/lib/acts_as_urlnameable_rb.html +101 -0
- data/vendor/plugins/acts_as_urlnameable/doc/fr_class_index.html +29 -0
- data/vendor/plugins/acts_as_urlnameable/doc/fr_file_index.html +30 -0
- data/vendor/plugins/acts_as_urlnameable/doc/fr_method_index.html +34 -0
- data/vendor/plugins/acts_as_urlnameable/doc/index.html +24 -0
- data/vendor/plugins/acts_as_urlnameable/doc/rdoc-style.css +208 -0
- data/vendor/plugins/acts_as_urlnameable/init.rb +3 -0
- data/vendor/plugins/acts_as_urlnameable/lib/acts_as_urlnameable.rb +159 -0
- data/vendor/plugins/acts_as_urlnameable/lib/urlname.rb +3 -0
- data/vendor/plugins/acts_as_urlnameable/test/acts_as_urlnameable_test.rb +233 -0
- data/vendor/plugins/acts_as_urlnameable/test/connection.rb +8 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/article.rb +13 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/articles.yml +62 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/page.rb +14 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/pages.yml +35 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/people.yml +9 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/person.rb +26 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/schema.rb +24 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/section.rb +5 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/sections.yml +9 -0
- data/vendor/plugins/acts_as_urlnameable/test/fixtures/urlnames.yml +153 -0
- data/vendor/plugins/acts_as_urlnameable/test/test_helper.rb +42 -0
- data/vendor/plugins/gems/README +30 -0
- data/vendor/plugins/gems/init.rb +9 -0
- data/vendor/plugins/gems/tasks/gems_tasks.rake +32 -0
- data/vendor/plugins/unobtrusive_javascript/CHANGELOG +72 -0
- data/vendor/plugins/unobtrusive_javascript/README +73 -0
- data/vendor/plugins/unobtrusive_javascript/Rakefile +33 -0
- data/vendor/plugins/unobtrusive_javascript/about.yml +6 -0
- data/vendor/plugins/unobtrusive_javascript/assets/javascripts/lowpro.js +307 -0
- data/vendor/plugins/unobtrusive_javascript/init.rb +21 -0
- data/vendor/plugins/unobtrusive_javascript/install.rb +1 -0
- data/vendor/plugins/unobtrusive_javascript/lib/actionview_helpers_patches.rb +17 -0
- data/vendor/plugins/unobtrusive_javascript/lib/asset_tag_helper_patches.rb +33 -0
- data/vendor/plugins/unobtrusive_javascript/lib/behaviour_caching.rb +70 -0
- data/vendor/plugins/unobtrusive_javascript/lib/controllers/unobtrusive_javascript_controller.rb +52 -0
- data/vendor/plugins/unobtrusive_javascript/lib/prototype_helper_patches.rb +72 -0
- data/vendor/plugins/unobtrusive_javascript/lib/scriptaculous_helper_patches.rb +62 -0
- data/vendor/plugins/unobtrusive_javascript/lib/tag_helper_patches.rb +37 -0
- data/vendor/plugins/unobtrusive_javascript/lib/ujs.rb +32 -0
- data/vendor/plugins/unobtrusive_javascript/lib/ujs/behaviour_helper.rb +62 -0
- data/vendor/plugins/unobtrusive_javascript/lib/ujs/behaviour_script.rb +54 -0
- data/vendor/plugins/unobtrusive_javascript/lib/ujs/behaviour_script_converter.rb +23 -0
- data/vendor/plugins/unobtrusive_javascript/lib/ujs/controller_methods.rb +55 -0
- data/vendor/plugins/unobtrusive_javascript/lib/ujs/helpers.rb +152 -0
- data/vendor/plugins/unobtrusive_javascript/lib/ujs/javascript_proxies.rb +57 -0
- data/vendor/plugins/unobtrusive_javascript/tasks/unobtrusive_javascript_tasks.rake +15 -0
- data/vendor/plugins/unobtrusive_javascript/test/asset_tag_helper_patches_test.rb +32 -0
- data/vendor/plugins/unobtrusive_javascript/test/behaviour_helper_test.rb +180 -0
- data/vendor/plugins/unobtrusive_javascript/test/behaviour_script_converter_test.rb +72 -0
- data/vendor/plugins/unobtrusive_javascript/test/behaviour_script_test.rb +98 -0
- data/vendor/plugins/unobtrusive_javascript/test/config/environment.rb +8 -0
- data/vendor/plugins/unobtrusive_javascript/test/config/routes.rb +4 -0
- data/vendor/plugins/unobtrusive_javascript/test/config/schema.rb +3 -0
- data/vendor/plugins/unobtrusive_javascript/test/controller_methods_test.rb +48 -0
- data/vendor/plugins/unobtrusive_javascript/test/helpers_test.rb +186 -0
- data/vendor/plugins/unobtrusive_javascript/test/javascript_proxies_test.rb +3 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/ptk/boot.rb +26 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/ptk/gem/action_controller.rb +11 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/ptk/gem/action_mailer.rb +4 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/ptk/gem/active_record.rb +27 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/ptk/gem/rails.rb +31 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/ptk/ptk.rb +148 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/ptk/suite/difference.rb +23 -0
- data/vendor/plugins/unobtrusive_javascript/test/lib/stubs/controller_stub.rb +10 -0
- data/vendor/plugins/unobtrusive_javascript/test/ptk_helper.rb +29 -0
- data/vendor/plugins/unobtrusive_javascript/test/tag_helper_patches_test.rb +59 -0
- data/vendor/plugins/unobtrusive_javascript/test/test_helper.rb +25 -0
- data/vendor/plugins/unobtrusive_javascript/test/unobtrusive_javascript_controller_test.rb +95 -0
- data/vendor/plugins/unobtrusive_javascript/uninstall.rb +1 -0
- data/vendor/redcloth/bin/redcloth +3 -0
- data/vendor/redcloth/doc/CHANGELOG +160 -0
- data/vendor/redcloth/doc/COPYING +25 -0
- data/vendor/redcloth/doc/README +106 -0
- data/vendor/redcloth/doc/REFERENCE +216 -0
- data/vendor/redcloth/doc/make.rb +359 -0
- data/vendor/redcloth/lib/redcloth.rb +1130 -0
- data/vendor/redcloth/run-tests.rb +28 -0
- data/vendor/redcloth/setup.rb +1376 -0
- data/vendor/redcloth/tests/code.yml +105 -0
- data/vendor/redcloth/tests/hard_breaks.yml +26 -0
- data/vendor/redcloth/tests/images.yml +171 -0
- data/vendor/redcloth/tests/instiki.yml +39 -0
- data/vendor/redcloth/tests/links.yml +155 -0
- data/vendor/redcloth/tests/lists.yml +77 -0
- data/vendor/redcloth/tests/markdown.yml +218 -0
- data/vendor/redcloth/tests/poignant.yml +64 -0
- data/vendor/redcloth/tests/table.yml +198 -0
- data/vendor/redcloth/tests/textism.yml +406 -0
- metadata +432 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
<div class="subtitle"><%= link_to "« Back", {:controller => "pages"}, :class=>"left"%> COMPAGES - LISTING PAGES </div>
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<div class="left_column column rborder" style="min-height:25em;">
|
|
6
|
+
<h2>Pages archive</h2>
|
|
7
|
+
<p><%= link_to_remote "Add a page »", :url=>{:action=>"create"}%>
|
|
8
|
+
<% unless @pages.empty? %>
|
|
9
|
+
<ol id="pages_listed">
|
|
10
|
+
<% for page in @pages %>
|
|
11
|
+
<% @page = page %>
|
|
12
|
+
<%= render :partial => "page_listed" %>
|
|
13
|
+
<% end %>
|
|
14
|
+
</ol>
|
|
15
|
+
<% else %>
|
|
16
|
+
<p> Currently there are no pages! Start creating the first one by clicking on
|
|
17
|
+
<em>Add a page ></em>.</p>
|
|
18
|
+
<% end %>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="right_column column">
|
|
24
|
+
<h2> Pages Help<i>!</i> </h2>
|
|
25
|
+
<p>Here are listed all the pages of the site, you can <em>edit the title by clicking
|
|
26
|
+
on it</em>.</p>
|
|
27
|
+
<p>To add a page to your site <em>click on “add a page”</em>.</p>
|
|
28
|
+
<p>To wipe out a page you can <em>click on “delete”</em>.</p>
|
|
29
|
+
|
|
30
|
+
<h2>Editing...</h2>
|
|
31
|
+
<p>To fill up a page with contents or review contets and layout of a page
|
|
32
|
+
<em>click on “edit”</em>.</p>
|
|
33
|
+
<p>By clicking on <em>edit</em> you'll be able to:
|
|
34
|
+
<ul>
|
|
35
|
+
<li>add, and/or remove contents from your page</li>
|
|
36
|
+
<li>change the position of the contents within the page</li>
|
|
37
|
+
<li>chose the theme of your page</li>
|
|
38
|
+
</ul>
|
|
39
|
+
|
|
40
|
+
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<h1 class="main_title">COMPAGES</h1>
|
|
2
|
+
|
|
3
|
+
<div id="subtitle">
|
|
4
|
+
A content management system
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
<div id="left_column" class="column">
|
|
9
|
+
<h2>What you can do now?</h2>
|
|
10
|
+
<p>
|
|
11
|
+
If you don't know where to start you can click on "Manage your pages" to create your first sitepage.
|
|
12
|
+
<ol>
|
|
13
|
+
<li><%= link_to "Manage your pages", :action => "index" %>Manage your pages</li>
|
|
14
|
+
<li>Browse Content Library</li>
|
|
15
|
+
<li>View the site onlilne</li>
|
|
16
|
+
</ol>
|
|
17
|
+
|
|
18
|
+
</p>
|
|
19
|
+
</div>
|
|
20
|
+
<div id="right_column" class="column">
|
|
21
|
+
<h2>What is Compages</h2>
|
|
22
|
+
<p>
|
|
23
|
+
Compages is a web applicatio that hepls you to build and maintain your content site.
|
|
24
|
+
</p>
|
|
25
|
+
<p class="signature"> Elia Schito (author of Compages)</p>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="clear"/> </div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= @page.render :edit %>
|
data/bin/compages
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require 'rubygems'
|
|
4
|
+
require 'rails-installer'
|
|
5
|
+
|
|
6
|
+
class AppInstaller < RailsInstaller
|
|
7
|
+
application_name 'compages'
|
|
8
|
+
support_location 'http://code.google.com/p/compages/'
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
directory = ARGV[1]
|
|
12
|
+
|
|
13
|
+
app = AppInstaller.new(directory)
|
|
14
|
+
app.execute_command(*ARGV)
|
data/config/boot.rb
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
|
|
2
|
+
|
|
3
|
+
unless defined?(RAILS_ROOT)
|
|
4
|
+
root_path = File.join(File.dirname(__FILE__), '..')
|
|
5
|
+
|
|
6
|
+
unless RUBY_PLATFORM =~ /mswin32/
|
|
7
|
+
require 'pathname'
|
|
8
|
+
root_path = Pathname.new(root_path).cleanpath(true).to_s
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
RAILS_ROOT = root_path
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
unless defined?(Rails::Initializer)
|
|
15
|
+
if File.directory?("#{RAILS_ROOT}/vendor/rails")
|
|
16
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
|
17
|
+
else
|
|
18
|
+
require 'rubygems'
|
|
19
|
+
|
|
20
|
+
environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join
|
|
21
|
+
environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/
|
|
22
|
+
rails_gem_version = $1
|
|
23
|
+
|
|
24
|
+
if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
|
|
25
|
+
rails_gem = Gem.cache.search('rails', "=#{version}").first
|
|
26
|
+
|
|
27
|
+
if rails_gem
|
|
28
|
+
require_gem "rails", "=#{version}"
|
|
29
|
+
require rails_gem.full_gem_path + '/lib/initializer'
|
|
30
|
+
else
|
|
31
|
+
STDERR.puts %(Cannot find gem for Rails =#{version}:
|
|
32
|
+
Install the missing gem with 'gem install -v=#{version} rails', or
|
|
33
|
+
change environment.rb to define RAILS_GEM_VERSION with your desired version.
|
|
34
|
+
)
|
|
35
|
+
exit 1
|
|
36
|
+
end
|
|
37
|
+
else
|
|
38
|
+
require_gem "rails"
|
|
39
|
+
require 'initializer'
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
Rails::Initializer.run(:set_load_path)
|
|
44
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# MySQL (default setup). Versions 4.1 and 5.0 are recommended.
|
|
2
|
+
#
|
|
3
|
+
# Install the MySQL driver:
|
|
4
|
+
# gem install mysql
|
|
5
|
+
# On MacOS X:
|
|
6
|
+
# gem install mysql -- --include=/usr/local/lib
|
|
7
|
+
# On Windows:
|
|
8
|
+
# There is no gem for Windows. Install mysql.so from RubyForApache.
|
|
9
|
+
# http://rubyforge.org/projects/rubyforapache
|
|
10
|
+
#
|
|
11
|
+
# And be sure to use new-style password hashing:
|
|
12
|
+
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
|
13
|
+
development:
|
|
14
|
+
adapter: mysql
|
|
15
|
+
database: compages_development
|
|
16
|
+
username: root
|
|
17
|
+
password:
|
|
18
|
+
host: localhost
|
|
19
|
+
|
|
20
|
+
# Warning: The database defined as 'test' will be erased and
|
|
21
|
+
# re-generated from your development database when you run 'rake'.
|
|
22
|
+
# Do not set this db to the same as development or production.
|
|
23
|
+
test:
|
|
24
|
+
adapter: mysql
|
|
25
|
+
database: compages_test
|
|
26
|
+
username: root
|
|
27
|
+
password:
|
|
28
|
+
host: localhost
|
|
29
|
+
|
|
30
|
+
production:
|
|
31
|
+
adapter: mysql
|
|
32
|
+
database: compages_production
|
|
33
|
+
username: root
|
|
34
|
+
password:
|
|
35
|
+
host: localhost
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Be sure to restart your web server when you modify this file.
|
|
2
|
+
|
|
3
|
+
# Uncomment below to force Rails into production mode when
|
|
4
|
+
# you don't control web/app server and can't set it the proper way
|
|
5
|
+
# ENV['RAILS_ENV'] ||= 'production'
|
|
6
|
+
|
|
7
|
+
# Specifies gem version of Rails to use when vendor/rails is not present
|
|
8
|
+
RAILS_GEM_VERSION = '1.1.6'
|
|
9
|
+
|
|
10
|
+
# Bootstrap the Rails environment, frameworks, and default configuration
|
|
11
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
|
12
|
+
|
|
13
|
+
Rails::Initializer.run do |config|
|
|
14
|
+
# Settings in config/environments/* take precedence those specified here
|
|
15
|
+
|
|
16
|
+
# Skip frameworks you're not going to use
|
|
17
|
+
# config.frameworks -= [ :action_web_service, :action_mailer ]
|
|
18
|
+
|
|
19
|
+
# Add additional load paths for your own custom dirs
|
|
20
|
+
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
|
21
|
+
|
|
22
|
+
# Force all environments to use the same logger level
|
|
23
|
+
# (by default production uses :info, the others :debug)
|
|
24
|
+
# config.log_level = :debug
|
|
25
|
+
|
|
26
|
+
# Use the database for sessions instead of the file system
|
|
27
|
+
# (create the session table with 'rake db:sessions:create')
|
|
28
|
+
# config.action_controller.session_store = :active_record_store
|
|
29
|
+
|
|
30
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
|
31
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
|
32
|
+
# like if you have constraints or database-specific column types
|
|
33
|
+
# config.active_record.schema_format = :sql
|
|
34
|
+
|
|
35
|
+
# Activate observers that should always be running
|
|
36
|
+
# config.active_record.observers = :cacher, :garbage_collector
|
|
37
|
+
|
|
38
|
+
# Make Active Record use UTC-base instead of local time
|
|
39
|
+
# config.active_record.default_timezone = :utc
|
|
40
|
+
|
|
41
|
+
# See Rails::Configuration for more options
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Add new inflection rules using the following format
|
|
45
|
+
# (all these examples are active by default):
|
|
46
|
+
# Inflector.inflections do |inflect|
|
|
47
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
|
48
|
+
# inflect.singular /^(ox)en/i, '\1'
|
|
49
|
+
# inflect.irregular 'person', 'people'
|
|
50
|
+
# inflect.uncountable %w( fish sheep )
|
|
51
|
+
# end
|
|
52
|
+
|
|
53
|
+
# Include your application configuration below
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
# Enable the breakpoint server that script/breakpointer connects to
|
|
12
|
+
config.breakpoint_server = true
|
|
13
|
+
|
|
14
|
+
# Show full error reports and disable caching
|
|
15
|
+
config.action_controller.consider_all_requests_local = true
|
|
16
|
+
config.action_controller.perform_caching = false
|
|
17
|
+
config.action_view.cache_template_extensions = false
|
|
18
|
+
config.action_view.debug_rjs = true
|
|
19
|
+
|
|
20
|
+
# Don't care if the mailer can't send
|
|
21
|
+
config.action_mailer.raise_delivery_errors = false
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
# Use a different logger for distributed setups
|
|
8
|
+
# config.logger = SyslogLogger.new
|
|
9
|
+
|
|
10
|
+
# Full error reports are disabled and caching is turned on
|
|
11
|
+
config.action_controller.consider_all_requests_local = false
|
|
12
|
+
config.action_controller.perform_caching = true
|
|
13
|
+
|
|
14
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
|
15
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
|
16
|
+
|
|
17
|
+
# Disable delivery errors if you bad email addresses should just be ignored
|
|
18
|
+
# config.action_mailer.raise_delivery_errors = false
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
|
|
16
|
+
# Tell ActionMailer not to deliver emails to the real world.
|
|
17
|
+
# The :test delivery method accumulates sent emails in the
|
|
18
|
+
# ActionMailer::Base.deliveries array.
|
|
19
|
+
config.action_mailer.delivery_method = :test
|
data/config/routes.rb
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
ActionController::Routing::Routes.draw do |map|
|
|
2
|
+
|
|
3
|
+
UJS::routes
|
|
4
|
+
|
|
5
|
+
# The priority is based upon order of creation: first created -> highest priority.
|
|
6
|
+
|
|
7
|
+
# Sample of regular route:
|
|
8
|
+
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
|
|
9
|
+
# Keep in mind you can assign values other than :controller and :action
|
|
10
|
+
|
|
11
|
+
# Sample of named route:
|
|
12
|
+
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
|
|
13
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
|
14
|
+
|
|
15
|
+
# You can have the root of your site routed by hooking up ''
|
|
16
|
+
# -- just remember to delete public/index.html.
|
|
17
|
+
|
|
18
|
+
# Allow downloading Web Service WSDL as a file with an extension
|
|
19
|
+
# instead of a file named 'wsdl'
|
|
20
|
+
# map.connect ':controller/service.wsdl', :action => 'wsdl'
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# Install the default route as the lowest priority.
|
|
24
|
+
map.connect '', :controller => "render"
|
|
25
|
+
map.connect 'admin', :controller => "pages"
|
|
26
|
+
map.connect 'admin/:controller/:action/:id', :controller => "pages"
|
|
27
|
+
map.connect ':urlname', :controller => "render", :action=>"show" #,
|
|
28
|
+
# :requirements => {:urlname => /([^a][^d][^m][^i][^n][^\/]).*/ }
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# This file is autogenerated. Instead of editing this file, please use the
|
|
2
|
+
# migrations feature of ActiveRecord to incrementally modify your database, and
|
|
3
|
+
# then regenerate this schema definition.
|
|
4
|
+
|
|
5
|
+
ActiveRecord::Schema.define(:version => 6) do
|
|
6
|
+
|
|
7
|
+
create_table "contents", :force => true do |t|
|
|
8
|
+
t.column "body", :text
|
|
9
|
+
t.column "content_type", :string
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
create_table "meta_datas", :force => true do |t|
|
|
13
|
+
t.column "content_id", :integer, :default => 0, :null => false
|
|
14
|
+
t.column "key", :string, :default => "", :null => false
|
|
15
|
+
t.column "value", :string
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
add_index "meta_datas", ["content_id"], :name => "meta_datas_content_id_index"
|
|
19
|
+
|
|
20
|
+
create_table "page_elements", :force => true do |t|
|
|
21
|
+
t.column "page_id", :integer, :default => 0, :null => false
|
|
22
|
+
t.column "content_id", :integer, :default => 0, :null => false
|
|
23
|
+
t.column "area_name", :string
|
|
24
|
+
t.column "position", :integer
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
add_index "page_elements", ["area_name", "position"], :name => "page_elements_area_name_index"
|
|
28
|
+
|
|
29
|
+
create_table "pages", :force => true do |t|
|
|
30
|
+
t.column "title", :string, :default => "", :null => false
|
|
31
|
+
t.column "theme_name", :string
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
create_table "sessions", :force => true do |t|
|
|
35
|
+
t.column "session_id", :string
|
|
36
|
+
t.column "data", :text
|
|
37
|
+
t.column "updated_at", :datetime
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
add_index "sessions", ["session_id"], :name => "sessions_session_id_index"
|
|
41
|
+
|
|
42
|
+
create_table "urlnames", :force => true do |t|
|
|
43
|
+
t.column "nameable_type", :string
|
|
44
|
+
t.column "nameable_id", :integer
|
|
45
|
+
t.column "name", :string
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
class CreateMetaDatas < ActiveRecord::Migration
|
|
2
|
+
def self.up
|
|
3
|
+
create_table :meta_datas do |t|
|
|
4
|
+
t.column :content_id, :integer, :null => false
|
|
5
|
+
t.column :key, :string, :null => false
|
|
6
|
+
t.column :value, :string, :limit => 255
|
|
7
|
+
end
|
|
8
|
+
add_index :meta_datas, :content_id
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def self.down
|
|
12
|
+
drop_table :meta_datas
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class CreatePageElements < ActiveRecord::Migration
|
|
2
|
+
def self.up
|
|
3
|
+
create_table :page_elements do |t|
|
|
4
|
+
t.column :page_id, :integer, :null => false
|
|
5
|
+
t.column :content_id, :integer, :null => false
|
|
6
|
+
t.column :area_name, :string
|
|
7
|
+
t.column :position, :integer
|
|
8
|
+
end
|
|
9
|
+
add_index :page_elements, :area_name
|
|
10
|
+
add_index :page_elements, :position
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def self.down
|
|
14
|
+
# remove_index :page_elements
|
|
15
|
+
drop_table :page_elements
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class AddUrlnames < ActiveRecord::Migration # :nodoc:
|
|
2
|
+
|
|
3
|
+
def self.up
|
|
4
|
+
create_table 'urlnames' do |t|
|
|
5
|
+
t.column 'nameable_type', :string
|
|
6
|
+
t.column 'nameable_id', :integer
|
|
7
|
+
t.column 'name', :string
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def self.down
|
|
12
|
+
drop_table 'urlnames'
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
end
|