zena 1.0.0.rc2 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +23 -0
- data/README.rdoc +1 -1
- data/app/controllers/columns_controller.rb +3 -31
- data/app/controllers/comments_controller.rb +8 -3
- data/app/controllers/data_entries_controller.rb +1 -1
- data/app/controllers/documents_controller.rb +2 -2
- data/app/controllers/nodes_controller.rb +29 -12
- data/app/controllers/relations_controller.rb +2 -2
- data/app/controllers/sites_controller.rb +1 -1
- data/app/controllers/user_sessions_controller.rb +6 -3
- data/app/controllers/users_controller.rb +18 -16
- data/app/controllers/versions_controller.rb +20 -18
- data/app/controllers/virtual_classes_controller.rb +103 -17
- data/app/helpers/users_helper.rb +1 -1
- data/app/models/column.rb +19 -50
- data/app/models/comment.rb +2 -1
- data/app/models/node.rb +45 -22
- data/app/models/relation.rb +13 -0
- data/app/models/relation_proxy.rb +3 -2
- data/app/models/role.rb +213 -4
- data/app/models/site.rb +18 -11
- data/app/models/template.rb +37 -35
- data/app/models/version.rb +1 -1
- data/app/models/virtual_class.rb +154 -86
- data/app/views/columns/_li.html.erb +1 -1
- data/app/views/columns/index.html.erb +1 -9
- data/app/views/comments/index.rhtml +10 -8
- data/app/views/documents/_crop.rhtml +5 -6
- data/app/views/documents/crop_form.rjs +3 -2
- data/app/views/groups/index.rhtml +1 -1
- data/app/views/iformats/index.rhtml +1 -1
- data/app/views/nodes/_import_results.rhtml +1 -1
- data/app/views/nodes/_parent.rhtml +1 -2
- data/app/views/nodes/update.rjs +3 -4
- data/app/views/relations/index.erb +1 -1
- data/app/views/sites/index.erb +1 -1
- data/app/views/templates/drive_tabs/_drive.rhtml +0 -2
- data/app/views/templates/edit_tabs/_image.rhtml +1 -1
- data/app/views/templates/edit_tabs/_title.rhtml +0 -6
- data/app/views/users/index.rhtml +1 -1
- data/app/views/users/preferences.html.erb +2 -2
- data/app/views/versions/backup.rjs +1 -1
- data/app/views/versions/custom_tab.rhtml +9 -4
- data/app/views/versions/destroy.rjs +2 -2
- data/app/views/versions/update.rjs +2 -9
- data/app/views/virtual_classes/_form.erb +3 -2
- data/app/views/virtual_classes/import_prepare.html.erb +13 -0
- data/app/views/virtual_classes/index.erb +28 -8
- data/app/views/zafu/default/Node-+adminLayout.zafu +1 -13
- data/app/views/zafu/default/Node-+login.zafu +1 -0
- data/app/views/zafu/default/Node-+notFound.zafu +1 -1
- data/app/views/zafu/default/Node-+popupLayout.zafu +1 -2
- data/app/views/zafu/default/Node-+search.zafu +1 -1
- data/app/views/zafu/default/Node-admin.zafu +205 -0
- data/app/views/zafu/default/Node.zafu +11 -11
- data/bricks/captcha/lib/bricks/captcha.rb +3 -2
- data/bricks/mongrel/zena/init.rb +2 -1
- data/bricks/pdf/README +5 -5
- data/bricks/pdf/lib/bricks/pdf/engine/prince.rb +2 -2
- data/bricks/pdf/lib/bricks/pdf/engine/xhtml2pdf.rb +2 -2
- data/bricks/pdf/lib/bricks/pdf/install.rb +5 -5
- data/bricks/pdf/lib/bricks/pdf.rb +11 -11
- data/bricks/pdf/test/engines/test_prince.rb +4 -4
- data/bricks/pdf/test/engines/test_xhtml2pdf.rb +4 -4
- data/bricks/pdf/test/shoulda_macros/shoulda_pdf.rb +2 -2
- data/bricks/pdf/zena/init.rb +2 -2
- data/bricks/pdf/zena/tasks.rb +2 -2
- data/bricks/sphinx/lib/bricks/sphinx.rb +6 -2
- data/bricks/sphinx/zena/{sphinx.yml → sphinx.yml.erb} +2 -2
- data/bricks/sphinx/zena/tasks.rb +28 -2
- data/bricks/tags/lib/bricks/tags.rb +16 -1
- data/bricks/tags/zena/test/unit/tags_test.rb +15 -0
- data/bricks/tags/zena/test/zafu/tags.yml +5 -1
- data/bricks/worker/lib/bricks/worker.rb +39 -0
- data/bricks/worker/zena/deploy.rb +0 -2
- data/bricks/worker/zena/init.rb +1 -0
- data/bricks/worker/zena/test/sites/zena/delayed_jobs.yml +16 -0
- data/bricks/worker/zena/test/zafu/worker.yml +8 -0
- data/bricks/zena/zena/migrate/01_base.rb +36 -60
- data/bricks/zena/zena/migrate/02_zerox1_schema.rb +388 -0
- data/bricks/zena/zena/migrate/03_zerox1_data.rb +380 -0
- data/bricks/zena/zena/migrate/20110315161158_add_reverse_scope_to_roles.rb +9 -0
- data/config/database_example.yml +1 -1
- data/config/environment.rb +1 -1
- data/config/gems.yml +17 -14
- data/db/init/base/skins/default/Node-+index.zafu +8 -1
- data/db/init/base/skins/default/Node-+login.zafu +1 -0
- data/db/init/base/skins/default/Node-+popupLayout.zafu +1 -2
- data/db/init/base/skins/default/Node-+search.zafu +2 -2
- data/db/init/base/skins/default/Node.zafu +9 -9
- data/db/init/base/skins/default/{favicon.png → img/favicon.png} +0 -0
- data/db/init/base/skins/default/{style.css → img/style.css} +0 -0
- data/db/init/base/skins/default/img/translations.yml +11 -0
- data/db/init/base/skins/default/notes.zafu +7 -9
- data/doc/zafu_changes.yml +12 -0
- data/lib/bricks/loader.rb +38 -15
- data/lib/tasks/zena.rake +74 -24
- data/lib/zena/acts/enrollable.rb +4 -1
- data/lib/zena/acts/secure.rb +2 -48
- data/lib/zena/acts/serializable.rb +13 -1
- data/lib/zena/app.rb +9 -0
- data/lib/zena/code_syntax.rb +154 -151
- data/lib/zena/console.rb +141 -0
- data/lib/zena/controller/test_case.rb +1 -1
- data/lib/zena/db_helper/abstract_db.rb +17 -5
- data/lib/zena/db_helper/mysql.rb +14 -12
- data/lib/zena/db_helper/postgresql.rb +1 -2
- data/lib/zena/db_helper/sqlite3.rb +6 -6
- data/lib/zena/deploy/awstats.conf.rhtml +1 -1
- data/lib/zena/deploy/httpd.rhtml +6 -1
- data/lib/zena/deploy/vhost.rhtml +9 -1
- data/lib/zena/deploy.rb +12 -7
- data/lib/zena/foxy_parser.rb +3 -1
- data/lib/zena/info.rb +1 -1
- data/lib/zena/parser/zafu_tags.rb +1 -0
- data/lib/zena/parser/zazen_rules.rb +1 -1
- data/lib/zena/remote/node.rb +15 -3
- data/lib/zena/remote/serializable_array.rb +19 -0
- data/lib/zena/remote.rb +1 -0
- data/lib/zena/routes.rb +7 -2
- data/lib/zena/site_worker.rb +11 -1
- data/lib/zena/unit/test_case.rb +68 -0
- data/lib/zena/use/action.rb +6 -2
- data/lib/zena/use/ajax.rb +127 -53
- data/lib/zena/use/ancestry.rb +11 -8
- data/lib/zena/use/calendar.rb +265 -129
- data/lib/zena/use/conditional.rb +1 -1
- data/lib/zena/use/context.rb +5 -5
- data/lib/zena/use/dates.rb +172 -60
- data/lib/zena/use/display.rb +70 -39
- data/lib/zena/use/error_rendering.rb +1 -3
- data/lib/zena/use/field_index.rb +4 -1
- data/lib/zena/use/forms.rb +94 -72
- data/lib/zena/use/fulltext.rb +16 -24
- data/lib/zena/use/html_tags.rb +20 -12
- data/lib/zena/use/i18n.rb +37 -37
- data/lib/zena/use/image_builder.rb +8 -1
- data/lib/zena/use/ml_index.rb +16 -16
- data/lib/zena/use/prop_eval.rb +10 -5
- data/lib/zena/use/query_builder.rb +55 -23
- data/lib/zena/use/query_node.rb +51 -25
- data/lib/zena/use/refactor.rb +2 -28
- data/lib/zena/use/relations.rb +1 -1
- data/lib/zena/use/rendering.rb +29 -0
- data/lib/zena/use/scope_index.rb +75 -14
- data/lib/zena/use/search.rb +5 -10
- data/lib/zena/use/test_helper.rb +2 -2
- data/lib/zena/use/urls.rb +125 -104
- data/lib/zena/use/workflow.rb +2 -1
- data/lib/zena/use/zafu_attributes.rb +2 -2
- data/lib/zena/use/zafu_safe_definitions.rb +20 -0
- data/lib/zena/use/zafu_templates.rb +20 -6
- data/lib/zena/use/zazen.rb +31 -20
- data/lib/zena/view/test_case.rb +5 -0
- data/lib/zena/zafu_compiler.rb +24 -2
- data/lib/zena.rb +12 -6
- data/locale/de/LC_MESSAGES/zena.mo +0 -0
- data/locale/de/zena.po +1345 -1164
- data/locale/en/LC_MESSAGES/zena.mo +0 -0
- data/locale/en/zena.po +1275 -1129
- data/locale/fr/LC_MESSAGES/zena.mo +0 -0
- data/locale/fr/zena.mo +0 -0
- data/locale/fr/zena.po +1617 -1441
- data/locale/log.txt +9 -0
- data/locale/zena.pot +957 -748
- data/public/javascripts/prototype.js +1 -1
- data/public/javascripts/zena.js +99 -44
- data/public/stylesheets/admin.css +6 -4
- data/public/stylesheets/backend.css +71 -0
- data/public/stylesheets/calendar.css +24 -25
- data/public/stylesheets/code.css +11 -6
- data/public/stylesheets/comment.css +2 -1
- data/public/stylesheets/popup.css +7 -8
- data/test/custom_queries/complex.host.yml +15 -1
- data/test/fixtures/files/Node-test.zafu +29 -28
- data/test/fixtures/files/translations_de.yml +12 -1
- data/test/fixtures/files/translations_fr.yml +12 -1
- data/test/functional/comments_controller_test.rb +9 -0
- data/test/functional/iformats_controller_test.rb +1 -1
- data/test/functional/nodes_controller_test.rb +124 -35
- data/test/functional/users_controller_test.rb +132 -3
- data/test/functional/virtual_classes_controller_test.rb +75 -4
- data/test/integration/navigation_test.rb +51 -9
- data/test/integration/query_node/basic.yml +19 -7
- data/test/integration/query_node/complex.yml +1 -1
- data/test/integration/query_node/dates.yml +27 -1
- data/test/integration/query_node/filters.yml +1 -1
- data/test/integration/query_node/relations.yml +13 -4
- data/test/integration/query_node_test.rb +4 -0
- data/test/integration/xml_api_test.rb +6 -1
- data/test/integration/zafu_compiler/action.yml +3 -3
- data/test/integration/zafu_compiler/ajax.yml +103 -22
- data/test/integration/zafu_compiler/basic.yml +0 -52
- data/test/integration/zafu_compiler/calendar.yml +44 -20
- data/test/integration/zafu_compiler/comments.yml +53 -0
- data/test/integration/zafu_compiler/complex.yml +11 -11
- data/test/integration/zafu_compiler/complex_ok.yml +16 -3
- data/test/integration/zafu_compiler/conditional.yml +15 -5
- data/test/integration/zafu_compiler/context.yml +9 -0
- data/test/integration/zafu_compiler/dates.yml +43 -15
- data/test/integration/zafu_compiler/display.yml +60 -6
- data/test/integration/zafu_compiler/errors.yml +6 -2
- data/test/integration/zafu_compiler/forms.yml +45 -6
- data/test/integration/zafu_compiler/i18n.yml +8 -1
- data/test/integration/zafu_compiler/meta.yml +38 -0
- data/test/integration/zafu_compiler/query.yml +43 -4
- data/test/integration/zafu_compiler/relations.yml +26 -33
- data/test/integration/zafu_compiler/rubyless.yml +10 -0
- data/test/integration/zafu_compiler/safe_definitions.yml +21 -1
- data/test/integration/zafu_compiler/urls.yml +75 -5
- data/test/integration/zafu_compiler/version.yml +2 -2
- data/test/integration/zafu_compiler/zafu_attributes.yml +5 -1
- data/test/integration/zafu_compiler/zazen.yml +14 -6
- data/test/integration/zafu_compiler_test.rb +5 -1
- data/test/sites/complex/columns.yml +5 -0
- data/test/sites/complex/roles.yml +4 -0
- data/test/sites/zena/nodes.yml +13 -2
- data/test/sites/zena/roles.yml +13 -5
- data/test/sites/zena/versions.yml +27 -9
- data/test/unit/column_test.rb +51 -5
- data/test/unit/iformat_test.rb +2 -2
- data/test/unit/node_test.rb +29 -17
- data/test/unit/note_test.rb +1 -1
- data/test/unit/relation_proxy_test.rb +4 -5
- data/test/unit/relation_test.rb +16 -0
- data/test/unit/remote_test.rb +2 -2
- data/test/unit/role_test.rb +292 -4
- data/test/unit/site_test.rb +12 -0
- data/test/unit/template_test.rb +1 -1
- data/test/unit/text_document_test.rb +1 -1
- data/test/unit/virtual_class_test.rb +200 -83
- data/test/unit/zena/acts/enrollable_test.rb +26 -31
- data/test/unit/zena/use/calendar_test.rb +90 -37
- data/test/unit/zena/use/field_index_test.rb +28 -0
- data/test/unit/zena/use/html_tags_test.rb +7 -3
- data/test/unit/zena/use/ml_index_test.rb +2 -16
- data/test/unit/zena/use/nested_attributes_alias_view_test.rb +2 -2
- data/test/unit/zena/use/prop_eval_test.rb +50 -8
- data/test/unit/zena/use/query_node_test.rb +11 -0
- data/test/unit/zena/use/rendering_test.rb +72 -0
- data/test/unit/zena/use/scope_index_test.rb +37 -2
- data/test/unit/zena/use/urls_test.rb +10 -0
- data/test/unit/zena/use/zazen_test.rb +3 -3
- data/vendor/plugins/gettext_i18n_rails/Gemfile +11 -0
- data/vendor/plugins/gettext_i18n_rails/Gemfile.lock +92 -0
- data/vendor/plugins/gettext_i18n_rails/Rakefile +12 -17
- data/vendor/plugins/gettext_i18n_rails/Readme.md +215 -0
- data/vendor/plugins/gettext_i18n_rails/VERSION +1 -1
- data/vendor/plugins/gettext_i18n_rails/gettext_i18n_rails.gemspec +38 -34
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/active_record.rb +1 -1
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/backend.rb +30 -14
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/haml_parser.rb +1 -1
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/html_safe_translations.rb +29 -0
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/i18n_hacks.rb +29 -1
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/model_attributes_finder.rb +7 -1
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/railtie.rb +10 -0
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/ruby_gettext_extractor.rb +6 -2
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/string_interpolate_fix.rb +20 -0
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/tasks.rb +120 -0
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails.rb +10 -3
- data/vendor/plugins/gettext_i18n_rails/lib/tasks/gettext_rails_i18n.rake +1 -74
- data/vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails/active_record_spec.rb +51 -20
- data/vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails/backend_spec.rb +12 -7
- data/vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails/string_interpolate_fix_spec.rb +32 -0
- data/vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails_spec.rb +38 -1
- data/vendor/plugins/gettext_i18n_rails/spec/rails2/Gemfile +11 -0
- data/vendor/plugins/gettext_i18n_rails/spec/spec_helper.rb +1 -8
- data/zena.gemspec +2241 -2217
- metadata +123 -83
- data/.gitignore +0 -36
- data/app/views/nodes/_dates.rhtml +0 -13
- data/db/init/base/skins/default/Node-+adminLayout.zafu +0 -46
- data/db/init/base/skins/default/Node-tree.zafu +0 -19
- data/vendor/plugins/gettext_i18n_rails/README.markdown +0 -143
@@ -22,10 +22,22 @@ url_with_param:
|
|
22
22
|
src: "<p do='eval'>url(parent)</p>"
|
23
23
|
res: "<p>http://test.host/oo/projects-list/Clean-Water-project</p>"
|
24
24
|
|
25
|
+
url_with_hash:
|
26
|
+
src: "<p do='url(this, :mode => \"foo\")'/>"
|
27
|
+
res: "/page22_foo.html/"
|
28
|
+
|
29
|
+
r_url_with_hash:
|
30
|
+
src: "<r:url mode='back' f='x'/>"
|
31
|
+
res: "/page22_back.html\?f=x/"
|
32
|
+
|
25
33
|
path:
|
26
34
|
src: "<a href='#{path}'>blah</a>"
|
27
35
|
res: "<a href='/oo/projects-list/Clean-Water-project/page22.html'>blah</a>"
|
28
36
|
|
37
|
+
path_with_mode:
|
38
|
+
src: "<a href='#{path(this, :mode => \"foo\")}'>blah</a>"
|
39
|
+
res: "<a href='/oo/projects-list/Clean-Water-project/page22_foo.html'>blah</a>"
|
40
|
+
|
29
41
|
link:
|
30
42
|
src: "<r:link/>"
|
31
43
|
tem: "<a href='<%= zen_path(@node) %>'><%= @node.prop['title'] %></a>"
|
@@ -62,6 +74,10 @@ link_set_class:
|
|
62
74
|
tem: "<a class='<%= \"#{@node.prop['title']}_foo\" %>' href='<%= zen_path(@node) %>'><%= @node.prop['title'] %></a>"
|
63
75
|
res: "<a class='status title_foo' href='/oo/projects-list/Clean-Water-project/page22.html'>status title</a>"
|
64
76
|
|
77
|
+
link_set_title:
|
78
|
+
src: "<r:link title='#{title}_foo'/>"
|
79
|
+
res: "<a title='status title_foo' href='/oo/projects-list/Clean-Water-project/page22.html'>status title</a>"
|
80
|
+
|
65
81
|
link_attr:
|
66
82
|
src: "<r:link attr='ref_lang'/>"
|
67
83
|
tem: "<a href='<%= zen_path(@node) %>'><%= @node.ref_lang %></a>"
|
@@ -138,17 +154,21 @@ link_href_string_with_anchor:
|
|
138
154
|
src: "<r:link href='\"yop\"' anchor='zoom'>"
|
139
155
|
res: "<a href='yop#zoom'>status title</a>"
|
140
156
|
|
141
|
-
|
157
|
+
link_href_find:
|
142
158
|
src: "<r:link href='find(30)'/>"
|
143
159
|
res: "<a href='/oo/image30.html'>status title</a>"
|
144
160
|
|
161
|
+
link_href_node:
|
162
|
+
src: "<r:nodes in='site'><r:link href='@node' eval='@node.title'/></r:nodes>"
|
163
|
+
res: "/.*page22.html'>status title</a>/"
|
164
|
+
|
145
165
|
link_date:
|
146
166
|
context:
|
147
167
|
ref_date: '2008-06-27'
|
148
168
|
old_src: "<r:link date='current_date'/>"
|
149
|
-
src: "<r:link date='#{
|
150
|
-
tem: '
|
151
|
-
res: "<a href='/oo/projects-list/Clean-Water-project/page22.html?date=2008-06-
|
169
|
+
src: "<r:link date='#{date.strftime(\"%Y-%m-%d\")}'/>"
|
170
|
+
tem: '/main_date/'
|
171
|
+
res: "<a href='/oo/projects-list/Clean-Water-project/page22.html?date=2008-06-27'>status title</a>"
|
152
172
|
|
153
173
|
link_url_params:
|
154
174
|
src: "<r:link plob='hopla'/>"
|
@@ -196,4 +216,54 @@ live_link_data_mode:
|
|
196
216
|
node: 'bird_jpg'
|
197
217
|
old_src: "<h2 do='title' link='pv.data'>super title</h2>"
|
198
218
|
src: "<h2 do='link' live='true' mode='pv' format='data'/>"
|
199
|
-
res: "<h2><a id='_title30' href='/en/image30_pv.jpg?967816914293'>bird</a></h2>"
|
219
|
+
res: "<h2><a id='_title30' href='/en/image30_pv.jpg?967816914293'>bird</a></h2>"
|
220
|
+
|
221
|
+
url_with_lang:
|
222
|
+
src: "window.location = \"<r:url lang='fr'/>\";"
|
223
|
+
res: "/\\?lang=fr/"
|
224
|
+
|
225
|
+
link_in_list_context:
|
226
|
+
src: "<div do='nodes in site'><r:link/></div>"
|
227
|
+
tem: "/zen_path\(var1.first\).*var1.first.prop\['title'\]/"
|
228
|
+
res: '/a href.*a wiki with Zena/'
|
229
|
+
|
230
|
+
link_trans:
|
231
|
+
src: "<r:link t='img_next_page'/>"
|
232
|
+
res: "/a href.*/images/control_fastforward.png/"
|
233
|
+
|
234
|
+
link_date_complex:
|
235
|
+
context:
|
236
|
+
ref_date: '2011-04-22 22:00'
|
237
|
+
src: "<r:link date='#{date.advance(:months => -1).strftime(\"%Y-%m-%d\", \"Asia/Jakarta\")}' text='PREV'/>"
|
238
|
+
# Date is in Asia/Jakarta timezone. Ref date is utc in tests.
|
239
|
+
res: "/\?date=2011-03-23'>PREV/"
|
240
|
+
|
241
|
+
target_blank:
|
242
|
+
src: "<r:link mode='foo' target='_blank'/>"
|
243
|
+
res: "/<a target='_blank' href='/"
|
244
|
+
|
245
|
+
action_destroy:
|
246
|
+
src: "<r:link action='destroy'/>"
|
247
|
+
res: "<a data-confirm='Destroy ? \"status title\"' href='/nodes/22' onclick='return Zena.m(this,\"delete\")'>status title</a>"
|
248
|
+
|
249
|
+
action_publish:
|
250
|
+
src: "<r:link action='publish'/>"
|
251
|
+
res: "<a href='/nodes/22/versions/0/publish' onclick='return Zena.m(this,\"put\")'>status title</a>"
|
252
|
+
|
253
|
+
action_edit:
|
254
|
+
src: "<r:link action='publish'/>"
|
255
|
+
res: "<a href='/nodes/22/versions/0/publish' onclick='return Zena.m(this,\"put\")'>status title</a>"
|
256
|
+
|
257
|
+
action_add_doc:
|
258
|
+
src: "<r:link action='add_doc'/>"
|
259
|
+
res: "<a href='/documents/new?parent_id=22'>status title</a>"
|
260
|
+
|
261
|
+
action_drive:
|
262
|
+
src: "<r:link action='drive'/>"
|
263
|
+
res: "<a href='/nodes/22/edit'>status title</a>"
|
264
|
+
|
265
|
+
action_confirm:
|
266
|
+
src: "<r:link confirm='really go away ?'/>"
|
267
|
+
res: "<a data-confirm='really go away ?' href='/oo/projects-list/Clean-Water-project/page22.html' onclick='return Zena.m(this,\"get\")'>status title</a>"
|
268
|
+
|
269
|
+
# update with insert tested in rendering_test.
|
@@ -39,9 +39,9 @@ author:
|
|
39
39
|
res: "en:Tigris Sumatran, fr:Invicta"
|
40
40
|
|
41
41
|
created_at:
|
42
|
-
src: "<p do='
|
42
|
+
src: "<p do='v.created_at' format='%d %b %y'/>"
|
43
43
|
res: "<p>10 Mar 06</p>"
|
44
44
|
|
45
45
|
updated_at:
|
46
|
-
src: "<p do='show'
|
46
|
+
src: "<p do='show' eval='v.updated_at' format='%d %b %y'/>"
|
47
47
|
res: "<p>11 Apr 06</p>"
|
@@ -45,6 +45,10 @@ show_title_with_actions_without_prefix:
|
|
45
45
|
src: "<h1 do='title' live='true' actions='all'/>"
|
46
46
|
tem: "/class='s<%= @node.version.status %>/"
|
47
47
|
|
48
|
+
show_link_with_actions:
|
49
|
+
src: "<h1 do='link' do='title' live='true' actions='all'/>"
|
50
|
+
tem: "/class='s<%= @node.version.status %>/"
|
51
|
+
|
48
52
|
node_actions_status_prefix_false:
|
49
53
|
src: "<h1 do='title' actions='all' status='false'/>"
|
50
54
|
tem: "!/class='s<%= @node.version.status %>/"
|
@@ -133,7 +137,7 @@ on_if_on_each:
|
|
133
137
|
res: "<p class=''>crocodiles</p><p class=''>Keeping things clean !</p><p class=' on'>status title</p>"
|
134
138
|
|
135
139
|
on_if_ancestor:
|
136
|
-
src: "<r:root><r:pages><li do='each' on_if='
|
140
|
+
src: "<r:root><r:pages><li do='each' on_if='is_ancestor?(main)' class='hello' join=', ' do='title'/></r:pages></r:root>"
|
137
141
|
res: "<li class='hello'>Collections</li>, <li class='hello'>Nature</li>, <li class='hello'>people</li>, <li class='hello on'>projects list</li>, <li class='hello'>Skins (layout themes)</li>"
|
138
142
|
|
139
143
|
on_if_empty:
|
@@ -35,6 +35,10 @@ at_code:
|
|
35
35
|
tem: "<%= zazen(\"Try this: @ruby|puts 'Hello'@ or this @zafu|<r:link/>@\") %>"
|
36
36
|
res: "<p>Try this: <code class='ruby'><span class=\"ident\">puts</span> <span class=\"punct\">'</span><span class=\"string\">Hello</span><span class=\"punct\">'</span></code> or this <code class='zafu'><span class=\"tag\"><r:</span><span class=\"ztag\">link</span><span class=\"tag\">/></span></code></p>"
|
37
37
|
|
38
|
+
code_sqliss:
|
39
|
+
tem: "<%= zazen('foo: @sqliss|contact in project@.') %>"
|
40
|
+
res: "/<span class=\"context\">in</span>/"
|
41
|
+
|
38
42
|
spaces_on_first_lines:
|
39
43
|
tem: "<%= zazen(\"This is a normal paragraphe. There are many phrases in this paragraphe and a forced line break\nhere. End of first paragraphe.\n\n This second paragraphe\n is space preserving\n la la la la.\") %>"
|
40
44
|
res: "<p>This is a normal paragraphe. There are many phrases in this paragraphe and a forced line break\n<br/>here. End of first paragraphe.</p>\n\n\n<pre>This second paragraphe\nis space preserving\nla la la la.</pre>"
|
@@ -44,27 +48,31 @@ line_break_list:
|
|
44
48
|
res: "/<p>first.<\/p>.*<ul>.*<li>one.*<li>two.*<p>second/"
|
45
49
|
|
46
50
|
zip_shortcut_link:
|
47
|
-
tem: "<%= zazen('Look \"here\"::lake or \"\"::lake
|
51
|
+
tem: "<%= zazen('Look \"here\"::lake+ or \"\"::lake') %>"
|
48
52
|
res: "/<p>Look <a href.*contact23.html.*projects list/Clean Water project/Lake Tanganyika.*href=.*image24.html.*projects list/Clean Water project/it’s a lake/"
|
49
53
|
|
54
|
+
data_on_obj:
|
55
|
+
tem: "<%= zazen('Look \"here\":22.data') %>"
|
56
|
+
res: "/page22.html/"
|
57
|
+
|
50
58
|
zip_shortcut_link_with_mode_format:
|
51
|
-
tem: "<%= zazen('Look \"here\"::
|
59
|
+
tem: "<%= zazen('Look \"here\"::lake+_life.rss, \"\"::lake_life.data.') %>"
|
52
60
|
res: "/<p>Look <a href.*contact23_life.rss.*projects list/Clean Water project/Lake Tanganyika_life.rss</a>, <a href=.*image24_life.jpg.*projects list/Clean Water project/it’s a lake_life.jpg</a>./"
|
53
61
|
|
54
62
|
zip_shortcut_image:
|
55
|
-
tem: "<%= zazen('Look !:lake
|
63
|
+
tem: "<%= zazen('Look !:lake+! or !:lake!') %>"
|
56
64
|
res: "/<p>Look \[projects list/Clean Water project/Lake Tanganyika is not a document\] or <img src=.*image24_std.jpg/"
|
57
65
|
|
58
66
|
zip_shortcut_image_with_options:
|
59
|
-
tem: "<%= zazen('Look !<.:
|
67
|
+
tem: "<%= zazen('Look !<.:lake+_med! or !=.:lake_pv!') %>"
|
60
68
|
res: "/<p>Look \[projects list/Clean Water project/Lake Tanganyika is not a document\] or .*center.*<img src=.*image24_pv.jpg/"
|
61
69
|
|
62
70
|
zip_shortcut_gallery:
|
63
|
-
tem: "<%= zazen('Look ![30,:lake
|
71
|
+
tem: "<%= zazen('Look ![30,:lake]!') %>"
|
64
72
|
res: "/gallery.*image30_pv.*image24_pv.*/"
|
65
73
|
|
66
74
|
zip_shortcut_list:
|
67
|
-
tem: "<%= zazen('Look !{30,:lake
|
75
|
+
tem: "<%= zazen('Look !{30,:lake}!') %>"
|
68
76
|
res: "/docs.*image30_mini.*image24_mini.*/"
|
69
77
|
|
70
78
|
line_break_between_paragraphs:
|
@@ -6,7 +6,7 @@ class ZafuCompilerTest < Zena::Controller::TestCase
|
|
6
6
|
'action',
|
7
7
|
'asset',
|
8
8
|
'conditional',
|
9
|
-
|
9
|
+
'calendar',
|
10
10
|
'dates',
|
11
11
|
'display',
|
12
12
|
'errors',
|
@@ -21,6 +21,7 @@ class ZafuCompilerTest < Zena::Controller::TestCase
|
|
21
21
|
'search',
|
22
22
|
'site',
|
23
23
|
'tags', # bricks/tags/zena/test/zafu
|
24
|
+
'worker', # bricks/worker/zena/test/zafu
|
24
25
|
'urls',
|
25
26
|
'user',
|
26
27
|
'version',
|
@@ -31,6 +32,9 @@ class ZafuCompilerTest < Zena::Controller::TestCase
|
|
31
32
|
'ajax',
|
32
33
|
'complex_ok',
|
33
34
|
'forms',
|
35
|
+
'meta',
|
36
|
+
'context',
|
37
|
+
'comments',
|
34
38
|
]
|
35
39
|
|
36
40
|
BUG = [
|
data/test/sites/zena/nodes.yml
CHANGED
@@ -84,6 +84,8 @@ proposition:
|
|
84
84
|
class: Post
|
85
85
|
parent: secret
|
86
86
|
user: ant
|
87
|
+
idx_datetime1: 2006-03-15
|
88
|
+
# FIXME: remove log_at and event_at
|
87
89
|
event_at: 2006-04-05
|
88
90
|
log_at: 2006-04-05
|
89
91
|
|
@@ -128,6 +130,8 @@ opening:
|
|
128
130
|
class: Post
|
129
131
|
parent: cleanWater
|
130
132
|
ref_lang: fr
|
133
|
+
idx_datetime1: 2006-03-15
|
134
|
+
# FIXME: remove 'log_at' and 'event_at'
|
131
135
|
log_at: 2006-03-15
|
132
136
|
event_at: 2006-03-18 15:00
|
133
137
|
|
@@ -269,10 +273,17 @@ Node_search_zafu:
|
|
269
273
|
class: Template
|
270
274
|
parent: default
|
271
275
|
|
276
|
+
img:
|
277
|
+
class: Page
|
278
|
+
parent: default
|
279
|
+
v_lang: en
|
280
|
+
v_prop:
|
281
|
+
title: img
|
282
|
+
|
272
283
|
style_css:
|
273
284
|
zip: 53
|
274
285
|
class: TextDocument
|
275
|
-
parent:
|
286
|
+
parent: img
|
276
287
|
|
277
288
|
Node_zafu:
|
278
289
|
class: Template
|
@@ -312,4 +323,4 @@ Node_login_zafu:
|
|
312
323
|
|
313
324
|
translations:
|
314
325
|
class: TextDocument
|
315
|
-
parent:
|
326
|
+
parent: img
|
data/test/sites/zena/roles.yml
CHANGED
@@ -20,14 +20,15 @@ Post:
|
|
20
20
|
Reference:
|
21
21
|
kpath: NR
|
22
22
|
real_class: Node
|
23
|
-
|
23
|
+
prop:
|
24
|
+
idx_scope: "{'reference' => 'references'}"
|
24
25
|
|
25
26
|
Contact:
|
26
27
|
kpath: NRC
|
27
28
|
real_class: Node
|
28
|
-
idx_scope: "{'reference' => 'references', 'contact' => 'project'}"
|
29
29
|
prop:
|
30
30
|
prop_eval: "{'title' => \"#{first_name} #{name}\"}"
|
31
|
+
idx_scope: "{'reference' => 'references', 'contact' => 'project'}"
|
31
32
|
|
32
33
|
Tracker:
|
33
34
|
kpath: NPA
|
@@ -37,7 +38,8 @@ Tracker:
|
|
37
38
|
Tag:
|
38
39
|
kpath: NPT
|
39
40
|
real_class: Page
|
40
|
-
|
41
|
+
prop:
|
42
|
+
idx_scope: "{'tag' => %w{project self}}"
|
41
43
|
|
42
44
|
Task:
|
43
45
|
kpath: N
|
@@ -47,8 +49,14 @@ Original:
|
|
47
49
|
kpath: N
|
48
50
|
type: Role
|
49
51
|
|
52
|
+
Comment:
|
53
|
+
kpath: N
|
54
|
+
type: Role
|
55
|
+
|
50
56
|
Blog:
|
51
57
|
kpath: NPPB
|
52
58
|
real_class: Project
|
53
|
-
|
54
|
-
|
59
|
+
prop:
|
60
|
+
idx_class: IdxProject
|
61
|
+
idx_scope: "{'blog' => 'self'}"
|
62
|
+
idx_reverse_scope: "nodes in project"
|
@@ -259,7 +259,7 @@ opening_fr:
|
|
259
259
|
prop:
|
260
260
|
comment: french opening
|
261
261
|
title: ouverture du parc
|
262
|
-
date:
|
262
|
+
date: 2006-03-15
|
263
263
|
|
264
264
|
bananas_en:
|
265
265
|
node: bananas
|
@@ -350,7 +350,7 @@ opening_en:
|
|
350
350
|
number: 2
|
351
351
|
prop:
|
352
352
|
title: parc opening
|
353
|
-
date:
|
353
|
+
date: 2006-03-15
|
354
354
|
text: |
|
355
355
|
We are glad to announce the opening of our new project !
|
356
356
|
|
@@ -364,7 +364,7 @@ opening_red_fr:
|
|
364
364
|
status: red
|
365
365
|
number: 3
|
366
366
|
prop:
|
367
|
-
date:
|
367
|
+
date: 2006-03-15
|
368
368
|
comment: new redaction for opening
|
369
369
|
title: super ouverture
|
370
370
|
|
@@ -571,7 +571,7 @@ Node_search_zafu_en:
|
|
571
571
|
node: Node_search_zafu
|
572
572
|
user: tiger
|
573
573
|
prop:
|
574
|
-
text: "[FILE:
|
574
|
+
text: "[FILE:db/init/base/skins/default/Node-+search.zafu]"
|
575
575
|
format: html
|
576
576
|
tkpath: N
|
577
577
|
mode: "+search"
|
@@ -581,7 +581,7 @@ style_css_en:
|
|
581
581
|
node: style_css
|
582
582
|
user: tiger
|
583
583
|
prop:
|
584
|
-
text: "[FILE:db/init/base/skins/default/style.css]"
|
584
|
+
text: "[FILE:db/init/base/skins/default/img/style.css]"
|
585
585
|
title: style
|
586
586
|
content_type: text/css
|
587
587
|
ext: css
|
@@ -591,11 +591,13 @@ Node_zafu_en:
|
|
591
591
|
node: Node_zafu
|
592
592
|
user: tiger
|
593
593
|
prop:
|
594
|
-
text: "[FILE:
|
594
|
+
text: "[FILE:db/init/base/skins/default/Node.zafu]"
|
595
595
|
title: Node
|
596
596
|
format: html
|
597
597
|
tkpath: N
|
598
598
|
target_klass: Node
|
599
|
+
content_type: text/zafu
|
600
|
+
ext: zafu
|
599
601
|
|
600
602
|
Node_admin_layout_zafu_en:
|
601
603
|
node: Node_admin_layout_zafu
|
@@ -607,6 +609,8 @@ Node_admin_layout_zafu_en:
|
|
607
609
|
tkpath: N
|
608
610
|
mode: "+adminLayout"
|
609
611
|
target_klass: Node
|
612
|
+
content_type: text/zafu
|
613
|
+
ext: zafu
|
610
614
|
|
611
615
|
Node_index_zafu_en:
|
612
616
|
node: Node_index_zafu
|
@@ -618,28 +622,34 @@ Node_index_zafu_en:
|
|
618
622
|
tkpath: N
|
619
623
|
mode: "+index"
|
620
624
|
target_klass: Node
|
625
|
+
content_type: text/zafu
|
626
|
+
ext: zafu
|
621
627
|
|
622
628
|
Node_not_found_zafu_en:
|
623
629
|
node: Node_not_found_zafu
|
624
630
|
user: tiger
|
625
631
|
prop:
|
626
|
-
text: "[FILE:
|
632
|
+
text: "[FILE:db/init/base/skins/default/Node-+notFound.zafu]"
|
627
633
|
title: Node-+notFound
|
628
634
|
format: html
|
629
635
|
tkpath: N
|
630
636
|
mode: "+notFound"
|
631
637
|
target_klass: Node
|
638
|
+
content_type: text/zafu
|
639
|
+
ext: zafu
|
632
640
|
|
633
641
|
Node_popup_layout_zafu_en:
|
634
642
|
node: Node_popup_layout_zafu
|
635
643
|
user: tiger
|
636
644
|
prop:
|
637
|
-
text: "[FILE:
|
645
|
+
text: "[FILE:db/init/base/skins/default/Node-+popupLayout.zafu]"
|
638
646
|
title: Node-+popupLayout
|
639
647
|
format: html
|
640
648
|
tkpath: N
|
641
649
|
mode: "+popupLayout"
|
642
650
|
target_klass: Node
|
651
|
+
content_type: text/zafu
|
652
|
+
ext: zafu
|
643
653
|
|
644
654
|
Node_test_en:
|
645
655
|
node: Node_test_zafu
|
@@ -651,6 +661,8 @@ Node_test_en:
|
|
651
661
|
tkpath: N
|
652
662
|
mode: test
|
653
663
|
target_klass: Node
|
664
|
+
content_type: text/zafu
|
665
|
+
ext: zafu
|
654
666
|
|
655
667
|
notes_zafu_en:
|
656
668
|
node: notes_zafu
|
@@ -659,6 +671,8 @@ notes_zafu_en:
|
|
659
671
|
text: "[FILE:db/init/base/skins/default/notes.zafu]"
|
660
672
|
title: notes
|
661
673
|
format: html
|
674
|
+
content_type: text/zafu
|
675
|
+
ext: zafu
|
662
676
|
|
663
677
|
Project_zafu_en:
|
664
678
|
node: Project_zafu
|
@@ -669,17 +683,21 @@ Project_zafu_en:
|
|
669
683
|
format: html
|
670
684
|
tkpath: NPP
|
671
685
|
target_klass: Project
|
686
|
+
content_type: text/zafu
|
687
|
+
ext: zafu
|
672
688
|
|
673
689
|
Node_login_zafu_en:
|
674
690
|
node: Node_login_zafu
|
675
691
|
user: tiger
|
676
692
|
prop:
|
677
|
-
text: "[FILE:
|
693
|
+
text: "[FILE:db/init/base/skins/default/Node-+login.zafu]"
|
678
694
|
title: Node-+login
|
679
695
|
format: html
|
680
696
|
tkpath: N
|
681
697
|
mode: "+login"
|
682
698
|
target_klass: Node
|
699
|
+
content_type: text/zafu
|
700
|
+
ext: zafu
|
683
701
|
|
684
702
|
translations_de:
|
685
703
|
node: translations
|
data/test/unit/column_test.rb
CHANGED
@@ -66,36 +66,82 @@ class ColumnTest < Zena::Unit::TestCase
|
|
66
66
|
Column.create(:role_id => roles_id(:Task), :ptype => 'string', :name => 'secure_on_destroy')
|
67
67
|
end
|
68
68
|
|
69
|
-
should 'fail with an error
|
69
|
+
should 'fail with an error' do
|
70
70
|
assert_difference('Column.count', 0) do
|
71
71
|
assert_equal 'invalid (method defined in Node)', subject.errors[:name]
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end # with the name of a hardwire property
|
75
|
-
|
75
|
+
|
76
76
|
context 'ending with _ids' do
|
77
77
|
subject do
|
78
78
|
Column.create(:role_id => roles_id(:Task), :ptype => 'string', :name => 'secure_on_destroy_ids')
|
79
79
|
end
|
80
80
|
|
81
|
-
should 'fail with an error
|
81
|
+
should 'fail with an error' do
|
82
82
|
assert_difference('Column.count', 0) do
|
83
83
|
assert_equal 'invalid (cannot end with _id or _ids)', subject.errors[:name]
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end # with the name of a hardwire property
|
87
|
-
|
87
|
+
|
88
88
|
context 'ending with _id' do
|
89
89
|
subject do
|
90
90
|
Column.create(:role_id => roles_id(:Task), :ptype => 'string', :name => 'secure_on_destroy_id')
|
91
91
|
end
|
92
92
|
|
93
|
-
should 'fail with an error
|
93
|
+
should 'fail with an error' do
|
94
94
|
assert_difference('Column.count', 0) do
|
95
95
|
assert_equal 'invalid (cannot end with _id or _ids)', subject.errors[:name]
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end # with the name of a hardwire property
|
99
|
+
|
100
|
+
context 'with an invalid ptype' do
|
101
|
+
subject do
|
102
|
+
Column.create(:role_id => roles_id(:Task), :ptype => 'stringlitch', :name => 'dummy')
|
103
|
+
end
|
104
|
+
|
105
|
+
should 'fail with an error' do
|
106
|
+
assert_difference('Column.count', 0) do
|
107
|
+
assert_equal 'invalid', subject.errors[:ptype]
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end # with an invalid ptype
|
111
|
+
|
112
|
+
context 'with an invalid index' do
|
113
|
+
subject do
|
114
|
+
Column.create(
|
115
|
+
:role_id => roles_id(:Task),
|
116
|
+
:ptype => 'string',
|
117
|
+
:index => 'bad',
|
118
|
+
:name => 'dummy'
|
119
|
+
)
|
120
|
+
end
|
121
|
+
|
122
|
+
should 'fail with an error' do
|
123
|
+
assert_difference('Column.count', 0) do
|
124
|
+
assert_equal 'invalid', subject.errors[:index]
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end # with an invalid index
|
128
|
+
|
99
129
|
end # Creating a column
|
100
130
|
|
131
|
+
context 'exporting a column' do
|
132
|
+
setup do
|
133
|
+
login(:lion)
|
134
|
+
end
|
135
|
+
|
136
|
+
subject do
|
137
|
+
columns(:Post_date)
|
138
|
+
end
|
139
|
+
|
140
|
+
should 'export attributes' do
|
141
|
+
assert_equal({
|
142
|
+
'ptype' => 'datetime',
|
143
|
+
'index' => '.idx_datetime1',
|
144
|
+
}, subject.export)
|
145
|
+
end
|
146
|
+
end # exporting a role
|
101
147
|
end
|
data/test/unit/iformat_test.rb
CHANGED
@@ -47,10 +47,10 @@ class IformatTest < Zena::Unit::TestCase
|
|
47
47
|
|
48
48
|
def test_list
|
49
49
|
login(:lion)
|
50
|
-
assert_equal %w{tiny mini pv square low top med side edit std full}, Iformat.list.map{|h| h[:name]}
|
50
|
+
assert_equal %w{tiny tipop mini pv square low top med side edit std full}, Iformat.list.map{|h| h[:name]}
|
51
51
|
|
52
52
|
login(:whale)
|
53
|
-
assert_equal %w{tiny mini pv square low med top side header edit std full}, Iformat.list.map{|h| h[:name]}
|
53
|
+
assert_equal %w{tiny tipop mini pv square low med top side header edit std full}, Iformat.list.map{|h| h[:name]}
|
54
54
|
end
|
55
55
|
|
56
56
|
def test_mem_cached
|