parlement 0.14 → 0.17
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +41 -1
- data/MEMORY +66 -5
- data/README +10 -5
- data/Rakefile +15 -23
- data/app/controllers/account_controller.rb +48 -43
- data/app/controllers/{application.rb → application_controller.rb} +15 -12
- data/app/controllers/elt_controller.rb +77 -32
- data/app/controllers/subscriber_controller.rb +11 -10
- data/app/helpers/application_helper.rb +14 -1
- data/app/helpers/elt_helper.rb +9 -7
- data/app/models/elt.rb +25 -24
- data/app/models/mail.rb +44 -47
- data/app/models/person_notify.rb +2 -2
- data/app/models/user.rb +128 -2
- data/app/models/user_notify.rb +15 -15
- data/app/views/account/_login.rhtml +39 -39
- data/app/views/account/_show.rhtml +22 -30
- data/app/views/account/signup.rhtml +2 -2
- data/app/views/elt/_choice.rhtml +6 -6
- data/app/views/elt/_elt.rhtml +27 -32
- data/app/views/elt/choices.rhtml +16 -18
- data/app/views/elt/list/_byDate.rhtml +14 -14
- data/app/views/elt/list/_byVote.rhtml +15 -15
- data/app/views/elt/list/_children.rhtml +48 -40
- data/app/views/elt/list/_subscribers.rhtml +1 -1
- data/app/views/elt/new.rhtml +22 -21
- data/app/views/elt/rss.rxml +4 -11
- data/app/views/elt/show.rhtml +65 -61
- data/app/views/elt/vote_rss.rxml +4 -11
- data/app/views/layouts/top.rhtml +39 -50
- data/app/views/person/_listElts.rhtml +1 -1
- data/app/views/person/show.rhtml +1 -1
- data/{vendor/plugins/login_engine/app → app}/views/user_notify/change_password.rhtml +0 -0
- data/{vendor/plugins/login_engine/app → app}/views/user_notify/delete.rhtml +0 -0
- data/{vendor/plugins/login_engine/app → app}/views/user_notify/forgot_password.rhtml +0 -0
- data/{vendor/plugins/login_engine/app → app}/views/user_notify/pending_delete.rhtml +0 -0
- data/{vendor/plugins/login_engine/app → app}/views/user_notify/signup.rhtml +0 -0
- data/config/boot.rb +97 -32
- data/config/environment.rb +37 -35
- data/config/environments/development.rb +2 -3
- data/config/environments/production.rb +3 -0
- data/config/initializers/string_ruby_1.8.rb +10 -0
- data/config/routes.rb +17 -22
- data/db/schema.rb +102 -74
- data/lib/tasks/rspec.rake +167 -0
- data/public/404.html +25 -7
- data/public/500.html +26 -7
- data/public/dispatch.cgi +0 -0
- data/public/dispatch.fcgi +0 -0
- data/public/dispatch.rb +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/javascripts/application.js +258 -0
- data/public/javascripts/controls.js +544 -414
- data/public/javascripts/dragdrop.js +229 -198
- data/public/javascripts/effects.js +499 -459
- data/public/javascripts/prototype.js +2926 -1121
- data/public/javascripts/shadedborder.js +68 -50
- data/public/stylesheets/default.css +34 -34
- data/public/stylesheets/live_tree.css +0 -0
- data/public/stylesheets/scaffold.css +6 -6
- data/script/about +0 -0
- data/script/autospec +6 -0
- data/script/benchmarker +0 -0
- data/script/breakpointer +0 -0
- data/script/console +0 -0
- data/script/dbconsole +3 -0
- data/script/destroy +0 -0
- data/script/generate +0 -0
- data/script/plugin +0 -0
- data/script/profiler +0 -0
- data/script/runner +0 -0
- data/script/server +0 -0
- data/script/spec +10 -0
- data/script/spec_server +9 -0
- data/test/unit/attachment_test.rb +4 -4
- data/test/unit/choice_test.rb +1 -1
- data/test/unit/elt_test.rb +9 -9
- data/test/unit/mail_notify_test.rb +2 -2
- data/test/unit/mail_test.rb +18 -11
- data/test/unit/person_notify_test.rb +1 -1
- data/test/unit/person_test.rb +1 -1
- data/test/unit/subscriber_test.rb +1 -1
- data/test/unit/user_test.rb +81 -0
- data/test/unit/visit_test.rb +6 -6
- data/vendor/plugins/activerecord_foreign_key_extensions/init.rb +2 -0
- data/vendor/plugins/activerecord_foreign_key_extensions/lib/active_record_extensions.rb +182 -0
- data/vendor/plugins/activerecord_text_id_extensions/init.rb +2 -0
- data/vendor/plugins/activerecord_text_id_extensions/lib/active_record_extensions.rb +24 -0
- data/vendor/plugins/acts_as_nested_set/README +15 -0
- data/vendor/plugins/acts_as_nested_set/init.rb +1 -0
- data/vendor/plugins/acts_as_nested_set/lib/active_record/acts/nested_set.rb +210 -0
- data/vendor/plugins/acts_as_nested_set/test/nested_set_test.rb +269 -0
- data/vendor/plugins/acts_as_tree/README +26 -0
- data/vendor/plugins/acts_as_tree/Rakefile +22 -0
- data/vendor/plugins/acts_as_tree/init.rb +1 -0
- data/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb +96 -0
- data/vendor/plugins/{output_compression/CHANGELOG → acts_as_tree/test/abstract_unit.rb} +0 -0
- data/vendor/plugins/acts_as_tree/test/acts_as_tree_test.rb +219 -0
- data/vendor/plugins/acts_as_tree/test/database.yml +0 -0
- data/vendor/plugins/acts_as_tree/test/fixtures/mixin.rb +0 -0
- data/vendor/plugins/acts_as_tree/test/fixtures/mixins.yml +0 -0
- data/vendor/plugins/acts_as_tree/test/schema.rb +0 -0
- data/vendor/plugins/classic_pagination/CHANGELOG +152 -0
- data/vendor/plugins/classic_pagination/README +18 -0
- data/vendor/plugins/{output_compression/rakefile → classic_pagination/Rakefile} +22 -22
- data/vendor/plugins/classic_pagination/init.rb +33 -0
- data/vendor/plugins/classic_pagination/install.rb +1 -0
- data/vendor/plugins/classic_pagination/lib/pagination.rb +405 -0
- data/vendor/plugins/classic_pagination/lib/pagination_helper.rb +135 -0
- data/vendor/plugins/classic_pagination/test/fixtures/companies.yml +24 -0
- data/vendor/plugins/classic_pagination/test/fixtures/company.rb +9 -0
- data/vendor/plugins/classic_pagination/test/fixtures/developer.rb +7 -0
- data/vendor/plugins/classic_pagination/test/fixtures/developers.yml +21 -0
- data/vendor/plugins/classic_pagination/test/fixtures/developers_projects.yml +13 -0
- data/vendor/plugins/classic_pagination/test/fixtures/project.rb +3 -0
- data/vendor/plugins/classic_pagination/test/fixtures/projects.yml +7 -0
- data/vendor/plugins/classic_pagination/test/fixtures/replies.yml +13 -0
- data/vendor/plugins/classic_pagination/test/fixtures/reply.rb +5 -0
- data/vendor/plugins/classic_pagination/test/fixtures/schema.sql +42 -0
- data/vendor/plugins/classic_pagination/test/fixtures/topic.rb +3 -0
- data/vendor/plugins/classic_pagination/test/fixtures/topics.yml +22 -0
- data/vendor/plugins/classic_pagination/test/helper.rb +117 -0
- data/vendor/plugins/classic_pagination/test/pagination_helper_test.rb +38 -0
- data/vendor/plugins/classic_pagination/test/pagination_test.rb +177 -0
- data/vendor/plugins/file_column/lib/file_column.rb +1 -1
- data/vendor/plugins/file_column/test/file_column_test.rb +0 -0
- metadata +151 -197
- data/app/helpers/live_tree.rb +0 -238
- data/app/views/elt/_form.rhtml +0 -31
- data/app/views/elt/show_tree.rhtml +0 -8
- data/config/environments/user_environment.rb +0 -1
- data/db/ROOT/Titemagli.txt +0 -3
- data/db/ROOT/titemagli.txt +0 -9
- data/public/javascripts/behaviour.js +0 -254
- data/public/javascripts/ie7-load.htc +0 -1
- data/public/javascripts/ie7.js +0 -6
- data/public/javascripts/live_tree.js +0 -749
- data/public/javascripts/mybehaviour.js +0 -225
- data/public/javascripts/scriptaculous.js +0 -47
- data/public/javascripts/slider.js +0 -283
- data/public/stylesheets/blue.css +0 -471
- data/vendor/plugins/engines/CHANGELOG +0 -241
- data/vendor/plugins/engines/MIT-LICENSE +0 -21
- data/vendor/plugins/engines/README +0 -64
- data/vendor/plugins/engines/Rakefile +0 -32
- data/vendor/plugins/engines/UPGRADING +0 -93
- data/vendor/plugins/engines/about.yml +0 -7
- data/vendor/plugins/engines/generators/plugin_migration/USAGE +0 -45
- data/vendor/plugins/engines/generators/plugin_migration/plugin_migration_generator.rb +0 -79
- data/vendor/plugins/engines/generators/plugin_migration/templates/plugin_migration.erb +0 -13
- data/vendor/plugins/engines/init.rb +0 -40
- data/vendor/plugins/engines/install.rb +0 -32
- data/vendor/plugins/engines/lib/engines.rb +0 -323
- data/vendor/plugins/engines/lib/engines/deprecated_config_support.rb +0 -135
- data/vendor/plugins/engines/lib/engines/plugin.rb +0 -214
- data/vendor/plugins/engines/lib/engines/plugin_list.rb +0 -31
- data/vendor/plugins/engines/lib/engines/plugin_migrator.rb +0 -60
- data/vendor/plugins/engines/lib/engines/rails_extensions.rb +0 -6
- data/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb +0 -19
- data/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb +0 -143
- data/vendor/plugins/engines/lib/engines/rails_extensions/migrations.rb +0 -155
- data/vendor/plugins/engines/lib/engines/rails_extensions/public_asset_helpers.rb +0 -116
- data/vendor/plugins/engines/lib/engines/rails_extensions/rails.rb +0 -20
- data/vendor/plugins/engines/lib/engines/rails_extensions/rails_initializer.rb +0 -86
- data/vendor/plugins/engines/lib/engines/rails_extensions/routing.rb +0 -77
- data/vendor/plugins/engines/lib/engines/rails_extensions/templates.rb +0 -140
- data/vendor/plugins/engines/lib/engines/testing.rb +0 -87
- data/vendor/plugins/engines/tasks/engines.rake +0 -149
- data/vendor/plugins/login_engine/CHANGELOG +0 -22
- data/vendor/plugins/login_engine/README +0 -344
- data/vendor/plugins/login_engine/app/controllers/user_controller.rb +0 -262
- data/vendor/plugins/login_engine/app/helpers/user_helper.rb +0 -88
- data/vendor/plugins/login_engine/app/models/user.rb +0 -7
- data/vendor/plugins/login_engine/app/models/user_notify.rb +0 -75
- data/vendor/plugins/login_engine/app/views/user/_edit.rhtml +0 -11
- data/vendor/plugins/login_engine/app/views/user/_password.rhtml +0 -9
- data/vendor/plugins/login_engine/app/views/user/change_password.rhtml +0 -17
- data/vendor/plugins/login_engine/app/views/user/edit.rhtml +0 -23
- data/vendor/plugins/login_engine/app/views/user/forgot_password.rhtml +0 -18
- data/vendor/plugins/login_engine/app/views/user/home.rhtml +0 -7
- data/vendor/plugins/login_engine/app/views/user/login.rhtml +0 -17
- data/vendor/plugins/login_engine/app/views/user/logout.rhtml +0 -8
- data/vendor/plugins/login_engine/app/views/user/signup.rhtml +0 -17
- data/vendor/plugins/login_engine/db/migrate/001_initial_schema.rb +0 -25
- data/vendor/plugins/login_engine/init_engine.rb +0 -11
- data/vendor/plugins/login_engine/install.rb +0 -4
- data/vendor/plugins/login_engine/lib/login_engine.rb +0 -62
- data/vendor/plugins/login_engine/lib/login_engine/authenticated_system.rb +0 -113
- data/vendor/plugins/login_engine/lib/login_engine/authenticated_user.rb +0 -155
- data/vendor/plugins/login_engine/public/stylesheets/login_engine.css +0 -81
- data/vendor/plugins/login_engine/test/fixtures/users.yml +0 -41
- data/vendor/plugins/login_engine/test/functional/user_controller_test.rb +0 -536
- data/vendor/plugins/login_engine/test/mocks/mail.rb +0 -14
- data/vendor/plugins/login_engine/test/mocks/time.rb +0 -19
- data/vendor/plugins/login_engine/test/test_helper.rb +0 -11
- data/vendor/plugins/login_engine/test/unit/user_test.rb +0 -114
- data/vendor/plugins/output_compression/MIT-LICENSE +0 -20
- data/vendor/plugins/output_compression/README +0 -4
- data/vendor/plugins/output_compression/init.rb +0 -1
- data/vendor/plugins/output_compression/lib/output_compression.rb +0 -84
- data/vendor/plugins/output_compression/test/output_test.rb +0 -11
- data/vendor/plugins/output_compression/test/test_controller.rb +0 -3
- data/vendor/plugins/output_compression/test/test_helper.rb +0 -14
data/app/views/elt/_elt.rhtml
CHANGED
@@ -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[:
|
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
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
29
|
+
<<%= link_to elt.person.name, :controller => 'person', :action => 'show', :id => elt.person %>>
|
32
30
|
</span>
|
33
31
|
<% elsif not displayTitle? elt %>
|
34
32
|
<span class="author"><<%= ANONYMOUS_POSTER %>></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, { :
|
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
|
-
|
46
|
+
<%= image_tag (elt.person && elt.person.image ? elt.person.image : "/javascripts/blank.gif"),
|
49
47
|
:onload => "setSize(this)", :class => "avatar" \
|
50
|
-
|
48
|
+
if elt.body =~ /\n/ %>
|
51
49
|
|
52
|
-
<%
|
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
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
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
|
-
|
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
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
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
|
-
|
87
|
+
<%= link_to_function('<span class="icon"><<</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}")+
|
data/app/views/elt/choices.rhtml
CHANGED
@@ -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
|
-
|
3
|
+
<th><%= image_tag('vote_minus.png', :class => "con") %></th>
|
6
4
|
<th>0</th>
|
7
|
-
|
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
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
<% end %>
|
11
|
+
<% if c.person %>
|
12
|
+
<span class="author" title="<%= c.created_on.strftime('%d/%m %H:%M') %>">
|
13
|
+
<<%= link_to c.person.name, :controller => 'person', :action => 'show', :id => c.person %>>
|
14
|
+
</span>
|
15
|
+
<% else %>
|
16
|
+
<span class="author" title="<%= c.created_on.strftime('%d/%m %H:%M') %>">
|
17
|
+
<<%= ANONYMOUS_POSTER %>>
|
18
|
+
</span>
|
19
|
+
<% end %>
|
23
20
|
<% } %>
|
24
21
|
</td>
|
25
22
|
<% } %>
|
26
23
|
</tr>
|
27
24
|
</table>
|
28
25
|
<script type="text/javascript">
|
29
|
-
|
30
|
-
|
31
|
-
|
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
|
-
|
8
|
-
|
9
|
-
|
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
|
-
|
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('|<',
|
23
23
|
{ :update => 'listByDate',
|
24
24
|
:url => { :action => 'listByDate', :id => @elt, :page => e_pages.last },
|
25
|
-
:before => visual_effect(:
|
26
|
-
:
|
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('<',
|
29
29
|
{ :update => 'listByDate',
|
30
30
|
:url => { :action => 'listByDate', :id => @elt, :page => e_pages.current.next },
|
31
|
-
:before => visual_effect(:
|
32
|
-
:
|
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('>',
|
38
38
|
{ :update => 'listByDate',
|
39
39
|
:url => { :action => 'listByDate', :id => @elt, :page => e_pages.current.previous },
|
40
|
-
:before => visual_effect(:
|
41
|
-
:
|
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('>|',
|
44
44
|
{ :update => 'listByDate',
|
45
45
|
:url => { :action => 'listByDate', :id => @elt, :page => e_pages.first },
|
46
|
-
:before => visual_effect(:
|
47
|
-
:
|
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"><<%= ANONYMOUS_POSTER %>></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
|
-
|
8
|
-
|
9
|
-
|
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
|
15
|
-
|
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('|<',
|
23
23
|
{ :update => 'listByVote',
|
24
24
|
:url => { :action => 'listByVote', :id => @elt, :page => e_pages.last },
|
25
|
-
:before => visual_effect(:
|
26
|
-
:
|
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('<',
|
29
29
|
{ :update => 'listByVote',
|
30
30
|
:url => { :action => 'listByVote', :id => @elt, :page => e_pages.current.next },
|
31
|
-
:before => visual_effect(:
|
32
|
-
:
|
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('>',
|
38
38
|
{ :update => 'listByVote',
|
39
39
|
:url => { :action => 'listByVote', :id => @elt, :page => e_pages.current.previous },
|
40
|
-
:before => visual_effect(:
|
41
|
-
:
|
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('>|',
|
44
44
|
{ :update => 'listByVote',
|
45
45
|
:url => { :action => 'listByVote', :id => @elt, :page => e_pages.first },
|
46
|
-
:before => visual_effect(:
|
47
|
-
:
|
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"><<%= ANONYMOUS_POSTER %>></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('|<',
|
13
|
-
{ :update => 'eltSubs_'+elt.id
|
13
|
+
{ :update => 'eltSubs_'+elt.id,
|
14
14
|
:url => { :action => 'list', :id => elt, :page => e_pages.first },
|
15
|
-
:before => visual_effect(:
|
16
|
-
:
|
17
|
-
|
18
|
-
|
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('<',
|
21
|
-
{ :update => 'eltSubs_'+elt.id
|
22
|
+
{ :update => 'eltSubs_'+elt.id,
|
22
23
|
:url => { :action => 'list', :id => elt, :page => e_pages.current.previous },
|
23
|
-
:before => visual_effect(:
|
24
|
-
:
|
25
|
-
|
26
|
-
|
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('>',
|
33
|
-
{ :update => 'eltSubs_'+elt.id
|
35
|
+
{ :update => 'eltSubs_'+elt.id,
|
34
36
|
:url => { :action => 'list', :id => elt, :page => e_pages.current.next },
|
35
|
-
:before => visual_effect(:
|
36
|
-
:
|
37
|
-
|
38
|
-
|
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('>|',
|
41
|
-
{ :update => 'eltSubs_'+elt.id
|
44
|
+
{ :update => 'eltSubs_'+elt.id,
|
42
45
|
:url => { :action => 'list', :id => elt, :page => e_pages.last },
|
43
|
-
:before => visual_effect(:
|
44
|
-
:
|
45
|
-
|
46
|
-
|
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('|<',
|
55
|
-
{ :update => 'eltSubs_'+elt.id
|
59
|
+
{ :update => 'eltSubs_'+elt.id,
|
56
60
|
:url => { :action => 'list', :id => elt, :page => e_pages.first },
|
57
|
-
:before => visual_effect(:
|
58
|
-
:
|
59
|
-
|
60
|
-
|
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('<',
|
63
|
-
{ :update => 'eltSubs_'+elt.id
|
68
|
+
{ :update => 'eltSubs_'+elt.id,
|
64
69
|
:url => { :action => 'list', :id => elt, :page => e_pages.current.previous },
|
65
|
-
:before => visual_effect(:
|
66
|
-
:
|
67
|
-
|
68
|
-
|
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('>',
|
75
|
-
{ :update => 'eltSubs_'+elt.id
|
81
|
+
{ :update => 'eltSubs_'+elt.id,
|
76
82
|
:url => { :action => 'list', :id => elt, :page => e_pages.current.next },
|
77
|
-
:before => visual_effect(:
|
78
|
-
:
|
79
|
-
|
80
|
-
|
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('>|',
|
83
|
-
{ :update => 'eltSubs_'+elt.id
|
90
|
+
{ :update => 'eltSubs_'+elt.id,
|
84
91
|
:url => { :action => 'list', :id => elt, :page => e_pages.last },
|
85
|
-
:before => visual_effect(:
|
86
|
-
:
|
87
|
-
|
88
|
-
|
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[:
|
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 },
|
data/app/views/elt/new.rhtml
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
:update => 'eltSubs_'+@elt.parent_id,
|
9
9
|
:url => { :action => 'create', :id => @elt.parent },
|
10
10
|
:position => 'top',
|
11
|
-
|
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
|
-
|
40
|
+
<br/>
|
41
|
+
<%= text_area 'elt', 'body', { :onkeyup => "resize(this)", :onfocus => "resize(this)" } %>
|
41
42
|
</div>
|
42
43
|
|
43
44
|
<div class="eltNewButtons">
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
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 => </div><blockquote>blockquote</blockquote> "Google":http://google.com => <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
|
-
|
57
|
-
|
57
|
+
<span id="eltNewPropose_<%= @elt.parent_id %>" style="display: none">
|
58
|
+
<span class="elt" id="eltNewPreview_<%= @elt.parent_id %>"></span>
|
58
59
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
60
|
+
<div class="eltNewButtons">
|
61
|
+
<%= link_to_function('<span class="icon"><<</span> '+_('Modify'),
|
62
|
+
visual_effect(:BlindUp, 'eltNewPropose_'+@elt.parent_id) \
|
63
|
+
+visual_effect(:BlindDown, 'eltNewWrite_'+@elt.parent_id)) %>
|
63
64
|
|
64
|
-
|
65
|
-
|
66
|
-
|
65
|
+
<%= submit_tag _('Propose!') %>
|
66
|
+
</div>
|
67
|
+
</span>
|
67
68
|
<% end %>
|
68
69
|
|