parlement 0.13 → 0.14

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 (43) hide show
  1. data/CHANGES +15 -0
  2. data/Rakefile +1 -1
  3. data/app/controllers/account_controller.rb +20 -20
  4. data/app/controllers/application.rb +18 -17
  5. data/app/controllers/elt_controller.rb +92 -71
  6. data/app/controllers/subscriber_controller.rb +1 -1
  7. data/app/helpers/elt_helper.rb +2 -1
  8. data/app/models/elt.rb +3 -1
  9. data/app/models/mail.rb +0 -3
  10. data/app/views/_help.rhtml +2 -0
  11. data/app/views/account/_login.rhtml +39 -37
  12. data/app/views/account/_show.rhtml +24 -18
  13. data/app/views/elt/_choice.rhtml +22 -22
  14. data/app/views/elt/_elt.rhtml +73 -64
  15. data/app/views/elt/choices.rhtml +22 -18
  16. data/app/views/elt/list/_byDate.rhtml +71 -0
  17. data/app/views/elt/list/_byVote.rhtml +71 -0
  18. data/app/views/elt/{_list.rhtml → list/_children.rhtml} +3 -3
  19. data/app/views/{subscriber/_list.rhtml → elt/list/_subscribers.rhtml} +0 -0
  20. data/app/views/elt/{_listVisitors.rhtml → list/_visitors.rhtml} +0 -0
  21. data/app/views/elt/{_listByVote.rhtml → list/byVote.rhtml} +3 -2
  22. data/app/views/elt/new.rhtml +26 -11
  23. data/app/views/elt/show.rhtml +32 -31
  24. data/app/views/layouts/_title.rhtml +10 -0
  25. data/app/views/layouts/top.rhtml +41 -23
  26. data/app/views/person/_listElts.rhtml +1 -1
  27. data/app/views/person/show.rhtml +19 -16
  28. data/config/boot.rb +2 -2
  29. data/config/environment.rb +1 -1
  30. data/db/ROOT/perso.txt +214 -0
  31. data/db/development_structure.sql +1 -1
  32. data/public/javascripts/mybehaviour.js +21 -21
  33. data/public/javascripts/prototype.js +1 -1
  34. data/public/javascripts/shadedborder.js +249 -0
  35. data/public/stylesheets/blue.css +471 -0
  36. data/public/stylesheets/default.css +165 -310
  37. data/vendor/plugins/engines/README +2 -0
  38. data/vendor/plugins/engines/Rakefile +18 -0
  39. data/vendor/plugins/engines/lib/engines/testing.rb +0 -1
  40. data/vendor/plugins/engines/tasks/engines.rake +4 -2
  41. data/vendor/plugins/login_engine/app/controllers/user_controller.rb +2 -1
  42. metadata +13 -7
  43. data/app/views/elt/_listByDate.rhtml +0 -76
@@ -1,35 +1,35 @@
1
1
  <%
2
- choice = Choice.find_by_elt_id_and_person_id elt.id, (session[:person] ? session[:person].id : nil)
3
- result = elt.result
2
+ choice = Choice.find_by_elt_id_and_person_id elt.id, session[:person].id if session[:person]
3
+ result = elt.result
4
4
  %>
5
5
 
6
- <label class="con <%= choice and choice.value == -1 ? "selected" : "" %>"
7
- title="-1" for="choice_<%= elt.id %>_con">
8
- <%= image_tag 'vote_minus.png' %>
9
- <%= radio_button_tag "choice[value]", "-1",
10
- (choice and choice.value == -1),
11
- :id => "choice_#{elt.id}_con",
12
- :onclick => "this.form.commit.click()" %>
13
- </label>
6
+ <%= link_to_remote(
7
+ image_tag('vote_minus.png',
8
+ :class => "con" + ((choice and choice.value == -1) ? ' selected' : '')),
9
+ { :update => 'eltChoice_'+elt.id.to_s,
10
+ :url => { :action => 'vote', :id => elt, 'choice[value]' => '-1' },
11
+ :before => visual_effect(:DropOut, 'eltChoice_'+elt.id.to_s, { :queue => 'end' }),
12
+ :loaded => visual_effect(:Grow, 'eltChoice_'+elt.id.to_s, { :queue => 'end' }) },
13
+ { :href => url_for(:controller => 'elt', :action => 'vote', 'choice[value]' => '-1') }) %>
14
14
 
15
15
  <%= link_to_remote("%+d" % result,
16
16
  { :update => 'result_'+elt.id,
17
17
  :position => :top,
18
18
  :url => { :action => 'choices', :id => elt } },
19
- { :class => 'result', :id => "result_#{ elt.id}",
19
+ { :class => 'result' + ((choice and choice.value != 0) ? ' selected' : ''),
20
+ :id => "result_#{ elt.id}",
20
21
  :href => url_for(:controller => 'elt', :action => 'choices', :id => elt) }) %>
21
- <script>setKnob($('elt_<%= elt.id %>'), <%= result %>);</script>
22
22
 
23
- <label class="pro <%= choice and choice.value == 1 ? "selected" : "" %>"
24
- title="+1" for="choice_<%= elt.id %>_pro">
25
- <%= image_tag 'vote_plus.png' %>
26
- <%= radio_button_tag "choice[value]", "+1",
27
- (choice and choice.value == +1),
28
- :id => "choice_#{elt.id}_pro",
29
- :onclick => "this.form.commit.click()" %>
30
- </label>
23
+ <%= link_to_remote(
24
+ image_tag('vote_plus.png',
25
+ :class => "pro" + ((choice and choice.value == 1) ? ' selected' : '')),
26
+ { :update => 'eltChoice_'+elt.id.to_s,
27
+ :url => { :action => 'vote', :id => elt, 'choice[value]' => '+1' },
28
+ :before => visual_effect(:DropOut, 'eltChoice_'+elt.id.to_s, { :queue => 'end' }),
29
+ :loaded => visual_effect(:Grow, 'eltChoice_'+elt.id.to_s, { :queue => 'end' }) },
30
+ { :href => url_for(:controller => 'elt', :action => 'vote', 'choice[value]' => '1') }) %>
31
31
 
32
- <%= submit_tag 'Vote!' %>
32
+ <script type="text/javascript">setKnob($('elt_<%= elt.id %>'), 0<%= result %>);</script>
33
33
 
34
34
  <span class="eltQuickAdd" id="eltQuickAdd_<%= elt.id %>" title="<%= elt.created_on %>">
35
35
  <%= link_to_remote(image_tag('write.png'),
@@ -37,6 +37,6 @@ result = elt.result
37
37
  :url => { :controller => 'elt', :action => 'new', :id => elt },
38
38
  :loaded => visual_effect(:BlindDown, 'eltNew_'+elt.id.to_s)+
39
39
  visual_effect(:BlindDown, 'eltSubsClose_'+elt.id.to_s) },
40
- { :href => url_for(:controller => 'elt', :action => 'new', :id => @elt)}) %>
40
+ { :href => url_for(:controller => 'elt', :action => 'new', :id => elt.id)}) %>
41
41
  </span>
42
42
 
@@ -1,79 +1,89 @@
1
- <li id="elt_<%= elt.id %>" class="elt <%= 'titled' if displayTitle? elt %>">
2
- <script>setKnobs($('elt_<%= elt.id %>'));</script>
3
-
4
- <!-- The form is here to make sure a text browser can see it all on one line -->
5
- <% form_remote_tag(
6
- :update => 'eltChoice_'+elt.id.to_s,
7
- :url => { :action => 'vote', :id => elt },
8
- :before => visual_effect(:DropOut, 'eltChoice_'+elt.id.to_s, { :queue => 'end' }),
9
- :loaded => visual_effect(:Grow, 'eltChoice_'+elt.id.to_s, { :queue => 'end' })) do
10
-
11
- cache :action => 'show', :id => elt.id do %>
12
- <% if displayTitle? elt and elt.created_on %>
13
- <span class="created_on"><%= elt.created_on.strftime('%d/%m/%y %H:%M') %></span>
14
- <% end %>
15
-
16
- <% if elt.person %>
17
- <span class="author">
18
- &lt;<%= link_to elt.person.name, :controller => 'person', :action => 'show', :id => elt.person %>&gt;
19
- </span>
20
- <% elsif not displayTitle? elt %>
21
- <span class="author">&lt;<%= ANONYMOUS_POSTER %>&gt;</span>
22
- <% end %>
1
+ <% if elt.new_record? %>
2
+ <% flash.each do |key, value| %>
3
+ <div class="<%= key %>"><%= value %></div>
4
+ <% end %>
5
+ <% end %>
23
6
 
24
- <% if displayTitle? elt %>
25
- <h1>
26
- <% if elt.new_record? %>
27
- <%= textilize_without_paragraph elt.subject.gsub(/\[.*\]/, '') %>
28
- <% else %>
29
- <%= link_to(textilize_without_paragraph(elt.subject.gsub(/\[.*\]/, '')),
30
- :controller => 'elt', :action => 'show', :id => elt) %>
31
- <% end %>
32
- </h1>
33
- <% end %>
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] %>
9
+ <script type="text/javascript">
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')) %>;
19
+ </script>
20
+ <% end %>
34
21
 
35
- <% formattedBody = format elt.body %>
22
+ <li id="elt_<%= elt.id %>" class="elt <%= 'titled' if displayTitle? elt %>">
23
+ <script type="text/javascript">setKnobs($('elt_<%= elt.id %>'));</script>
36
24
 
37
- <%= image_tag (elt.person && elt.person.image ? elt.person.image : "/javascripts/blank.gif"),
38
- :onload => "setSize(this)",
39
- :class => "avatar" \
40
- if formattedBody.match(/[.\s]<p>/) %>
25
+ <% if displayTitle? elt and elt.created_on %>
26
+ <span class="created_on"><%= elt.created_on.strftime('%d/%m/%y %H:%M') %></span>
27
+ <% end %>
41
28
 
42
- <%= formattedBody %>
29
+ <% if elt.person %>
30
+ <span class="author">
31
+ &lt;<%= link_to elt.person.name, :controller => 'person', :action => 'show', :id => elt.person %>&gt;
32
+ </span>
33
+ <% elsif not displayTitle? elt %>
34
+ <span class="author">&lt;<%= ANONYMOUS_POSTER %>&gt;</span>
35
+ <% end %>
43
36
 
44
- <span class="attachments">
45
- <% for att in elt.attachments %>
46
- <%= link_to image_tag("/attachment/file/#{att.file_relative_path}"),
47
- "/attachment/file/#{att.file_relative_path}" %>
48
- <% end %>
49
- </span>
50
- <% end %>
51
- <% @controller.expire_fragment( :action => 'show', :id => elt.id) if elt.new_record? %>
37
+ <% if displayTitle? elt
38
+ titleText = elt.subject.gsub(/\[.*\]/, '')%>
39
+ <h<%= eltTop ? 1:2 %>>
40
+ <% if elt.new_record? %>
41
+ <%= link_to(titleText, { }, :title => titleText) %>
42
+ <% else %>
43
+ <%= link_to(titleText, { :controller => 'elt', :action => 'show', :id => elt }, :title => titleText) %>
44
+ <% end %>
45
+ </h<%= eltTop ? 1:2 %>>
46
+ <% end %>
52
47
 
53
- <% unless elt.new_record? %>
54
- <span class="choice" id="eltChoice_<%= elt.id %>">
55
- <%= render :partial => '/elt/choice', :locals => { :elt => elt } %>
56
- </span>
57
- <% end %>
48
+ <%= image_tag (elt.person && elt.person.image ? elt.person.image : "/javascripts/blank.gif"),
49
+ :onload => "setSize(this)", :class => "avatar" \
50
+ if elt.body =~ /\n/ %>
58
51
 
59
- <span class="eltMore" id="eltMore_<%= elt.id %>"
60
- <%= 'style="display: none"' if (eltTop or elt.elts_count < SUB_THREAD_LENGTH) %>>
61
- <%= link_to_remote(n_('%s message...', '%s messages...', elt.elts_count) % elt.elts_count,
62
- { :update => 'eltSubs_'+elt.id.to_s,
63
- :url => { :controller => 'elt', :action => 'list', :id => elt },
64
- :before => visual_effect(:BlindUp, "eltMore_#{elt.id.to_s}")+
65
- visual_effect(:BlindDown, "eltSubsClose_#{elt.id.to_s}"),
66
- :loading => visual_effect(:BlindDown, "eltSubs_#{elt.id.to_s}") },
67
- { :href => url_for(:controller => 'elt', :action => 'show', :id => elt) }) %>
52
+ <% @controller.expire_fragment( :action => 'show', :id => elt.id) if elt.new_record? %>
53
+ <% cache :action => 'show', :id => elt.id do %>
54
+ <%= format elt.body %>
55
+ <span class="attachments">
56
+ <% for att in elt.attachments %>
57
+ <%= link_to image_tag("/attachment/file/#{att.file_relative_path}"),
58
+ "/attachment/file/#{att.file_relative_path}" %>
59
+ <% end %>
68
60
  </span>
69
- <!-- The choice end form, here to make sure it looks nice in text browsers -->
70
61
  <% end %>
62
+ <% @controller.expire_fragment( :action => 'show', :id => elt.id) if elt.new_record? %>
71
63
 
72
- <ul class="eltNew" id="eltNew_<%= elt.id %>"></ul>
64
+ <span class="choice" id="eltChoice_<%= elt.id %>">
65
+ <%= render :partial => '/elt/choice', :locals => { :elt => elt } unless elt.new_record? %>
66
+ </span>
67
+
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>
78
+
79
+ <ul class="eltNew" id="eltNew_<%= elt.id %>"><li style="display: none"/></ul>
73
80
 
74
81
  <ul <%= 'style="display: none"' unless (eltTop or elt.elts_count < SUB_THREAD_LENGTH) %>
75
82
  id="eltSubs_<%= elt.id %>" class="eltSub">
76
- <%= render :partial => '/elt/list', :locals => { :elt => elt } if (eltTop or elt.elts_count < SUB_THREAD_LENGTH) %>
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)) %>
77
87
  </ul>
78
88
 
79
89
  <span <%= 'style="display: none"' unless (elt.elts_count > 0 and (eltTop or elt.elts_count < SUB_THREAD_LENGTH)) %>
@@ -95,4 +105,3 @@
95
105
  -->
96
106
  </span>
97
107
  </li>
98
-
@@ -1,29 +1,33 @@
1
+ <% @elt = Elt.find params[:id] %>
2
+
1
3
  <table border="1" id="choices_<%= @elt.id %>" class="choices">
2
- <caption><h2><%= @elt.subject %></h2></caption>
3
- <tr onclick="Element.remove(this.parentNode);return false;">
4
- <th><label class="con" title="-1">V</label></th>
5
- <th><label title="0">0</label></th>
6
- <th><label class="pro" title="+1">Λ</label></th>
7
- <th style="border: none"><a href="#" class="closeChoices">X</a></th>
4
+ <tr>
5
+ <th><%= image_tag('vote_minus.png', :class => "con") %></th>
6
+ <th>0</th>
7
+ <th><%= image_tag('vote_plus.png', :class => "pro") %></th>
8
8
  </tr>
9
9
  <tr>
10
10
  <% (-1..1).each { |n| %>
11
11
  <td>
12
12
  <% @elt.choices.select{ |c| c.value == n }.reverse.each { |c| %>
13
- <div class="personalChoice" title="<%= c.created_on.strftime('%d/%m %H:%M') %>">
14
- <span class="created_on"><%= c.created_on.strftime('%d/%m %H:%M') %></span>
15
- <% if c.person %>
16
- <span class="author">
17
- &lt;<%= link_to c.person.name, :controller => 'person',
18
- :action => 'show', :id => c.person %>&gt;
19
- </span>
20
- <% else %>
21
- <span class="author">&lt;<%= ANONYMOUS_POSTER %>&gt;</span>
22
- <% end %>
23
- </div>
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 %>
24
23
  <% } %>
25
24
  </td>
26
25
  <% } %>
27
26
  </tr>
28
27
  </table>
29
-
28
+ <script type="text/javascript">
29
+ document.onclick = function() {
30
+ Element.remove($('choices_<%= @elt.id %>'));
31
+ document.onclick = null;
32
+ }
33
+ </script>
@@ -0,0 +1,71 @@
1
+ <%= link_to image_tag("/images/feed-icon-14x14.png"),
2
+ { :action => 'rss', :id => @elt }, :class => 'feed',
3
+ :title => _('Webfeed') %>
4
+ <h3 class="boxTitle"><%= _('Latest posts') %></h3>
5
+
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 \
10
+ FROM elts \
11
+ LEFT JOIN choices ON choices.elt_id = elts.id \
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 created_on DESC \
16
+ LIMIT #{e_pages.items_per_page} \
17
+ OFFSET #{e_pages.current.offset}" %>
18
+
19
+ <ul>
20
+ <% if e_pages.length > 1 %>
21
+ <li class="nav">
22
+ <%= link_to_remote('|&lt;',
23
+ { :update => 'listByDate',
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' }) }) \
27
+ if e_pages.last != e_pages.current %>
28
+ <%= link_to_remote('&lt;',
29
+ { :update => 'listByDate',
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' }) }) \
33
+ if e_pages.current.next and e_pages.current.next != e_pages.last %>
34
+
35
+ <span class="pageCount"><%= e_pages.length-e_pages.current.to_i+1 %></span>
36
+
37
+ <%= link_to_remote('&gt;',
38
+ { :update => 'listByDate',
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' }) }) \
42
+ if e_pages.current.previous and e_pages.current.previous != e_pages.first %>
43
+ <%= link_to_remote('&gt;|',
44
+ { :update => 'listByDate',
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' }) }) \
48
+ if e_pages.first != e_pages.current %>
49
+ </li>
50
+ <% end %>
51
+
52
+ <% elts.each do |elt| %>
53
+ <li class="boxLine elt" title="<%= elt.created_on.strftime '%d/%m %H:%M' %>">
54
+ <span class="created_on"><%= elt.created_on.strftime '%d/%m %H:%M' %></span>
55
+ <span class="result">
56
+ <%= ("%+d" % elt.resultlocal) if elt.resultlocal %>
57
+ </span>
58
+
59
+ <% if elt.person %>
60
+ <span class="author">
61
+ &lt;<%= link_to elt.person.name, :controller => 'person', :action => 'show', :id => elt.person %>&gt;
62
+ </span>
63
+ <% elsif not displayTitle? elt %>
64
+ <span class="author">&lt;<%= ANONYMOUS_POSTER %>&gt;</span>
65
+ <% end %>
66
+
67
+ <%= link_to elt.subject.gsub(/\[.*\]/, ''), :action => 'show', :id => elt %>
68
+ </li>
69
+ <% end %>
70
+ </ul>
71
+
@@ -0,0 +1,71 @@
1
+ <%= link_to image_tag("/images/feed-icon-14x14.png"),
2
+ { :action => 'vote_rss', :id => @elt }, :class => 'feed',
3
+ :title => _('Webfeed') %>
4
+ <h3 class="boxTitle"><%= _('Highest posts') %></h3>
5
+
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 \
10
+ FROM elts \
11
+ LEFT JOIN choices ON choices.elt_id = elts.id \
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 \
16
+ LIMIT #{e_pages.items_per_page} \
17
+ OFFSET #{e_pages.current.offset}" %>
18
+
19
+ <ul>
20
+ <% if e_pages.length > 1 %>
21
+ <li class="nav">
22
+ <%= link_to_remote('|&lt;',
23
+ { :update => 'listByVote',
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' }) }) \
27
+ if e_pages.last != e_pages.current %>
28
+ <%= link_to_remote('&lt;',
29
+ { :update => 'listByVote',
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' }) }) \
33
+ if e_pages.current.next and e_pages.current.next != e_pages.last %>
34
+
35
+ <span class="pageCount"><%= e_pages.length-e_pages.current.to_i+1 %></span>
36
+
37
+ <%= link_to_remote('&gt;',
38
+ { :update => 'listByVote',
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' }) }) \
42
+ if e_pages.current.previous and e_pages.current.previous != e_pages.first %>
43
+ <%= link_to_remote('&gt;|',
44
+ { :update => 'listByVote',
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' }) }) \
48
+ if e_pages.first != e_pages.current %>
49
+ </li>
50
+ <% end %>
51
+
52
+ <% elts.each do |elt| %>
53
+ <li class="boxLine elt" title="<%= elt.created_on.strftime '%d/%m %H:%M' %>">
54
+ <span class="created_on"><%= elt.created_on.strftime '%d/%m %H:%M' %></span>
55
+ <span class="result">
56
+ <%= ("%+d" % elt.resultlocal) if elt.resultlocal %>
57
+ </span>
58
+
59
+ <% if elt.person %>
60
+ <span class="author">
61
+ &lt;<%= link_to elt.person.name, :controller => 'person', :action => 'show', :id => elt.person %>&gt;
62
+ </span>
63
+ <% elsif not displayTitle? elt %>
64
+ <span class="author">&lt;<%= ANONYMOUS_POSTER %>&gt;</span>
65
+ <% end %>
66
+
67
+ <%= link_to elt.subject.gsub(/\[.*\]/, ''), :action => 'show', :id => elt %>
68
+ </li>
69
+ <% end %>
70
+ </ul>
71
+
@@ -2,13 +2,13 @@
2
2
  self, elt.elts_count, PAGE_LENGTH, params['page'])
3
3
  elts = Elt.find(:all,
4
4
  :conditions => "parent_id = '#{elt.id}'",
5
- :order => 'position, last_activity DESC, elts.created_on DESC',
5
+ :order => 'position, last_activity IS NULL, last_activity DESC, elts.created_on DESC',
6
6
  :include => :person,
7
7
  :limit => e_pages.items_per_page,
8
8
  :offset => e_pages.current.offset) %>
9
9
 
10
10
  <% if e_pages.length > 1 && e_pages.current.to_i != 1 %>
11
- <li class="pager">
11
+ <li class="nav">
12
12
  <%= link_to_remote('|&lt;',
13
13
  { :update => 'eltSubs_'+elt.id.to_s,
14
14
  :url => { :action => 'list', :id => elt, :page => e_pages.first },
@@ -50,7 +50,7 @@
50
50
  <%= render :partial => '/elt/elt', :collection => elts, :locals => { :eltTop => false } %>
51
51
 
52
52
  <% if e_pages.length > 1 %>
53
- <li class="pager">
53
+ <li class="nav">
54
54
  <%= link_to_remote('|&lt;',
55
55
  { :update => 'eltSubs_'+elt.id.to_s,
56
56
  :url => { :action => 'list', :id => elt, :page => e_pages.first },
@@ -1,5 +1,6 @@
1
- <%= link_to image_tag("/images/feed-icon-28x28.png"),
2
- { :action => 'vote_rss', :id => @elt }, :class => 'feed' %>
1
+ <%= link_to image_tag("/images/feed-icon-14x14.png"),
2
+ { :action => 'vote_rss', :id => @elt }, :class => 'feed',
3
+ :title => _('Webfeed') %>
3
4
  <h3 class="boxTitle">
4
5
  <%= _('Highest posts') %>
5
6
  </h3>
@@ -14,18 +14,33 @@
14
14
 
15
15
  <%= hidden_field 'elt', 'parent_id' %>
16
16
 
17
- <span id="eltNewWrite_<%= @elt.parent_id %>">
18
- <h2>
19
- <%= text_field 'elt', 'subject' %>
17
+ <span id="eltNewWrite_<%= @elt.parent_id %>">
18
+ <span class="for_anon">
19
+ <div>
20
+ <label for="person_name"><%= _('Name') %>:</label>
21
+ <%= text_field 'person', 'name' %>
22
+ </div>
20
23
 
21
- <%= render :partial => '/help',
22
- :locals => { :divId => 'title'+@elt.parent_id,
23
- :content => _('This is the title of your proposition.<br/>If you leave it as it is then it won\'t be displayed (recommanded if your text is short, like in a conversation).') } %>
24
- </h2>
24
+ <div>
25
+ <label for="person_email"><%= _('Email') %>:</label>
26
+ <%= text_field 'person', 'email' %>
27
+ </div>
28
+ </span>
25
29
 
26
- <%= text_area 'elt', 'body' %>
30
+ <div>
31
+ <label for="elt_subject"><%= _('subject') %>:</label>
32
+ <%= text_field 'elt', 'subject' %>
33
+ <%= render :partial => '/help',
34
+ :locals => { :divId => 'title'+@elt.parent_id,
35
+ :content => _('This is the title of your proposition.<br/>If you leave it as it is then it won\'t be displayed (recommanded if your text is short, like in a conversation).') } %>
36
+ </div>
27
37
 
28
- <div class="eltNewButtons">
38
+ <div>
39
+ <label for="elt_body"><%= _('Content') %>:</label>
40
+ <%= text_area 'elt', 'body' %>
41
+ </div>
42
+
43
+ <div class="eltNewButtons">
29
44
  <%= submit_to_remote(_('Preview'), _('Preview'),
30
45
  :update => "eltNewPreview_"+@elt.parent_id,
31
46
  :url => { :action => "create", :id => @elt.parent, :submit => "preview" },
@@ -43,8 +58,8 @@
43
58
 
44
59
  <div class="eltNewButtons">
45
60
  <%= link_to_function('<span class="icon">&lt;&lt;</span> '+_('Modify'),
46
- visual_effect(:BlindDown, 'eltNewWrite_'+@elt.parent_id) \
47
- +visual_effect(:BlindUp, 'eltNewPropose_'+@elt.parent_id)) %>
61
+ visual_effect(:BlindUp, 'eltNewPropose_'+@elt.parent_id) \
62
+ +visual_effect(:BlindDown, 'eltNewWrite_'+@elt.parent_id)) %>
48
63
 
49
64
  <%= submit_tag _('Propose!') %>
50
65
  </div>
@@ -1,46 +1,47 @@
1
1
  <% voters = Choice.count :select => 'person_id', :distinct => true %>
2
2
 
3
- <%= periodically_call_remote(:update => 'spinner', :url => { :action => 'updateView', :id => @elt })%>
4
- <span id="spinner">
5
- <!--
6
- <%= image_tag "/images/live_tree_loading_spinner.gif" %>
7
- -->
8
- </span>
3
+ <div id="sidebar" class="sb">
4
+ <script type="text/javascript">if (displayBorder) { border.render('sidebar'); }</script>
5
+ <%= render :partial => '/layouts/title' %>
6
+
7
+ <%= periodically_call_remote(:update => 'spinner', :url => { :action => 'updateView', :id => @elt })%>
8
+ <span id="spinner"></span>
9
9
 
10
- <div class="sidebar">
11
10
  <div class="box identity" id="identity">
12
11
  <%= render :partial => 'account/show', :locals => { :elt => @elt.parent } %>
13
12
  </div>
14
13
 
15
14
  <div class="box" id="filter">
16
- <h3 class="boxTitle"><%= _('Filter') %></h3>
17
- <form id="filterForm" name="filterForm">
18
- <a onclick="return decrementFilter()" href="#" accesskey="<">&lt;</a>
19
- <select id="filter" name="filter"
20
- onchange="setFilter(this.options[this.selectedIndex].value, '<%= @elt.id %>')">
21
- <%= options_for_select [["", -voters]] %>
22
- <%= options_for_select (0..(voters)), 0 %>
23
- </select>
24
- <a onclick="return incrementFilter()" href="#" accesskey=">">&gt;</a>
25
- <%= submit_tag 'Ok' %>
15
+ <h3 class="boxTitle"><%= _('Filter') %></h3>
16
+ <form id="filterForm" action="">
17
+ <p>
18
+ <a onclick="return decrementFilter()" href="#" accesskey="-">&#x2012;</a>
19
+ <select name="filter"
20
+ onchange="setFilter(this.options[this.selectedIndex].value, '<%= @elt.id %>')">
21
+ <%= options_for_select [["", -voters]] %>
22
+ <%= options_for_select (0..(voters)), 0 %>
23
+ </select>
24
+ <a onclick="return incrementFilter()" href="#" accesskey="+">+</a>
25
+ <%= submit_tag 'Ok' %>
26
+ </p>
26
27
  </form>
27
- <script>setFilterFromCookie();</script>
28
+ <script type="text/javascript">setFilterFromCookie();</script>
28
29
  </div>
29
30
 
30
31
  <div class="box" id="listVisitors">
31
- <%= render :partial => '/elt/listVisitors' %>
32
+ <%= render :partial => '/elt/list/visitors' %>
32
33
  </div>
33
34
 
34
35
  <div class="box" id="listSubscribers">
35
- <%= render :partial => '/subscriber/list' %>
36
+ <%= render :partial => '/elt/list/subscribers' %>
36
37
  </div>
37
38
 
38
39
  <div class="box" id="listByVote">
39
- <%= render :partial => '/elt/listByVote' %>
40
+ <%= render :partial => '/elt/list/byVote' %>
40
41
  </div>
41
42
 
42
43
  <div class="box" id="listByDate">
43
- <%= render :partial => '/elt/listByDate' %>
44
+ <%= render :partial => '/elt/list/byDate' %>
44
45
  </div>
45
46
 
46
47
  <div class="box">
@@ -63,8 +64,6 @@
63
64
  <h4><%= _('Democracy') %></h4>
64
65
  <div class="boxLine"><a href="http://worldblu.com">
65
66
  World BLU</a></div>
66
- <div class="boxLine"><a href="http://groups.google.com/group/top-politics">
67
- top politics</a></div>
68
67
  <div class="boxLine"><a href="http://www.tdge.org">
69
68
  world Parliament Experiment</a></div>
70
69
  <div class="boxLine"><a href="http://groups.google.com/group/worldcit">
@@ -76,10 +75,12 @@
76
75
  <div class="box">
77
76
  <h3 class="boxTitle"><%= _('Search') %></h3>
78
77
  <form action="http://google.com/search">
79
- <input type="hidden" name="q"
80
- value="site:<%= ActionMailer::Base.smtp_settings[:domain] %>"/>
81
- <input type="text" name="q"/>
82
- <%= submit_tag 'OK' %>
78
+ <div>
79
+ <input type="hidden" name="q"
80
+ value="site:<%= ActionMailer::Base.smtp_settings[:domain] %>" />
81
+ <input type="text" name="q" />
82
+ <%= submit_tag 'OK' %>
83
+ </div>
83
84
  </form>
84
85
  </div>
85
86
 
@@ -91,7 +92,7 @@
91
92
  </td>
92
93
  <td colspan="3">
93
94
  <b><font size="3">DIRECT DEMOCRACY</font></b>
94
- <br/>
95
+ <br />
95
96
  <font size="4">Web Ring</font>
96
97
  </td>
97
98
  </tr>
@@ -138,8 +139,8 @@
138
139
  <% end %>
139
140
 
140
141
  <h3 class="parent">
141
- <%= link_to textilize_without_paragraph(@elt.parent.subject), :id => @elt.parent \
142
- if @elt.parent %>
142
+ <%= link_to @elt.parent.subject, :id => @elt.parent \
143
+ if @elt.parent and @elt.parent_id != 'ROOT' %>
143
144
  </h3>
144
145
 
145
146
  <ul class="top">