parlement 0.6 → 0.7
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/CHANGES +13 -0
- data/README +51 -38
- data/app/controllers/account_controller.rb +65 -37
- data/app/controllers/application.rb +1 -1
- data/app/controllers/elt_controller.rb +1 -0
- data/app/models/elt.rb +25 -14
- data/app/models/mail.rb +36 -35
- data/app/models/mail_notify.rb +23 -0
- data/app/views/account/_login.rhtml +1 -1
- data/app/views/account/_show.rhtml +22 -5
- data/app/views/elt/_elt.rhtml +44 -47
- data/app/views/elt/_listByDate.rhtml +7 -7
- data/app/views/elt/show.rhtml +3 -3
- data/app/views/layouts/top.rhtml +1 -0
- data/app/views/person/show.rhtml +5 -0
- data/config/environment.rb +1 -1
- data/db/ROOT/parlement/Parlement_fr.txt +46 -0
- data/db/ROOT/parlement/news/Version_06.txt +25 -0
- data/db/ROOT/parlement/news/Version_07.txt +12 -0
- data/db/ROOT/parlement/test.txt +14 -5
- data/db/ROOT/parlement.txt +2 -0
- data/db/development_structure.sql +119 -44
- data/db/migrate/004_people_image.rb +9 -0
- data/lib/data_import.rb +9 -13
- data/public/javascripts/mybehaviour.js +41 -0
- data/test/fixtures/img.png +0 -0
- data/test/fixtures/mail/avatar +249 -0
- data/test/fixtures/people.yml +1 -1
- data/test/functional/account_controller_test.rb +108 -56
- data/test/functional/elt_controller_test.rb +6 -6
- data/test/unit/elt_test.rb +1 -1
- data/test/unit/mail_test.rb +17 -0
- data/vendor/plugins/engines/CHANGELOG +91 -53
- data/vendor/plugins/engines/README +1 -1
- data/vendor/plugins/engines/generators/engine/templates/init_engine.erb +6 -4
- data/vendor/plugins/engines/generators/engine/templates/test/test_helper.erb +5 -1
- data/vendor/plugins/engines/init.rb +8 -3
- data/vendor/plugins/engines/lib/engines/action_mailer_extensions.rb +6 -5
- data/vendor/plugins/engines/lib/engines/action_view_extensions.rb +10 -6
- data/vendor/plugins/engines/lib/engines/active_record_extensions.rb +3 -1
- data/vendor/plugins/engines/lib/engines/dependencies_extensions.rb +27 -16
- data/vendor/plugins/engines/lib/engines/routing_extensions.rb +28 -0
- data/vendor/plugins/engines/lib/engines/testing_extensions.rb +6 -2
- data/vendor/plugins/engines/lib/engines.rb +77 -12
- data/vendor/plugins/engines/tasks/deprecated_engines.rake +7 -0
- data/vendor/plugins/engines/tasks/engines.rake +25 -10
- data/vendor/plugins/login_engine/CHANGELOG +8 -0
- data/vendor/plugins/login_engine/README +2 -2
- data/vendor/plugins/login_engine/app/controllers/user_controller.rb +4 -1
- data/vendor/plugins/login_engine/app/views/user/forgot_password.rhtml +1 -1
- data/vendor/plugins/login_engine/init_engine.rb +6 -5
- data/vendor/plugins/login_engine/lib/login_engine/authenticated_user.rb +1 -1
- data/vendor/plugins/output_compression/CHANGELOG +0 -0
- data/vendor/plugins/output_compression/MIT-LICENSE +20 -0
- data/vendor/plugins/output_compression/README +4 -4
- data/vendor/plugins/output_compression/init.rb +1 -2
- data/vendor/plugins/output_compression/lib/output_compression.rb +84 -66
- data/vendor/plugins/output_compression/{Rakefile → rakefile} +22 -22
- data/vendor/plugins/output_compression/test/output_test.rb +11 -0
- data/vendor/plugins/output_compression/test/test_controller.rb +3 -0
- data/vendor/plugins/output_compression/test/test_helper.rb +14 -0
- data/vendor/plugins/responds_to_parent/MIT-LICENSE +20 -0
- data/vendor/plugins/responds_to_parent/README +42 -0
- data/vendor/plugins/responds_to_parent/Rakefile +22 -0
- data/vendor/plugins/responds_to_parent/init.rb +1 -0
- data/vendor/plugins/responds_to_parent/lib/responds_to_parent.rb +45 -0
- data/vendor/plugins/responds_to_parent/test/responds_to_parent_test.rb +115 -0
- metadata +33 -16
- data/vendor/plugins/login_engine/tasks/tasks.rake +0 -4
- data/vendor/plugins/output_compression/tasks/output_compression_tasks.rake +0 -4
- data/vendor/plugins/output_compression/test/output_compression_test.rb +0 -8
- /data/db/ROOT/parlement/news/{release0.1.txt → Version_01.txt} +0 -0
- /data/db/ROOT/parlement/news/{release0.2.txt → Version_02.txt} +0 -0
- /data/db/ROOT/parlement/news/{release0.3.txt → Version_03.txt} +0 -0
- /data/db/ROOT/parlement/news/{release0.4.txt → Version_04.txt} +0 -0
- /data/db/ROOT/parlement/news/{release0.5.txt → Version_05.txt} +0 -0
@@ -0,0 +1,45 @@
|
|
1
|
+
# Module containing the methods useful for child IFRAME to parent window communication
|
2
|
+
module RespondsToParent
|
3
|
+
|
4
|
+
# Executes the response body as JavaScript in the context of the parent window.
|
5
|
+
# Use this method of you are posting a form to a hidden IFRAME or if you would like
|
6
|
+
# to use IFRAME base RPC.
|
7
|
+
def responds_to_parent(&block)
|
8
|
+
yield
|
9
|
+
|
10
|
+
if performed?
|
11
|
+
# We're returning HTML instead of JS or XML now
|
12
|
+
response.headers['Content-Type'] = 'text/html; charset=UTF-8'
|
13
|
+
|
14
|
+
# Either pull out a redirect or the request body
|
15
|
+
script = if location = erase_redirect_results
|
16
|
+
"document.location.href = #{location.to_s.inspect}"
|
17
|
+
else
|
18
|
+
response.body
|
19
|
+
end
|
20
|
+
|
21
|
+
# Escape quotes, linebreaks and slashes, maintaining previously escaped slashes
|
22
|
+
# Suggestions for improvement?
|
23
|
+
script = (script || '').
|
24
|
+
gsub('\\', '\\\\\\').
|
25
|
+
gsub(/\r\n|\r|\n/, '\\n').
|
26
|
+
gsub(/['"]/, '\\\\\&')
|
27
|
+
|
28
|
+
# Clear out the previous render to prevent double render
|
29
|
+
erase_results
|
30
|
+
|
31
|
+
# Eval in parent scope and replace document location of this frame
|
32
|
+
# so back button doesn't replay action on targeted forms
|
33
|
+
# loc = document.location to be set after parent is updated for IE
|
34
|
+
# with(window.parent) - pull in variables from parent window
|
35
|
+
# setTimeout - scope the execution in the windows parent for safari
|
36
|
+
# window.eval - legal eval for Opera
|
37
|
+
render :text => "<html><body><script type='text/javascript' charset='utf-8'>
|
38
|
+
var loc = document.location;
|
39
|
+
with(window.parent) { setTimeout(function() { window.eval('#{script}'); loc.replace('about:blank'); }, 1) }
|
40
|
+
</script></body></html>"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
alias respond_to_parent responds_to_parent
|
44
|
+
end
|
45
|
+
|
@@ -0,0 +1,115 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../../config/environment'
|
2
|
+
require 'test/unit'
|
3
|
+
require 'test_help'
|
4
|
+
|
5
|
+
class IFrameController < ActionController::Base
|
6
|
+
def normal
|
7
|
+
render :update do |page|
|
8
|
+
page.alert "foo"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def aliased
|
13
|
+
respond_to_parent do
|
14
|
+
render :text => 'woot'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def redirect
|
19
|
+
responds_to_parent do
|
20
|
+
redirect_to '/another/place'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def no_block
|
25
|
+
responds_to_parent
|
26
|
+
end
|
27
|
+
|
28
|
+
def empty_render
|
29
|
+
responds_to_parent do
|
30
|
+
end
|
31
|
+
|
32
|
+
render :text => ''
|
33
|
+
end
|
34
|
+
|
35
|
+
def quotes
|
36
|
+
responds_to_parent do
|
37
|
+
render :text => %(single' double" qs\\' qd\\" escaped\\\' doubleescaped\\\\')
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def newlines
|
42
|
+
responds_to_parent do
|
43
|
+
render :text => "line1\nline2\\nline2"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def update
|
48
|
+
responds_to_parent do
|
49
|
+
render :update do |page|
|
50
|
+
page.alert 'foo'
|
51
|
+
page.alert 'bar'
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def rescue_action(e)
|
57
|
+
raise e
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
class RespondsToParentTest < Test::Unit::TestCase
|
62
|
+
def setup
|
63
|
+
@controller = IFrameController.new
|
64
|
+
@request = ActionController::TestRequest.new
|
65
|
+
@response = ActionController::TestResponse.new
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_normal
|
69
|
+
get :normal
|
70
|
+
assert_match /alert\("foo"\)/, @response.body
|
71
|
+
assert_no_match /window\.parent/, @response.body
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_quotes_should_be_escaped
|
75
|
+
render :quotes
|
76
|
+
assert_match %r{eval\('single\\' double\\" qs\\\\\\' qd\\\\\\" escaped\\\\\\' doubleescaped\\\\\\\\\\'}, @response.body
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_newlines_should_be_escaped
|
80
|
+
render :newlines
|
81
|
+
assert_match %r{eval\('line1\\nline2\\\\nline2'\)}, @response.body
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_no_block_should_raise
|
85
|
+
assert_raises LocalJumpError do
|
86
|
+
get :no_block
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_empty_render_should_not_expand_javascript
|
91
|
+
get :empty_render
|
92
|
+
assert_equal '', @response.body
|
93
|
+
end
|
94
|
+
|
95
|
+
def test_update_should_perform_combined_rjs
|
96
|
+
render :update
|
97
|
+
assert_match /alert\(\\"foo\\"\);\\nalert\(\\"bar\\"\)/, @response.body
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_aliased_method_should_not_raise
|
101
|
+
assert_nothing_raised do
|
102
|
+
render :aliased
|
103
|
+
assert_match /eval\('woot'\)/, @response.body
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
protected
|
108
|
+
|
109
|
+
def render(action)
|
110
|
+
get action
|
111
|
+
assert_match /<script type='text\/javascript'/, @response.body
|
112
|
+
assert_match /with\(window\.parent\)/, @response.body
|
113
|
+
assert_match /document\.location\.replace\('about:blank'\)/, @response.body
|
114
|
+
end
|
115
|
+
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: parlement
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: "0.
|
7
|
-
date: 2006-
|
6
|
+
version: "0.7"
|
7
|
+
date: 2006-08-16 00:00:00 +02:00
|
8
8
|
summary: Trusted Direct Democracy on a forum
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- db/migrate/001_create_choices.rb
|
107
107
|
- db/migrate/002_nested_set.rb
|
108
108
|
- db/migrate/003_elt_children_count.rb
|
109
|
+
- db/migrate/004_people_image.rb
|
109
110
|
- db/ROOT/perso
|
110
111
|
- db/ROOT/parlement.txt
|
111
112
|
- db/ROOT/perso.txt
|
@@ -120,12 +121,15 @@ files:
|
|
120
121
|
- db/ROOT/parlement/top-politics.txt
|
121
122
|
- db/ROOT/parlement/ddRing.txt
|
122
123
|
- db/ROOT/parlement/our-constitution.txt
|
124
|
+
- db/ROOT/parlement/Parlement_fr.txt
|
123
125
|
- db/ROOT/parlement/security/anonymity.txt
|
124
|
-
- db/ROOT/parlement/news/
|
125
|
-
- db/ROOT/parlement/news/
|
126
|
-
- db/ROOT/parlement/news/
|
127
|
-
- db/ROOT/parlement/news/
|
128
|
-
- db/ROOT/parlement/news/
|
126
|
+
- db/ROOT/parlement/news/Version_03.txt
|
127
|
+
- db/ROOT/parlement/news/Version_04.txt
|
128
|
+
- db/ROOT/parlement/news/Version_05.txt
|
129
|
+
- db/ROOT/parlement/news/Version_07.txt
|
130
|
+
- db/ROOT/parlement/news/Version_06.txt
|
131
|
+
- db/ROOT/parlement/news/Version_01.txt
|
132
|
+
- db/ROOT/parlement/news/Version_02.txt
|
129
133
|
- lib/localization.rb
|
130
134
|
- lib/tasks
|
131
135
|
- lib/data_import.rb
|
@@ -187,11 +191,13 @@ files:
|
|
187
191
|
- test/fixtures/subscribers.yml
|
188
192
|
- test/fixtures/mail_notify
|
189
193
|
- test/fixtures/choices.yml
|
194
|
+
- test/fixtures/img.png
|
190
195
|
- test/fixtures/mail/mail_ruby
|
191
196
|
- test/fixtures/mail/mail_rubyWithSubject
|
192
197
|
- test/fixtures/mail/mail_rubyWithAttachment
|
193
198
|
- test/fixtures/mail/mail_rubyChild
|
194
199
|
- test/fixtures/mail/mail_rubyChild2
|
200
|
+
- test/fixtures/mail/avatar
|
195
201
|
- test/functional/subscriber_controller_test.rb
|
196
202
|
- test/functional/account_controller_test.rb
|
197
203
|
- test/functional/person_controller_test.rb
|
@@ -215,10 +221,10 @@ files:
|
|
215
221
|
- vendor/plugins/file_column
|
216
222
|
- vendor/plugins/output_compression
|
217
223
|
- vendor/plugins/google_analytics
|
224
|
+
- vendor/plugins/responds_to_parent
|
218
225
|
- vendor/plugins/login_engine/test
|
219
226
|
- vendor/plugins/login_engine/app
|
220
227
|
- vendor/plugins/login_engine/db
|
221
|
-
- vendor/plugins/login_engine/tasks
|
222
228
|
- vendor/plugins/login_engine/lib
|
223
229
|
- vendor/plugins/login_engine/public
|
224
230
|
- vendor/plugins/login_engine/init_engine.rb
|
@@ -261,7 +267,6 @@ files:
|
|
261
267
|
- vendor/plugins/login_engine/app/views/user/logout.rhtml
|
262
268
|
- vendor/plugins/login_engine/db/migrate
|
263
269
|
- vendor/plugins/login_engine/db/migrate/001_initial_schema.rb
|
264
|
-
- vendor/plugins/login_engine/tasks/tasks.rake
|
265
270
|
- vendor/plugins/login_engine/lib/login_engine
|
266
271
|
- vendor/plugins/login_engine/lib/login_engine.rb
|
267
272
|
- vendor/plugins/login_engine/lib/login_engine/authenticated_user.rb
|
@@ -279,6 +284,7 @@ files:
|
|
279
284
|
- vendor/plugins/engines/test/ruby_extensions_test.rb
|
280
285
|
- vendor/plugins/engines/test/action_view_extensions_test.rb
|
281
286
|
- vendor/plugins/engines/tasks/engines.rake
|
287
|
+
- vendor/plugins/engines/tasks/deprecated_engines.rake
|
282
288
|
- vendor/plugins/engines/lib/engines
|
283
289
|
- vendor/plugins/engines/lib/bundles
|
284
290
|
- vendor/plugins/engines/lib/engines.rb
|
@@ -290,6 +296,7 @@ files:
|
|
290
296
|
- vendor/plugins/engines/lib/engines/action_view_extensions.rb
|
291
297
|
- vendor/plugins/engines/lib/engines/active_record_extensions.rb
|
292
298
|
- vendor/plugins/engines/lib/engines/testing_extensions.rb
|
299
|
+
- vendor/plugins/engines/lib/engines/routing_extensions.rb
|
293
300
|
- vendor/plugins/engines/lib/bundles/require_resource.rb
|
294
301
|
- vendor/plugins/engines/generators/engine
|
295
302
|
- vendor/plugins/engines/generators/engine/templates
|
@@ -347,15 +354,17 @@ files:
|
|
347
354
|
- vendor/plugins/file_column/lib/magick_file_column.rb
|
348
355
|
- vendor/plugins/file_column/lib/file_column_helper.rb
|
349
356
|
- vendor/plugins/file_column/lib/file_column.rb
|
350
|
-
- vendor/plugins/output_compression/
|
351
|
-
- vendor/plugins/output_compression/
|
352
|
-
- vendor/plugins/output_compression/lib
|
353
|
-
- vendor/plugins/output_compression/Rakefile
|
354
|
-
- vendor/plugins/output_compression/init.rb
|
357
|
+
- vendor/plugins/output_compression/CHANGELOG
|
358
|
+
- vendor/plugins/output_compression/MIT-LICENSE
|
355
359
|
- vendor/plugins/output_compression/README
|
356
|
-
- vendor/plugins/output_compression/
|
357
|
-
- vendor/plugins/output_compression/
|
360
|
+
- vendor/plugins/output_compression/init.rb
|
361
|
+
- vendor/plugins/output_compression/lib
|
362
|
+
- vendor/plugins/output_compression/rakefile
|
363
|
+
- vendor/plugins/output_compression/test
|
358
364
|
- vendor/plugins/output_compression/lib/output_compression.rb
|
365
|
+
- vendor/plugins/output_compression/test/output_test.rb
|
366
|
+
- vendor/plugins/output_compression/test/test_controller.rb
|
367
|
+
- vendor/plugins/output_compression/test/test_helper.rb
|
359
368
|
- vendor/plugins/google_analytics/test
|
360
369
|
- vendor/plugins/google_analytics/lib
|
361
370
|
- vendor/plugins/google_analytics/Rakefile
|
@@ -364,6 +373,14 @@ files:
|
|
364
373
|
- vendor/plugins/google_analytics/test/google_analytics_test.rb
|
365
374
|
- vendor/plugins/google_analytics/lib/rubaidh
|
366
375
|
- vendor/plugins/google_analytics/lib/rubaidh/google_analytics.rb
|
376
|
+
- vendor/plugins/responds_to_parent/test
|
377
|
+
- vendor/plugins/responds_to_parent/lib
|
378
|
+
- vendor/plugins/responds_to_parent/MIT-LICENSE
|
379
|
+
- vendor/plugins/responds_to_parent/Rakefile
|
380
|
+
- vendor/plugins/responds_to_parent/init.rb
|
381
|
+
- vendor/plugins/responds_to_parent/README
|
382
|
+
- vendor/plugins/responds_to_parent/test/responds_to_parent_test.rb
|
383
|
+
- vendor/plugins/responds_to_parent/lib/responds_to_parent.rb
|
367
384
|
test_files:
|
368
385
|
- test/unit/mail_test.rb
|
369
386
|
- test/unit/elt_test.rb
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|