parlement 0.14 → 0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. data/CHANGES +41 -1
  2. data/MEMORY +66 -5
  3. data/README +10 -5
  4. data/Rakefile +15 -23
  5. data/app/controllers/account_controller.rb +48 -43
  6. data/app/controllers/{application.rb → application_controller.rb} +15 -12
  7. data/app/controllers/elt_controller.rb +77 -32
  8. data/app/controllers/subscriber_controller.rb +11 -10
  9. data/app/helpers/application_helper.rb +14 -1
  10. data/app/helpers/elt_helper.rb +9 -7
  11. data/app/models/elt.rb +25 -24
  12. data/app/models/mail.rb +44 -47
  13. data/app/models/person_notify.rb +2 -2
  14. data/app/models/user.rb +128 -2
  15. data/app/models/user_notify.rb +15 -15
  16. data/app/views/account/_login.rhtml +39 -39
  17. data/app/views/account/_show.rhtml +22 -30
  18. data/app/views/account/signup.rhtml +2 -2
  19. data/app/views/elt/_choice.rhtml +6 -6
  20. data/app/views/elt/_elt.rhtml +27 -32
  21. data/app/views/elt/choices.rhtml +16 -18
  22. data/app/views/elt/list/_byDate.rhtml +14 -14
  23. data/app/views/elt/list/_byVote.rhtml +15 -15
  24. data/app/views/elt/list/_children.rhtml +48 -40
  25. data/app/views/elt/list/_subscribers.rhtml +1 -1
  26. data/app/views/elt/new.rhtml +22 -21
  27. data/app/views/elt/rss.rxml +4 -11
  28. data/app/views/elt/show.rhtml +65 -61
  29. data/app/views/elt/vote_rss.rxml +4 -11
  30. data/app/views/layouts/top.rhtml +39 -50
  31. data/app/views/person/_listElts.rhtml +1 -1
  32. data/app/views/person/show.rhtml +1 -1
  33. data/{vendor/plugins/login_engine/app → app}/views/user_notify/change_password.rhtml +0 -0
  34. data/{vendor/plugins/login_engine/app → app}/views/user_notify/delete.rhtml +0 -0
  35. data/{vendor/plugins/login_engine/app → app}/views/user_notify/forgot_password.rhtml +0 -0
  36. data/{vendor/plugins/login_engine/app → app}/views/user_notify/pending_delete.rhtml +0 -0
  37. data/{vendor/plugins/login_engine/app → app}/views/user_notify/signup.rhtml +0 -0
  38. data/config/boot.rb +97 -32
  39. data/config/environment.rb +37 -35
  40. data/config/environments/development.rb +2 -3
  41. data/config/environments/production.rb +3 -0
  42. data/config/initializers/string_ruby_1.8.rb +10 -0
  43. data/config/routes.rb +17 -22
  44. data/db/schema.rb +102 -74
  45. data/lib/tasks/rspec.rake +167 -0
  46. data/public/404.html +25 -7
  47. data/public/500.html +26 -7
  48. data/public/dispatch.cgi +0 -0
  49. data/public/dispatch.fcgi +0 -0
  50. data/public/dispatch.rb +0 -0
  51. data/public/images/live_tree_branch_collapsed_icon.gif +0 -0
  52. data/public/images/live_tree_branch_expanded_icon.gif +0 -0
  53. data/public/images/live_tree_leaf_icon.gif +0 -0
  54. data/public/javascripts/application.js +258 -0
  55. data/public/javascripts/controls.js +544 -414
  56. data/public/javascripts/dragdrop.js +229 -198
  57. data/public/javascripts/effects.js +499 -459
  58. data/public/javascripts/prototype.js +2926 -1121
  59. data/public/javascripts/shadedborder.js +68 -50
  60. data/public/stylesheets/default.css +34 -34
  61. data/public/stylesheets/live_tree.css +0 -0
  62. data/public/stylesheets/scaffold.css +6 -6
  63. data/script/about +0 -0
  64. data/script/autospec +6 -0
  65. data/script/benchmarker +0 -0
  66. data/script/breakpointer +0 -0
  67. data/script/console +0 -0
  68. data/script/dbconsole +3 -0
  69. data/script/destroy +0 -0
  70. data/script/generate +0 -0
  71. data/script/plugin +0 -0
  72. data/script/profiler +0 -0
  73. data/script/runner +0 -0
  74. data/script/server +0 -0
  75. data/script/spec +10 -0
  76. data/script/spec_server +9 -0
  77. data/test/unit/attachment_test.rb +4 -4
  78. data/test/unit/choice_test.rb +1 -1
  79. data/test/unit/elt_test.rb +9 -9
  80. data/test/unit/mail_notify_test.rb +2 -2
  81. data/test/unit/mail_test.rb +18 -11
  82. data/test/unit/person_notify_test.rb +1 -1
  83. data/test/unit/person_test.rb +1 -1
  84. data/test/unit/subscriber_test.rb +1 -1
  85. data/test/unit/user_test.rb +81 -0
  86. data/test/unit/visit_test.rb +6 -6
  87. data/vendor/plugins/activerecord_foreign_key_extensions/init.rb +2 -0
  88. data/vendor/plugins/activerecord_foreign_key_extensions/lib/active_record_extensions.rb +182 -0
  89. data/vendor/plugins/activerecord_text_id_extensions/init.rb +2 -0
  90. data/vendor/plugins/activerecord_text_id_extensions/lib/active_record_extensions.rb +24 -0
  91. data/vendor/plugins/acts_as_nested_set/README +15 -0
  92. data/vendor/plugins/acts_as_nested_set/init.rb +1 -0
  93. data/vendor/plugins/acts_as_nested_set/lib/active_record/acts/nested_set.rb +210 -0
  94. data/vendor/plugins/acts_as_nested_set/test/nested_set_test.rb +269 -0
  95. data/vendor/plugins/acts_as_tree/README +26 -0
  96. data/vendor/plugins/acts_as_tree/Rakefile +22 -0
  97. data/vendor/plugins/acts_as_tree/init.rb +1 -0
  98. data/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb +96 -0
  99. data/vendor/plugins/{output_compression/CHANGELOG → acts_as_tree/test/abstract_unit.rb} +0 -0
  100. data/vendor/plugins/acts_as_tree/test/acts_as_tree_test.rb +219 -0
  101. data/vendor/plugins/acts_as_tree/test/database.yml +0 -0
  102. data/vendor/plugins/acts_as_tree/test/fixtures/mixin.rb +0 -0
  103. data/vendor/plugins/acts_as_tree/test/fixtures/mixins.yml +0 -0
  104. data/vendor/plugins/acts_as_tree/test/schema.rb +0 -0
  105. data/vendor/plugins/classic_pagination/CHANGELOG +152 -0
  106. data/vendor/plugins/classic_pagination/README +18 -0
  107. data/vendor/plugins/{output_compression/rakefile → classic_pagination/Rakefile} +22 -22
  108. data/vendor/plugins/classic_pagination/init.rb +33 -0
  109. data/vendor/plugins/classic_pagination/install.rb +1 -0
  110. data/vendor/plugins/classic_pagination/lib/pagination.rb +405 -0
  111. data/vendor/plugins/classic_pagination/lib/pagination_helper.rb +135 -0
  112. data/vendor/plugins/classic_pagination/test/fixtures/companies.yml +24 -0
  113. data/vendor/plugins/classic_pagination/test/fixtures/company.rb +9 -0
  114. data/vendor/plugins/classic_pagination/test/fixtures/developer.rb +7 -0
  115. data/vendor/plugins/classic_pagination/test/fixtures/developers.yml +21 -0
  116. data/vendor/plugins/classic_pagination/test/fixtures/developers_projects.yml +13 -0
  117. data/vendor/plugins/classic_pagination/test/fixtures/project.rb +3 -0
  118. data/vendor/plugins/classic_pagination/test/fixtures/projects.yml +7 -0
  119. data/vendor/plugins/classic_pagination/test/fixtures/replies.yml +13 -0
  120. data/vendor/plugins/classic_pagination/test/fixtures/reply.rb +5 -0
  121. data/vendor/plugins/classic_pagination/test/fixtures/schema.sql +42 -0
  122. data/vendor/plugins/classic_pagination/test/fixtures/topic.rb +3 -0
  123. data/vendor/plugins/classic_pagination/test/fixtures/topics.yml +22 -0
  124. data/vendor/plugins/classic_pagination/test/helper.rb +117 -0
  125. data/vendor/plugins/classic_pagination/test/pagination_helper_test.rb +38 -0
  126. data/vendor/plugins/classic_pagination/test/pagination_test.rb +177 -0
  127. data/vendor/plugins/file_column/lib/file_column.rb +1 -1
  128. data/vendor/plugins/file_column/test/file_column_test.rb +0 -0
  129. metadata +151 -197
  130. data/app/helpers/live_tree.rb +0 -238
  131. data/app/views/elt/_form.rhtml +0 -31
  132. data/app/views/elt/show_tree.rhtml +0 -8
  133. data/config/environments/user_environment.rb +0 -1
  134. data/db/ROOT/Titemagli.txt +0 -3
  135. data/db/ROOT/titemagli.txt +0 -9
  136. data/public/javascripts/behaviour.js +0 -254
  137. data/public/javascripts/ie7-load.htc +0 -1
  138. data/public/javascripts/ie7.js +0 -6
  139. data/public/javascripts/live_tree.js +0 -749
  140. data/public/javascripts/mybehaviour.js +0 -225
  141. data/public/javascripts/scriptaculous.js +0 -47
  142. data/public/javascripts/slider.js +0 -283
  143. data/public/stylesheets/blue.css +0 -471
  144. data/vendor/plugins/engines/CHANGELOG +0 -241
  145. data/vendor/plugins/engines/MIT-LICENSE +0 -21
  146. data/vendor/plugins/engines/README +0 -64
  147. data/vendor/plugins/engines/Rakefile +0 -32
  148. data/vendor/plugins/engines/UPGRADING +0 -93
  149. data/vendor/plugins/engines/about.yml +0 -7
  150. data/vendor/plugins/engines/generators/plugin_migration/USAGE +0 -45
  151. data/vendor/plugins/engines/generators/plugin_migration/plugin_migration_generator.rb +0 -79
  152. data/vendor/plugins/engines/generators/plugin_migration/templates/plugin_migration.erb +0 -13
  153. data/vendor/plugins/engines/init.rb +0 -40
  154. data/vendor/plugins/engines/install.rb +0 -32
  155. data/vendor/plugins/engines/lib/engines.rb +0 -323
  156. data/vendor/plugins/engines/lib/engines/deprecated_config_support.rb +0 -135
  157. data/vendor/plugins/engines/lib/engines/plugin.rb +0 -214
  158. data/vendor/plugins/engines/lib/engines/plugin_list.rb +0 -31
  159. data/vendor/plugins/engines/lib/engines/plugin_migrator.rb +0 -60
  160. data/vendor/plugins/engines/lib/engines/rails_extensions.rb +0 -6
  161. data/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb +0 -19
  162. data/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb +0 -143
  163. data/vendor/plugins/engines/lib/engines/rails_extensions/migrations.rb +0 -155
  164. data/vendor/plugins/engines/lib/engines/rails_extensions/public_asset_helpers.rb +0 -116
  165. data/vendor/plugins/engines/lib/engines/rails_extensions/rails.rb +0 -20
  166. data/vendor/plugins/engines/lib/engines/rails_extensions/rails_initializer.rb +0 -86
  167. data/vendor/plugins/engines/lib/engines/rails_extensions/routing.rb +0 -77
  168. data/vendor/plugins/engines/lib/engines/rails_extensions/templates.rb +0 -140
  169. data/vendor/plugins/engines/lib/engines/testing.rb +0 -87
  170. data/vendor/plugins/engines/tasks/engines.rake +0 -149
  171. data/vendor/plugins/login_engine/CHANGELOG +0 -22
  172. data/vendor/plugins/login_engine/README +0 -344
  173. data/vendor/plugins/login_engine/app/controllers/user_controller.rb +0 -262
  174. data/vendor/plugins/login_engine/app/helpers/user_helper.rb +0 -88
  175. data/vendor/plugins/login_engine/app/models/user.rb +0 -7
  176. data/vendor/plugins/login_engine/app/models/user_notify.rb +0 -75
  177. data/vendor/plugins/login_engine/app/views/user/_edit.rhtml +0 -11
  178. data/vendor/plugins/login_engine/app/views/user/_password.rhtml +0 -9
  179. data/vendor/plugins/login_engine/app/views/user/change_password.rhtml +0 -17
  180. data/vendor/plugins/login_engine/app/views/user/edit.rhtml +0 -23
  181. data/vendor/plugins/login_engine/app/views/user/forgot_password.rhtml +0 -18
  182. data/vendor/plugins/login_engine/app/views/user/home.rhtml +0 -7
  183. data/vendor/plugins/login_engine/app/views/user/login.rhtml +0 -17
  184. data/vendor/plugins/login_engine/app/views/user/logout.rhtml +0 -8
  185. data/vendor/plugins/login_engine/app/views/user/signup.rhtml +0 -17
  186. data/vendor/plugins/login_engine/db/migrate/001_initial_schema.rb +0 -25
  187. data/vendor/plugins/login_engine/init_engine.rb +0 -11
  188. data/vendor/plugins/login_engine/install.rb +0 -4
  189. data/vendor/plugins/login_engine/lib/login_engine.rb +0 -62
  190. data/vendor/plugins/login_engine/lib/login_engine/authenticated_system.rb +0 -113
  191. data/vendor/plugins/login_engine/lib/login_engine/authenticated_user.rb +0 -155
  192. data/vendor/plugins/login_engine/public/stylesheets/login_engine.css +0 -81
  193. data/vendor/plugins/login_engine/test/fixtures/users.yml +0 -41
  194. data/vendor/plugins/login_engine/test/functional/user_controller_test.rb +0 -536
  195. data/vendor/plugins/login_engine/test/mocks/mail.rb +0 -14
  196. data/vendor/plugins/login_engine/test/mocks/time.rb +0 -19
  197. data/vendor/plugins/login_engine/test/test_helper.rb +0 -11
  198. data/vendor/plugins/login_engine/test/unit/user_test.rb +0 -114
  199. data/vendor/plugins/output_compression/MIT-LICENSE +0 -20
  200. data/vendor/plugins/output_compression/README +0 -4
  201. data/vendor/plugins/output_compression/init.rb +0 -1
  202. data/vendor/plugins/output_compression/lib/output_compression.rb +0 -84
  203. data/vendor/plugins/output_compression/test/output_test.rb +0 -11
  204. data/vendor/plugins/output_compression/test/test_controller.rb +0 -3
  205. data/vendor/plugins/output_compression/test/test_helper.rb +0 -14
@@ -5,17 +5,15 @@
5
5
  <% end %>
6
6
 
7
7
  <% # That element is newly created, its creator is also new
8
- if created ||= false and !elt.new_record? and elt.person and not session[:person] %>
8
+ if created ||= false and !elt.new_record? and elt.person and not session[:person_id] %>
9
9
  <script type="text/javascript">
10
10
  <%= remote_function(
11
- :update => 'identity',
12
- :url => { :controller => 'account', :action => 'login',
13
- 'person[name]' => elt.person.name, 'user[password]' => '' },
14
- :method => :post,
15
- :before => visual_effect(:BlindUp, 'identity', { :queue => 'login' }) \
16
- +";resetChoices();",
17
- :loaded => visual_effect(:BlindDown, 'identity', { :queue => 'login' }) \
18
- +visual_effect(:BlindDown, 'subscriptionLink')) %>;
11
+ :update => 'identity',
12
+ :url => { :controller => 'account', :action => 'login',
13
+ 'person[name]' => elt.person.name, 'user[password]' => '' },
14
+ :method => :post,
15
+ :before => "resetChoices();",
16
+ :loaded => visual_effect(:BlindDown, 'subscriptionLink')) %>;
19
17
  </script>
20
18
  <% end %>
21
19
 
@@ -28,7 +26,7 @@
28
26
 
29
27
  <% if elt.person %>
30
28
  <span class="author">
31
- &lt;<%= link_to elt.person.name, :controller => 'person', :action => 'show', :id => elt.person %>&gt;
29
+ &lt;<%= link_to elt.person.name, :controller => 'person', :action => 'show', :id => elt.person %>&gt;
32
30
  </span>
33
31
  <% elsif not displayTitle? elt %>
34
32
  <span class="author">&lt;<%= ANONYMOUS_POSTER %>&gt;</span>
@@ -40,17 +38,16 @@
40
38
  <% if elt.new_record? %>
41
39
  <%= link_to(titleText, { }, :title => titleText) %>
42
40
  <% else %>
43
- <%= link_to(titleText, { :controller => 'elt', :action => 'show', :id => elt }, :title => titleText) %>
41
+ <%= link_to(titleText, { :action => 'index', :id => elt }, :title => titleText) %>
44
42
  <% end %>
45
43
  </h<%= eltTop ? 1:2 %>>
46
44
  <% end %>
47
45
 
48
- <%= image_tag (elt.person && elt.person.image ? elt.person.image : "/javascripts/blank.gif"),
46
+ <%= image_tag (elt.person && elt.person.image ? elt.person.image : "/javascripts/blank.gif"),
49
47
  :onload => "setSize(this)", :class => "avatar" \
50
- if elt.body =~ /\n/ %>
48
+ if elt.body =~ /\n/ %>
51
49
 
52
- <% @controller.expire_fragment( :action => 'show', :id => elt.id) if elt.new_record? %>
53
- <% cache :action => 'show', :id => elt.id do %>
50
+ <% cache :id => elt.id do %>
54
51
  <%= format elt.body %>
55
52
  <span class="attachments">
56
53
  <% for att in elt.attachments %>
@@ -59,37 +56,35 @@
59
56
  <% end %>
60
57
  </span>
61
58
  <% end %>
62
- <% @controller.expire_fragment( :action => 'show', :id => elt.id) if elt.new_record? %>
63
59
 
64
60
  <span class="choice" id="eltChoice_<%= elt.id %>">
65
61
  <%= render :partial => '/elt/choice', :locals => { :elt => elt } unless elt.new_record? %>
66
62
  </span>
67
63
 
68
- <div class="eltMore" id="eltMore_<%= elt.id %>"
69
- <%= 'style="display: none"' if (eltTop or elt.elts_count < SUB_THREAD_LENGTH) %>>
70
- <%= link_to_remote(n_('%s message...', '%s messages...', elt.elts_count) % elt.elts_count,
71
- { :update => 'eltSubs_'+elt.id.to_s,
72
- :url => { :controller => 'elt', :action => 'list', :id => elt },
73
- :before => visual_effect(:BlindUp, "eltMore_#{elt.id.to_s}")+
74
- visual_effect(:BlindDown, "eltSubsClose_#{elt.id.to_s}"),
75
- :loading => visual_effect(:BlindDown, "eltSubs_#{elt.id.to_s}") },
76
- { :href => url_for(:controller => 'elt', :action => 'show', :id => elt) }) %>
77
- </div>
64
+ <div class="eltMore" id="eltMore_<%= elt.id %>"
65
+ <%= 'style="display: none"' if (eltTop or elt.elts_count < SUB_THREAD_LENGTH) %>>
66
+ <%= link_to_remote(n_('%s message...', '%s messages...', elt.elts_count) % elt.elts_count,
67
+ { :update => 'eltSubs_'+elt.id.to_s,
68
+ :url => { :controller => 'elt', :action => 'list', :id => elt },
69
+ :before => visual_effect(:BlindUp, "eltMore_#{elt.id.to_s}")+
70
+ visual_effect(:BlindDown, "eltSubsClose_#{elt.id.to_s}"),
71
+ :loading => visual_effect(:BlindDown, "eltSubs_#{elt.id.to_s}") }) %>
72
+ </div>
78
73
 
79
- <ul class="eltNew" id="eltNew_<%= elt.id %>"><li style="display: none"/></ul>
74
+ <ul class="eltNew" id="eltNew_<%= elt.id %>"><li style="display: none"/></ul>
80
75
 
81
76
  <ul <%= 'style="display: none"' unless (eltTop or elt.elts_count < SUB_THREAD_LENGTH) %>
82
77
  id="eltSubs_<%= elt.id %>" class="eltSub">
83
- <%= render :partial => '/elt/list/children', :locals => { :elt => elt } \
84
- if (eltTop or elt.elts_count < SUB_THREAD_LENGTH) %>
85
- <%= "<li style=\"display: none\"></li>" \
86
- unless (eltTop or (elt.elts_count > 0 and elt.elts_count < SUB_THREAD_LENGTH)) %>
78
+ <%= render :partial => '/elt/list/children', :locals => { :elt => elt } \
79
+ if (eltTop or elt.elts_count < SUB_THREAD_LENGTH) %>
80
+ <%= "<li style=\"display: none\"></li>" \
81
+ unless (eltTop or (elt.elts_count > 0 and elt.elts_count < SUB_THREAD_LENGTH)) %>
87
82
  </ul>
88
83
 
89
84
  <span <%= 'style="display: none"' unless (elt.elts_count > 0 and (eltTop or elt.elts_count < SUB_THREAD_LENGTH)) %>
90
85
  id="eltSubsClose_<%= elt.id %>" title="<%= elt.created_on %>"
91
86
  class="eltSubsClose">
92
- <%= link_to_function('<span class="icon">&lt;&lt;</span> '+_('Close'),
87
+ <%= link_to_function('<span class="icon">&lt;&lt;</span> '+_('Close'),
93
88
  visual_effect(:BlindUp, "eltNew_#{elt.id}")+
94
89
  visual_effect(:BlindUp, "eltSubsClose_#{elt.id}")+
95
90
  visual_effect(:BlindUp, "eltSubs_#{elt.id}")+
@@ -1,33 +1,31 @@
1
- <% @elt = Elt.find params[:id] %>
2
-
3
1
  <table border="1" id="choices_<%= @elt.id %>" class="choices">
4
2
  <tr>
5
- <th><%= image_tag('vote_minus.png', :class => "con") %></th>
3
+ <th><%= image_tag('vote_minus.png', :class => "con") %></th>
6
4
  <th>0</th>
7
- <th><%= image_tag('vote_plus.png', :class => "pro") %></th>
5
+ <th><%= image_tag('vote_plus.png', :class => "pro") %></th>
8
6
  </tr>
9
7
  <tr>
10
8
  <% (-1..1).each { |n| %>
11
9
  <td>
12
10
  <% @elt.choices.select{ |c| c.value == n }.reverse.each { |c| %>
13
- <% if c.person %>
14
- <span class="author" title="<%= c.created_on.strftime('%d/%m %H:%M') %>">
15
- &lt;<%= link_to c.person.name, :controller => 'person',
16
- :action => 'show', :id => c.person %>&gt;
17
- </span>
18
- <% else %>
19
- <span class="author" title="<%= c.created_on.strftime('%d/%m %H:%M') %>">
20
- &lt;<%= ANONYMOUS_POSTER %>&gt;
21
- </span>
22
- <% end %>
11
+ <% if c.person %>
12
+ <span class="author" title="<%= c.created_on.strftime('%d/%m %H:%M') %>">
13
+ &lt;<%= link_to c.person.name, :controller => 'person', :action => 'show', :id => c.person %>&gt;
14
+ </span>
15
+ <% else %>
16
+ <span class="author" title="<%= c.created_on.strftime('%d/%m %H:%M') %>">
17
+ &lt;<%= ANONYMOUS_POSTER %>&gt;
18
+ </span>
19
+ <% end %>
23
20
  <% } %>
24
21
  </td>
25
22
  <% } %>
26
23
  </tr>
27
24
  </table>
28
25
  <script type="text/javascript">
29
- document.onclick = function() {
30
- Element.remove($('choices_<%= @elt.id %>'));
31
- document.onclick = null;
32
- }
26
+ document.onclick = function() {
27
+ Element.remove($('choices_<%= @elt.id %>'));
28
+ document.onclick = null;
29
+ }
33
30
  </script>
31
+
@@ -4,15 +4,15 @@
4
4
  <h3 class="boxTitle"><%= _('Latest posts') %></h3>
5
5
 
6
6
  <%e_pages = ActionController::Pagination::Paginator.new(
7
- self, countEltsAboveFilter, LIST_LENGTH, params['page'])
8
- elts = Elt.find_by_sql " \
9
- SELECT COALESCE(SUM(value), 0) AS resultLocal, elts.id, elts.created_on, subject \
7
+ self, countEltsAboveFilter, LIST_LENGTH, params['page'])
8
+ elts = Elt.find_by_sql " \
9
+ SELECT COALESCE(SUM(value), 0) AS resultLocal, elts.id, elts.created_on, subject, elts.person_id \
10
10
  FROM elts \
11
11
  LEFT JOIN choices ON choices.elt_id = elts.id \
12
12
  WHERE lft > #{@elt.lft} AND rgt < #{@elt.rgt} \
13
- GROUP BY elts.id, elts.created_on, subject \
13
+ GROUP BY elts.id, elts.created_on, subject, elts.person_id \
14
14
  HAVING COALESCE(SUM(value), 0) >= #{filter||-10**10} \
15
- ORDER BY created_on DESC \
15
+ ORDER BY created_on DESC \
16
16
  LIMIT #{e_pages.items_per_page} \
17
17
  OFFSET #{e_pages.current.offset}" %>
18
18
 
@@ -22,14 +22,14 @@
22
22
  <%= link_to_remote('|&lt;',
23
23
  { :update => 'listByDate',
24
24
  :url => { :action => 'listByDate', :id => @elt, :page => e_pages.last },
25
- :before => visual_effect(:BlindUp, 'listByDate', { :queue => 'end' }),
26
- :loaded => visual_effect(:BlindDown, 'listByDate', { :queue => 'end' }) }) \
25
+ :before => visual_effect(:DropOut, 'listByDate', { :queue => 'end' }),
26
+ :loading => visual_effect(:BlindDown, 'listByDate', { :queue => 'end' }) }) \
27
27
  if e_pages.last != e_pages.current %>
28
28
  <%= link_to_remote('&lt;',
29
29
  { :update => 'listByDate',
30
30
  :url => { :action => 'listByDate', :id => @elt, :page => e_pages.current.next },
31
- :before => visual_effect(:BlindUp, 'listByDate', { :queue => 'end' }),
32
- :loaded => visual_effect(:BlindDown, 'listByDate', { :queue => 'end' }) }) \
31
+ :before => visual_effect(:DropOut, 'listByDate', { :queue => 'end' }),
32
+ :loading => visual_effect(:BlindDown, 'listByDate', { :queue => 'end' }) }) \
33
33
  if e_pages.current.next and e_pages.current.next != e_pages.last %>
34
34
 
35
35
  <span class="pageCount"><%= e_pages.length-e_pages.current.to_i+1 %></span>
@@ -37,14 +37,14 @@
37
37
  <%= link_to_remote('&gt;',
38
38
  { :update => 'listByDate',
39
39
  :url => { :action => 'listByDate', :id => @elt, :page => e_pages.current.previous },
40
- :before => visual_effect(:BlindUp, 'listByDate', { :queue => 'end' }),
41
- :loaded => visual_effect(:BlindDown, 'listByDate', { :queue => 'end' }) }) \
40
+ :before => visual_effect(:DropOut, 'listByDate', { :queue => 'end' }),
41
+ :loading => visual_effect(:BlindDown, 'listByDate', { :queue => 'end' }) }) \
42
42
  if e_pages.current.previous and e_pages.current.previous != e_pages.first %>
43
43
  <%= link_to_remote('&gt;|',
44
44
  { :update => 'listByDate',
45
45
  :url => { :action => 'listByDate', :id => @elt, :page => e_pages.first },
46
- :before => visual_effect(:BlindUp, 'listByDate', { :queue => 'end' }),
47
- :loaded => visual_effect(:BlindDown, 'listByDate', { :queue => 'end' }) }) \
46
+ :before => visual_effect(:DropOut, 'listByDate', { :queue => 'end' }),
47
+ :loading => visual_effect(:BlindDown, 'listByDate', { :queue => 'end' }) }) \
48
48
  if e_pages.first != e_pages.current %>
49
49
  </li>
50
50
  <% end %>
@@ -64,7 +64,7 @@
64
64
  <span class="author">&lt;<%= ANONYMOUS_POSTER %>&gt;</span>
65
65
  <% end %>
66
66
 
67
- <%= link_to elt.subject.gsub(/\[.*\]/, ''), :action => 'show', :id => elt %>
67
+ <%= link_to elt.subject.gsub(/\[.*\]/, ''), :controller => 'elt', :action => 'show', :id => elt %>
68
68
  </li>
69
69
  <% end %>
70
70
  </ul>
@@ -4,15 +4,15 @@
4
4
  <h3 class="boxTitle"><%= _('Highest posts') %></h3>
5
5
 
6
6
  <%e_pages = ActionController::Pagination::Paginator.new(
7
- self, countEltsAboveFilter, LIST_LENGTH, params['page'])
8
- elts = Elt.find_by_sql " \
9
- SELECT COALESCE(SUM(value), 0) AS resultLocal, elts.id, elts.created_on, subject \
7
+ self, countEltsAboveFilter, LIST_LENGTH, params['page'])
8
+ elts = Elt.find_by_sql " \
9
+ SELECT COALESCE(SUM(value), 0) AS resultLocal, elts.id, elts.created_on, subject, elts.person_id \
10
10
  FROM elts \
11
11
  LEFT JOIN choices ON choices.elt_id = elts.id \
12
12
  WHERE lft > #{@elt.lft} AND rgt < #{@elt.rgt} \
13
- GROUP BY elts.id, elts.created_on, subject \
14
- HAVING COALESCE(SUM(value), 0) >= #{filter||-10**10} \
15
- ORDER BY COALESCE(SUM(value), 0) DESC, created_on DESC \
13
+ GROUP BY elts.id, elts.created_on, subject, elts.person_id \
14
+ HAVING COALESCE(SUM(value), 0) >= #{filter||1} \
15
+ ORDER BY COALESCE(SUM(value), 0) DESC, created_on DESC \
16
16
  LIMIT #{e_pages.items_per_page} \
17
17
  OFFSET #{e_pages.current.offset}" %>
18
18
 
@@ -22,14 +22,14 @@
22
22
  <%= link_to_remote('|&lt;',
23
23
  { :update => 'listByVote',
24
24
  :url => { :action => 'listByVote', :id => @elt, :page => e_pages.last },
25
- :before => visual_effect(:BlindUp, 'listByVote', { :queue => 'end' }),
26
- :loaded => visual_effect(:BlindDown, 'listByVote', { :queue => 'end' }) }) \
25
+ :before => visual_effect(:DropOut, 'listByVote', { :queue => 'end' }),
26
+ :loading => visual_effect(:BlindDown, 'listByVote', { :queue => 'end' }) }) \
27
27
  if e_pages.last != e_pages.current %>
28
28
  <%= link_to_remote('&lt;',
29
29
  { :update => 'listByVote',
30
30
  :url => { :action => 'listByVote', :id => @elt, :page => e_pages.current.next },
31
- :before => visual_effect(:BlindUp, 'listByVote', { :queue => 'end' }),
32
- :loaded => visual_effect(:BlindDown, 'listByVote', { :queue => 'end' }) }) \
31
+ :before => visual_effect(:DropOut, 'listByVote', { :queue => 'end' }),
32
+ :loading => visual_effect(:BlindDown, 'listByVote', { :queue => 'end' }) }) \
33
33
  if e_pages.current.next and e_pages.current.next != e_pages.last %>
34
34
 
35
35
  <span class="pageCount"><%= e_pages.length-e_pages.current.to_i+1 %></span>
@@ -37,14 +37,14 @@
37
37
  <%= link_to_remote('&gt;',
38
38
  { :update => 'listByVote',
39
39
  :url => { :action => 'listByVote', :id => @elt, :page => e_pages.current.previous },
40
- :before => visual_effect(:BlindUp, 'listByVote', { :queue => 'end' }),
41
- :loaded => visual_effect(:BlindDown, 'listByVote', { :queue => 'end' }) }) \
40
+ :before => visual_effect(:DropOut, 'listByVote', { :queue => 'end' }),
41
+ :loading => visual_effect(:BlindDown, 'listByVote', { :queue => 'end' }) }) \
42
42
  if e_pages.current.previous and e_pages.current.previous != e_pages.first %>
43
43
  <%= link_to_remote('&gt;|',
44
44
  { :update => 'listByVote',
45
45
  :url => { :action => 'listByVote', :id => @elt, :page => e_pages.first },
46
- :before => visual_effect(:BlindUp, 'listByVote', { :queue => 'end' }),
47
- :loaded => visual_effect(:BlindDown, 'listByVote', { :queue => 'end' }) }) \
46
+ :before => visual_effect(:DropOut, 'listByVote', { :queue => 'end' }),
47
+ :loading => visual_effect(:BlindDown, 'listByVote', { :queue => 'end' }) }) \
48
48
  if e_pages.first != e_pages.current %>
49
49
  </li>
50
50
  <% end %>
@@ -64,7 +64,7 @@
64
64
  <span class="author">&lt;<%= ANONYMOUS_POSTER %>&gt;</span>
65
65
  <% end %>
66
66
 
67
- <%= link_to elt.subject.gsub(/\[.*\]/, ''), :action => 'show', :id => elt %>
67
+ <%= link_to elt.subject.gsub(/\[.*\]/, ''), :controller => 'elt', :action => 'show', :id => elt %>
68
68
  </li>
69
69
  <% end %>
70
70
  </ul>
@@ -10,40 +10,44 @@
10
10
  <% if e_pages.length > 1 && e_pages.current.to_i != 1 %>
11
11
  <li class="nav">
12
12
  <%= link_to_remote('|&lt;',
13
- { :update => 'eltSubs_'+elt.id.to_s,
13
+ { :update => 'eltSubs_'+elt.id,
14
14
  :url => { :action => 'list', :id => elt, :page => e_pages.first },
15
- :before => visual_effect(:BlindUp, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }),
16
- :loaded => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }) },
17
- { :href => url_for(:controller => 'elt', :action => 'show', :id => @elt,
18
- :page => e_pages.first)}) if e_pages.first != e_pages.current %>
15
+ :before => visual_effect(:DropOut, 'eltSubs_'+elt.id, { :queue => 'end' }),
16
+ :loading => visual_effect(:ScrollTo, 'eltSubs_'+elt.id),
17
+ :success => visual_effect(:BlindDown, 'eltSubs_'+elt.id, { :queue => 'end' }) },
18
+ { :href => url_for(:id => @elt, :page => e_pages.first) }
19
+ ) if e_pages.first != e_pages.current %>
19
20
 
20
21
  <%= link_to_remote('&lt;',
21
- { :update => 'eltSubs_'+elt.id.to_s,
22
+ { :update => 'eltSubs_'+elt.id,
22
23
  :url => { :action => 'list', :id => elt, :page => e_pages.current.previous },
23
- :before => visual_effect(:BlindUp, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }),
24
- :loaded => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }) },
25
- { :href => url_for(:controller => 'elt', :action => 'show', :id => @elt,
26
- :page => e_pages.current.previous )}) if e_pages.current.previous and e_pages.current.previous != e_pages.first %>
24
+ :before => visual_effect(:DropOut, 'eltSubs_'+elt.id, { :queue => 'end' }),
25
+ :loading => visual_effect(:ScrollTo, 'eltSubs_'+elt.id),
26
+ :success => visual_effect(:BlindDown, 'eltSubs_'+elt.id, { :queue => 'end' }) },
27
+ { :href => url_for(:id => @elt, :page => e_pages.current.previous) }
28
+ ) if e_pages.current.previous and e_pages.current.previous != e_pages.first %>
27
29
 
28
30
  <span class="pageCount">
29
31
  <%= e_pages.current.to_i %> / <%= e_pages.length %>
30
32
  </span>
31
33
 
32
34
  <%= link_to_remote('&gt;',
33
- { :update => 'eltSubs_'+elt.id.to_s,
35
+ { :update => 'eltSubs_'+elt.id,
34
36
  :url => { :action => 'list', :id => elt, :page => e_pages.current.next },
35
- :before => visual_effect(:BlindUp, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }),
36
- :loaded => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }) },
37
- { :href => url_for(:controller => 'elt', :action => 'show', :id => @elt,
38
- :page => e_pages.current.next )}) if e_pages.current.next and e_pages.current.next != e_pages.last %>
37
+ :before => visual_effect(:DropOut, 'eltSubs_'+elt.id, { :queue => 'end' }),
38
+ :loading => visual_effect(:ScrollTo, 'eltSubs_'+elt.id),
39
+ :success => visual_effect(:BlindDown, 'eltSubs_'+elt.id, { :queue => 'end' }) },
40
+ { :href => url_for(:id => @elt, :page => e_pages.current.next) }
41
+ ) if e_pages.current.next and e_pages.current.next != e_pages.last %>
39
42
 
40
43
  <%= link_to_remote('&gt;|',
41
- { :update => 'eltSubs_'+elt.id.to_s,
44
+ { :update => 'eltSubs_'+elt.id,
42
45
  :url => { :action => 'list', :id => elt, :page => e_pages.last },
43
- :before => visual_effect(:BlindUp, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }),
44
- :loaded => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }) },
45
- { :href => url_for(:controller => 'elt', :action => 'show', :id => @elt,
46
- :page => e_pages.last)}) if e_pages.last != e_pages.current %>
46
+ :before => visual_effect(:DropOut, 'eltSubs_'+elt.id, { :queue => 'end' }),
47
+ :loading => visual_effect(:ScrollTo, 'eltSubs_'+elt.id),
48
+ :success => visual_effect(:BlindDown, 'eltSubs_'+elt.id, { :queue => 'end' }) },
49
+ { :href => url_for(:id => @elt, :page => e_pages.last) }
50
+ ) if e_pages.last != e_pages.current %>
47
51
  </li>
48
52
  <% end %>
49
53
 
@@ -52,40 +56,44 @@
52
56
  <% if e_pages.length > 1 %>
53
57
  <li class="nav">
54
58
  <%= link_to_remote('|&lt;',
55
- { :update => 'eltSubs_'+elt.id.to_s,
59
+ { :update => 'eltSubs_'+elt.id,
56
60
  :url => { :action => 'list', :id => elt, :page => e_pages.first },
57
- :before => visual_effect(:BlindUp, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }),
58
- :loaded => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }) },
59
- { :href => url_for(:controller => 'elt', :action => 'show', :id => @elt,
60
- :page => e_pages.first)}) if e_pages.first != e_pages.current %>
61
+ :before => visual_effect(:DropOut, 'eltSubs_'+elt.id, { :queue => 'end' }),
62
+ :loading => visual_effect(:ScrollTo, 'eltSubs_'+elt.id),
63
+ :success => visual_effect(:BlindDown, 'eltSubs_'+elt.id, { :queue => 'end' }) },
64
+ { :href => url_for(:id => @elt, :page => e_pages.first) }
65
+ ) if e_pages.first != e_pages.current %>
61
66
 
62
67
  <%= link_to_remote('&lt;',
63
- { :update => 'eltSubs_'+elt.id.to_s,
68
+ { :update => 'eltSubs_'+elt.id,
64
69
  :url => { :action => 'list', :id => elt, :page => e_pages.current.previous },
65
- :before => visual_effect(:BlindUp, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }),
66
- :loaded => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }) },
67
- { :href => url_for(:controller => 'elt', :action => 'show', :id => @elt,
68
- :page => e_pages.current.previous )}) if e_pages.current.previous and e_pages.current.previous != e_pages.first %>
70
+ :before => visual_effect(:DropOut, 'eltSubs_'+elt.id, { :queue => 'end' }),
71
+ :loading => visual_effect(:ScrollTo, 'eltSubs_'+elt.id),
72
+ :success => visual_effect(:BlindDown, 'eltSubs_'+elt.id, { :queue => 'end' }) },
73
+ { :href => url_for(:id => @elt, :page => e_pages.current.previous) }
74
+ ) if e_pages.current.previous and e_pages.current.previous != e_pages.first %>
69
75
 
70
76
  <span class="pageCount">
71
77
  <%= e_pages.current.to_i %> / <%= e_pages.length %>
72
78
  </span>
73
79
 
74
80
  <%= link_to_remote('&gt;',
75
- { :update => 'eltSubs_'+elt.id.to_s,
81
+ { :update => 'eltSubs_'+elt.id,
76
82
  :url => { :action => 'list', :id => elt, :page => e_pages.current.next },
77
- :before => visual_effect(:BlindUp, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }),
78
- :loaded => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }) },
79
- { :href => url_for(:controller => 'elt', :action => 'show', :id => @elt,
80
- :page => e_pages.current.next )}) if e_pages.current.next and e_pages.current.next != e_pages.last %>
83
+ :before => visual_effect(:DropOut, 'eltSubs_'+elt.id, { :queue => 'end' }),
84
+ :loading => visual_effect(:ScrollTo, 'eltSubs_'+elt.id),
85
+ :success => visual_effect(:BlindDown, 'eltSubs_'+elt.id, { :queue => 'end' }) },
86
+ { :href => url_for(:id => @elt, :page => e_pages.current.next) }
87
+ ) if e_pages.current.next and e_pages.current.next != e_pages.last %>
81
88
 
82
89
  <%= link_to_remote('&gt;|',
83
- { :update => 'eltSubs_'+elt.id.to_s,
90
+ { :update => 'eltSubs_'+elt.id,
84
91
  :url => { :action => 'list', :id => elt, :page => e_pages.last },
85
- :before => visual_effect(:BlindUp, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }),
86
- :loaded => visual_effect(:BlindDown, 'eltSubs_'+elt.id.to_s, { :queue => 'end' }) },
87
- { :href => url_for(:controller => 'elt', :action => 'show', :id => @elt,
88
- :page => e_pages.last)}) if e_pages.last != e_pages.current %>
92
+ :before => visual_effect(:DropOut, 'eltSubs_'+elt.id, { :queue => 'end' }),
93
+ :loading => visual_effect(:ScrollTo, 'eltSubs_'+elt.id),
94
+ :success => visual_effect(:BlindDown, 'eltSubs_'+elt.id, { :queue => 'end' }) },
95
+ { :href => url_for(:id => @elt, :page => e_pages.last) }
96
+ ) if e_pages.last != e_pages.current %>
89
97
  </li>
90
98
  <% end %>
91
99
 
@@ -17,7 +17,7 @@
17
17
  <% end %>
18
18
 
19
19
  <div id="subscriptionLink" class="boxLineR"
20
- <%= "style='display: none'" unless session[:person] %> >
20
+ <%= "style='display: none'" unless session[:person_id] %> >
21
21
  <%= link_to_remote _('Add/remove me!'),
22
22
  :update => 'listSubscribers',
23
23
  :url => { :controller => 'subscriber', :action => 'subscribe', :id => @elt },
@@ -8,7 +8,7 @@
8
8
  :update => 'eltSubs_'+@elt.parent_id,
9
9
  :url => { :action => 'create', :id => @elt.parent },
10
10
  :position => 'top',
11
- :before => visual_effect(:BlindUp, "eltNew_#{@elt.parent_id}"),
11
+ :before => visual_effect(:BlindUp, "eltNew_#{@elt.parent_id}"),
12
12
  :loading => "Element.show('eltSubs_#{@elt.parent_id}');
13
13
  Element.show('eltSubsClose_#{@elt.parent_id}')") do %>
14
14
 
@@ -37,32 +37,33 @@
37
37
 
38
38
  <div>
39
39
  <label for="elt_body"><%= _('Content') %>:</label>
40
- <%= text_area 'elt', 'body' %>
40
+ <br/>
41
+ <%= text_area 'elt', 'body', { :onkeyup => "resize(this)", :onfocus => "resize(this)" } %>
41
42
  </div>
42
43
 
43
44
  <div class="eltNewButtons">
44
- <%= submit_to_remote(_('Preview'), _('Preview'),
45
- :update => "eltNewPreview_"+@elt.parent_id,
46
- :url => { :action => "create", :id => @elt.parent, :submit => "preview" },
47
- :before => visual_effect(:BlindUp, 'eltNewWrite_'+@elt.parent_id),
48
- :loading => visual_effect(:BlindDown, 'eltNewPropose_'+@elt.parent_id)) %>
45
+ <%= submit_to_remote(_('Preview'), _('Preview'),
46
+ :update => "eltNewPreview_"+@elt.parent_id,
47
+ :url => { :action => "create", :id => @elt.parent, :submit => "preview" },
48
+ :before => visual_effect(:BlindUp, 'eltNewWrite_'+@elt.parent_id),
49
+ :loading => visual_effect(:BlindDown, 'eltNewPropose_'+@elt.parent_id)) %>
49
50
 
50
- <%= render :partial => '/help',
51
- :locals => { :divId => 'body'+@elt.parent_id,
52
- :content => _('_<em>emphasis</em>_ *<strong>strong</strong>* -<span style="text-decoration: line-through;">strike-through</span>- +added+^<sup>sup</sup>^ ~<sub>sub</sub>~<div>bg. blockquote =&gt; </div><blockquote>blockquote</blockquote> "Google":http://google.com =&gt; <a href="http://google.com">Google</a><br/><pre>@code@</pre><div style="float:left">ordered list<br/># first item<br/># second item<br/># third item</div><div style="margin-left:10em"><ol>ordered list<li>first item</li><li>second item</li><li>third item</li></ol></div><div style="float:left">unordered list<br/>* item<br/>* item<br/>* item</div><div style="margin-left:10em"><ul>unordered list<li>item</li><li>item</li><li>item</li></ul></div><a href="http://hobix.com/textile/quick.html">Textile Reference</a>') } %>
53
- </div>
54
- </span>
51
+ <%= render :partial => '/help',
52
+ :locals => { :divId => 'body'+@elt.parent_id,
53
+ :content => _('_<em>emphasis</em>_ *<strong>strong</strong>* -<span style="text-decoration: line-through;">strike-through</span>- +added+^<sup>sup</sup>^ ~<sub>sub</sub>~<div>bg. blockquote =&gt; </div><blockquote>blockquote</blockquote> "Google":http://google.com =&gt; <a href="http://google.com">Google</a><br/><pre>@code@</pre><div style="float:left">ordered list<br/># first item<br/># second item<br/># third item</div><div style="margin-left:10em"><ol>ordered list<li>first item</li><li>second item</li><li>third item</li></ol></div><div style="float:left">unordered list<br/>* item<br/>* item<br/>* item</div><div style="margin-left:10em"><ul>unordered list<li>item</li><li>item</li><li>item</li></ul></div><a href="http://hobix.com/textile/quick.html">Textile Reference</a>') } %>
54
+ </div>
55
+ </span>
55
56
 
56
- <span id="eltNewPropose_<%= @elt.parent_id %>" style="display: none">
57
- <span class="elt" id="eltNewPreview_<%= @elt.parent_id %>"></span>
57
+ <span id="eltNewPropose_<%= @elt.parent_id %>" style="display: none">
58
+ <span class="elt" id="eltNewPreview_<%= @elt.parent_id %>"></span>
58
59
 
59
- <div class="eltNewButtons">
60
- <%= link_to_function('<span class="icon">&lt;&lt;</span> '+_('Modify'),
61
- visual_effect(:BlindUp, 'eltNewPropose_'+@elt.parent_id) \
62
- +visual_effect(:BlindDown, 'eltNewWrite_'+@elt.parent_id)) %>
60
+ <div class="eltNewButtons">
61
+ <%= link_to_function('<span class="icon">&lt;&lt;</span> '+_('Modify'),
62
+ visual_effect(:BlindUp, 'eltNewPropose_'+@elt.parent_id) \
63
+ +visual_effect(:BlindDown, 'eltNewWrite_'+@elt.parent_id)) %>
63
64
 
64
- <%= submit_tag _('Propose!') %>
65
- </div>
66
- </span>
65
+ <%= submit_tag _('Propose!') %>
66
+ </div>
67
+ </span>
67
68
  <% end %>
68
69