%= link_to image_tag("/images/feed-icon-28x28.png"),
{ :action => 'rss', :id => @elt }, :class => 'feed' %>
<%= _('Latest posts') %>
<%e_pages = ActionController::Pagination::Paginator.new(
self, countEltsAboveFilter, LIST_LENGTH, params['page'])
elts = Elt.find_by_sql " \
SELECT SUM(value) AS resultLocal, elts.id, parent_id, elts.created_on, parent_id, \
elts_count, position, elts.person_id, subject, body, lft, rgt \
FROM elts \
LEFT JOIN choices ON choices.elt_id = elts.id \
WHERE lft > #{@elt.lft} AND rgt < #{@elt.rgt} \
GROUP BY elts.id, parent_id, elts.created_on, parent_id, elts_count, \
position, elts.person_id, subject, body, lft, rgt \
HAVING SUM(value) >= #{filter||-10**10} \
ORDER BY created_on DESC \
LIMIT #{e_pages.items_per_page} \
OFFSET #{e_pages.current.offset}" %>
<% if e_pages.length > 1 %>
<%= link_to_remote('|<',
{ :update => 'listByDate',
:url => { :action => 'listByDate', :id => @elt, :page => e_pages.last },
:before => visual_effect(:BlindUp, 'listByDate', { :queue => 'end' }),
:loaded => visual_effect(:BlindDown, 'listByDate', { :queue => 'end' }) }) \
if e_pages.last != e_pages.current %>
<%= link_to_remote('<',
{ :update => 'listByDate',
:url => { :action => 'listByDate', :id => @elt, :page => e_pages.current.next },
:before => visual_effect(:BlindUp, 'listByDate', { :queue => 'end' }),
:loaded => visual_effect(:BlindDown, 'listByDate', { :queue => 'end' }) }) \
if e_pages.current.next and e_pages.current.next != e_pages.last %>
<%= e_pages.length-e_pages.current.to_i+1 %>
<%= link_to_remote('>',
{ :update => 'listByDate',
:url => { :action => 'listByDate', :id => @elt, :page => e_pages.current.previous },
:before => visual_effect(:BlindUp, 'listByDate', { :queue => 'end' }),
:loaded => visual_effect(:BlindDown, 'listByDate', { :queue => 'end' }) }) \
if e_pages.current.previous and e_pages.current.previous != e_pages.first %>
<%= link_to_remote('>|',
{ :update => 'listByDate',
:url => { :action => 'listByDate', :id => @elt, :page => e_pages.first },
:before => visual_effect(:BlindUp, 'listByDate', { :queue => 'end' }),
:loaded => visual_effect(:BlindDown, 'listByDate', { :queue => 'end' }) }) \
if e_pages.first != e_pages.current %>
<% end %>
<% elts.each do |elt| %>
-
<%= elt.created_on.strftime '%d/%m %H:%M' %>
<%= link_to_remote("%+d" % elt.resultlocal,
{ :update => 'resultList_'+elt.id,
:position => :top,
:url => { :action => 'choices', :id => elt } },
{ :class => 'result', :id => "resultList_#{ elt.id}",
:href => url_for(:controller => 'elt', :action => 'choices', :id => elt) }
) if elt.resultlocal %>
<% if elt.person %>
<<%= link_to elt.person.name, :controller => 'person', :action => 'show', :id => elt.person %>>
<% elsif not displayTitle? elt %>
<<%= ANONYMOUS_POSTER %>>
<% end %>
<%= link_to elt.subject.gsub(/\[.*\]/, ''), :action => 'show', :id => elt %>
<% end %>