parlement 0.1
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 +709 -0
- data/COPYING +223 -0
- data/README +20 -0
- data/Rakefile +136 -0
- data/app/controllers/account_controller.rb +181 -0
- data/app/controllers/application.rb +30 -0
- data/app/controllers/elt_controller.rb +83 -0
- data/app/helpers/account_helper.rb +2 -0
- data/app/helpers/application_helper.rb +4 -0
- data/app/helpers/elt_helper.rb +37 -0
- data/app/helpers/live_tree.rb +238 -0
- data/app/helpers/mailman.rb +96 -0
- data/app/models/attachment.rb +4 -0
- data/app/models/elt.rb +17 -0
- data/app/models/mail.rb +4 -0
- data/app/models/notifier.rb +13 -0
- data/app/models/person.rb +9 -0
- data/app/models/user.rb +7 -0
- data/app/models/user_notify.rb +75 -0
- data/app/views/account/_help.rhtml +23 -0
- data/app/views/account/_login.rhtml +57 -0
- data/app/views/account/_show.rhtml +31 -0
- data/app/views/account/logout.rhtml +10 -0
- data/app/views/account/signup.rhtml +17 -0
- data/app/views/account/welcome.rhtml +13 -0
- data/app/views/elt/_elt.rhtml +105 -0
- data/app/views/elt/_form.rhtml +31 -0
- data/app/views/elt/_list.rhtml +28 -0
- data/app/views/elt/new.rhtml +102 -0
- data/app/views/elt/rss.rxml +31 -0
- data/app/views/elt/show.rhtml +46 -0
- data/app/views/elt/show_tree.rhtml +8 -0
- data/app/views/layouts/scaffold.rhtml +13 -0
- data/app/views/layouts/top.rhtml +45 -0
- data/app/views/notifier/changeEmail.rhtml +10 -0
- data/config/boot.rb +17 -0
- data/config/database.yml +82 -0
- data/config/environment.rb +92 -0
- data/config/environments/development.rb +17 -0
- data/config/environments/production.rb +17 -0
- data/config/environments/test.rb +17 -0
- data/config/environments/user_environment.rb +1 -0
- data/config/routes.rb +28 -0
- data/db/ROOT/CV.txt +166 -0
- data/db/ROOT/IP.txt +3 -0
- data/db/ROOT/parleR.txt +3 -0
- data/db/ROOT/parlement/security.txt +34 -0
- data/db/ROOT/parlement/test.txt +4 -0
- data/db/ROOT/parlement.txt +51 -0
- data/db/ROOT/perso.txt +215 -0
- data/db/schema.sql +127 -0
- data/lib/data_import.rb +54 -0
- data/lib/file_column.rb +263 -0
- data/lib/file_column_helper.rb +45 -0
- data/lib/localization.rb +88 -0
- data/lib/localizer.rb +88 -0
- data/lib/login_system.rb +87 -0
- data/lib/rails_file_column.rb +19 -0
- data/lib/user_system.rb +101 -0
- data/public/404.html +8 -0
- data/public/500.html +8 -0
- data/public/dispatch.cgi +10 -0
- data/public/dispatch.fcgi +24 -0
- data/public/dispatch.rb +10 -0
- data/public/engine_files/README +5 -0
- data/public/engine_files/login_engine/stylesheets/login_engine.css +81 -0
- data/public/favicon.ico +0 -0
- data/public/favicon.png +0 -0
- data/public/images/live_tree_branch_collapsed_icon.gif +0 -0
- data/public/images/live_tree_branch_expanded_icon.gif +0 -0
- data/public/images/live_tree_leaf_icon.gif +0 -0
- data/public/images/live_tree_loading_spinner.gif +0 -0
- data/public/images/webfeed.gif +0 -0
- data/public/javascripts/controls.js +721 -0
- data/public/javascripts/dragdrop.js +519 -0
- data/public/javascripts/effects.js +992 -0
- data/public/javascripts/live_tree.js +749 -0
- data/public/javascripts/prototype.js +1726 -0
- data/public/javascripts/scriptaculous.js +47 -0
- data/public/javascripts/slider.js +258 -0
- data/public/oldREADME +190 -0
- data/public/oldindex.html +78 -0
- data/public/robots.txt +1 -0
- data/public/stylesheets/default.css +238 -0
- data/public/stylesheets/live_tree.css +62 -0
- data/public/stylesheets/scaffold.css +74 -0
- data/script/about +3 -0
- data/script/benchmarker +19 -0
- data/script/breakpointer +3 -0
- data/script/console +3 -0
- data/script/create_db +7 -0
- data/script/destroy +3 -0
- data/script/generate +3 -0
- data/script/performance/benchmarker +3 -0
- data/script/performance/profiler +3 -0
- data/script/plugin +3 -0
- data/script/process/reaper +3 -0
- data/script/process/spawner +3 -0
- data/script/process/spinner +3 -0
- data/script/profiler +34 -0
- data/script/runner +3 -0
- data/script/server +3 -0
- data/test/fixtures/attachments.yml +10 -0
- data/test/fixtures/elts.yml +15 -0
- data/test/fixtures/mails.yml +7 -0
- data/test/fixtures/people.yml +49 -0
- data/test/fixtures/users.yml +41 -0
- data/test/functional/account_controller_test.rb +239 -0
- data/test/functional/elt_controller_test.rb +18 -0
- data/test/mocks/test/time.rb +17 -0
- data/test/mocks/test/user_notify.rb +16 -0
- data/test/test_helper.rb +28 -0
- data/test/unit/attachment_test.rb +14 -0
- data/test/unit/elt_test.rb +14 -0
- data/test/unit/mail_test.rb +14 -0
- data/test/unit/notifier_test.rb +31 -0
- data/test/unit/person_test.rb +24 -0
- data/test/unit/user_test.rb +94 -0
- data/vendor/plugins/engines/CHANGELOG +7 -0
- data/vendor/plugins/engines/README +128 -0
- data/vendor/plugins/engines/init.rb +33 -0
- data/vendor/plugins/engines/lib/action_mailer_extensions.rb +160 -0
- data/vendor/plugins/engines/lib/action_view_extensions.rb +130 -0
- data/vendor/plugins/engines/lib/dependencies_extensions.rb +56 -0
- data/vendor/plugins/engines/lib/engines.rb +292 -0
- data/vendor/plugins/engines/lib/ruby_extensions.rb +127 -0
- data/vendor/plugins/engines/lib/testing_extensions.rb +33 -0
- data/vendor/plugins/engines/test/ruby_extensions_test.rb +94 -0
- data/vendor/plugins/login_engine/README +258 -0
- data/vendor/plugins/login_engine/app/controllers/user_controller.rb +248 -0
- data/vendor/plugins/login_engine/app/helpers/user_helper.rb +88 -0
- data/vendor/plugins/login_engine/app/models/user.rb +7 -0
- data/vendor/plugins/login_engine/app/models/user_notify.rb +75 -0
- data/vendor/plugins/login_engine/app/views/user/_edit.rhtml +11 -0
- data/vendor/plugins/login_engine/app/views/user/_password.rhtml +9 -0
- data/vendor/plugins/login_engine/app/views/user/change_password.rhtml +17 -0
- data/vendor/plugins/login_engine/app/views/user/edit.rhtml +23 -0
- data/vendor/plugins/login_engine/app/views/user/forgot_password.rhtml +18 -0
- data/vendor/plugins/login_engine/app/views/user/home.rhtml +7 -0
- data/vendor/plugins/login_engine/app/views/user/login.rhtml +17 -0
- data/vendor/plugins/login_engine/app/views/user/logout.rhtml +8 -0
- data/vendor/plugins/login_engine/app/views/user/signup.rhtml +17 -0
- data/vendor/plugins/login_engine/app/views/user_notify/change_password.rhtml +10 -0
- data/vendor/plugins/login_engine/app/views/user_notify/delete.rhtml +5 -0
- data/vendor/plugins/login_engine/app/views/user_notify/forgot_password.rhtml +11 -0
- data/vendor/plugins/login_engine/app/views/user_notify/pending_delete.rhtml +9 -0
- data/vendor/plugins/login_engine/app/views/user_notify/signup.rhtml +12 -0
- data/vendor/plugins/login_engine/db/schema.rb +25 -0
- data/vendor/plugins/login_engine/init_engine.rb +10 -0
- data/vendor/plugins/login_engine/lib/login_engine/authenticated_system.rb +107 -0
- data/vendor/plugins/login_engine/lib/login_engine/authenticated_user.rb +149 -0
- data/vendor/plugins/login_engine/lib/login_engine.rb +58 -0
- data/vendor/plugins/login_engine/public/stylesheets/login_engine.css +81 -0
- data/vendor/plugins/login_engine/tasks/tasks.rake +4 -0
- data/vendor/plugins/login_engine/test/fixtures/templates/users.yml +41 -0
- data/vendor/plugins/login_engine/test/fixtures/users.yml +41 -0
- data/vendor/plugins/login_engine/test/functional/user_controller_test.rb +533 -0
- data/vendor/plugins/login_engine/test/mocks/mail.rb +14 -0
- data/vendor/plugins/login_engine/test/mocks/time.rb +19 -0
- data/vendor/plugins/login_engine/test/test_helper.rb +15 -0
- data/vendor/plugins/login_engine/test/unit/user_test.rb +94 -0
- metadata +276 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<% eltSubsNb = elt.children.count if eltSubsNb == nil %>
|
|
2
|
+
|
|
3
|
+
<div class="elt" id="elt_<%= elt.id %>">
|
|
4
|
+
<% if elt.person != nil and elt.person.name != nil \
|
|
5
|
+
and elt.person.name != '' %>
|
|
6
|
+
<div class="author">
|
|
7
|
+
<% if elt.person != nil and elt.person.email != nil %>
|
|
8
|
+
<<%= mail_to elt.person.email, elt.person.name,
|
|
9
|
+
:subject => elt.subject %>>
|
|
10
|
+
<% else %>
|
|
11
|
+
<<%= elt.person.name %>>
|
|
12
|
+
<% end %>
|
|
13
|
+
</div>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<div class="eltInfo" title="<%= elt.created_on %>">
|
|
17
|
+
<!--
|
|
18
|
+
<= link_to('@', :action => 'raw_elt', :id => elt) if elt.mail != nil >
|
|
19
|
+
-->
|
|
20
|
+
|
|
21
|
+
<% if elt.id and elt.children.count == 0 %>
|
|
22
|
+
<%= link_to_remote('>>',
|
|
23
|
+
:update => 'eltNew_'+elt.id.to_s,
|
|
24
|
+
:url => { :action => 'new', :id => elt },
|
|
25
|
+
:loaded => visual_effect(:BlindDown, 'eltNew_'+elt.id.to_s)+
|
|
26
|
+
visual_effect(:BlindDown, 'eltSubsClose_'+elt.id.to_s)) %>
|
|
27
|
+
<% end %>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<% if elt.parent_id == 'ROOT' or not elt.subject.include? elt.parent.subject %>
|
|
31
|
+
<h<%= eltTop ? '1' : '2' %>>
|
|
32
|
+
<% if elt.id %>
|
|
33
|
+
<%= link_to(textilize_without_paragraph(elt.subject),
|
|
34
|
+
:controller => 'elt', :action => 'show', :id => elt) %>
|
|
35
|
+
<% else %>
|
|
36
|
+
<%= textilize_without_paragraph(elt.subject) %>
|
|
37
|
+
<% end %>
|
|
38
|
+
</h<%= eltTop ? '1' : '2' %>>
|
|
39
|
+
<% end %>
|
|
40
|
+
|
|
41
|
+
<div class="eltBody">
|
|
42
|
+
<p style="margin-top:0px;margin-bottom:0px"><%= format elt.body %></p>
|
|
43
|
+
|
|
44
|
+
<% for att in elt.attachments %>
|
|
45
|
+
<%= link_to image_tag('/attachment/file/'+att.file_relative_path),
|
|
46
|
+
'/attachment/file/'+att.file_relative_path %>
|
|
47
|
+
<% end %>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div class="eltSub">
|
|
51
|
+
<!-- Display automatically one element threads -->
|
|
52
|
+
<div style="display:<%= (eltTop or eltSubsNb < 2) ? 'none' : '' %>"
|
|
53
|
+
class="eltMore" id="eltMore_<%= elt.id %>">
|
|
54
|
+
<%= link_to_remote(eltSubsNb.to_s+' more',
|
|
55
|
+
:update => 'eltSubs_'+elt.id.to_s,
|
|
56
|
+
:url => { :action => 'list', :id => elt },
|
|
57
|
+
:loading => visual_effect(:SwitchOff, 'eltMore_'+elt.id.to_s)+
|
|
58
|
+
visual_effect(:BlindDown, 'eltSubsClose_'+elt.id.to_s),
|
|
59
|
+
:loaded => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s)) %>
|
|
60
|
+
|
|
61
|
+
<%= link_to_remote('Add >>',
|
|
62
|
+
:update => 'eltNew_'+elt.id.to_s,
|
|
63
|
+
:url => { :action => 'new', :id => elt },
|
|
64
|
+
:loaded => visual_effect(:BlindDown, 'eltNew_'+elt.id.to_s)+
|
|
65
|
+
visual_effect(:BlindDown, 'eltSubsClose_'+elt.id.to_s)) %>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div style="display:<%= (eltTop or eltSubsNb == 1) ? '' : 'none' %>"
|
|
69
|
+
class="eltSubs" id="eltSubs_<%= elt.id %>">
|
|
70
|
+
<% if eltTop or eltSubsNb == 1 %>
|
|
71
|
+
<%= render :partial => 'list', :locals => { :elt => elt } %>
|
|
72
|
+
<% end %>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div style="display:none" class="eltNew" id="eltNew_<%= elt.id %>">
|
|
76
|
+
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div style="display:<%= ((eltTop and eltSubsNb > 0) or eltSubsNb == 1) ? '' : 'none' %>"
|
|
81
|
+
id="eltSubsClose_<%= elt.id %>" title="<%= elt.created_on %>"
|
|
82
|
+
class="eltSubsClose">
|
|
83
|
+
<%= link_to_function('<< Close',
|
|
84
|
+
visual_effect(:BlindUp, 'eltSubs_'+elt.id.to_s)+
|
|
85
|
+
visual_effect(:BlindUp, 'eltNew_'+elt.id.to_s)+
|
|
86
|
+
visual_effect(:BlindUp, 'eltSubsClose_'+elt.id.to_s)+
|
|
87
|
+
visual_effect(:BlindDown, 'eltMore_'+elt.id.to_s)) %>
|
|
88
|
+
|
|
89
|
+
<% if elt.person != nil and elt.person.name != nil \
|
|
90
|
+
and elt.person.name != '' %>
|
|
91
|
+
<% if elt.person != nil and elt.person.email != nil %>
|
|
92
|
+
<<%= mail_to elt.person.email, elt.person.name %>>
|
|
93
|
+
<% else %>
|
|
94
|
+
<<%= elt.person.name %>>
|
|
95
|
+
<% end %>
|
|
96
|
+
<% end %>
|
|
97
|
+
|
|
98
|
+
<%= link_to_remote('Add >>',
|
|
99
|
+
:update => 'eltNew_'+elt.id.to_s,
|
|
100
|
+
:url => { :action => 'new', :id => elt },
|
|
101
|
+
:loaded => visual_effect(:BlindDown, 'eltNew_'+elt.id.to_s)+
|
|
102
|
+
visual_effect(:BlindDown, 'eltSubsClose_'+elt.id.to_s)) %>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<%= error_messages_for 'elt' %>
|
|
2
|
+
|
|
3
|
+
<div class="eltInfo">
|
|
4
|
+
<%= link_to_remote('<<',
|
|
5
|
+
:empty => 'new_link_'+@elt.parent.id.to_s,
|
|
6
|
+
:url => {
|
|
7
|
+
:controller => 'elt',
|
|
8
|
+
:action => 'new',
|
|
9
|
+
:id => @elt.parent.id },
|
|
10
|
+
:loading => visual_effect(:BlindUp,
|
|
11
|
+
'new_link_'+@elt.parent.id.to_s)) %>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<!--[form:elt]-->
|
|
15
|
+
<%= hidden_field 'elt', 'parent_id' %></p>
|
|
16
|
+
|
|
17
|
+
<p style="display:<%= 'none' if @person.name != nil %>">
|
|
18
|
+
<label for="person_name">Proposed by</label>
|
|
19
|
+
<%= text_field 'person', 'name' %>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
<!-- <p><label for="elt_subject">Title</label><br/> -->
|
|
23
|
+
<%= text_field 'elt', 'subject' %>
|
|
24
|
+
|
|
25
|
+
<label for="elt_position">Position</label>
|
|
26
|
+
<%= text_field 'elt', 'position', 'size' => 1, 'align' => 'right' %>
|
|
27
|
+
|
|
28
|
+
<label for="elt_body"></label><br/>
|
|
29
|
+
<%= text_area 'elt', 'body' %>
|
|
30
|
+
<!--[eoform:elt]-->
|
|
31
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<%
|
|
2
|
+
# TODO get the count from the parent element call
|
|
3
|
+
e_pages = ActionController::Pagination::Paginator.new(
|
|
4
|
+
self, elt.children.count, PAGE_ELT_LENGTH, @params['page'])
|
|
5
|
+
e = Elt.find_all("parent_id = '#{elt.id}'",
|
|
6
|
+
'created_on DESC', e_pages.current.to_sql)
|
|
7
|
+
%>
|
|
8
|
+
|
|
9
|
+
<%= link_to_remote('< Previous',
|
|
10
|
+
:update => 'eltSubs_'+elt.id.to_s,
|
|
11
|
+
:url => { :action => 'list', :id => elt, :page => e_pages.current.next },
|
|
12
|
+
:loading => visual_effect(:BlindDown, 'eltSubsClose_'+elt.id.to_s),
|
|
13
|
+
:loaded => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s)) if e_pages.current.next %>
|
|
14
|
+
|
|
15
|
+
<span style="display:<%= e_pages.length > 1 ? '' : 'none'%>" class="pageCount">
|
|
16
|
+
(<%= e_pages.length-e_pages.current.to_i+1 %>/<%= e_pages.length %>)
|
|
17
|
+
</span>
|
|
18
|
+
|
|
19
|
+
<%= link_to_remote('Next >',
|
|
20
|
+
:update => 'eltSubs_'+elt.id.to_s,
|
|
21
|
+
:url => { :action => 'list', :id => elt, :page => e_pages.current.previous },
|
|
22
|
+
:loading => visual_effect(:BlindDown, 'eltSubsClose_'+elt.id.to_s),
|
|
23
|
+
:loaded => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s)) if e_pages.current.previous %>
|
|
24
|
+
|
|
25
|
+
<%= render :partial => 'elt',
|
|
26
|
+
:collection => e.reverse,
|
|
27
|
+
:locals => { :eltTop => false } %>
|
|
28
|
+
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<% @flash.each do |key, value| %>
|
|
2
|
+
<div class="<%= key %>"><%= value %></div>
|
|
3
|
+
<% end %>
|
|
4
|
+
|
|
5
|
+
<%= error_messages_for 'elt' %>
|
|
6
|
+
|
|
7
|
+
<div id="author_<%= @elt.parent_id %>">
|
|
8
|
+
<%= render :partial => 'account/show',
|
|
9
|
+
:locals => { :divId => 'author_'+@elt.parent_id } %>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<%= form_remote_tag(
|
|
13
|
+
:update => 'eltSubs_'+@elt.parent_id,
|
|
14
|
+
:url => { :action => 'create' },
|
|
15
|
+
:position => 'bottom',
|
|
16
|
+
:loading => visual_effect(:BlindUp, 'eltNew_'+@elt.parent.id.to_s),
|
|
17
|
+
:complete => "Element.show('eltSubs_#{@elt.parent_id.to_s}');
|
|
18
|
+
Element.show('eltSubsClose_#{@elt.parent_id.to_s}');",
|
|
19
|
+
:loaded => visual_effect(:BlindDown, 'elt_'+@elt.id.to_s)) %>
|
|
20
|
+
|
|
21
|
+
<!--[form:elt]-->
|
|
22
|
+
<%= hidden_field 'elt', 'parent_id' %></p>
|
|
23
|
+
|
|
24
|
+
<h2>
|
|
25
|
+
<%= text_field 'elt', 'subject', :style => 'font-weight:bolder' %>
|
|
26
|
+
|
|
27
|
+
<%= render :partial => 'account/help',
|
|
28
|
+
:locals => { :divId => 'title'+@elt.parent_id, :content => '
|
|
29
|
+
This is the title of your proposition.
|
|
30
|
+
<br/>
|
|
31
|
+
If you leave it as it is then it won\'t be displayed (recommanded if your
|
|
32
|
+
text is short, like in a conversation).
|
|
33
|
+
' } %>
|
|
34
|
+
</h2>
|
|
35
|
+
|
|
36
|
+
<div style="display:none">
|
|
37
|
+
<label for="elt_position">Position:</label>
|
|
38
|
+
<%= text_field 'elt', 'position', 'size' => 1, 'align' => 'right' %>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<p style="margin-top:0px;text-align:right">
|
|
42
|
+
<%= text_area 'elt', 'body' %>
|
|
43
|
+
|
|
44
|
+
<%= submit_to_remote('Preview', 'Preview',
|
|
45
|
+
:update => 'eltNewPreview_'+@elt.parent_id,
|
|
46
|
+
:url => { :action => 'create', :submit => :preview },
|
|
47
|
+
:loaded => visual_effect(:BlindDown, 'eltNewPreview_'+@elt.parent_id)) %>
|
|
48
|
+
<%= submit_tag 'Propose' %>
|
|
49
|
+
|
|
50
|
+
<%= render :partial => 'account/help',
|
|
51
|
+
:locals => { :divId => 'body'+@elt.parent_id, :content => '
|
|
52
|
+
_<em>emphasis</em>_ *<strong>strong</strong>* -<span
|
|
53
|
+
style="text-decoration:line-through;">strike-through</span>- +added+
|
|
54
|
+
^<sup>sup</sup>^ ~<sub>sub</sub>~
|
|
55
|
+
<div>bg. blockquote => </div>
|
|
56
|
+
<blockquote>blockquote</blockquote>
|
|
57
|
+
"Google":http://google.com => <a href="http://google.com">Google</a>
|
|
58
|
+
<br/>
|
|
59
|
+
<pre>@code@</pre>
|
|
60
|
+
<div style="float:left">
|
|
61
|
+
ordered list
|
|
62
|
+
<br/>
|
|
63
|
+
# first item
|
|
64
|
+
<br/>
|
|
65
|
+
# second item
|
|
66
|
+
<br/>
|
|
67
|
+
# third item
|
|
68
|
+
</div>
|
|
69
|
+
<div style="margin-left:10em">
|
|
70
|
+
<ol>ordered list
|
|
71
|
+
<li>first item</li>
|
|
72
|
+
<li>second item</li>
|
|
73
|
+
<li>third item</li>
|
|
74
|
+
</ol>
|
|
75
|
+
</div>
|
|
76
|
+
<div style="float:left">
|
|
77
|
+
unordered list
|
|
78
|
+
<br/>
|
|
79
|
+
* item
|
|
80
|
+
<br/>
|
|
81
|
+
* item
|
|
82
|
+
<br/>
|
|
83
|
+
* item
|
|
84
|
+
</div>
|
|
85
|
+
<div style="margin-left:10em">
|
|
86
|
+
<ul>unordered list
|
|
87
|
+
<li>item</li>
|
|
88
|
+
<li>item</li>
|
|
89
|
+
<li>item</li>
|
|
90
|
+
</ul>
|
|
91
|
+
</div>
|
|
92
|
+
<a href="http://hobix.com/textile/quick.html">Textile Reference</a>
|
|
93
|
+
' } %>
|
|
94
|
+
|
|
95
|
+
<div style="display:none" class="eltNew" id="eltNewPreview_<%= @elt.parent_id %>">
|
|
96
|
+
|
|
97
|
+
</div>
|
|
98
|
+
</p>
|
|
99
|
+
|
|
100
|
+
<!--[eoform:elt]-->
|
|
101
|
+
<%= end_form_tag %>
|
|
102
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
|
|
2
|
+
xml.channel do
|
|
3
|
+
xml.title(@elt.subject)
|
|
4
|
+
xml.link(url_for(:only_path => false, :action => nil, :id => @elt.id))
|
|
5
|
+
xml.description @elt.subject+" (parlement)"
|
|
6
|
+
xml.language "en"
|
|
7
|
+
xml.language "fr"
|
|
8
|
+
|
|
9
|
+
for item in @elt.children.reverse
|
|
10
|
+
xml.item do
|
|
11
|
+
xml.title(item.subject)
|
|
12
|
+
#xml.category(@elt.subject)
|
|
13
|
+
xml.pubDate(item.created_on)
|
|
14
|
+
|
|
15
|
+
if url_for(:only_path => false).match(/http:\/\/echarp.dyndns.org/) and @elt.id == 'blog'
|
|
16
|
+
xml.link(url_for(:only_path => false, :controller => 'perso',
|
|
17
|
+
:action => 'blog', :id => item.id+'.html'))
|
|
18
|
+
xml.comments(url_for(:only_path => false, :controller => 'perso',
|
|
19
|
+
:action => 'blog', :id => item.id+'.html'))
|
|
20
|
+
else
|
|
21
|
+
xml.link(url_for(:only_path => false, :action => 'show', :id => item.id))
|
|
22
|
+
xml.comments(url_for(:only_path => false, :action => 'show', :id => item.id))
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
xml.tag!("dc:creator", item.person.name) if item.person != nil
|
|
26
|
+
|
|
27
|
+
xml.description("<p>"+format(item.body)+"</p>")
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<div class="sidebar" style="clear:right">
|
|
2
|
+
<div class="box">
|
|
3
|
+
<% if @elt.children.count > 0 %>
|
|
4
|
+
<div class="boxTitle">Titres</div>
|
|
5
|
+
<% end %>
|
|
6
|
+
|
|
7
|
+
<% for elt in @elt.children.reverse[0..9] %>
|
|
8
|
+
<div class="boxLine">
|
|
9
|
+
<span style="float:right;margin-right:0.5em;font-size:smaller;">
|
|
10
|
+
<%= elt.created_on.strftime('%d/%m') %>
|
|
11
|
+
</span>
|
|
12
|
+
<%= link_to elt.subject, :id => elt %>
|
|
13
|
+
</div>
|
|
14
|
+
<% end %>
|
|
15
|
+
|
|
16
|
+
<br/>
|
|
17
|
+
|
|
18
|
+
<%= link_to image_tag("/images/webfeed.gif"),
|
|
19
|
+
:action => 'rss', :id => @elt %>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<!--
|
|
23
|
+
<a href="http://echarp.dyndns.org/perso/image/echarp.jpg"
|
|
24
|
+
title="Oui oui, je fais mon style ;)">
|
|
25
|
+
<img src="/perso/image/echarpSmall.jpg" style="margin-top:1em"/>
|
|
26
|
+
<img src="http://echarp.dyndns.org/perso/CV/20030520echarp.jpg"/>
|
|
27
|
+
</a>
|
|
28
|
+
-->
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<% @flash.each do |key, value| %>
|
|
32
|
+
<div class="<%= key %>"><%= value %></div>
|
|
33
|
+
<% end %>
|
|
34
|
+
|
|
35
|
+
<% if @elt.parent.subject != '' %>
|
|
36
|
+
<div class="parent">
|
|
37
|
+
<%= link_to(textilize_without_paragraph(@elt.parent.subject),
|
|
38
|
+
:id => @elt.parent) %>
|
|
39
|
+
</div>
|
|
40
|
+
<% end %>
|
|
41
|
+
|
|
42
|
+
<%= render :partial => 'elt', :layout => 'top',
|
|
43
|
+
:locals => { :elt => @elt, :eltTop => true } %>
|
|
44
|
+
|
|
45
|
+
<div class="version">version <%= PARLEMENT_VERSION %></div>
|
|
46
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
|
+
|
|
4
|
+
<html>
|
|
5
|
+
<head>
|
|
6
|
+
<title><%= @title %></title>
|
|
7
|
+
<!--<title><%= controller.action_name %></title>-->
|
|
8
|
+
|
|
9
|
+
<%= stylesheet_link_tag 'default' %>
|
|
10
|
+
<!--
|
|
11
|
+
<%= stylesheet_link_tag 'scaffold' %>
|
|
12
|
+
<%= javascript_include_tag "/javascripts/live_tree.js" %>
|
|
13
|
+
-->
|
|
14
|
+
<%= javascript_include_tag "/javascripts/prototype" %>
|
|
15
|
+
<%= javascript_include_tag "/javascripts/scriptaculous" %>
|
|
16
|
+
|
|
17
|
+
<meta name="ROBOTS" content="ALL"/>
|
|
18
|
+
<meta name="author" content="Emmanuel Charpentier"/>
|
|
19
|
+
<meta name="description" content="Parlement, a mix between direct and
|
|
20
|
+
representative democracy, in the shape of a website. A mailing list,
|
|
21
|
+
forum, chat."/>
|
|
22
|
+
<meta name="keywords" content="collaborative writing, democracy,
|
|
23
|
+
participative democracy, direct democracy, representative democracy,
|
|
24
|
+
participative internationalisation, web site, ruby on rails,
|
|
25
|
+
PostgreSQL"/>
|
|
26
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
27
|
+
</head>
|
|
28
|
+
|
|
29
|
+
<body>
|
|
30
|
+
<div class="sidebar">
|
|
31
|
+
<a class="title" href="/">Parlement</a>
|
|
32
|
+
|
|
33
|
+
<div class="signets">
|
|
34
|
+
<a href="http://rubyforge.org/projects/parlement">forge</a>
|
|
35
|
+
<a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<%= @content_for_layout %>
|
|
40
|
+
|
|
41
|
+
<!-- To make sure the content goes beyond the sidebar -->
|
|
42
|
+
<div style="clear:both"/>
|
|
43
|
+
</body>
|
|
44
|
+
</html>
|
|
45
|
+
|
data/config/boot.rb
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
unless defined?(RAILS_ROOT)
|
|
2
|
+
root_path = File.join(File.dirname(__FILE__), '..')
|
|
3
|
+
unless RUBY_PLATFORM =~ /mswin32/
|
|
4
|
+
require 'pathname'
|
|
5
|
+
root_path = Pathname.new(root_path).cleanpath(true).to_s
|
|
6
|
+
end
|
|
7
|
+
RAILS_ROOT = root_path
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
if File.directory?("#{RAILS_ROOT}/vendor/rails")
|
|
11
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
|
12
|
+
else
|
|
13
|
+
require 'rubygems'
|
|
14
|
+
require 'initializer'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
Rails::Initializer.run(:set_load_path)
|
data/config/database.yml
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# MySQL (default setup). Versions 4.1 and 5.0 are recommended.
|
|
2
|
+
#
|
|
3
|
+
# Get the fast C bindings:
|
|
4
|
+
# gem install postgresql
|
|
5
|
+
# (on OS X: gem install postgresql -- --include=/usr/local/lib)
|
|
6
|
+
# And be sure to use new-style password hashing:
|
|
7
|
+
# http://dev.postgresql.com/doc/refman/5.0/en/old-client.html
|
|
8
|
+
development:
|
|
9
|
+
adapter: postgresql
|
|
10
|
+
database: parlement_development
|
|
11
|
+
username: manu
|
|
12
|
+
password: manu
|
|
13
|
+
|
|
14
|
+
# Connect on a TCP socket. If omitted, the adapter will connect on the
|
|
15
|
+
# domain socket given by socket instead.
|
|
16
|
+
#host: localhost
|
|
17
|
+
#port: 3306
|
|
18
|
+
|
|
19
|
+
# Warning: The database defined as 'test' will be erased and
|
|
20
|
+
# re-generated from your development database when you run 'rake'.
|
|
21
|
+
# Do not set this db to the same as development or production.
|
|
22
|
+
test:
|
|
23
|
+
adapter: postgresql
|
|
24
|
+
database: parlement_test
|
|
25
|
+
username: manu
|
|
26
|
+
password:
|
|
27
|
+
|
|
28
|
+
production:
|
|
29
|
+
adapter: postgresql
|
|
30
|
+
database: parlement_production
|
|
31
|
+
username: manu
|
|
32
|
+
password: manu
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# PostgreSQL versions 7.4 - 8.1
|
|
36
|
+
#
|
|
37
|
+
# Get the C bindings:
|
|
38
|
+
# gem install postgres
|
|
39
|
+
# or use the pure-Ruby bindings on Windows:
|
|
40
|
+
# gem install postgres-pr
|
|
41
|
+
postgresql_example:
|
|
42
|
+
adapter: postgresql
|
|
43
|
+
database: parlement_development
|
|
44
|
+
username: parlement
|
|
45
|
+
password:
|
|
46
|
+
|
|
47
|
+
# Connect on a TCP socket. Omitted by default since the client uses a
|
|
48
|
+
# domain socket that doesn't need configuration.
|
|
49
|
+
#host: remote-database
|
|
50
|
+
#port: 5432
|
|
51
|
+
|
|
52
|
+
# Schema search path. The server defaults to $user,public
|
|
53
|
+
#schema_search_path: myapp,sharedapp,public
|
|
54
|
+
|
|
55
|
+
# Character set encoding. The server defaults to sql_ascii.
|
|
56
|
+
#encoding: UTF8
|
|
57
|
+
|
|
58
|
+
# Minimum log levels, in increasing order:
|
|
59
|
+
# debug5, debug4, debug3, debug2, debug1,
|
|
60
|
+
# info, notice, warning, error, log, fatal, or panic
|
|
61
|
+
# The server defaults to notice.
|
|
62
|
+
#min_messages: warning
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
# SQLite version 2.x
|
|
66
|
+
# gem install sqlite-ruby
|
|
67
|
+
sqlite_example:
|
|
68
|
+
adapter: sqlite
|
|
69
|
+
database: db/development.sqlite2
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
# SQLite version 3.x
|
|
73
|
+
# gem install sqlite3-ruby
|
|
74
|
+
sqlite3_example:
|
|
75
|
+
adapter: sqlite3
|
|
76
|
+
database: db/development.sqlite3
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
# In-memory SQLite 3 database. Useful for tests.
|
|
80
|
+
sqlite3_in_memory_example:
|
|
81
|
+
adapter: sqlite3
|
|
82
|
+
database: ":memory:"
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Be sure to restart your web server when you modify this file.
|
|
2
|
+
|
|
3
|
+
# Uncomment below to force Rails into production mode
|
|
4
|
+
# (Use only when you can't set environment variables through your web/app server)
|
|
5
|
+
# ENV['RAILS_ENV'] ||= 'production'
|
|
6
|
+
|
|
7
|
+
# Bootstrap the Rails environment, frameworks, and default configuration
|
|
8
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
|
9
|
+
|
|
10
|
+
Rails::Initializer.run do |config|
|
|
11
|
+
# Skip frameworks you're not going to use
|
|
12
|
+
# config.frameworks -= [ :action_web_service, :action_mailer ]
|
|
13
|
+
|
|
14
|
+
# Add additional load paths for your own custom dirs
|
|
15
|
+
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
|
16
|
+
|
|
17
|
+
# Force all environments to use the same logger level
|
|
18
|
+
# (by default production uses :info, the others :debug)
|
|
19
|
+
# config.log_level = :debug
|
|
20
|
+
|
|
21
|
+
# Use the database for sessions instead of the file system
|
|
22
|
+
# (create the session table with 'rake create_sessions_table')
|
|
23
|
+
# config.action_controller.session_store = :active_record_store
|
|
24
|
+
|
|
25
|
+
# Enable page/fragment caching by setting a file-based store
|
|
26
|
+
# (remember to create the caching directory and make it readable to the application)
|
|
27
|
+
# config.action_controller.fragment_cache_store = :file_store, "#{RAILS_ROOT}/cache"
|
|
28
|
+
|
|
29
|
+
# Activate observers that should always be running
|
|
30
|
+
# config.active_record.observers = :cacher, :garbage_collector
|
|
31
|
+
|
|
32
|
+
# Make Active Record use UTC-base instead of local time
|
|
33
|
+
# config.active_record.default_timezone = :utc
|
|
34
|
+
|
|
35
|
+
# Use Active Record's schema dumper instead of SQL when creating the test database
|
|
36
|
+
# (enables use of different database adapters for development and test environments)
|
|
37
|
+
# config.active_record.schema_format = :ruby
|
|
38
|
+
|
|
39
|
+
# See Rails::Configuration for more options
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Add new inflection rules using the following format
|
|
43
|
+
# (all these examples are active by default):
|
|
44
|
+
# Inflector.inflections do |inflect|
|
|
45
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
|
46
|
+
# inflect.singular /^(ox)en/i, '\1'
|
|
47
|
+
# inflect.irregular 'person', 'people'
|
|
48
|
+
# inflect.uncountable %w( fish sheep )
|
|
49
|
+
# end
|
|
50
|
+
|
|
51
|
+
# Include your application configuration below
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# http://www.kanthak.net/opensource/file_column/
|
|
56
|
+
require 'rails_file_column'
|
|
57
|
+
|
|
58
|
+
require 'jcode'
|
|
59
|
+
$KCODE = 'u'
|
|
60
|
+
|
|
61
|
+
# How many elements are displayed at once
|
|
62
|
+
PAGE_ELT_LENGTH = 20
|
|
63
|
+
|
|
64
|
+
PARLEMENT_VERSION=0.1
|
|
65
|
+
|
|
66
|
+
require 'environments/user_environment'
|
|
67
|
+
|
|
68
|
+
CONFIG = { :default_language => 'en' }
|
|
69
|
+
|
|
70
|
+
ActionMailer::Base.server_settings = {
|
|
71
|
+
:domain => 'leparlement.org'
|
|
72
|
+
}
|
|
73
|
+
"""
|
|
74
|
+
:address => 'smtp.postoffice.net',
|
|
75
|
+
:port => 25,
|
|
76
|
+
:domain => 'www.mywebsite.com',
|
|
77
|
+
:user_name => 'me@postoffice.net',
|
|
78
|
+
:password => 'mypass',
|
|
79
|
+
:authentication => :login
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
module LoginEngine
|
|
84
|
+
config :salt, 'parle'
|
|
85
|
+
config :email_from, 'facteur@leparlement.org'
|
|
86
|
+
config :admin_email, 'root@leparlement.org'
|
|
87
|
+
config :app_url, 'http://leparlement.org'
|
|
88
|
+
config :app_name, 'parlement'
|
|
89
|
+
config :use_email_notification, true
|
|
90
|
+
end
|
|
91
|
+
Engines.start :login
|
|
92
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# In the development environment your application's code is reloaded on
|
|
2
|
+
# every request. This slows down response time but is perfect for development
|
|
3
|
+
# since you don't have to restart the webserver when you make code changes.
|
|
4
|
+
config.cache_classes = false
|
|
5
|
+
|
|
6
|
+
# Log error messages when you accidentally call methods on nil.
|
|
7
|
+
config.whiny_nils = true
|
|
8
|
+
|
|
9
|
+
# Enable the breakpoint server that script/breakpointer connects to
|
|
10
|
+
config.breakpoint_server = true
|
|
11
|
+
|
|
12
|
+
# Show full error reports and disable caching
|
|
13
|
+
config.action_controller.consider_all_requests_local = true
|
|
14
|
+
config.action_controller.perform_caching = true
|
|
15
|
+
|
|
16
|
+
# Don't care if the mailer can't send
|
|
17
|
+
#config.action_mailer.raise_delivery_errors = false
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# The production environment is meant for finished, "live" apps.
|
|
2
|
+
# Code is not reloaded between requests
|
|
3
|
+
config.cache_classes = true
|
|
4
|
+
|
|
5
|
+
# Use a different logger for distributed setups
|
|
6
|
+
# config.logger = SyslogLogger.new
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# Full error reports are disabled and caching is turned on
|
|
10
|
+
config.action_controller.consider_all_requests_local = false
|
|
11
|
+
config.action_controller.perform_caching = true
|
|
12
|
+
|
|
13
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
|
14
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
|
15
|
+
|
|
16
|
+
# Disable delivery errors if you bad email addresses should just be ignored
|
|
17
|
+
# config.action_mailer.raise_delivery_errors = false
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# The test environment is used exclusively to run your application's
|
|
2
|
+
# test suite. You never need to work with it otherwise. Remember that
|
|
3
|
+
# your test database is "scratch space" for the test suite and is wiped
|
|
4
|
+
# and recreated between test runs. Don't rely on the data there!
|
|
5
|
+
config.cache_classes = true
|
|
6
|
+
|
|
7
|
+
# Log error messages when you accidentally call methods on nil.
|
|
8
|
+
config.whiny_nils = true
|
|
9
|
+
|
|
10
|
+
# Show full error reports and disable caching
|
|
11
|
+
config.action_controller.consider_all_requests_local = true
|
|
12
|
+
config.action_controller.perform_caching = false
|
|
13
|
+
|
|
14
|
+
# Tell ActionMailer not to deliver emails to the real world.
|
|
15
|
+
# The :test delivery method accumulates sent emails in the
|
|
16
|
+
# ActionMailer::Base.deliveries array.
|
|
17
|
+
config.action_mailer.delivery_method = :test
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|