Sha256: 4ceea1057a91c2925a61aa38ea8c70979cafcec8116e28671f6c2e4dfd4507bc

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

<h3 class="boxTitle"><%= _('Subscribers') %></h3>

<% subscribers = Person.find :all,
  :select => 'people.id, people.name, MIN(subscriptions.created_on) AS created_on, MAX(filter) AS filter',
  :joins => "JOIN subscriptions ON people.id = subscriptions.person_id \
    JOIN elts elts ON subscriptions.elt_id = elts.id
      AND ((#{@elt.lft} <= elts.lft AND elts.rgt <= #{@elt.rgt}) \
        OR (elts.lft < #{@elt.lft} AND #{@elt.rgt} < elts.rgt))",
  :group => [ 'people.id, ', 'people.name' ],
  :order => 'MIN(subscriptions.created_on) DESC' %>

<% subscribers.each do |s| %>
  <span class="author">
    <%= link_to s.name, :controller => 'person', :action => 'show', :id => s.id %>
  </span>
  <span class="filter"><%= "(#{ s.filter })" if s.filter %></span>
<% end %>

<div id="subscriptionLink" class="boxLineR"
  <%= "style='display: none'" unless session[:person] %> >
  <%= link_to_remote _('Add/remove me!'),
    :update => 'listSubscribers',
    :url => { :controller => 'subscriber', :action => 'subscribe', :id => @elt },
    :before => visual_effect(:BlindUp, 'listSubscribers', { :queue => 'end' }),
    :loaded => visual_effect(:BlindDown, 'listSubscribers', { :queue => 'end' }) %>
</div>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
parlement-0.14 app/views/elt/list/_subscribers.rhtml
parlement-0.13 app/views/subscriber/_list.rhtml