zena 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +29 -1
- data/Rakefile +0 -1
- data/app/controllers/documents_controller.rb +1 -1
- data/app/controllers/nodes_controller.rb +34 -8
- data/app/controllers/sites_controller.rb +8 -1
- data/app/controllers/user_sessions_controller.rb +13 -3
- data/app/models/acl.rb +16 -0
- data/app/models/document.rb +33 -14
- data/app/models/idx_nodes_integer.rb +5 -0
- data/app/models/image.rb +16 -4
- data/app/models/node.rb +16 -3
- data/app/models/relation_proxy.rb +3 -3
- data/app/models/site.rb +11 -1
- data/app/models/string_hash.rb +1 -1
- data/app/models/template.rb +1 -1
- data/app/models/user.rb +6 -1
- data/app/models/virtual_class.rb +36 -1
- data/app/views/acls/_form.rhtml +5 -1
- data/app/views/acls/_li.rhtml +1 -1
- data/app/views/templates/document_create_tabs/_file.rhtml +1 -0
- data/app/views/templates/document_create_tabs/_template.rhtml +1 -1
- data/app/views/users/_form.rhtml +1 -0
- data/app/views/virtual_classes/_form.erb +8 -7
- data/bricks/acls/lib/bricks/acls.rb +43 -15
- data/bricks/acls/zena/migrate/20130313110443_add_create_kpath_to_acl.rb +13 -0
- data/bricks/acls/zena/migrate/20130429073432_fix_create_kpath_default.rb +8 -0
- data/bricks/acls/zena/test/integration/acl_integration_test.rb +53 -1
- data/bricks/acls/zena/test/sites/erebus/acls.yml +21 -0
- data/bricks/acls/zena/test/unit/acl_test.rb +35 -2
- data/bricks/math/lib/bricks/math.rb +1 -1
- data/bricks/sphinx/zena/tasks.rb +1 -1
- data/bricks/spreadsheet/lib/bricks/spreadsheet.rb +1 -1
- data/bricks/worker/zena/worker +25 -0
- data/config/environment.rb +1 -1
- data/config/environments/production.rb +1 -1
- data/config/gems.yml +6 -5
- data/lib/bricks/requirements_validation.rb +1 -1
- data/lib/log_recorder/lib/log_recorder.rb +1 -1
- data/lib/tasks/zena.rake +10 -2
- data/lib/zena.rb +4 -3
- data/lib/zena/app.rb +1 -0
- data/lib/zena/deploy/httpd.rhtml +2 -2
- data/lib/zena/deploy/template.rb +15 -5
- data/lib/zena/info.rb +1 -1
- data/lib/zena/parser/zazen_rules.rb +9 -2
- data/lib/zena/remote/connection.rb +2 -2
- data/lib/zena/remote/interface.rb +8 -2
- data/lib/zena/remote/node.rb +1 -1
- data/lib/zena/routes.rb +2 -1
- data/lib/zena/use/action.rb +8 -2
- data/lib/zena/use/ajax.rb +31 -20
- data/lib/zena/use/calendar.rb +2 -0
- data/lib/zena/use/conditional.rb +15 -14
- data/lib/zena/use/dates.rb +5 -2
- data/lib/zena/use/display.rb +3 -2
- data/lib/zena/use/forms.rb +36 -9
- data/lib/zena/use/i18n.rb +8 -2
- data/lib/zena/use/image_builder.rb +7 -0
- data/lib/zena/use/query_node.rb +24 -8
- data/lib/zena/use/relations.rb +2 -6
- data/lib/zena/use/rendering.rb +10 -6
- data/lib/zena/use/upload.rb +6 -4
- data/lib/zena/use/urls.rb +13 -5
- data/lib/zena/use/zafu_safe_definitions.rb +1 -1
- data/public/javascripts/grid.js +11 -2
- data/public/javascripts/upload-progress.js +5 -3
- data/public/javascripts/zena.js +6 -2
- data/public/stylesheets/upload-progress.css +1 -0
- data/test/fixtures/files/TestNode.zafu +2 -2
- data/test/fixtures/files/translations_fr.yml +2 -1
- data/test/functional/acls_controller_test.rb +6 -0
- data/test/functional/nodes_controller_test.rb +1 -1
- data/test/functional/sites_controller_test.rb +19 -0
- data/test/integration/navigation_test.rb +7 -0
- data/test/integration/query_node/filters.yml +10 -0
- data/test/integration/zafu_compiler/action.yml +8 -4
- data/test/integration/zafu_compiler/ajax.yml +4 -4
- data/test/integration/zafu_compiler/calendar.yml +8 -15
- data/test/integration/zafu_compiler/context.yml +1 -1
- data/test/integration/zafu_compiler/dates.yml +5 -1
- data/test/integration/zafu_compiler/display.yml +1 -2
- data/test/integration/zafu_compiler/forms.yml +37 -10
- data/test/integration/zafu_compiler/query.yml +5 -5
- data/test/integration/zafu_compiler/relations.yml +8 -8
- data/test/integration/zafu_compiler/safe_definitions.yml +7 -2
- data/test/integration/zafu_compiler/urls.yml +24 -3
- data/test/integration/zafu_compiler/zazen.yml +9 -1
- data/test/selenium/Destroy/destroy1.rsel +2 -1
- data/test/selenium/Destroy/destroy2.rsel +17 -0
- data/test/unit/document_test.rb +17 -4
- data/test/unit/relation_proxy_test.rb +19 -8
- data/test/unit/string_hash_test.rb +1 -1
- data/test/unit/template_test.rb +3 -3
- data/test/unit/virtual_class_test.rb +77 -0
- data/test/unit/zena/use/urls_test.rb +9 -1
- data/vendor/plugins/selenium-on-rails/lib/selenium_on_rails_config.rb +1 -1
- data/zena.gemspec +60 -53
- metadata +145 -125
data/public/javascripts/grid.js
CHANGED
@@ -902,12 +902,20 @@ Grid.save = function(grid_id) {
|
|
902
902
|
data.each(function(pair) {
|
903
903
|
var id = pair.key
|
904
904
|
var changes = pair.value
|
905
|
-
var attrs = {
|
905
|
+
var attrs = {}
|
906
|
+
if (!grid.list_name && !grid.rlist_name) {
|
907
|
+
// insert forced field values
|
908
|
+
var a = $(id).getAttribute('data-base')
|
909
|
+
if (a) attrs = a.evalJSON()
|
910
|
+
}
|
911
|
+
attrs.zjs = true
|
912
|
+
attrs["opts[format]"] = grid.fdate
|
906
913
|
$H(changes).each(function(pair) {
|
907
914
|
if (pair.key != '_new') {
|
908
915
|
attrs['node['+pair.key+']'] = pair.value
|
909
916
|
}
|
910
|
-
})
|
917
|
+
})
|
918
|
+
|
911
919
|
|
912
920
|
if (changes._new) {
|
913
921
|
new Ajax.Request('/nodes', {
|
@@ -940,6 +948,7 @@ Grid.save = function(grid_id) {
|
|
940
948
|
method: 'post'
|
941
949
|
});
|
942
950
|
} else {
|
951
|
+
// UPDATE
|
943
952
|
new Ajax.Request('/nodes/' + id.replace(/^[^0-9]+/,''), {
|
944
953
|
parameters: attrs,
|
945
954
|
onSuccess: function(transport) {
|
@@ -100,9 +100,11 @@ var UploadProgress = {
|
|
100
100
|
Effect.Appear('progress_shell' + this.uuid) ;
|
101
101
|
},
|
102
102
|
|
103
|
-
setAsError: function() {
|
104
|
-
|
105
|
-
|
103
|
+
setAsError: function(error) {
|
104
|
+
this.uploading = false
|
105
|
+
this.watcher.stop()
|
106
|
+
$('progress_text' + this.uuid).innerHTML = error;
|
107
|
+
$('progress_bar' + this.uuid).setStyle({background:"#f88"})
|
106
108
|
},
|
107
109
|
|
108
110
|
setAsFinished: function() {
|
data/public/javascripts/zena.js
CHANGED
@@ -839,7 +839,11 @@ Zena.set_toggle = function(dom_id, definition) {
|
|
839
839
|
if (elem.tagName == 'TR') {
|
840
840
|
target = elem.select('td')[0];
|
841
841
|
}
|
842
|
-
|
842
|
+
var input_type = 'checkbox'
|
843
|
+
if (definition['arity'] == 'one') {
|
844
|
+
input_type = 'radio'
|
845
|
+
}
|
846
|
+
target.insert({top:"<input type='"+input_type+"' class='cb'/>"});
|
843
847
|
}
|
844
848
|
|
845
849
|
if (list.indexOf(id) == -1) {
|
@@ -879,7 +883,7 @@ Zena.toggle = function(elem, definition, id) {
|
|
879
883
|
onSuccess: function() {
|
880
884
|
if (definition['arity'] == 'one') {
|
881
885
|
// uncheck all
|
882
|
-
definition['list'] =
|
886
|
+
definition['list'] = [];
|
883
887
|
// search for siblings
|
884
888
|
elem.siblings().each(function(s) {
|
885
889
|
try {
|
@@ -1,4 +1,5 @@
|
|
1
1
|
.progress_shell { display: table; background:#15242B; width:15em; padding:0; position:relative; border:2px solid #999;}
|
2
2
|
.progress_text { position:absolute; text-align:center; width:15em; color:#ccc;}
|
3
|
+
.progress_text .errors { color:#222;}
|
3
4
|
.progress_bar { background:#35f;}
|
4
5
|
#UploadIFrame {width:0; height:0; border:0; }
|
@@ -68,8 +68,8 @@
|
|
68
68
|
<p>Using "action='destroy'" to remove elements.</p>
|
69
69
|
<ul id='destroy_list' do='block' do='projects in site'>
|
70
70
|
<li do='add' klass='Project' after='self'/>
|
71
|
-
<li do='form'><r:input name='title'/></li>
|
72
|
-
<li class='#{title}' do='each'><r:link/> <span id='destroy_#{
|
71
|
+
<li do='form'><r:input name='title'/><r:input name='summary'/></li>
|
72
|
+
<li class='#{title}' do='each'><r:link/> <span id='destroy_#{summary}' do='link' action='destroy' update='destroy_list' do='t'>destroy</span></li>
|
73
73
|
</ul>
|
74
74
|
</div>
|
75
75
|
|
@@ -48,6 +48,12 @@ class AclsControllerTest < Zena::Controller::TestCase
|
|
48
48
|
post :create, :acl => { :query => '%q{assigned_project}', :group_id => groups_id(:sky) }
|
49
49
|
end
|
50
50
|
end
|
51
|
+
|
52
|
+
should 'not create acl with bad kpath' do
|
53
|
+
assert_difference('Acl.count', 0) do
|
54
|
+
post :create, :acl => { :query => '%q{assigned_project}', :group_id => groups_id(:sky), :create_kpath => 'TRI' }
|
55
|
+
end
|
56
|
+
end
|
51
57
|
end # with admin rights
|
52
58
|
|
53
59
|
end # creating an acl
|
@@ -746,7 +746,7 @@ class NodesControllerTest < Zena::Controller::TestCase
|
|
746
746
|
opening = secure!(Node) { nodes(:opening) }
|
747
747
|
art = opening.find(:first, 'set_tag')
|
748
748
|
assert_equal 5, art.l_status
|
749
|
-
put 'update', :id => art[:zip], :node => {:l_status => 54321
|
749
|
+
put 'update', :id => art[:zip], :node => {:l_status => 54321, :link_id => links_id(:opening_in_art)}
|
750
750
|
art = assigns(:node)
|
751
751
|
assert_equal 54321, art.l_status
|
752
752
|
# reload
|
@@ -22,6 +22,23 @@ class SitesControllerTest < Zena::Controller::TestCase
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
|
26
|
+
test 'should clear cache with GET' do
|
27
|
+
with_caching do
|
28
|
+
login(:anon)
|
29
|
+
@node = secure!(Node) { nodes(:status) }
|
30
|
+
filepath = "#{RAILS_ROOT}/sites/test.host/public/en/clear_cache_test.html"
|
31
|
+
assert !File.exist?(filepath)
|
32
|
+
secure!(CachedPage) { CachedPage.create(:expire_after => nil, :path => "/test.host/public/en/clear_cache_test.html", :content_data => "houbahouba", :node_id => @node[:id], :expire_with_ids => visitor.visited_node_ids) }
|
33
|
+
assert File.exist?(filepath)
|
34
|
+
assert CachedPage.find(:first, :conditions => ["path = ?", "/test.host/public/en/clear_cache_test.html"])
|
35
|
+
login(:lion)
|
36
|
+
get :clear_cache
|
37
|
+
assert !File.exist?(filepath)
|
38
|
+
assert !CachedPage.find(:first, :conditions => ["path = ?", "/test.host/public/en/clear_cache_test.html"])
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
25
42
|
test 'clearing cache should clear zafu' do
|
26
43
|
with_caching do
|
27
44
|
login(:anon)
|
@@ -40,6 +57,8 @@ class SitesControllerTest < Zena::Controller::TestCase
|
|
40
57
|
login(:tiger)
|
41
58
|
get :index
|
42
59
|
assert_response :missing
|
60
|
+
get :clear_cache
|
61
|
+
assert_response :missing
|
43
62
|
end
|
44
63
|
|
45
64
|
test "should get index" do
|
@@ -396,6 +396,13 @@ class NavigationTest < Zena::Integration::TestCase
|
|
396
396
|
assert_response :missing
|
397
397
|
end
|
398
398
|
|
399
|
+
def test_bad_url_format
|
400
|
+
get 'http://test.host/foo/bar'
|
401
|
+
assert_redirected_to 'http://test.host/en/foo/bar'
|
402
|
+
get 'http://test.host/en/foo/bar'
|
403
|
+
assert_response :missing
|
404
|
+
end
|
405
|
+
|
399
406
|
def test_bad_url_without_notFound_template
|
400
407
|
$_test_site = 'zena'
|
401
408
|
Node.connection.execute "UPDATE nodes SET kpath='N' where id = #{nodes_id(:Node_not_found_zafu)}"
|
@@ -94,6 +94,16 @@ class_filter:
|
|
94
94
|
sql: "%Q{SELECT nodes.* FROM nodes WHERE #{secure_scope('nodes')} AND (nodes.kpath LIKE 'NDI%' OR nodes.kpath = 'NPP') GROUP BY nodes.id ORDER BY nodes.zip ASC}"
|
95
95
|
res: "Zena the wild CMS, Clean Water project, it's a lake, bird, flower, Autumn Tree"
|
96
96
|
|
97
|
+
class_not_like:
|
98
|
+
src: "documents where class not like Image in site limit 3"
|
99
|
+
sql: "%Q{SELECT nodes.* FROM nodes WHERE #{secure_scope('nodes')} AND nodes.kpath NOT LIKE 'NDI%' AND nodes.kpath LIKE 'ND%' ORDER BY nodes.zip ASC LIMIT 3}"
|
100
|
+
res: "water, Forest, Project-changes-xml"
|
101
|
+
|
102
|
+
class_not_equal:
|
103
|
+
src: "documents where class <> Image in site limit 3"
|
104
|
+
sql: "%Q{SELECT nodes.* FROM nodes WHERE #{secure_scope('nodes')} AND nodes.kpath <> 'NDI' AND nodes.kpath LIKE 'ND%' ORDER BY nodes.zip ASC LIMIT 3}"
|
105
|
+
res: "water, Forest, Project-changes-xml"
|
106
|
+
|
97
107
|
class_filter_with_quotes:
|
98
108
|
src: "nodes where class = 'Project' and title = 'k' in site"
|
99
109
|
sql: "/nodes.kpath = 'NPP'/"
|
@@ -20,7 +20,7 @@ login_link:
|
|
20
20
|
# Forces NodesController type of url and params
|
21
21
|
fake_controller: 'nodes'
|
22
22
|
src: "<r:login_link/>"
|
23
|
-
res: '<a href="/oo/projects-list/Clean-Water-project/page22.html">login</a>'
|
23
|
+
res: '<a href="/oo/projects-list/Clean-Water-project/page22.html" rel="nofollow">login</a>'
|
24
24
|
|
25
25
|
logout_link_other_controller:
|
26
26
|
src: "<r:login_link/>"
|
@@ -30,7 +30,7 @@ login_link_other_controller:
|
|
30
30
|
context:
|
31
31
|
visitor: 'anon'
|
32
32
|
src: "<r:login_link/>"
|
33
|
-
res: '<a href="/login">login</a>'
|
33
|
+
res: '<a href="/login" rel="nofollow">login</a>'
|
34
34
|
|
35
35
|
login_link_with_blocks:
|
36
36
|
src: "<r:login_link>ONE ONE<r:else do='title'/></r:login_link>"
|
@@ -40,7 +40,7 @@ login_link_with_blocks_not_logged_in:
|
|
40
40
|
context:
|
41
41
|
visitor: 'anon'
|
42
42
|
src: "<r:login_link><r:title/><r:else do='title'/></r:login_link>"
|
43
|
-
res: "<a href='/login'>status title</a>"
|
43
|
+
res: "<a rel='nofollow' href='/login'>status title</a>"
|
44
44
|
|
45
45
|
visitor_link_not_logged_in:
|
46
46
|
context:
|
@@ -90,4 +90,8 @@ swap_in_each_with_block:
|
|
90
90
|
|
91
91
|
hand_made_swap:
|
92
92
|
src: "<r:link update='_page' node[origin]='next_in_list(origin, \"todo,done\")' action='update'/>"
|
93
|
-
tem: "/node\[origin\]. => next_in_list_s\(@node.prop\['origin'\].*todo,done.*method:.put./"
|
93
|
+
tem: "/node\[origin\]. => next_in_list_s\(@node.prop\['origin'\].*todo,done.*method:.put./"
|
94
|
+
|
95
|
+
versions_list:
|
96
|
+
src: "<r:versions_list/>"
|
97
|
+
res: "/td class=\"date\">2006-03-10</td>/"
|
@@ -80,7 +80,7 @@ each_add_with_form:
|
|
80
80
|
<li do='add'>add new</li>
|
81
81
|
<li do='form'><input name='title'/> this is the form</li>
|
82
82
|
</ol>
|
83
|
-
res: "/<li id='list1_30'>bird.*<li id='list1_31'>flower.*<li.*list1_add.*list1_0.*toggle.*<li.*style.*none.*list1_0.*Ajax.Request.*
|
83
|
+
res: "/<li id='list1_30'>bird.*<li id='list1_31'>flower.*<li.*list1_add.*list1_0.*toggle.*<li.*style.*none.*list1_0.*Ajax.Request.*name='t_url' value=.ajax/each/add/with/form/list1/"
|
84
84
|
|
85
85
|
each_add_with_form_in_sub_block:
|
86
86
|
context:
|
@@ -141,7 +141,7 @@ each_edit_cannot_write:
|
|
141
141
|
node: 'cleanWater'
|
142
142
|
visitor: 'anon'
|
143
143
|
src: "<r:children><li do='each'><r:show attr='title'>blah</r:show> <r:edit>edit</r:edit></li>\n</r:children>"
|
144
|
-
res: "/<li id='list1_24'>it
|
144
|
+
res: "/<li id='list1_24'>it's a lake</li>.*/"
|
145
145
|
|
146
146
|
add_each_publish:
|
147
147
|
src: "<ul do='children' id='things'><li do='each'>I <p do='title'>blah</p></li><li do='add' publish='true'/></ul>"
|
@@ -396,7 +396,7 @@ link_page_list:
|
|
396
396
|
toggle:
|
397
397
|
src: "<span do='toggle' set='favorite' for='visitor.node'/>"
|
398
398
|
res: "<span class='toggle' id='list1_22'></span>"
|
399
|
-
js: "/
|
399
|
+
js: "/tog1 = \{list:\[39\], url:\"/nodes/13\", role:\"favorite\".*\"list1_22\"\].each.function.item. \{ Zena.set_toggle/"
|
400
400
|
|
401
401
|
toggle_attribute_in_each:
|
402
402
|
context:
|
@@ -410,7 +410,7 @@ toggle_dyn_attribute_in_each:
|
|
410
410
|
node: cleanWater
|
411
411
|
rel: favorite
|
412
412
|
src: "<ul do='pages'><li do='each' toggle='#{params[:rel]}' for='visitor.node' do='title'/></ul>"
|
413
|
-
tem: "/add_toggle_id\(\"list1_#\{var2.zip\}\", \"
|
413
|
+
tem: "/add_toggle_id\(\"list1_#\{var2.zip\}\", \"tog1\", \"#\{params\[:rel\]\}\",\{\}\)/"
|
414
414
|
res: "/<ul><li class='toggle' id='list1_26'>crocodiles</li>/"
|
415
415
|
js: "/list1_26.*each/"
|
416
416
|
|
@@ -44,18 +44,11 @@ calendar_bad_attr:
|
|
44
44
|
src: "<div do='calendar' attr='date' select='posts where #{cal_start} <= starsky and hutch < #{cal_end} in project'/>"
|
45
45
|
res: "/<span class='method'>calendar</span> <span class='message'>Unknown field 'starsky'/"
|
46
46
|
|
47
|
-
#
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
# context:
|
56
|
-
# ref_date: "2009-7-17"
|
57
|
-
# node: 'zena'
|
58
|
-
# # I do not like the way we do this, the 'else' thing is not helping. Maybe we need some
|
59
|
-
# # extra zafu tags because it' messy: we have 3 lists (days, hours, nodes) ...
|
60
|
-
# src: "<div do='calendar' select='added_notes' date='l_date' split_hours='12'><r:if test='hour eq 0' do='[current_date]' format='%d'/><div do='void' set_class='hour_[hour]' do='each' do='title' join=', '/><r:else><r:if test='hour eq 0' do='[current_date]' format='%d'/><div do='void' set_class='hour_[hour]'></div></r:else></div>"
|
61
|
-
# res: "/<td class='ref'>17<div class='hour_0'></div><div class='hour_12'>opening</div></td>/"
|
47
|
+
# Should render without errors.
|
48
|
+
calendar_other_date:
|
49
|
+
src: |
|
50
|
+
<r:void set_date='date.advance(:months => 1)'>
|
51
|
+
<div do='calendar' attr='created_at' select='pages where #{cal_start} <= created_at and created_at < #{cal_end} in site'/>
|
52
|
+
</r:void>
|
53
|
+
res: '/Clean-Water-project/'
|
54
|
+
|
@@ -6,7 +6,7 @@ default:
|
|
6
6
|
|
7
7
|
each_group:
|
8
8
|
src: "<r:nodes do='group' by='kpath'><p do='each_group'><r:kpath/>: <r:each join=', ' do='title'/></p></r:nodes>"
|
9
|
-
res: "<p>NP: crocodiles, status title</p><p>NDI: it
|
9
|
+
res: "<p>NP: crocodiles, status title</p><p>NDI: it's a lake</p><p>NRC: The lake we love</p><p>NNP: parc opening</p><p>ND: water</p>"
|
10
10
|
|
11
11
|
# set_var tested in eval.yml
|
12
12
|
|
@@ -205,4 +205,8 @@ time_wday:
|
|
205
205
|
node: opening
|
206
206
|
tz: 'US/Pacific'
|
207
207
|
src: "<r:Post?><b do='this.date.wday'/> <b do='this.date.wday(\"UTC\")'/></r:Post?>"
|
208
|
-
res: "<b>2</b> <b>3</b>"
|
208
|
+
res: "<b>2</b> <b>3</b>"
|
209
|
+
|
210
|
+
date_id:
|
211
|
+
src: "<r:input type='date' name='updated_at' id='foobar'/>"
|
212
|
+
res: "/id='foobar'/"
|
@@ -77,7 +77,6 @@ show_title_link_http:
|
|
77
77
|
show_title_link_attribute:
|
78
78
|
context:
|
79
79
|
node: 'bird_jpg'
|
80
|
-
old_src: "<r:title link='http://[name].com'/>"
|
81
80
|
src: "<a href='http://#{title}.com' do='title'/>"
|
82
81
|
res: "<a href='http://bird.com'>bird</a>"
|
83
82
|
|
@@ -256,7 +255,7 @@ icon:
|
|
256
255
|
context:
|
257
256
|
node: 'cleanWater'
|
258
257
|
src: "<r:icon do='title'/>"
|
259
|
-
res: "it
|
258
|
+
res: "it's a lake"
|
260
259
|
|
261
260
|
img_image:
|
262
261
|
context:
|
@@ -46,24 +46,26 @@ select_class_existing_node:
|
|
46
46
|
context:
|
47
47
|
node: 'letter'
|
48
48
|
src: "<r:form><r:select name='klass' root_class='Note'/></r:form>"
|
49
|
-
res: "/<select name=.node\[klass\]. id=.list1_klass.><option value=\"Note\">
|
49
|
+
res: "/<select name=.node\[klass\]. id=.list1_klass.><option value=\"Note\">Note<\/option>\n<option value=\"Letter\" selected=\"selected\"> Letter<\/option>\n<option value=\"Post\"> Post<\/option><\/select>/"
|
50
50
|
|
51
51
|
select_class_new_node:
|
52
52
|
src: "<r:pages><r:each/><r:add/><r:form><r:select name='klass' root_class='Note' selected='Post'/></r:form>"
|
53
|
-
res: "/<select.*name=.node\[klass\].*
|
53
|
+
res: "/<select.*name=.node\[klass\].*Note.*Letter.*Post. selected=.selected./"
|
54
54
|
|
55
55
|
select_class_kpath:
|
56
56
|
src: "<r:select param='k' root_class='Note' attr='kpath'/>"
|
57
|
-
res: "/<select.*name=.k.*NN.*
|
57
|
+
res: "/<select.*name=.k.*NN.*Note.*NNL.*Letter.*NNP.*Post/"
|
58
58
|
|
59
59
|
select_class_tprefix:
|
60
|
-
|
61
|
-
|
62
|
-
|
60
|
+
context:
|
61
|
+
lang: fr
|
62
|
+
src: "<r:load dictionary='/Default skin/translations'><r:select tprefix='foo' param='k' root_class='Note'/></r:load>"
|
63
|
+
tem: '/\["the Foo Note", "Note"\]/'
|
64
|
+
res: "/the Foo Note.*Letter/"
|
63
65
|
|
64
66
|
select_data:
|
65
67
|
src: "<r:select data-d='foo' param='k' root_class='Note' attr='kpath'/>"
|
66
|
-
res: "/<select name=.k. data-d='foo'.*NN.*
|
68
|
+
res: "/<select name=.k. data-d='foo'.*NN.*Note.*NNL.*Letter.*NNP.*Post/"
|
67
69
|
|
68
70
|
select_nodes:
|
69
71
|
src: "<r:form><r:select nodes='images in site' name='origin'></select></r:form>"
|
@@ -87,7 +89,7 @@ select_nodes_in_ajax:
|
|
87
89
|
|
88
90
|
select_nodes_show_attr:
|
89
91
|
src: "<r:form><r:select name='title' nodes='images in site' attr='ext' show='title'/></r:form>"
|
90
|
-
res: "/name=.node\[title\].[^>]+>.*<option value=\"jpg\">flower</option>\n<option value=\"jpg\">it
|
92
|
+
res: "/name=.node\[title\].[^>]+>.*<option value=\"jpg\">flower</option>\n<option value=\"jpg\">it's a lake</option>/"
|
91
93
|
|
92
94
|
select_time_zone:
|
93
95
|
src: "<r:form><r:select type='time_zone' name='settings[tz]'/></r:form>"
|
@@ -105,7 +107,7 @@ select_prop:
|
|
105
107
|
|
106
108
|
select_l_status:
|
107
109
|
# Refactor select to use collection_select.
|
108
|
-
src: "<r:select name='l_status' values='1,2,3' tshow='en,fr,de'/>"
|
110
|
+
src: "<r:select name='l_status' values='1.0, 2.0, 3.0' tshow='en,fr,de'/>"
|
109
111
|
tem: "/@node.l_status.to_s/"
|
110
112
|
|
111
113
|
form_publish:
|
@@ -118,6 +120,20 @@ checkbox:
|
|
118
120
|
src: "<r:checkbox role='calendar' nodes='11'/>"
|
119
121
|
res: "/hidden.*node\[calendar_ids\]\[\]' value=''.*input type='checkbox' name='node\[calendar_ids\]\[\]' value='11' checked='checked'.*Zena/"
|
120
122
|
|
123
|
+
checkbox_literal_auto_trans:
|
124
|
+
context:
|
125
|
+
node: 'people'
|
126
|
+
src: "<r:load dictionary='/Default skin/translations'><r:checkbox name='assigned' values='1,2'/></r:load>"
|
127
|
+
tem: "/foo/"
|
128
|
+
res: "/value='1'/> <span>foo</span>/"
|
129
|
+
|
130
|
+
radio_literal_auto_trans:
|
131
|
+
context:
|
132
|
+
node: 'people'
|
133
|
+
lang: fr
|
134
|
+
src: "<r:load dictionary='/Default skin/translations'><r:radio name='assigned' values='1,2'/></r:load>"
|
135
|
+
res: "/value='1'/> <span>foo</span>/"
|
136
|
+
|
121
137
|
checkbox_literal:
|
122
138
|
context:
|
123
139
|
node: 'people'
|
@@ -273,6 +289,10 @@ label_on_checkbox:
|
|
273
289
|
src: "<r:checkbox label='t' name='title' values='1,2'/>"
|
274
290
|
res: "/<label>titre</label>.*input type='checkbox'"
|
275
291
|
|
292
|
+
default_checkbox:
|
293
|
+
src: "<r:checkbox name='title' values='1' default='0'/>"
|
294
|
+
res: "/<input type='hidden' name='node\[title\]' value='0'/>/"
|
295
|
+
|
276
296
|
label_on_select:
|
277
297
|
context:
|
278
298
|
lang: fr
|
@@ -346,4 +366,11 @@ should_show_fields_for_columns:
|
|
346
366
|
lang: 'fr'
|
347
367
|
src: "<r:load dictionary='/Default skin/translations'><r:form><r:select name='assigned' values=',1,2,3'/></r:form></r:load>"
|
348
368
|
tem: "/foo.*bar/"
|
349
|
-
res: "/value=\"1\">foo<\/option>\n<option value=\"2\">bar/"
|
369
|
+
res: "/value=\"1\">foo<\/option>\n<option value=\"2\">bar/"
|
370
|
+
|
371
|
+
form_rel_status:
|
372
|
+
context:
|
373
|
+
node: 'cleanWater'
|
374
|
+
src: "<r:input name='set_tag_status'/>"
|
375
|
+
tem: "/other_status/"
|
376
|
+
res: "<input type='text' name='node[set_tag_status]' value='10.0'/>"
|
@@ -169,7 +169,7 @@ query_with_default:
|
|
169
169
|
visitor: lion
|
170
170
|
node: cleanWater
|
171
171
|
src: "<r:query default='nodes in project' do='each' join=', ' do='title'/>"
|
172
|
-
res: "crocodiles, it
|
172
|
+
res: "crocodiles, it's a lake, The lake we love, Nice Bananas, parc opening, status title, water"
|
173
173
|
|
174
174
|
query_with_param:
|
175
175
|
# Live compile and query from params
|
@@ -257,16 +257,16 @@ select_with_type:
|
|
257
257
|
select_in_from:
|
258
258
|
src: "<div do='images select title as it from projects select title as pt in site' do='each' join=', '><r:pt/>: <r:it/></div>"
|
259
259
|
tem: '/<%=h var2.attributes\["pt"\] %>: <%=h var2.attributes\["it"\] %>/'
|
260
|
-
res: "<div>a wiki with Zena: bird, a wiki with Zena: flower, Clean Water project: it
|
260
|
+
res: "<div>a wiki with Zena: bird, a wiki with Zena: flower, Clean Water project: it's a lake</div>"
|
261
261
|
|
262
262
|
select_in_from_saved:
|
263
263
|
src: "<div do='images select title as it from projects select title as pt in site' do='set' list='this' do='list' do='each' join=', '><r:pt/>: <r:it/></div>"
|
264
264
|
tem: '/<%=h var3.attributes\["pt"\] %>: <%=h var3.attributes\["it"\] %>/'
|
265
|
-
res: "<div>a wiki with Zena: bird, a wiki with Zena: flower, Clean Water project: it
|
265
|
+
res: "<div>a wiki with Zena: bird, a wiki with Zena: flower, Clean Water project: it's a lake</div>"
|
266
266
|
|
267
267
|
select_group:
|
268
268
|
src: "<div do='images select title as it from projects select title as pt in site' do='group' by='pt' do='each_group' join=' / '><r:pt/>: <r:each join=', ' do='it'/></div>"
|
269
|
-
res: "<div>a wiki with Zena: bird, flower / Clean Water project: it
|
269
|
+
res: "<div>a wiki with Zena: bird, flower / Clean Water project: it's a lake</div>"
|
270
270
|
|
271
271
|
select_group_count:
|
272
272
|
src: "<div do='images select id.count as img_count from projects select id as pid, title as pt in site group by pid' do='each' join=', '><r:pt/>: <r:img_count/></div>"
|
@@ -280,7 +280,7 @@ query_errors:
|
|
280
280
|
context:
|
281
281
|
c: 'badaboum'
|
282
282
|
src: "<r:query default='nodes' select='nodes in #{params[:c]}'><r:elsif test='query_errors' do='query_errors'/></r:query>"
|
283
|
-
res: "<span class='query'>nodes in badaboum</span> <span class='error'>Invalid scope
|
283
|
+
res: "<span class='query'>nodes in badaboum</span> <span class='error'>Invalid scope 'badaboum'.</span>"
|
284
284
|
|
285
285
|
query_count:
|
286
286
|
context:
|