radiant 1.0.0.rc3 → 1.0.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of radiant might be problematic. Click here for more details.
- data/.gitignore +1 -1
- data/CHANGELOG.md +172 -4
- data/CONTRIBUTORS.md +13 -0
- data/Gemfile +6 -4
- data/Gemfile.lock +3 -3
- data/INSTALL.md +2 -2
- data/README.md +1 -1
- data/Rakefile +2 -1
- data/app/controllers/admin/pages_controller.rb +2 -0
- data/app/helpers/admin/node_helper.rb +5 -42
- data/app/helpers/admin/resource_helper.rb +2 -0
- data/app/models/file_not_found_page.rb +1 -1
- data/app/models/menu_renderer.rb +133 -0
- data/app/models/page.rb +10 -10
- data/app/models/radiant/config.rb +2 -1
- data/app/models/standard_tags.rb +15 -3
- data/app/views/admin/pages/_node.html.haml +3 -3
- data/bin/ci/before_script +13 -0
- data/bin/radiant +0 -2
- data/config.ru +2 -0
- data/config/boot.rb +0 -1
- data/config/cucumber.yml +1 -1
- data/config/environment.rb +2 -0
- data/config/initializers/radiant_config.rb +1 -1
- data/config/initializers/rails_patch.rb +2 -0
- data/config/locales/en.yml +4 -1
- data/config/preinitializer.rb +1 -1
- data/db/migrate/20110902203823_add_allowed_children_cache_to_pages.rb +13 -0
- data/db/migrate/20111016150725_extend_page_part_content_limit.rb +15 -0
- data/db/radiant_dev.db.default +0 -0
- data/db/radiant_dev.db.high_five +0 -0
- data/db/schema.rb +8 -7
- data/features/admin/pages_management.feature +5 -15
- data/features/step_definitions/admin/pages_management_steps.rb +17 -0
- data/lib/generators/extension/templates/tasks.rake +0 -8
- data/lib/generators/instance/instance_generator.rb +2 -3
- data/lib/generators/instance/templates/instance_gemfile +22 -22
- data/lib/generators/language_extension/language_extension_generator.rb +22 -0
- data/lib/generators/language_extension/templates/available_tags.yml +1 -1
- data/lib/generators/language_extension/templates/extension.rb +9 -5
- data/lib/generators/language_extension/templates/gemspec.rb +24 -0
- data/lib/generators/language_extension/templates/lang.yml +1 -1
- data/lib/generators/language_extension/templates/lib.rb +8 -0
- data/lib/plugins/string_extensions/lib/string_extensions.rb +3 -1
- data/lib/radiant.rb +1 -1
- data/lib/radiant/admin_ui/region_partials.rb +5 -0
- data/lib/radiant/cache.rb +2 -1
- data/lib/radiant/extension/script.rb +3 -3
- data/lib/radiant/extension_loader.rb +4 -2
- data/lib/radiant/extension_path.rb +10 -2
- data/lib/radiant/initializer.rb +10 -14
- data/lib/radiant/resource_responses.rb +6 -0
- data/lib/radiant/setup.rb +5 -2
- data/lib/radiant/taggable.rb +7 -1
- data/lib/tasks/cucumber.rake +6 -0
- data/lib/tasks/database.rake +9 -5
- data/lib/tasks/extensions.rake +2 -17
- data/lib/tasks/framework.rake +52 -31
- data/public/javascripts/admin/assets.js +296 -0
- data/public/javascripts/application.js +2 -0
- data/public/javascripts/controls.js +963 -0
- data/public/javascripts/dragdrop.js +973 -0
- data/public/javascripts/effects.js +1128 -0
- data/public/javascripts/prototype.js +4320 -0
- data/public/stylesheets/admin/main.css +1 -1
- data/public/stylesheets/sass/admin/assets.sass +209 -0
- data/radiant.gemspec +33 -34
- data/spec/ci/database.mysql.yml +7 -0
- data/spec/ci/database.postgresql.yml +7 -0
- data/spec/ci/database.sqlite.yml +6 -0
- data/spec/controllers/site_controller_spec.rb +2 -2
- data/spec/datasets/config_dataset.rb +3 -2
- data/spec/datasets/home_page_dataset.rb +1 -1
- data/spec/datasets/layouts_dataset.rb +1 -1
- data/spec/datasets/snippets_dataset.rb +1 -1
- data/spec/generators/instance_generator_spec.rb +5 -11
- data/spec/helpers/admin/node_helper_spec.rb +1 -50
- data/spec/helpers/admin/regions_helper_spec.rb +1 -1
- data/spec/lib/radiant/admin_ui/region_partials_spec.rb +1 -1
- data/spec/lib/radiant/initializer_spec.rb +2 -7
- data/spec/lib/radiant/resource_responses_spec.rb +1 -1
- data/spec/lib/radiant/taggable_spec.rb +1 -1
- data/spec/lib/task_support_spec.rb +1 -0
- data/spec/models/menu_renderer_spec.rb +297 -0
- data/spec/models/page_spec.rb +21 -8
- data/spec/models/standard_tags_spec.rb +6 -2
- data/test/fixtures/extensions/basic/app/helpers/basic_extension_helper.rb +2 -0
- data/testthegemgeneration/CHANGELOG.md +721 -0
- data/testthegemgeneration/CONTRIBUTORS.md +257 -0
- data/testthegemgeneration/Gemfile +57 -0
- data/testthegemgeneration/Gemfile.lock +107 -0
- data/testthegemgeneration/INSTALL.md +42 -0
- data/testthegemgeneration/LICENSE.md +21 -0
- data/testthegemgeneration/README.md +84 -0
- data/testthegemgeneration/Rakefile +3 -0
- data/testthegemgeneration/config.ru +2 -0
- data/testthegemgeneration/config/boot.rb +122 -0
- data/testthegemgeneration/config/cucumber.yml +7 -0
- data/testthegemgeneration/config/database.yml +16 -0
- data/testthegemgeneration/config/environment.rb +81 -0
- data/testthegemgeneration/config/environments/cucumber.rb +22 -0
- data/testthegemgeneration/config/environments/development.rb +17 -0
- data/testthegemgeneration/config/environments/production.rb +24 -0
- data/testthegemgeneration/config/environments/test.rb +32 -0
- data/testthegemgeneration/config/initializers/radiant_config.rb +16 -0
- data/testthegemgeneration/config/preinitializer.rb +19 -0
- data/testthegemgeneration/config/routes.rb +1 -0
- data/testthegemgeneration/db/development.sqlite3.db +0 -0
- data/testthegemgeneration/db/schema.rb +142 -0
- data/testthegemgeneration/log/development.log +1055 -0
- data/testthegemgeneration/public/404.html +8 -0
- data/testthegemgeneration/public/500.html +8 -0
- data/testthegemgeneration/public/dispatch.cgi +10 -0
- data/testthegemgeneration/public/dispatch.fcgi +24 -0
- data/testthegemgeneration/public/dispatch.rb +10 -0
- data/testthegemgeneration/public/favicon.ico +0 -0
- data/testthegemgeneration/public/flash/ZeroClipboard.swf +0 -0
- data/testthegemgeneration/public/images/admin/add_tab.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/add.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/archive_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/audio_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/audio_thumbnail.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/c_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/copy.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/css_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/database_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/delete.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/document_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/document_thumbnail.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/flash_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/flash_thumbnail.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/font_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/gzip_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/html_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/image_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/image_thumbnail.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/java_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/page_edit.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/perl_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/php_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/presentation_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/python_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/reorder_assets.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/ruby_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/script_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/spreadsheet_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/tar_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/unknown_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/unknown_thumbnail.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/video_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/video_thumbnail.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/xml_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/assets/zip_icon.png +0 -0
- data/testthegemgeneration/public/images/admin/avatar_32x32.png +0 -0
- data/testthegemgeneration/public/images/admin/avatar_64x64.png +0 -0
- data/testthegemgeneration/public/images/admin/avatar_96x96.png +0 -0
- data/testthegemgeneration/public/images/admin/brown_bottom_line.gif +0 -0
- data/testthegemgeneration/public/images/admin/calendar_down.gif +0 -0
- data/testthegemgeneration/public/images/admin/collapse.png +0 -0
- data/testthegemgeneration/public/images/admin/draft_page.png +0 -0
- data/testthegemgeneration/public/images/admin/expand.png +0 -0
- data/testthegemgeneration/public/images/admin/image.png +0 -0
- data/testthegemgeneration/public/images/admin/javascript.png +0 -0
- data/testthegemgeneration/public/images/admin/layout.png +0 -0
- data/testthegemgeneration/public/images/admin/metadata_toggle.png +0 -0
- data/testthegemgeneration/public/images/admin/minus.png +0 -0
- data/testthegemgeneration/public/images/admin/minus_disabled.png +0 -0
- data/testthegemgeneration/public/images/admin/minus_grey.png +0 -0
- data/testthegemgeneration/public/images/admin/navigation_secondary_separator.gif +0 -0
- data/testthegemgeneration/public/images/admin/page.png +0 -0
- data/testthegemgeneration/public/images/admin/plus.png +0 -0
- data/testthegemgeneration/public/images/admin/plus_disabled.png +0 -0
- data/testthegemgeneration/public/images/admin/plus_grey.png +0 -0
- data/testthegemgeneration/public/images/admin/popup_border_background.png +0 -0
- data/testthegemgeneration/public/images/admin/popup_border_bottom_left.png +0 -0
- data/testthegemgeneration/public/images/admin/popup_border_bottom_right.png +0 -0
- data/testthegemgeneration/public/images/admin/popup_border_top_left.png +0 -0
- data/testthegemgeneration/public/images/admin/popup_border_top_right.png +0 -0
- data/testthegemgeneration/public/images/admin/search.png +0 -0
- data/testthegemgeneration/public/images/admin/single_form_shadow.png +0 -0
- data/testthegemgeneration/public/images/admin/snippet.png +0 -0
- data/testthegemgeneration/public/images/admin/spinner.gif +0 -0
- data/testthegemgeneration/public/images/admin/status_background.png +0 -0
- data/testthegemgeneration/public/images/admin/status_bottom_left.png +0 -0
- data/testthegemgeneration/public/images/admin/status_bottom_right.png +0 -0
- data/testthegemgeneration/public/images/admin/status_spinner.gif +0 -0
- data/testthegemgeneration/public/images/admin/status_top_left.png +0 -0
- data/testthegemgeneration/public/images/admin/status_top_right.png +0 -0
- data/testthegemgeneration/public/images/admin/stylesheet.png +0 -0
- data/testthegemgeneration/public/images/admin/tab_close.png +0 -0
- data/testthegemgeneration/public/images/admin/upload.png +0 -0
- data/testthegemgeneration/public/images/admin/virtual_page.png +0 -0
- data/testthegemgeneration/public/images/radiant/radiant-badge-color.png +0 -0
- data/testthegemgeneration/public/images/roasters/banner.jpg +0 -0
- data/testthegemgeneration/public/images/roasters/closelabel.gif +0 -0
- data/testthegemgeneration/public/images/roasters/comment.png +0 -0
- data/testthegemgeneration/public/images/roasters/gallery1.jpg +0 -0
- data/testthegemgeneration/public/images/roasters/gallery2.jpg +0 -0
- data/testthegemgeneration/public/images/roasters/gallery3.jpg +0 -0
- data/testthegemgeneration/public/images/roasters/gallery4.jpg +0 -0
- data/testthegemgeneration/public/images/roasters/gift.gif +0 -0
- data/testthegemgeneration/public/images/roasters/green.gif +0 -0
- data/testthegemgeneration/public/images/roasters/nav-background.gif +0 -0
- data/testthegemgeneration/public/images/roasters/nav-divider.gif +0 -0
- data/testthegemgeneration/public/images/roasters/nextlabel.gif +0 -0
- data/testthegemgeneration/public/images/roasters/open.gif +0 -0
- data/testthegemgeneration/public/images/roasters/preview-1.jpg +0 -0
- data/testthegemgeneration/public/images/roasters/preview.jpg +0 -0
- data/testthegemgeneration/public/images/roasters/prevlabel.gif +0 -0
- data/testthegemgeneration/public/images/roasters/prize.gif +0 -0
- data/testthegemgeneration/public/images/roasters/recycle.gif +0 -0
- data/testthegemgeneration/public/images/roasters/rss.gif +0 -0
- data/testthegemgeneration/public/images/roasters/thumb-grinder.jpg +0 -0
- data/testthegemgeneration/public/images/roasters/thumb-grower.jpg +0 -0
- data/testthegemgeneration/public/images/roasters/thumb-roaster.jpg +0 -0
- data/testthegemgeneration/public/images/roasters/truck.gif +0 -0
- data/testthegemgeneration/public/javascripts/admin/application.js +94 -0
- data/testthegemgeneration/public/javascripts/admin/assets.js +296 -0
- data/testthegemgeneration/public/javascripts/admin/codearea.js +165 -0
- data/testthegemgeneration/public/javascripts/admin/controls.js +965 -0
- data/testthegemgeneration/public/javascripts/admin/cookie.js +80 -0
- data/testthegemgeneration/public/javascripts/admin/dateinput.js +402 -0
- data/testthegemgeneration/public/javascripts/admin/dragdrop.js +974 -0
- data/testthegemgeneration/public/javascripts/admin/dropdown.js +216 -0
- data/testthegemgeneration/public/javascripts/admin/effects.js +1122 -0
- data/testthegemgeneration/public/javascripts/admin/lowpro.js +340 -0
- data/testthegemgeneration/public/javascripts/admin/overrides.js +1 -0
- data/testthegemgeneration/public/javascripts/admin/page_preview.js +41 -0
- data/testthegemgeneration/public/javascripts/admin/pagefield.js +54 -0
- data/testthegemgeneration/public/javascripts/admin/pagestatus.js +17 -0
- data/testthegemgeneration/public/javascripts/admin/popup.js +339 -0
- data/testthegemgeneration/public/javascripts/admin/prototype.js +4874 -0
- data/testthegemgeneration/public/javascripts/admin/ruledtable.js +13 -0
- data/testthegemgeneration/public/javascripts/admin/shortcuts.js +27 -0
- data/testthegemgeneration/public/javascripts/admin/sitemap.js +149 -0
- data/testthegemgeneration/public/javascripts/admin/status.js +233 -0
- data/testthegemgeneration/public/javascripts/admin/tabcontrol.js +123 -0
- data/testthegemgeneration/public/javascripts/admin/toggle.js +430 -0
- data/testthegemgeneration/public/javascripts/admin/utility.js +53 -0
- data/testthegemgeneration/public/javascripts/admin/validationerror.js +18 -0
- data/testthegemgeneration/public/javascripts/application.js +2 -0
- data/testthegemgeneration/public/javascripts/controls.js +963 -0
- data/testthegemgeneration/public/javascripts/dragdrop.js +973 -0
- data/testthegemgeneration/public/javascripts/effects.js +1128 -0
- data/testthegemgeneration/public/javascripts/prototype.js +4320 -0
- data/testthegemgeneration/public/loading-iframe.html +11 -0
- data/testthegemgeneration/public/robots.txt +1 -0
- data/testthegemgeneration/public/stylesheets/admin/assets.css +1 -0
- data/testthegemgeneration/public/stylesheets/admin/main.css +1 -0
- data/testthegemgeneration/public/stylesheets/admin/overrides.css +0 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/_base.sass +17 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/assets.sass +209 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/main.sass +27 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/modules/_boxes.sass +6 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/modules/_links.sass +18 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/overrides.sass +2 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_actions.sass +96 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_avatars.sass +10 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_content.sass +58 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_dateinput.sass +62 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_deprecated.sass +55 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_dropdown.sass +28 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_footer.sass +12 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_forms.sass +322 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_header.sass +114 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_index.sass +147 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_layout.sass +10 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_messages.sass +10 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_popup.sass +213 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_tabcontrol.sass +72 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_toolbar.sass +31 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_typography.sass +60 -0
- data/testthegemgeneration/public/stylesheets/sass/admin/partials/_validations.sass +19 -0
- data/testthegemgeneration/script/about +4 -0
- data/testthegemgeneration/script/autospec +5 -0
- data/testthegemgeneration/script/breakpointer +3 -0
- data/testthegemgeneration/script/console +3 -0
- data/testthegemgeneration/script/cucumber +10 -0
- data/testthegemgeneration/script/dbconsole +3 -0
- data/testthegemgeneration/script/extension +5 -0
- data/testthegemgeneration/script/generate +6 -0
- data/testthegemgeneration/script/performance/benchmarker +3 -0
- data/testthegemgeneration/script/performance/profiler +3 -0
- data/testthegemgeneration/script/performance/request +3 -0
- data/testthegemgeneration/script/process/inspector +3 -0
- data/testthegemgeneration/script/process/reaper +3 -0
- data/testthegemgeneration/script/process/spawner +3 -0
- data/testthegemgeneration/script/process/spinner +3 -0
- data/testthegemgeneration/script/runner +3 -0
- data/testthegemgeneration/script/server +3 -0
- data/testthegemgeneration/script/spec +5 -0
- data/testthegemgeneration/script/spec_server +116 -0
- data/testthegemgeneration/script/version +5 -0
- data/testthegemgeneration/tmp/radiant_config_cache.txt +0 -0
- metadata +845 -133
- data/public/stylesheets/admin/base.css +0 -1
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,26 +2,193 @@
|
|
2
2
|
|
3
3
|
## Edge
|
4
4
|
|
5
|
-
*
|
5
|
+
* Ruby 1.9.3 compatibility [Jim Gay]
|
6
|
+
* Allow page menus to be overridden by additional modules [Jim Gay]
|
7
|
+
* Add migration to not crop page part content > 64kB in MySql and MSSQL [Benny Degezelle]
|
8
|
+
* Add r:site:title, r:site:domain and r:site:dev_domain [Benny Degezelle]
|
9
|
+
* Polish language pack generation [Benny Degezelle]
|
10
|
+
* 1.9.2 compatibility [Johannes Fahrenkrug, John Muhl]
|
11
|
+
* Fix view_path order [William Ross]
|
12
|
+
* Extension rake task files loaded directly: no need to copy on update [William Ross]
|
13
|
+
* Fake published_at on preview, if necessary [William Ross]
|
14
|
+
* Ignore the generated admin stylesheets [jsntv200]
|
15
|
+
* No need to boot Radiant during instance generation [jsntv200]
|
16
|
+
* Rake test:extensions uses new extension loader [William Ross]
|
17
|
+
* Rake spec:extensions updated [William Ross]
|
18
|
+
* Don't disable ActionMailer [John Muhl]
|
19
|
+
* Use example.com as the example sites [Jim Gay]
|
20
|
+
* Allow the upgrade from an existing instance with no Gemfile [Jim Gay]
|
21
|
+
* Fixed bootstrap so that migrations run from Radiant.root/db/migrate [William Ross]
|
22
|
+
* Add config.ru for racking up in eg. Pow [William Ross]
|
23
|
+
* Remove the extension post_install_message [jsntv200]
|
24
|
+
* Extensions should require the module not the version [jsntv200]
|
25
|
+
* Fix rake radiant:update by setting the missing variables [jsntv200]
|
26
|
+
* Update rails binaries [Jim Gay]
|
27
|
+
* Make PreviewStop exception explicit in purpose [Jim Gay]
|
28
|
+
* Bundler instructions at the end of bootstrap [William Ross]
|
29
|
+
* Less maintenance required in instance generator [William Ross]
|
30
|
+
* Add extension root to autoload paths [William Ross]
|
31
|
+
* Refactored extension loader [William Ross]
|
32
|
+
* Extension generator updated for bundler compatibility [William Ross]
|
33
|
+
* Add extension models, controllers and helpers to eager-load paths. [William Ross]
|
34
|
+
* Explicit initialize_nav call to help test extensions [William Ross]
|
35
|
+
* Instance mode uses Bundler [William Ross]
|
36
|
+
* De-vendor Rails [William Ross]
|
37
|
+
* Old CI tasks removed [William Ross]
|
38
|
+
* Other text files markdowned, generator and tests updated [William Ross]
|
39
|
+
* README in markdown with Travis badge [William Ross]
|
40
|
+
* Setup Travis CI [John Muhl]
|
41
|
+
* Add Bundler support [William Ross, Michal Cichra, Edmund Haselwanter]
|
42
|
+
* Add sqlite and zentest as dev. dependencies [John Muhl]
|
43
|
+
* Dev site should show draft and hidden pages [Jim Gay]
|
44
|
+
* Better duplicate-config error reporting [William Ross]
|
45
|
+
* Alter the environment path when running tests from RADIANT_ROOT [Jim Gay]
|
46
|
+
* De-submodule built-in extensions and language packs, depend on gems instead [John Muhl, jsntv200]
|
47
|
+
* Fixed "dev?" method so that pre-pending hostname with "dev." works. [Wes Gamble]
|
48
|
+
* No need to migrate extensions after loading schema [William Ross]
|
49
|
+
* Load templates from gems [Jim Gay]
|
50
|
+
* Require all extension explicitly [Jim Gay]
|
51
|
+
* De-vendor acts_as_tree, highline, rack-cache, radius, RedCloth [William Ross, John Muhl, jsntv200]
|
52
|
+
* Removed custom pluralize method in the application helper. [Michael Stalker]
|
53
|
+
* Reflect sqlite default in help output [John Muhl]
|
54
|
+
* Fix import task name [Jim Gay]
|
55
|
+
* Newextension.replaces("OldExtension") to inherit matching migrations [William Ross]
|
56
|
+
* Make sqlite the default database. closes #224 [John Muhl]
|
57
|
+
* Deprecating r:url family of tags [William Ross]
|
58
|
+
* Explicitly load will_paginate in resource controller [Jim Gay]
|
59
|
+
* Check for @current_tab [jsntv200]
|
60
|
+
* Properly load features files in generated extension gemspecs [Jim Gay]
|
61
|
+
* Alter compass initializer to load from tmp/stylesheets [Jim Gay]
|
62
|
+
* Allow content areas without a 'page_part' naming scheme [Jim Gay]
|
63
|
+
* Allow access to the instance of the user action observer [Jim Gay]
|
64
|
+
* Allow extensions to add to the built-in cucumber paths [Jim Gay]
|
65
|
+
* Remove git dependency on generated extension gemspecs [Jim Gay]
|
66
|
+
* Unvendored haml [William Ross]
|
67
|
+
* Removed non-portable (Windows-unfriendly) syntax from System commands [Chris Parrish]
|
68
|
+
* Fix script/console path to boot [Andrew vonderLuft]
|
69
|
+
* Gem dependency compatibility fix for ruby 1.9 [Andrew vonderLuft]
|
70
|
+
* Fix case statements for ruby 1.9 compatibility [Andrew vonderLuft]
|
71
|
+
* Migrate extensions in load order [Jim Gay]
|
72
|
+
* Don't need the message about running the extension migration task [Jim Gay]
|
73
|
+
* Migrate and update extensions after bootstrap [Jim Gay]
|
74
|
+
* Use request.cookies [Jim Gay]
|
75
|
+
* Explicitly find the preview page again after the post [Jim Gay]
|
76
|
+
* Remove errant ruby-debug [Jim Gay]
|
77
|
+
* Update instance boot [Jim Gay]
|
78
|
+
* Patch for requiring RedCloth and gem dependencies [Jim Gay]
|
79
|
+
* Ensure @extensions in the initializer is an array [Jim Gay]
|
80
|
+
* We don't need to validate numericality of reference columns [Jim Gay]
|
81
|
+
* Replace returning with tap [Jim Gay]
|
82
|
+
* Don't validate id [Jim Gay]
|
83
|
+
* Tweak to tabcontrol.Js [William Ross]
|
84
|
+
* Add rake update task for static html files [Andrew vonderLuft]
|
85
|
+
* Changes popup.js to support switching from one popup to another [William Ross]
|
86
|
+
* Allow the :all symbol to represent gem extensions [Jim Gay]
|
87
|
+
* Only show paginate link when depaginated [Benny Degezelle]
|
88
|
+
* Require delocalize gem, so date input in non-English is interpreted correctly [Benny Degezelle]
|
89
|
+
* Use white background for page preview [Jim Gay]
|
90
|
+
* Add option to ignore extensions where ruby's -= operator won't cut it [Jim Gay]
|
91
|
+
* Remove unused abstract_model_helper.rb [Jim Gay]
|
92
|
+
* Provide access to standard configuration options through methods [Jim Gay]
|
93
|
+
* Add reusable .action_button class [Jim Gay]
|
94
|
+
* Move radiant-badge to /images/radiant/ [Andrew vonderLuft]
|
95
|
+
* Fix rake method for extension script [Andrew vonderLuft]
|
96
|
+
* Make environment files similar [Jeff Casimir]
|
97
|
+
* Require HAML 3.0.25 [Jeff Casimir]
|
98
|
+
* Fix extension installer script to run migrations and updates [Andrew vonderLuft]
|
99
|
+
* Allow two link triggers to the same popup window [John Long]
|
100
|
+
* Make popup windows draggable by their title bars [John Long]
|
101
|
+
* Add tag alias for navigation:url/path [Andrew vonderLuft]
|
102
|
+
* Define page subclasses with acts_as_tree [Jim Gay]
|
103
|
+
* Add preview page feature [Jim Gay]
|
104
|
+
* Modify locales to use Dir.glob so that dot files are ignored [jsntv200]
|
105
|
+
* Don't show secondary nav when there is only one item [John Long]
|
106
|
+
* Pull in changes from prototype [John Long]
|
107
|
+
* Add .bundle to .gitignore [John Long]
|
108
|
+
* Allow extensions to insert tabs after or before other tabs [John Long]
|
6
109
|
* Provide an export function for custom templates [Jim Gay]
|
110
|
+
* Cleanup styled blog template [Jim Gay]
|
111
|
+
* Fix bug when rendering with nil content [Jim Gay]
|
112
|
+
* Make rspec matchers available in cucumber [Jim Gay]
|
113
|
+
* Better support for cucumber in generated extensions [Jim Gay]
|
114
|
+
* Added development dependencies to gemspec [Michal Cichra]
|
115
|
+
* Fixed boot to work with rubygems >= 1.6.0 [Michal Cichra]
|
116
|
+
* Added .rvmrc and radiant-*.gem to gitignore [Michal Cichra]
|
117
|
+
* Fixed gemspec to include all files from git repo [Michal Cichra, Jim Gay]
|
118
|
+
* Move from url to path in sample templates [Jim Gay]
|
119
|
+
* Updated available tags i18n [Jim Gay]
|
7
120
|
* Remove legacy routes [Jim Gay]
|
8
121
|
* Allow pagination in aggregated pages [Jim Gay]
|
122
|
+
* Fix hard-coded string in page edit [Mario Visic]
|
123
|
+
* Make NodeHelper available outside of PageHelper [William Ross]
|
124
|
+
* User has_many pages [William Ross]
|
125
|
+
* Remove arbitrary restriction on limit and offset [Jim Gay]
|
9
126
|
* Make UserActionObserver thread safe [Mark Reginald James]
|
10
127
|
* Speedup recursive snippet usage [Andrew O'Brian, Jim Gay]
|
128
|
+
* Add validate_path helper to check that a page exists [William Ross]
|
129
|
+
* Standardize on site:host for consistency with dev:host [William Ross]
|
11
130
|
* Use <r:cycle /> for a numeric counter [Jim Gay, Dirk Kelly]
|
12
131
|
* String format breadcrumb tag in archive pages [Oriol Gual]
|
132
|
+
* More explicit cache strategy and cookies no longer force cache-bypass [William Ross]
|
133
|
+
* Make pagination_parameters available to views [William Ross]
|
134
|
+
* Add style for inline list of links in drawer [Andrew vonderLuft]
|
135
|
+
* Added defaults.snippet.filter to the configuration view [Samuel Whited]
|
136
|
+
* Defer default_child to class so we can bootstrap without error [Josh French]
|
137
|
+
* Page.find_by_url → Page.find_by_path [Josh French]
|
138
|
+
* Added config option defaults.snippet.filter [Samuel Whited]
|
13
139
|
* Fix bug with deletion of page parts [Josh French]
|
140
|
+
* Add Personal settings sub-tab [William Ross]
|
141
|
+
* Cleaner large status spinner [John Muhl]
|
14
142
|
* Unroll PageMenu into core [Josh French]
|
143
|
+
* Add missing semicolons + add radix parameter to parseInt() for safety [vanderhoorn]
|
144
|
+
* Fix status select box with more specific translate call [William Ross]
|
145
|
+
* Make config validation case-insensitive [William Ross]
|
146
|
+
* Don't run Radiant initializations if Radiant.root is the same as Rails.root [William Ross]
|
147
|
+
* Fix page remove screen [Jim Gay]
|
148
|
+
* Move <r:comment> to deprecated tags [Jim Gay]
|
149
|
+
* Call find_by_url inside find_by_path so existing extensions continue to work [Jim Gay]
|
150
|
+
* Update generated extension to include gemspec and better README [Jim Gay]
|
151
|
+
* Config definition can specify units [William Ross]
|
15
152
|
* Update Haml to 3.0.23 [Jim Gay]
|
153
|
+
* Clicking on a tab focuses the associated textarea [John Muhl]
|
16
154
|
* Localize <r:date> [Jim Gay]
|
17
155
|
* Make any date column a valid value for <r:date /> [Jim Gay]
|
18
156
|
* Move url methods to path [Jim Gay]
|
19
|
-
* Allow use of custom TextFilter names[Petrik de Heus]
|
157
|
+
* Allow use of custom TextFilter names [Petrik de Heus]
|
158
|
+
* Prevent autofill when at new-user form [Gert Goet]
|
20
159
|
* Set autocomplete="off" for password fields [Gert Goet]
|
21
160
|
* Allow loading of database templates from extensions [Jim Gay]
|
22
161
|
* Restore Roasters template styling [Jim Gay]
|
23
|
-
*
|
162
|
+
* Auto-expand Status and Actions columns to prevent clipping [Benny Degezelle]
|
163
|
+
* Fix config import/export [William Ross]
|
164
|
+
* Add Radiant.config method and radiant_config.rb initializer [William Ross]
|
165
|
+
* Add configuration interface, with validation and error reporting [William Ross]
|
166
|
+
* Close other menus when dropdown option clicked [Jim Gay]
|
167
|
+
* Move markdown_filter into an extension [John Muhl]
|
168
|
+
* Adding the <r:hide> tag to replace <r:comment> [Jim Gay]
|
169
|
+
* Change "Website" to "More Info" on the Extensions page [Jim Gay]
|
170
|
+
* Don't allow children for File Not Found pages [Jim Gay]
|
171
|
+
* Get the children for the menu explicitly [Jim Gay]
|
172
|
+
* Ensure parent_id and @page are set on Page#new [Jim Gay]
|
173
|
+
* Move export into an extension [Jim Gay]
|
174
|
+
* Add "noself" attribute to breadcrumbs tag [William Ross]
|
175
|
+
* Separate Env Dump page into a debug extension [Jim Gay]
|
176
|
+
* Support PageFields in imports & exports [Josh French]
|
177
|
+
* More granular regionsets in Pages#edit [Josh French]
|
178
|
+
* Integrate Compass [John Long]
|
179
|
+
* Update the prototype import task [Jim Gay]
|
180
|
+
* Fix bug for filtered Snippets not showing stored filter [Jim Gay]
|
181
|
+
* Fix Layouts pagination [Andrew vonderLuft]
|
182
|
+
* Fix Snippet pagination [Andrew vonderLuft]
|
183
|
+
* Exclude dot files (e.g. .svn) in rake radiant:update:sass [Andrew vonderLuft]
|
184
|
+
* Expose attribute assignment in Pages#new [Josh French]
|
185
|
+
* Rename Page#fields[] to Page#field() [Josh French]
|
186
|
+
* Add #scheduled? to Page [Jim Gay]
|
24
187
|
* Added the Sheets extension to manage Javascript and Stylesheets [Jim Gay]
|
188
|
+
* Update toSlug to allow periods in slugs [Jim Gay]
|
189
|
+
* Protect against gems that are required but not installed [Sean Cribbs]
|
190
|
+
* Updated index views to use latest markup and styles [John Long]
|
191
|
+
* Integrated PageFields extension into core [Josh French]
|
25
192
|
* Page-type select menu moved to Pages#index [Josh French]
|
26
193
|
* Allow gem-extensions to override core views [Josh French]
|
27
194
|
* Popup.js fix for multiple control instances [Josh French]
|
@@ -551,4 +718,5 @@ included in more than one extension will be loaded only once according to the ex
|
|
551
718
|
* Fixed a problem with an error being thrown when the <r:context /> tag was rendered with the inherit attribute set to true and the page part did not exist (closes ticket #155) [Bodhi Philpot]
|
552
719
|
|
553
720
|
## 0.5.0 Grindstone (June 28, 2006)
|
554
|
-
|
721
|
+
|
722
|
+
* First release. [John Long]
|
data/CONTRIBUTORS.md
CHANGED
@@ -18,6 +18,19 @@ core:
|
|
18
18
|
* Andrew vonderLuft
|
19
19
|
* William Ross
|
20
20
|
* John Muhl
|
21
|
+
* Johannes Fahrenkrug
|
22
|
+
* Benny Degezelle
|
23
|
+
* Jason Taylor
|
24
|
+
* Wes Gamble
|
25
|
+
* Michael Stalker
|
26
|
+
* Chris Parrish
|
27
|
+
* John W. Long
|
28
|
+
* Edmund Haselwanter
|
29
|
+
* Michal Cichra
|
30
|
+
* Jason Garber
|
31
|
+
* Samuel Whited
|
32
|
+
* vanderhoorn
|
33
|
+
* Sean Cribbs
|
21
34
|
|
22
35
|
## 0.9.1 Refraction
|
23
36
|
|
data/Gemfile
CHANGED
@@ -6,9 +6,9 @@ source :rubygems
|
|
6
6
|
# application. The instance has its own Gemfile, which
|
7
7
|
# requires radiant and therefore pulls in every
|
8
8
|
# dependency mentioned in radiant.gemspec.
|
9
|
-
|
10
|
-
gem
|
11
|
-
gem
|
9
|
+
|
10
|
+
gem "rails", "2.3.14"
|
11
|
+
gem "sqlite3", "1.3.4"
|
12
12
|
|
13
13
|
# When radiant is installed as a gem you can run all of
|
14
14
|
# its tests and specs from an instance. If you're working
|
@@ -20,4 +20,6 @@ gem 'sqlite3', '1.3.4'
|
|
20
20
|
|
21
21
|
if ENV['TRAVIS']
|
22
22
|
gemspec :development_group => :test
|
23
|
-
|
23
|
+
gem "mysql"
|
24
|
+
gem "pg"
|
25
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -11,7 +11,7 @@ GEM
|
|
11
11
|
activeresource (2.3.14)
|
12
12
|
activesupport (= 2.3.14)
|
13
13
|
activesupport (2.3.14)
|
14
|
-
rack (1.1.
|
14
|
+
rack (1.1.3)
|
15
15
|
rails (2.3.14)
|
16
16
|
actionmailer (= 2.3.14)
|
17
17
|
actionpack (= 2.3.14)
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
activeresource (= 2.3.14)
|
20
20
|
activesupport (= 2.3.14)
|
21
21
|
rake (>= 0.8.3)
|
22
|
-
rake (0.
|
22
|
+
rake (0.9.2.2)
|
23
23
|
sqlite3 (1.3.4)
|
24
24
|
|
25
25
|
PLATFORMS
|
@@ -27,4 +27,4 @@ PLATFORMS
|
|
27
27
|
|
28
28
|
DEPENDENCIES
|
29
29
|
rails (= 2.3.14)
|
30
|
-
sqlite3 (
|
30
|
+
sqlite3 (= 1.3.4)
|
data/INSTALL.md
CHANGED
@@ -19,9 +19,9 @@ config/database.yml to match.
|
|
19
19
|
|
20
20
|
3. Run the database bootstrap rake task:
|
21
21
|
|
22
|
-
% rake production db:bootstrap
|
22
|
+
% bundle exec rake production db:bootstrap
|
23
23
|
|
24
|
-
(If you would like bootstrap a development database run `rake db:bootstrap`.)
|
24
|
+
(If you would like bootstrap a development database run `bundle exec rake db:bootstrap`.)
|
25
25
|
|
26
26
|
4. Radiant is a normal Rails application and you can run it in all the usual
|
27
27
|
ways. To test your installation, try running:
|
data/README.md
CHANGED
@@ -60,7 +60,7 @@ This will install the gem with the prerelease name, for example: ‘radiant-0.9.
|
|
60
60
|
|
61
61
|
To run tests you will need to have the following gems installed:
|
62
62
|
|
63
|
-
gem install ZenTest rspec rspec-rails cucumber webrat nokogiri
|
63
|
+
gem install ZenTest rspec rspec-rails cucumber webrat nokogiri sqlite3-ruby
|
64
64
|
|
65
65
|
## Support
|
66
66
|
|
data/Rakefile
CHANGED
@@ -7,5 +7,6 @@ require 'rdoc/task'
|
|
7
7
|
require 'tasks/rails'
|
8
8
|
|
9
9
|
unless Rake::Task.task_defined? "radiant:release"
|
10
|
-
Dir["#{RADIANT_ROOT}/lib/tasks/**/*.rake"].sort.each { |
|
10
|
+
Dir["#{RADIANT_ROOT}/lib/tasks/**/*.rake"].sort.each { |taskfile| load taskfile }
|
11
|
+
Radiant::ExtensionPath.rake_task_paths.each { |taskfile| load taskfile }
|
11
12
|
end
|
@@ -60,11 +60,13 @@ class Admin::PagesController < Admin::ResourceController
|
|
60
60
|
if request.referer =~ %r{/admin/pages/(\d+)/edit}
|
61
61
|
page = Page.find($1).becomes(page_class)
|
62
62
|
page.update_attributes(params[:page])
|
63
|
+
page.published_at ||= Time.now
|
63
64
|
else
|
64
65
|
page = page_class.new(params[:page])
|
65
66
|
page.published_at = page.updated_at = page.created_at = Time.now
|
66
67
|
page.parent = Page.find($1) if request.referer =~ %r{/admin/pages/(\d+)/children/new}
|
67
68
|
end
|
69
|
+
page.pagination_parameters = pagination_parameters
|
68
70
|
process_with_exception(page)
|
69
71
|
end
|
70
72
|
end
|
@@ -2,6 +2,11 @@ module Admin::NodeHelper
|
|
2
2
|
|
3
3
|
def render_node(page, locals = {})
|
4
4
|
@current_node = page
|
5
|
+
page.extend MenuRenderer
|
6
|
+
page.view = self
|
7
|
+
if page.additional_menu_features?
|
8
|
+
page.extend(*page.menu_renderer_modules)
|
9
|
+
end
|
5
10
|
locals.reverse_merge!(:level => 0, :simple => false).merge!(:page => page)
|
6
11
|
render :partial => 'admin/pages/node', :locals => locals
|
7
12
|
end
|
@@ -10,48 +15,6 @@ module Admin::NodeHelper
|
|
10
15
|
@homepage ||= Page.find_by_parent_id(nil)
|
11
16
|
end
|
12
17
|
|
13
|
-
def clean_page_description(page)
|
14
|
-
page.description.to_s.strip.gsub(/\t/,'').gsub(/\s+/,' ')
|
15
|
-
end
|
16
|
-
|
17
|
-
def child_link_for(page)
|
18
|
-
case children_for(page).size
|
19
|
-
when 0
|
20
|
-
content_tag :span, image('plus_disabled') + ' ' + t('add_child'), :class => 'action disabled'
|
21
|
-
when 1
|
22
|
-
link_to image('plus') + ' ' + t('add_child'), new_admin_page_child_path(page, :page_class => children_for(page).first), :class => "action"
|
23
|
-
else
|
24
|
-
link_to image('plus') + ' ' + t('add_child'), "#allowed_children_#{page.id}", :class => "action dropdown"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def child_menu_for(page)
|
29
|
-
children = children_for(page)
|
30
|
-
return nil if children.size < 2
|
31
|
-
children.unshift(children.delete(page.default_child), :separator) if children.include?(page.default_child)
|
32
|
-
name_for = proc { |p| (name = p.name.to_name('Page')).blank? ? t('normal_page') : name }
|
33
|
-
content_tag :ul, :class => 'menu', :id => "allowed_children_#{page.id}" do
|
34
|
-
children.map do |child|
|
35
|
-
if child == :separator
|
36
|
-
content_tag :li, nil, :class => 'separator'
|
37
|
-
else
|
38
|
-
content_tag :li, link_to(name_for[child], new_admin_page_child_path(page, :page_class => child), :title => clean_page_description(child))
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def children_for(page)
|
45
|
-
page.allowed_children
|
46
|
-
end
|
47
|
-
|
48
|
-
def children_for_with_roles(page)
|
49
|
-
children = children_for_without_roles(page)
|
50
|
-
children.reject! { |p| p.new.virtual? } unless admin?
|
51
|
-
children
|
52
|
-
end
|
53
|
-
alias_method_chain :children_for, :roles
|
54
|
-
|
55
18
|
def show_all?
|
56
19
|
@controller.action_name == 'remove'
|
57
20
|
end
|
@@ -0,0 +1,133 @@
|
|
1
|
+
module MenuRenderer
|
2
|
+
|
3
|
+
def exclude(*type_names)
|
4
|
+
@excluded_class_names ||= []
|
5
|
+
@excluded_class_names.concat(type_names).uniq!
|
6
|
+
end
|
7
|
+
module_function :exclude
|
8
|
+
|
9
|
+
def excluded_class_names
|
10
|
+
MenuRenderer.instance_variable_get(:@excluded_class_names)
|
11
|
+
end
|
12
|
+
|
13
|
+
module_function :excluded_class_names
|
14
|
+
public :excluded_class_names
|
15
|
+
|
16
|
+
def view=(val)
|
17
|
+
@view = val
|
18
|
+
end
|
19
|
+
|
20
|
+
def view
|
21
|
+
@view
|
22
|
+
end
|
23
|
+
|
24
|
+
def additional_menu_features?
|
25
|
+
@additional_menu_features ||= (menu_renderer_module_name != 'MenuRenderer' && Object.const_defined?(menu_renderer_module_name))
|
26
|
+
end
|
27
|
+
|
28
|
+
def menu_renderer_module_name
|
29
|
+
simple_name = self.class_name.to_s.sub('Page','')
|
30
|
+
"#{simple_name}MenuRenderer"
|
31
|
+
end
|
32
|
+
|
33
|
+
def menu_renderer_modules
|
34
|
+
[Object.const_get(menu_renderer_module_name)]
|
35
|
+
end
|
36
|
+
|
37
|
+
def allowed_child_classes
|
38
|
+
(allowed_children_cache.to_s.split(',') - Array(excluded_class_names)).map(&:constantize)
|
39
|
+
end
|
40
|
+
|
41
|
+
def default_child_item
|
42
|
+
menu_item(default_child)
|
43
|
+
end
|
44
|
+
|
45
|
+
def separator_item
|
46
|
+
view.content_tag :li, '', :class => 'separator'
|
47
|
+
end
|
48
|
+
|
49
|
+
def child_items
|
50
|
+
(allowed_child_classes - [self.class.default_child]).map do |child|
|
51
|
+
menu_item(child)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def menu_items
|
56
|
+
[default_child_item, separator_item] + child_items
|
57
|
+
end
|
58
|
+
|
59
|
+
def menu_list
|
60
|
+
view.content_tag :ul, menu_items.join, :class => 'menu', :id => "allowed_children_#{id}"
|
61
|
+
end
|
62
|
+
|
63
|
+
def remove_link
|
64
|
+
view.link_to view.image('minus') + ' ' + I18n.t('remove'), view.remove_admin_page_url(self), :class => "action"
|
65
|
+
end
|
66
|
+
|
67
|
+
def remove_option
|
68
|
+
remove_link
|
69
|
+
end
|
70
|
+
|
71
|
+
def add_child_disabled?
|
72
|
+
allowed_child_classes.size == 0
|
73
|
+
end
|
74
|
+
|
75
|
+
def disabled_add_child_link
|
76
|
+
view.content_tag :span, view.image('plus_disabled') + ' ' + I18n.t('add_child'), :class => 'action disabled'
|
77
|
+
end
|
78
|
+
|
79
|
+
def add_child_link
|
80
|
+
view.link_to((view.image('plus') + ' ' + I18n.t('add_child')), view.new_admin_page_child_path(self, :page_class => default_child.name), :class => "action")
|
81
|
+
end
|
82
|
+
|
83
|
+
def add_child_link_with_menu_hook
|
84
|
+
view.link_to((view.image('plus') + ' ' + I18n.t('add_child')), "#allowed_children_#{id}", :class => "action dropdown")
|
85
|
+
end
|
86
|
+
|
87
|
+
def add_child_menu
|
88
|
+
menu_list
|
89
|
+
end
|
90
|
+
|
91
|
+
def add_child_link_with_menu
|
92
|
+
add_child_link_with_menu_hook + add_child_menu
|
93
|
+
end
|
94
|
+
|
95
|
+
def add_child_option
|
96
|
+
if add_child_disabled?
|
97
|
+
disabled_add_child_link
|
98
|
+
else
|
99
|
+
if allowed_child_classes.size == 1
|
100
|
+
add_child_link
|
101
|
+
else
|
102
|
+
add_child_link_with_menu
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
private
|
108
|
+
|
109
|
+
def clean_page_description(page_class)
|
110
|
+
page_class.description.to_s.strip.gsub(/\t/,'').gsub(/\s+/,' ')
|
111
|
+
end
|
112
|
+
|
113
|
+
def menu_item(child_class)
|
114
|
+
view.content_tag(:li, menu_link(child_class))
|
115
|
+
end
|
116
|
+
|
117
|
+
def menu_link(child_class)
|
118
|
+
title = clean_page_description(child_class)
|
119
|
+
path = view.new_admin_page_child_path(self, :page_class => child_class.name)
|
120
|
+
text = link_text_for_child_class(child_class.name)
|
121
|
+
view.link_to(text, path, :title => title)
|
122
|
+
end
|
123
|
+
|
124
|
+
def link_text_for_child_class(given_class_name)
|
125
|
+
translation_key = if given_class_name == 'Page' || given_class_name.blank?
|
126
|
+
'normal_page'
|
127
|
+
else
|
128
|
+
given_class_name.sub('Page','').underscore
|
129
|
+
end
|
130
|
+
fallback = given_class_name == 'Page' ? 'Page' : given_class_name.sub('Page','').titleize
|
131
|
+
I18n.t(translation_key, :default => fallback)
|
132
|
+
end
|
133
|
+
end
|