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.
Files changed (162) hide show
  1. data/CHANGES +709 -0
  2. data/COPYING +223 -0
  3. data/README +20 -0
  4. data/Rakefile +136 -0
  5. data/app/controllers/account_controller.rb +181 -0
  6. data/app/controllers/application.rb +30 -0
  7. data/app/controllers/elt_controller.rb +83 -0
  8. data/app/helpers/account_helper.rb +2 -0
  9. data/app/helpers/application_helper.rb +4 -0
  10. data/app/helpers/elt_helper.rb +37 -0
  11. data/app/helpers/live_tree.rb +238 -0
  12. data/app/helpers/mailman.rb +96 -0
  13. data/app/models/attachment.rb +4 -0
  14. data/app/models/elt.rb +17 -0
  15. data/app/models/mail.rb +4 -0
  16. data/app/models/notifier.rb +13 -0
  17. data/app/models/person.rb +9 -0
  18. data/app/models/user.rb +7 -0
  19. data/app/models/user_notify.rb +75 -0
  20. data/app/views/account/_help.rhtml +23 -0
  21. data/app/views/account/_login.rhtml +57 -0
  22. data/app/views/account/_show.rhtml +31 -0
  23. data/app/views/account/logout.rhtml +10 -0
  24. data/app/views/account/signup.rhtml +17 -0
  25. data/app/views/account/welcome.rhtml +13 -0
  26. data/app/views/elt/_elt.rhtml +105 -0
  27. data/app/views/elt/_form.rhtml +31 -0
  28. data/app/views/elt/_list.rhtml +28 -0
  29. data/app/views/elt/new.rhtml +102 -0
  30. data/app/views/elt/rss.rxml +31 -0
  31. data/app/views/elt/show.rhtml +46 -0
  32. data/app/views/elt/show_tree.rhtml +8 -0
  33. data/app/views/layouts/scaffold.rhtml +13 -0
  34. data/app/views/layouts/top.rhtml +45 -0
  35. data/app/views/notifier/changeEmail.rhtml +10 -0
  36. data/config/boot.rb +17 -0
  37. data/config/database.yml +82 -0
  38. data/config/environment.rb +92 -0
  39. data/config/environments/development.rb +17 -0
  40. data/config/environments/production.rb +17 -0
  41. data/config/environments/test.rb +17 -0
  42. data/config/environments/user_environment.rb +1 -0
  43. data/config/routes.rb +28 -0
  44. data/db/ROOT/CV.txt +166 -0
  45. data/db/ROOT/IP.txt +3 -0
  46. data/db/ROOT/parleR.txt +3 -0
  47. data/db/ROOT/parlement/security.txt +34 -0
  48. data/db/ROOT/parlement/test.txt +4 -0
  49. data/db/ROOT/parlement.txt +51 -0
  50. data/db/ROOT/perso.txt +215 -0
  51. data/db/schema.sql +127 -0
  52. data/lib/data_import.rb +54 -0
  53. data/lib/file_column.rb +263 -0
  54. data/lib/file_column_helper.rb +45 -0
  55. data/lib/localization.rb +88 -0
  56. data/lib/localizer.rb +88 -0
  57. data/lib/login_system.rb +87 -0
  58. data/lib/rails_file_column.rb +19 -0
  59. data/lib/user_system.rb +101 -0
  60. data/public/404.html +8 -0
  61. data/public/500.html +8 -0
  62. data/public/dispatch.cgi +10 -0
  63. data/public/dispatch.fcgi +24 -0
  64. data/public/dispatch.rb +10 -0
  65. data/public/engine_files/README +5 -0
  66. data/public/engine_files/login_engine/stylesheets/login_engine.css +81 -0
  67. data/public/favicon.ico +0 -0
  68. data/public/favicon.png +0 -0
  69. data/public/images/live_tree_branch_collapsed_icon.gif +0 -0
  70. data/public/images/live_tree_branch_expanded_icon.gif +0 -0
  71. data/public/images/live_tree_leaf_icon.gif +0 -0
  72. data/public/images/live_tree_loading_spinner.gif +0 -0
  73. data/public/images/webfeed.gif +0 -0
  74. data/public/javascripts/controls.js +721 -0
  75. data/public/javascripts/dragdrop.js +519 -0
  76. data/public/javascripts/effects.js +992 -0
  77. data/public/javascripts/live_tree.js +749 -0
  78. data/public/javascripts/prototype.js +1726 -0
  79. data/public/javascripts/scriptaculous.js +47 -0
  80. data/public/javascripts/slider.js +258 -0
  81. data/public/oldREADME +190 -0
  82. data/public/oldindex.html +78 -0
  83. data/public/robots.txt +1 -0
  84. data/public/stylesheets/default.css +238 -0
  85. data/public/stylesheets/live_tree.css +62 -0
  86. data/public/stylesheets/scaffold.css +74 -0
  87. data/script/about +3 -0
  88. data/script/benchmarker +19 -0
  89. data/script/breakpointer +3 -0
  90. data/script/console +3 -0
  91. data/script/create_db +7 -0
  92. data/script/destroy +3 -0
  93. data/script/generate +3 -0
  94. data/script/performance/benchmarker +3 -0
  95. data/script/performance/profiler +3 -0
  96. data/script/plugin +3 -0
  97. data/script/process/reaper +3 -0
  98. data/script/process/spawner +3 -0
  99. data/script/process/spinner +3 -0
  100. data/script/profiler +34 -0
  101. data/script/runner +3 -0
  102. data/script/server +3 -0
  103. data/test/fixtures/attachments.yml +10 -0
  104. data/test/fixtures/elts.yml +15 -0
  105. data/test/fixtures/mails.yml +7 -0
  106. data/test/fixtures/people.yml +49 -0
  107. data/test/fixtures/users.yml +41 -0
  108. data/test/functional/account_controller_test.rb +239 -0
  109. data/test/functional/elt_controller_test.rb +18 -0
  110. data/test/mocks/test/time.rb +17 -0
  111. data/test/mocks/test/user_notify.rb +16 -0
  112. data/test/test_helper.rb +28 -0
  113. data/test/unit/attachment_test.rb +14 -0
  114. data/test/unit/elt_test.rb +14 -0
  115. data/test/unit/mail_test.rb +14 -0
  116. data/test/unit/notifier_test.rb +31 -0
  117. data/test/unit/person_test.rb +24 -0
  118. data/test/unit/user_test.rb +94 -0
  119. data/vendor/plugins/engines/CHANGELOG +7 -0
  120. data/vendor/plugins/engines/README +128 -0
  121. data/vendor/plugins/engines/init.rb +33 -0
  122. data/vendor/plugins/engines/lib/action_mailer_extensions.rb +160 -0
  123. data/vendor/plugins/engines/lib/action_view_extensions.rb +130 -0
  124. data/vendor/plugins/engines/lib/dependencies_extensions.rb +56 -0
  125. data/vendor/plugins/engines/lib/engines.rb +292 -0
  126. data/vendor/plugins/engines/lib/ruby_extensions.rb +127 -0
  127. data/vendor/plugins/engines/lib/testing_extensions.rb +33 -0
  128. data/vendor/plugins/engines/test/ruby_extensions_test.rb +94 -0
  129. data/vendor/plugins/login_engine/README +258 -0
  130. data/vendor/plugins/login_engine/app/controllers/user_controller.rb +248 -0
  131. data/vendor/plugins/login_engine/app/helpers/user_helper.rb +88 -0
  132. data/vendor/plugins/login_engine/app/models/user.rb +7 -0
  133. data/vendor/plugins/login_engine/app/models/user_notify.rb +75 -0
  134. data/vendor/plugins/login_engine/app/views/user/_edit.rhtml +11 -0
  135. data/vendor/plugins/login_engine/app/views/user/_password.rhtml +9 -0
  136. data/vendor/plugins/login_engine/app/views/user/change_password.rhtml +17 -0
  137. data/vendor/plugins/login_engine/app/views/user/edit.rhtml +23 -0
  138. data/vendor/plugins/login_engine/app/views/user/forgot_password.rhtml +18 -0
  139. data/vendor/plugins/login_engine/app/views/user/home.rhtml +7 -0
  140. data/vendor/plugins/login_engine/app/views/user/login.rhtml +17 -0
  141. data/vendor/plugins/login_engine/app/views/user/logout.rhtml +8 -0
  142. data/vendor/plugins/login_engine/app/views/user/signup.rhtml +17 -0
  143. data/vendor/plugins/login_engine/app/views/user_notify/change_password.rhtml +10 -0
  144. data/vendor/plugins/login_engine/app/views/user_notify/delete.rhtml +5 -0
  145. data/vendor/plugins/login_engine/app/views/user_notify/forgot_password.rhtml +11 -0
  146. data/vendor/plugins/login_engine/app/views/user_notify/pending_delete.rhtml +9 -0
  147. data/vendor/plugins/login_engine/app/views/user_notify/signup.rhtml +12 -0
  148. data/vendor/plugins/login_engine/db/schema.rb +25 -0
  149. data/vendor/plugins/login_engine/init_engine.rb +10 -0
  150. data/vendor/plugins/login_engine/lib/login_engine/authenticated_system.rb +107 -0
  151. data/vendor/plugins/login_engine/lib/login_engine/authenticated_user.rb +149 -0
  152. data/vendor/plugins/login_engine/lib/login_engine.rb +58 -0
  153. data/vendor/plugins/login_engine/public/stylesheets/login_engine.css +81 -0
  154. data/vendor/plugins/login_engine/tasks/tasks.rake +4 -0
  155. data/vendor/plugins/login_engine/test/fixtures/templates/users.yml +41 -0
  156. data/vendor/plugins/login_engine/test/fixtures/users.yml +41 -0
  157. data/vendor/plugins/login_engine/test/functional/user_controller_test.rb +533 -0
  158. data/vendor/plugins/login_engine/test/mocks/mail.rb +14 -0
  159. data/vendor/plugins/login_engine/test/mocks/time.rb +19 -0
  160. data/vendor/plugins/login_engine/test/test_helper.rb +15 -0
  161. data/vendor/plugins/login_engine/test/unit/user_test.rb +94 -0
  162. 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
+ &lt;<%= mail_to elt.person.email, elt.person.name,
9
+ :subject => elt.subject %>&gt;
10
+ <% else %>
11
+ &lt;<%= elt.person.name %>&gt;
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
+ &nbsp;
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
+ &lt;<%= mail_to elt.person.email, elt.person.name %>&gt;
93
+ <% else %>
94
+ &lt;<%= elt.person.name %>&gt;
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 =&gt; </div>
56
+ <blockquote>blockquote</blockquote>
57
+ "Google":http://google.com =&gt; <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
+ &nbsp;
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,8 @@
1
+ <div class="data">
2
+ <%= live_tree(:family_tree, {
3
+ :initial_data_root => @root,
4
+ :preload_items => false,
5
+ :on_click_item => "alert('You clicked on ' + item.name)",
6
+ }) %>
7
+ </div>
8
+
@@ -0,0 +1,13 @@
1
+ <html>
2
+ <head>
3
+ <title>: <%= controller.action_name %></title>
4
+ <%= stylesheet_link_tag 'scaffold' %>
5
+ </head>
6
+ <body>
7
+
8
+ <p style="color: green"><%= flash[:notice] %></p>
9
+
10
+ <%= @content_for_layout %>
11
+
12
+ </body>
13
+ </html>
@@ -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
+
@@ -0,0 +1,10 @@
1
+ <%= @name %>
2
+
3
+ To verify your email, please reply to that email or click on that link:
4
+
5
+ <%= @link %>
6
+
7
+
8
+ You can change your password if you paste in your email field this check key:
9
+ <%= @check_key %>
10
+
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)
@@ -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