zena 1.0.0 → 1.1.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/History.txt +28 -0
- data/README.rdoc +6 -6
- data/Rakefile +3 -0
- data/app/controllers/users_controller.rb +4 -2
- data/app/models/acl.rb +6 -0
- data/app/models/cached_page.rb +2 -1
- data/app/models/document.rb +3 -4
- data/app/models/node.rb +8 -5
- data/app/models/site.rb +1 -1
- data/app/models/template.rb +2 -2
- data/app/models/user.rb +5 -3
- data/app/views/acls/_add.rhtml +2 -1
- data/app/views/acls/_form.rhtml +15 -7
- data/app/views/acls/_li.rhtml +2 -0
- data/app/views/acls/index.rhtml +3 -1
- data/app/views/acls/show.html.erb +1 -1
- data/app/views/links/destroy.rjs +16 -2
- data/app/views/versions/destroy.rjs +1 -1
- data/app/views/zafu/default/Node-admin.zafu +1 -1
- data/bin/zena +5 -3
- data/bricks/acls/lib/bricks/acls.rb +11 -4
- data/bricks/acls/zena/migrate/20110627193757_add_allowed_mode_and_format_to_acl.rb +11 -0
- data/bricks/acls/zena/test/integration/acl_integration_test.rb +42 -0
- data/bricks/acls/zena/test/sites/erebus/acls.yml +8 -0
- data/bricks/mongrel/zena/deploy.rb +19 -0
- data/bricks/single/lib/bricks/single.rb +15 -0
- data/bricks/single/zena/init.rb +1 -0
- data/bricks/sphinx/zena/tasks.rb +1 -1
- data/bricks/static/lib/bricks/static.rb +151 -0
- data/bricks/static/zena/init.rb +1 -0
- data/bricks/static/zena/migrate/20110702010330_add_static_to_idx_templates.rb +12 -0
- data/bricks/static/zena/skins/blog/Image-edit.zafu +6 -0
- data/bricks/static/zena/skins/blog/Image.zafu +19 -0
- data/bricks/static/zena/skins/blog/Node-+index.zafu +1 -0
- data/bricks/static/zena/skins/blog/Node-+notFound.zafu +7 -0
- data/bricks/static/zena/skins/blog/Node-+search.zafu +19 -0
- data/bricks/static/zena/skins/blog/Node.zafu +66 -0
- data/bricks/static/zena/skins/blog/Post.zafu +12 -0
- data/bricks/static/zena/skins/blog/Project--kml.zafu +30 -0
- data/bricks/static/zena/skins/blog/Project.zafu +45 -0
- data/bricks/static/zena/skins/blog/comments.zafu +30 -0
- data/bricks/static/zena/skins/blog/dict.yml +11 -0
- data/bricks/static/zena/skins/blog/img/dateBg.jpg +0 -0
- data/bricks/static/zena/skins/blog/img/header.png +0 -0
- data/bricks/static/zena/skins/blog/img/mapPin.png +0 -0
- data/bricks/static/zena/skins/blog/img/menu.gif +0 -0
- data/bricks/static/zena/skins/blog/img/menuover.gif +0 -0
- data/bricks/static/zena/skins/blog/img/style.css +110 -0
- data/bricks/static/zena/test/integration/static_integration_test.rb +30 -0
- data/bricks/static/zena/test/unit/static_test.rb +33 -0
- data/bricks/zena/zena/migrate/01_base.rb +1 -2
- data/bricks/zena/zena/migrate/20110623072048_fix_cached_path_index.rb +10 -0
- data/bricks/zena/zena/migrate/20110710113731_remove_icon_field.rb +18 -0
- data/config/bricks.yml +4 -0
- data/config/deploy.rb +17 -2
- data/config/gems.yml +9 -7
- data/config/selenium.yml +38 -0
- data/lib/bricks/requirements_validation.rb +8 -2
- data/lib/gettext_strings.rb +2 -1
- data/lib/tasks/zena.rake +5 -0
- data/lib/zena/app.rb +12 -0
- data/lib/zena/console.rb +9 -1
- data/lib/zena/core_ext/string.rb +7 -2
- data/lib/zena/deploy.rb +60 -6
- data/lib/zena/deploy/app_init.rhtml +56 -0
- data/lib/zena/deploy/haproxy.cnf.rhtml +34 -0
- data/lib/zena/deploy/httpd.rhtml +6 -0
- data/lib/zena/deploy/start_stop.rhtml +35 -0
- data/lib/zena/info.rb +1 -1
- data/lib/zena/remote/connection.rb +1 -1
- data/lib/zena/site_worker.rb +9 -5
- data/lib/zena/use.rb +1 -1
- data/lib/zena/use/action.rb +2 -2
- data/lib/zena/use/ajax.rb +22 -9
- data/lib/zena/use/conditional.rb +5 -0
- data/lib/zena/use/context.rb +6 -1
- data/lib/zena/use/dates.rb +17 -2
- data/lib/zena/use/display.rb +14 -3
- data/lib/zena/use/forms.rb +37 -47
- data/lib/zena/use/html_tags.rb +3 -0
- data/lib/zena/use/node_context.rb +17 -17
- data/lib/zena/use/rendering.rb +1 -1
- data/lib/zena/use/urls.rb +11 -2
- data/lib/zena/use/zafu_attributes.rb +1 -0
- data/lib/zena/use/zafu_safe_definitions.rb +16 -1
- data/lib/zena/use/zafu_templates.rb +39 -24
- data/lib/zena/use/zazen.rb +1 -0
- data/locale/de/LC_MESSAGES/zena.mo +0 -0
- data/locale/de/zena.po +105 -89
- data/locale/en/LC_MESSAGES/zena.mo +0 -0
- data/locale/en/zena.mo +0 -0
- data/locale/en/zena.po +188 -253
- data/locale/fr/LC_MESSAGES/zena.mo +0 -0
- data/locale/fr/zena.mo +0 -0
- data/locale/fr/zena.po +200 -257
- data/locale/zena.pot +95 -85
- data/public/javascripts/zena.js +2 -2
- data/test/fixtures/files/{Node-test.zafu → TestNode.zafu} +206 -4
- data/test/functional/nodes_controller_test.rb +2 -2
- data/test/integration/navigation_test.rb +9 -3
- data/test/integration/query_node/basic.yml +4 -4
- data/test/integration/query_node/filters.yml +2 -2
- data/test/integration/zafu_compiler/ajax.yml +6 -6
- data/test/integration/zafu_compiler/basic.yml +1 -1
- data/test/integration/zafu_compiler/calendar.yml +4 -3
- data/test/integration/zafu_compiler/conditional.yml +3 -10
- data/test/integration/zafu_compiler/context.yml +1 -1
- data/test/integration/zafu_compiler/dates.yml +9 -1
- data/test/integration/zafu_compiler/display.yml +7 -1
- data/test/integration/zafu_compiler/eval.yml +12 -46
- data/test/integration/zafu_compiler/forms.yml +1 -1
- data/test/integration/zafu_compiler/query.yml +2 -2
- data/test/integration/zafu_compiler/relations.yml +19 -9
- data/test/integration/zafu_compiler/roles.yml +12 -0
- data/test/integration/zafu_compiler/safe_definitions.yml +1 -1
- data/test/integration/zafu_compiler/urls.yml +13 -5
- data/test/integration/zafu_compiler/version.yml +6 -0
- data/test/integration/zafu_compiler/zafu_attributes.yml +4 -4
- data/test/integration/zafu_compiler_test.rb +1 -1
- data/test/selenium.readme +8 -0
- data/test/selenium/Add/0setup.rsel +12 -0
- data/test/selenium/Add/add1.rsel +22 -0
- data/test/selenium/Add/add2.rsel +22 -0
- data/test/selenium/Add/add3.rsel +22 -0
- data/test/selenium/Drop/0setup.rsel +12 -0
- data/test/selenium/Drop/drop1.rsel +25 -0
- data/test/selenium/Drop/drop2.rsel +25 -0
- data/test/selenium/Drop/drop3.rsel +51 -0
- data/test/selenium/Drop/drop4.rsel +44 -0
- data/test/selenium/Drop/drop5.rsel +16 -0
- data/test/selenium/Edit/0setup.rsel +12 -0
- data/test/selenium/Edit/edit1.rsel +31 -0
- data/test/selenium/Edit/edit2.rsel +39 -0
- data/test/selenium/Edit/edit3.rsel +40 -0
- data/test/selenium/Form/0setup.rsel +12 -0
- data/test/selenium/Form/form1.rsel +9 -0
- data/test/selenium/Form/form2.rsel +9 -0
- data/test/selenium/Paginate/0setup.rsel +12 -0
- data/test/selenium/Paginate/paginate1.rsel +24 -0
- data/test/selenium/Toggle/0setup.rsel +12 -0
- data/test/selenium/Toggle/toggle1.rsel +21 -0
- data/test/sites/zena/nodes.yml +4 -4
- data/test/sites/zena/roles.yml +3 -2
- data/test/sites/zena/versions.yml +12 -11
- data/test/unit/core_ext_test.rb +23 -5
- data/test/unit/document_test.rb +6 -2
- data/test/unit/node_test.rb +2 -2
- data/test/unit/remote_test.rb +1 -2
- data/test/unit/role_test.rb +2 -2
- data/test/unit/user_test.rb +48 -1
- data/test/unit/virtual_class_test.rb +7 -7
- data/test/unit/zena/acts/secure_test.rb +1 -1
- data/test/unit/zena/use/rendering_test.rb +1 -1
- data/test/unit/zena/use/urls_test.rb +3 -3
- data/zena.gemspec +65 -101
- metadata +67 -103
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run 2.tmCommand +0 -24
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run Context.tmCommand +0 -58
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run Focused Should.tmCommand +0 -88
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/Run.tmCommand +0 -27
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Commands/YAML to Shoulda.tmCommand +0 -23
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Preferences/Symbol List: Context.tmPreferences +0 -19
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Preferences/Symbol List: Should.tmPreferences +0 -19
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory attributes for.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory build.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_define with class.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_define.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_next.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/Factory_sequence.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_bad_value.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_contains.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_does_not_contain.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_good_value.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_same_elements.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_save.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_sent_email.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/assert_valid.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/association.tmSnippet +0 -17
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/attribute.tmSnippet +0 -17
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/before_should block.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/context block get.tmSnippet +0 -22
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/context block post.tmSnippet +0 -23
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/context block with setup.tmSnippet +0 -25
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/setup.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should block with before proc.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should block.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_allow_values_for.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_assign_to.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_be_restful denied.tmSnippet +0 -20
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_be_restful.tmSnippet +0 -20
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_belong_to.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_change by.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_change from to.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_length_at_least.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_length_in_range.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_length_is.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_ensure_value_in_range.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_eventually.tmSnippet +0 -18
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_filter_params.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_and_belong_to_many.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_class_methods.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_db_column.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_db_columns.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_index.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_indices.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_instance_methods.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_many.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_named_scope.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_one.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_have_readonly_attributes.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_allow_mass_assignment_of.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_allow_values_for.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_assign_to.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_change.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_not_set_the_flash.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_redirect_to.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_a_form.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_template.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_with_layout.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_render_without_layout.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_respond_with.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_respond_with_content_type.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_return_from_session.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_route.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_set_the_flash_to.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_acceptance_of.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_numericality_of.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_presence_of.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_uniqueness_of with scope.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Snippets/should_validate_uniqueness_of.tmSnippet +0 -16
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/catch_exception.rb +0 -39
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/run_script.rb +0 -104
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/stdin_dialog.rb +0 -14
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/test.rb +0 -17
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/RubyMate/todo.txt +0 -13
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Support/bin/yaml_to_shoulda.rb +0 -25
- data/vendor/TextMate/Ruby Shoulda.tmbundle/Syntaxes/Ruby on Rails (Shoulda).tmLanguage +0 -166
- data/vendor/TextMate/Ruby Shoulda.tmbundle/info.plist +0 -304
- data/vendor/TextMate/Zena.tmbundle/Commands/Run all yaml tests.tmCommand +0 -37
- data/vendor/TextMate/Zena.tmbundle/Commands/Run focused yaml test.tmCommand +0 -52
- data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb +0 -39
- data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/run_script.rb +0 -118
- data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/stdin_dialog.rb +0 -14
- data/vendor/TextMate/Zena.tmbundle/info.plist +0 -17
data/History.txt
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
== 1.1.0 2011-07-11
|
|
2
|
+
|
|
3
|
+
* Major changes
|
|
4
|
+
* Fixed 'cached_pages' indexing.
|
|
5
|
+
* Added support for haproxy and init.d scripts in cap deploy rules.
|
|
6
|
+
* Added support for upvalues (variables defined in siblings above).
|
|
7
|
+
* Added mode and format filters to Acl rules.
|
|
8
|
+
* Added Selenium testing
|
|
9
|
+
** > rake zena:test_server (cleans zafu, setup fixtures, start server)
|
|
10
|
+
** > rake test:acceptance
|
|
11
|
+
* Using up instead of first element in list_context as 'this' (use "first" to obtain old behavior)
|
|
12
|
+
* Enabled specializable static skins (with proper class loading) to ease code reuse and enable filesystem based development.
|
|
13
|
+
* Created "Single" brick to ease deployment on shared hosting.
|
|
14
|
+
|
|
15
|
+
* Minor changes
|
|
16
|
+
* Fixed 'prefix' option on [url].
|
|
17
|
+
* Console methods now accept SQLiss.
|
|
18
|
+
* Admin interface top link moves to page.
|
|
19
|
+
* Fixed a bug in date parsing: links should use contextual timezone.
|
|
20
|
+
* Added 'versions' safe method to return list of versions for a node.
|
|
21
|
+
* Fixed bricks requirements when database.yml is not present.
|
|
22
|
+
* Fixed [input type='id'] when used on new records.
|
|
23
|
+
* Fixed bugs in [edit] forms and Ajax [add].
|
|
24
|
+
* Fixed bugs in [edit] when used with a table.
|
|
25
|
+
* Fixed initial migration bug when using MySQL.
|
|
26
|
+
* Fixed loading on shared hosts without rmagick (or with an old version).
|
|
27
|
+
* Fixed Role icon (sometimes there is a legacy 'icon' column).
|
|
28
|
+
|
|
1
29
|
== 1.0.0 2011-06-15
|
|
2
30
|
|
|
3
31
|
* Major changes
|
data/README.rdoc
CHANGED
|
@@ -8,9 +8,9 @@ licence: MIT
|
|
|
8
8
|
= Getting started
|
|
9
9
|
|
|
10
10
|
# sudo gem install zena
|
|
11
|
-
# zena myapp
|
|
11
|
+
# zena new myapp
|
|
12
12
|
# cd myapp
|
|
13
|
-
#
|
|
13
|
+
# zena init
|
|
14
14
|
|
|
15
15
|
You can now visit http://localhost:3000 (user = admin, password = admin)
|
|
16
16
|
|
|
@@ -21,11 +21,11 @@ These commands do the following:
|
|
|
21
21
|
3. ...
|
|
22
22
|
4. Create the database, migrate, create the 'localhost' website in 'production' environment and start server.
|
|
23
23
|
|
|
24
|
-
The 'zena
|
|
24
|
+
The 'zena init' task does the following:
|
|
25
25
|
|
|
26
26
|
# rake db:create RAILS_ENV=production
|
|
27
|
-
#
|
|
28
|
-
#
|
|
27
|
+
# zena migrate
|
|
28
|
+
# zena mksite LANG=en RAILS_ENV=production PASSWORD=admin HOST=localhost
|
|
29
29
|
# script/server -e production
|
|
30
30
|
|
|
31
31
|
Read more: http://zenadmin.org/documentation
|
|
@@ -41,7 +41,7 @@ http://github.com/zena/zena/blob/master/config/zena.rb
|
|
|
41
41
|
You should use capistrano to ease deployment. See 'config/delploy.rb'.
|
|
42
42
|
|
|
43
43
|
=== Create a new site
|
|
44
|
-
#
|
|
44
|
+
# zena mksite HOST=example.com PASSWORD=secret RAILS_ENV=production
|
|
45
45
|
|
|
46
46
|
=== Start
|
|
47
47
|
# ruby lib/upload_progress_server.rb start
|
data/Rakefile
CHANGED
|
@@ -27,6 +27,9 @@ begin
|
|
|
27
27
|
gemspec.rubyforge_project = 'zena'
|
|
28
28
|
|
|
29
29
|
gemspec.files.exclude 'config/routes.rb'
|
|
30
|
+
gemspec.files.exclude 'vendor/plugins/selenium-on-rails'
|
|
31
|
+
gemspec.files.exclude 'vendor/TextMate'
|
|
32
|
+
|
|
30
33
|
|
|
31
34
|
# Gem dependecies
|
|
32
35
|
Zena.gem_configuration.each do |gem_name, gem_config|
|
|
@@ -63,8 +63,6 @@ class UsersController < ApplicationController
|
|
|
63
63
|
|
|
64
64
|
get_groups_list
|
|
65
65
|
|
|
66
|
-
params[:user][:node_attributes] = params[:node]
|
|
67
|
-
|
|
68
66
|
@user = secure(User) { User.create(params[:user]) }
|
|
69
67
|
end
|
|
70
68
|
|
|
@@ -145,7 +143,11 @@ class UsersController < ApplicationController
|
|
|
145
143
|
def restrict_access
|
|
146
144
|
if visitor.is_admin?
|
|
147
145
|
@admin = true
|
|
146
|
+
if params[:user] && params[:node]
|
|
147
|
+
params[:user][:node_attributes] = params[:node]
|
|
148
|
+
end
|
|
148
149
|
elsif @user[:id] == visitor[:id]
|
|
150
|
+
# Cannot change linked node
|
|
149
151
|
if params[:user]
|
|
150
152
|
# visitor changing his/her own info : restrict fields
|
|
151
153
|
params[:user].keys.each do |k|
|
data/app/models/acl.rb
CHANGED
|
@@ -5,6 +5,7 @@ class Acl < ActiveRecord::Base
|
|
|
5
5
|
ACTIONS = %w{read update create delete}
|
|
6
6
|
ACTION_FROM_METHOD = Hash[:get,'read',:put,'update',:post,'create',:delete,'delete']
|
|
7
7
|
|
|
8
|
+
before_validation :set_defaults
|
|
8
9
|
before_save :set_visitor_id, :set_site_id
|
|
9
10
|
belongs_to :exec_group, :class_name => 'Group', :foreign_key => 'exec_group_id'
|
|
10
11
|
belongs_to :group
|
|
@@ -43,6 +44,11 @@ class Acl < ActiveRecord::Base
|
|
|
43
44
|
end
|
|
44
45
|
|
|
45
46
|
protected
|
|
47
|
+
def set_defaults
|
|
48
|
+
self.format = 'html' if format.blank?
|
|
49
|
+
self.mode = '' if mode.nil?
|
|
50
|
+
end
|
|
51
|
+
|
|
46
52
|
def set_visitor_id
|
|
47
53
|
self.user_id = visitor.id
|
|
48
54
|
end
|
data/app/models/cached_page.rb
CHANGED
|
@@ -126,7 +126,8 @@ class CachedPage < ActiveRecord::Base
|
|
|
126
126
|
|
|
127
127
|
# When destroying a cache record, remove the related cached file.
|
|
128
128
|
def cached_page_on_destroy
|
|
129
|
-
|
|
129
|
+
# allow ../public for single site mode
|
|
130
|
+
filepath = "#{SITES_ROOT}#{path.gsub(%r{\.\./(?!public)},'NO/')}" # just in case...
|
|
130
131
|
CachedPage.logger.info "remove #{filepath}"
|
|
131
132
|
# if symlink points to a dead file, exist? returns false...
|
|
132
133
|
FileUtils.rm(filepath) if File.exist?(filepath) || File.symlink?(filepath)
|
data/app/models/document.rb
CHANGED
|
@@ -72,7 +72,7 @@ class Document < Node
|
|
|
72
72
|
elsif attrs['title'] =~ /^.*\.(\w+)$/ && types = Zena::EXT_TO_TYPE[$1.downcase]
|
|
73
73
|
content_type = types[0]
|
|
74
74
|
end
|
|
75
|
-
|
|
75
|
+
|
|
76
76
|
real_class = document_class_from_content_type(content_type)
|
|
77
77
|
|
|
78
78
|
unless vclass && vclass.kpath =~ /\A#{real_class.kpath}/
|
|
@@ -91,7 +91,7 @@ class Document < Node
|
|
|
91
91
|
|
|
92
92
|
# Compatibility with VirtualClass
|
|
93
93
|
alias new_instance new
|
|
94
|
-
|
|
94
|
+
|
|
95
95
|
# Class list to which this class can change to
|
|
96
96
|
def change_to_classes_for_form
|
|
97
97
|
classes_for_form(:class => 'Document', :without => 'Image')
|
|
@@ -148,9 +148,8 @@ class Document < Node
|
|
|
148
148
|
end
|
|
149
149
|
|
|
150
150
|
# Get the document's public filename using the name and the file extension.
|
|
151
|
-
# FIXME: shouldn't we use title here ?
|
|
152
151
|
def filename
|
|
153
|
-
|
|
152
|
+
"#{title}.#{ext}"
|
|
154
153
|
end
|
|
155
154
|
|
|
156
155
|
# Get the file path defined in attachment.
|
data/app/models/node.rb
CHANGED
|
@@ -238,12 +238,14 @@ class Node < ActiveRecord::Base
|
|
|
238
238
|
:visitor => 'User', [:is_ancestor?, Node] => Boolean,
|
|
239
239
|
:comments_count => Number,
|
|
240
240
|
:v => {:class => 'Version', :method => 'version'},
|
|
241
|
+
:versions => {:class => ['Version'], :method => 'zafu_versions'},
|
|
241
242
|
:version => 'Version', :v_status => Number, :v_lang => String,
|
|
242
243
|
:v_publish_from => Time, :v_backup => Boolean,
|
|
243
244
|
:zip => Number, :parent_id => {:class => Number, :nil => true, :method => 'parent_zip'},
|
|
244
245
|
:user => 'User',
|
|
245
246
|
:author => author_proc,
|
|
246
|
-
:vclass => {:class => 'VirtualClass', :method => 'virtual_class'}
|
|
247
|
+
:vclass => {:class => 'VirtualClass', :method => 'virtual_class'},
|
|
248
|
+
:new_record? => Boolean
|
|
247
249
|
|
|
248
250
|
# This is needed so that we can use secure_scope and secure in search.
|
|
249
251
|
extend Zena::Acts::Secure
|
|
@@ -888,10 +890,8 @@ class Node < ActiveRecord::Base
|
|
|
888
890
|
res["#{$1}_zip"] = value
|
|
889
891
|
elsif key =~ /^(\w+)_ids$/
|
|
890
892
|
res["#{$1}_zips"] = value.kind_of?(Array) ? value : value.split(',')
|
|
891
|
-
elsif key == 'file'
|
|
892
|
-
unless value.blank?
|
|
893
|
-
res[key] = value
|
|
894
|
-
end
|
|
893
|
+
elsif key == 'v_status' || key == 'file'
|
|
894
|
+
res[key] = value unless value.blank?
|
|
895
895
|
elsif value.kind_of?(Hash)
|
|
896
896
|
res[key] = transform_attributes(value, base_node, change_timezone, %w{link rel rel_attributes}.include?(key) || is_link)
|
|
897
897
|
else
|
|
@@ -933,6 +933,9 @@ class Node < ActiveRecord::Base
|
|
|
933
933
|
end
|
|
934
934
|
end
|
|
935
935
|
|
|
936
|
+
def zafu_versions
|
|
937
|
+
versions.all(:order => 'number desc')
|
|
938
|
+
end
|
|
936
939
|
# Remove loaded version and properties on reload.
|
|
937
940
|
def reload
|
|
938
941
|
@version = nil
|
data/app/models/site.rb
CHANGED
|
@@ -421,7 +421,7 @@ class Site < ActiveRecord::Base
|
|
|
421
421
|
# The visitor used during index rebuild should be an admin user (to index
|
|
422
422
|
# unpublished templates).
|
|
423
423
|
def rebuild_index(nodes = nil, page = nil, page_count = nil)
|
|
424
|
-
if !
|
|
424
|
+
if !page
|
|
425
425
|
Site.logger.error("\n----------------- REBUILD INDEX FOR SITE #{host} -----------------\n")
|
|
426
426
|
Zena::SiteWorker.perform(self, :rebuild_index)
|
|
427
427
|
else
|
data/app/models/template.rb
CHANGED
|
@@ -14,7 +14,7 @@ Other templates have a title built from the given name, just like any other node
|
|
|
14
14
|
|
|
15
15
|
=end
|
|
16
16
|
class Template < TextDocument
|
|
17
|
-
|
|
17
|
+
MODE_FORMAT_FROM_TITLE = /^([A-Z][a-zA-Z]+?)(-(([a-zA-Z_\+]*)(-([a-zA-Z_]+)|))|)(\.|\Z)/
|
|
18
18
|
property do |p|
|
|
19
19
|
p.string 'target_klass'
|
|
20
20
|
p.string 'format'
|
|
@@ -82,7 +82,7 @@ class Template < TextDocument
|
|
|
82
82
|
self.content_type = 'text/zafu'
|
|
83
83
|
|
|
84
84
|
if prop.title_changed?
|
|
85
|
-
if title =~
|
|
85
|
+
if title =~ MODE_FORMAT_FROM_TITLE
|
|
86
86
|
# title changed force update
|
|
87
87
|
self.target_klass = $1 unless prop.target_klass_changed?
|
|
88
88
|
self.mode = ($4 || '') unless prop.mode_changed?
|
data/app/models/user.rb
CHANGED
|
@@ -186,10 +186,12 @@ class User < ActiveRecord::Base
|
|
|
186
186
|
end
|
|
187
187
|
|
|
188
188
|
def node_attributes=(node_attrs)
|
|
189
|
-
|
|
189
|
+
node_attrs.stringify_keys!
|
|
190
|
+
if !node_attrs['id'].blank?
|
|
191
|
+
@node = secure!(Node) { Node.find_node_by_pseudo(node_attrs.delete('id')) }
|
|
192
|
+
self[:node_id] = @node.id
|
|
193
|
+
elsif self[:node_id]
|
|
190
194
|
@node = secure!(Node) { node_without_secure }
|
|
191
|
-
elsif !node_attrs[:id].blank?
|
|
192
|
-
@node = secure!(Node) { Node.find_node_by_pseudo(node_attrs.delete(:id)) }
|
|
193
195
|
else
|
|
194
196
|
@node = secure(Node) { Node.new_node(prototype_attributes) }
|
|
195
197
|
end
|
data/app/views/acls/_add.rhtml
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<tr id='add_acl' class='btn_add'>
|
|
2
|
-
<td class='add'><%= link_to_function _('btn_acl_add'), "['add_acl', 'add_acl_form'].each(Element.toggle); " %></td
|
|
2
|
+
<td class='add'><%= link_to_function _('btn_acl_add'), "['add_acl', 'add_acl_form'].each(Element.toggle); " %></td>
|
|
3
|
+
<td colspan='8' class='add_user'></td>
|
|
3
4
|
</tr>
|
|
4
5
|
<tr id='add_acl_form' style='display:none;'>
|
|
5
6
|
<%= render :partial=>'acls/form' %>
|
data/app/views/acls/_form.rhtml
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
link_to_function _('btn_x'), "['add_acl', 'add_acl_form'].each(Element.toggle);"
|
|
6
6
|
end %>
|
|
7
7
|
</td>
|
|
8
|
-
<td class='add' colspan='
|
|
8
|
+
<td class='add' colspan='8'>
|
|
9
9
|
<div class='errors'><%= error_messages_for(:acl, :object => @acl) %></div>
|
|
10
10
|
<% if @acl[:id] %>
|
|
11
11
|
<%= form_remote_tag(:url=> acl_path(@acl)) %>
|
|
@@ -16,35 +16,43 @@
|
|
|
16
16
|
<% end %>
|
|
17
17
|
<table cellspacing='0'>
|
|
18
18
|
<tr>
|
|
19
|
-
<td class='label'><%= _('group')%> <%= help('acl_group_help') %></td>
|
|
19
|
+
<td class='label'><%= _('group')%> <%= help(_('acl_group_help')) %></td>
|
|
20
20
|
<td><%= select('acl', 'group_id', visitor.all_groups.map{|g| [g.name, g.id]}) %></td>
|
|
21
21
|
</tr>
|
|
22
22
|
<tr>
|
|
23
|
-
<td class='label'><%= _('action')%> <%= help('acl_action_help') %></td>
|
|
23
|
+
<td class='label'><%= _('action')%> <%= help(_('acl_action_help')) %></td>
|
|
24
24
|
<td><%= select('acl', 'action', Acl::ACTIONS ) %></td>
|
|
25
25
|
</tr>
|
|
26
26
|
<tr class='priority'>
|
|
27
|
-
<td class='label'><%= _('priority')%> <%= help('acl_priority_help') %></td>
|
|
27
|
+
<td class='label'><%= _('priority')%> <%= help(_('acl_priority_help')) %></td>
|
|
28
28
|
<td><%= text_field('acl', 'priority', :size => 4 ) %></td>
|
|
29
29
|
</tr>
|
|
30
30
|
<tr>
|
|
31
31
|
<td class='label'><%= _('name')%></td>
|
|
32
32
|
<td><%= text_field('acl', 'name', :size=>15 ) %></td>
|
|
33
33
|
</tr>
|
|
34
|
+
<tr>
|
|
35
|
+
<td class='label'><%= _('mode')%> <%= help(_('acl_mode_help')) %></td>
|
|
36
|
+
<td><%= text_field('acl', 'mode', :size=>15 ) %></td>
|
|
37
|
+
</tr>
|
|
38
|
+
<tr>
|
|
39
|
+
<td class='label'><%= _('format')%> <%= help(_('acl_format_help')) %></td>
|
|
40
|
+
<td><%= text_field('acl', 'format', :size=>15 ) %></td>
|
|
41
|
+
</tr>
|
|
34
42
|
<tr>
|
|
35
43
|
<td class='label'><%= _('description')%></td>
|
|
36
44
|
<td><%= text_area('acl', 'description', :rows => 2, :cols => 40) %></td>
|
|
37
45
|
</tr>
|
|
38
46
|
<tr>
|
|
39
|
-
<td class='label'><%= _('query')%> <%= help('acl_query_help') %></td>
|
|
47
|
+
<td class='label'><%= _('query')%> <%= help(_('acl_query_help')) %></td>
|
|
40
48
|
<td><%= text_area('acl', 'query', :rows => 4, :cols => 40) %></td>
|
|
41
49
|
</tr>
|
|
42
50
|
<tr class='exec'>
|
|
43
|
-
<td class='label'><%= _('exec group')%> <%= help('acl_exec_group_help') %></td>
|
|
51
|
+
<td class='label'><%= _('exec group')%> <%= help(_('acl_exec_group_help')) %></td>
|
|
44
52
|
<td><%= select('acl', 'exec_group_id', visitor.all_groups.map{|g| [g.name, g.id]}, :include_blank => true) %></td>
|
|
45
53
|
</tr>
|
|
46
54
|
<tr class='exec'>
|
|
47
|
-
<td class='label'><%= _('exec skin')%> <%= help('acl_exec_skin_help') %></td>
|
|
55
|
+
<td class='label'><%= _('exec skin')%> <%= help(_('acl_exec_skin_help')) %></td>
|
|
48
56
|
<td><%= select('acl', 'exec_skin_id', form_skins, {:include_blank => true, :selected => @acl.exec_skin_zip}) %></td>
|
|
49
57
|
</tr>
|
|
50
58
|
<tr>
|
data/app/views/acls/_li.rhtml
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
<td class='group'><%= li.group.name %></td>
|
|
4
4
|
<td class='act'><%= li.action %></td>
|
|
5
5
|
<td class='name'><%= li.name %></td>
|
|
6
|
+
<td class='mode'><%= li.mode %></td>
|
|
7
|
+
<td class='format'><%= li.format %></td>
|
|
6
8
|
<td class='query'><%= li.query %></td>
|
|
7
9
|
<td class='exec group'><%= li.exec_group_id ? li.exec_group.name : '' %></td>
|
|
8
10
|
<td class='exec skin'><%= li.exec_skin ? li.exec_skin.title : '' %></td>
|
data/app/views/acls/index.rhtml
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<h2 class='title'><%= _('access controls') %></h2>
|
|
2
2
|
<table class="admin" cellspacing="0">
|
|
3
|
-
<tr><th class='nav' colspan='
|
|
3
|
+
<tr><th class='nav' colspan='9'><%= will_paginate @acls %></th></tr>
|
|
4
4
|
<tr>
|
|
5
5
|
<th> </th>
|
|
6
6
|
<th><%= _('group') %></th>
|
|
7
7
|
<th><%= _('action') %></th>
|
|
8
8
|
<th><%= _('name') %></th>
|
|
9
|
+
<th><%= _('mode') %></th>
|
|
10
|
+
<th><%= _('format') %></th>
|
|
9
11
|
<th><%= _('query') %></th>
|
|
10
12
|
<th><%= _('exec group') %></th>
|
|
11
13
|
<th><%= _('exec skin') %></th>
|
data/app/views/links/destroy.rjs
CHANGED
|
@@ -4,8 +4,22 @@ else
|
|
|
4
4
|
if @errors || !@node.errors.empty?
|
|
5
5
|
page.replace_html 'link_errors', :inline=> @errors ? render_errors : error_messages_for(:node, :object => @node)
|
|
6
6
|
else
|
|
7
|
+
dom_id = "link#{@link[:id]}"
|
|
7
8
|
page.replace_html 'link_errors', :inline=>''
|
|
8
|
-
page
|
|
9
|
-
|
|
9
|
+
page << %Q{
|
|
10
|
+
new Effect.Highlight(
|
|
11
|
+
'#{dom_id}', {
|
|
12
|
+
duration: 0.3,
|
|
13
|
+
afterFinish: function() {
|
|
14
|
+
new Effect.Fade('#{dom_id}', {
|
|
15
|
+
duration: 0.5,
|
|
16
|
+
afterFinish: function() {
|
|
17
|
+
$('#{dom_id}').remove();
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
10
24
|
end
|
|
11
25
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# only called when the last version is destroyed in 'drive' popup
|
|
2
2
|
page.replace 'flash_messages', :inline => flash_messages(:page => page)
|
|
3
|
-
page.
|
|
3
|
+
page.remove 'versions'
|
|
4
4
|
page.delay(0.3) do
|
|
5
5
|
page << " if (parent != window) {
|
|
6
6
|
parent.Zena.version_preview('#{zen_path(@node.parent)}');
|
data/bin/zena
CHANGED
|
@@ -7,8 +7,10 @@ if %w(--version -v).include? ARGV.first
|
|
|
7
7
|
exit(0)
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
ENV['RAILS_ENV'] ||= 'production'
|
|
11
|
+
|
|
12
|
+
unless ARGV.first == 'new'
|
|
13
|
+
exec "rake zena:#{ARGV.join(' ')}"
|
|
12
14
|
end
|
|
13
15
|
|
|
14
16
|
require 'rails/version'
|
|
@@ -16,7 +18,7 @@ require 'rails_generator'
|
|
|
16
18
|
require 'rails_generator/scripts/generate'
|
|
17
19
|
template_path = File.join(Zena::ROOT, 'lib', 'zena', 'deploy', 'template.rb')
|
|
18
20
|
args = ["-m", template_path]
|
|
19
|
-
args << ARGV
|
|
21
|
+
args << ARGV[1]
|
|
20
22
|
|
|
21
23
|
puts "Generating zena application from template #{template_path}"
|
|
22
24
|
Rails::Generator::Base.use_application_sources!
|
|
@@ -8,8 +8,10 @@ module Bricks
|
|
|
8
8
|
# directory to avoid letting the user render with any zafu template.
|
|
9
9
|
def template_path_from_template_url_with_acls(template_url=params[:t_url])
|
|
10
10
|
if visitor.exec_acl && skin = visitor.exec_acl.exec_skin
|
|
11
|
+
# Make sure t_url is using templates in the allowed Skin
|
|
11
12
|
skin_name = skin.title.to_filename
|
|
12
13
|
unless template_url[0..skin_name.size] == skin_name + '/'
|
|
14
|
+
# Wrong Skin !
|
|
13
15
|
Node.logger.warn "Bad t_url used in ACL context (#{template_url}). Visitor = #{visitor.id} // #{visitor.login}"
|
|
14
16
|
# We do not raise AccessViolation to not give hints.
|
|
15
17
|
raise ActiveRecord::RecordNotFound
|
|
@@ -32,7 +34,7 @@ module Bricks
|
|
|
32
34
|
def acl_authorized?(action, params, base_node = nil)
|
|
33
35
|
node = nil
|
|
34
36
|
group_ids_bak = group_ids.dup
|
|
35
|
-
acls(action).each do |acl|
|
|
37
|
+
acls(action, params[:mode], params[:format]).each do |acl|
|
|
36
38
|
# Load exec_group to execute query
|
|
37
39
|
if acl.exec_group_id
|
|
38
40
|
@group_ids = group_ids_bak + [acl.exec_group_id]
|
|
@@ -55,9 +57,14 @@ module Bricks
|
|
|
55
57
|
# Find all acls for the visitor for a given action. The action should
|
|
56
58
|
# be one of the following: 'create', 'read', 'update', 'delete'. See
|
|
57
59
|
# Acl::ACTIONS.
|
|
58
|
-
def acls(action)
|
|
60
|
+
def acls(action, mode, format)
|
|
61
|
+
mode = '' if mode.blank?
|
|
62
|
+
# Can the format be blank ?
|
|
63
|
+
format = 'html' if format.blank?
|
|
59
64
|
secure(Acl) { Acl.find(:all,
|
|
60
|
-
:conditions => [
|
|
65
|
+
:conditions => [
|
|
66
|
+
'group_id IN (?) AND action = ? AND (mode = ? OR mode = ?) AND (format = ? OR format = ?)',
|
|
67
|
+
group_ids, action, '*', mode, '*', format],
|
|
61
68
|
:order => 'priority DESC'
|
|
62
69
|
)} || []
|
|
63
70
|
end
|
|
@@ -79,7 +86,7 @@ module Bricks
|
|
|
79
86
|
else
|
|
80
87
|
acl_params[:id] = zip
|
|
81
88
|
end
|
|
82
|
-
|
|
89
|
+
|
|
83
90
|
visitor.acl_authorized?(::Acl::ACTION_FROM_METHOD[method], acl_params)
|
|
84
91
|
end
|
|
85
92
|
end # UserMethods
|