<% items.each do |item| %>
<li id="" class="filer-item filer-item-<%= model.to_s.underscore -%>">
<div id="" class="filer-item-symbol">
- <% link = symbol['link'] || {'type' => 'action', 'name' => 'show'} %>
- <% path = case link['type'] %>
- <% when 'action' %>
- <% case link['name'] %>
- <% when 'show' %>
- <% polymorphic_path(item) %>
- <% else %>
- <% polymorphic_path(item, :action => link['name']) %>
- <% end %>
- <% when 'none' %>
- <% '' %>
- <% when 'url_column' %>
- <% item.__send__(link['name']).to_s %>
- <% else %>
- <% '' %>
- <% end %>
- <% str = case symbol_type %>
- <% when 'image' %>
- <% tag(:img, :src => symbol['name'], :width => 64, :height => 64) %>
- <% when 'picture' %>
- <% tag(:img, item.__send__(symbol['name'])) %>
- <% when 'template' %>
- <%= render path_name + '/' + symbol['name'], :item => item %>
- <% nil %>
- <% else %>
- <% 'no.png' %>
- <% end %>
- <% unless str.blank? %>
- <%= link_to_unless path.blank?, str, path %>
- <% end %>
+ <%= filer.symbol item, self %>
+ </div>
+ <div id="" class="filer-item-caption">
+ <%= filer.caption item, self %>
+ </div>
+ <div id="" class="filer-item-summary">
+ <%= filer.summary item, self %>
</div>
- <% unless caption_type == 'none' %>
- <div id="" class="filer-item-caption">
- <% link = caption['link'] || {'type' => 'action', 'name' => 'show'} %>
- <% path = case link['type'] %>
- <% when 'action' %>
- <% case link['name'] %>
- <% when 'show' %>
- <% polymorphic_path(item) %>
- <% else %>
- <% polymorphic_path(item, :action => link['name']) %>
- <% end %>
- <% when 'none' %>
- <% '' %>
- <% when 'url_column' %>
- <% item.__send__(link['name']).to_s %>
- <% else %>
- <% polymorphic_path(item) %>
- <% end %>
- <% str = case caption_type %>
- <% when 'column' %>
- <% item.attributes[caption['name']] %>
- <% when 'method' %>
- <% item.__send__(caption['name']).to_s %>
- <% else %>
- <% 'no caption' %>
- <% end %>
- <% str = 'no caption' if str.blank? %>
- <% unless str.blank? %>
- <%= link_to_unless path.blank?, str, path %>
- <% end %>
- </div>
- <% end %>
- <% unless summary_type == 'none' %>
- <div id="" class="filer-item-summary">
- <% case summary_type %>
- <% when 'template' %>
- <%= render path_name + '/' + summary['name'], :item => item %>
- <% else %>
- <% 'no config' %>
- <% end %>
- </div>
- <% end %>
<div id="" class="filer-item-icon">
- <%= link_to icon_tag(item.class.to_s, :object => item, :size => 64), polymorphic_path(item, :format => :prof) %>
+ <%= filer.icon item, self %>
</div>
<div id="" class="filer-item-date">
- <%= distance_of_time_in_words_to_now item.updated_at %>
+ <%= filer.date item, self %>
+ </div>
+ <div id="" class="filer-item-edit">
+ <%= filer.edit item, self %>
</div>
- <% unless edit_type == 'none' %>
- <div id="" class="filer-item-edit">
- <% case edit_type %>
- <% when 'default' %>
- <% if item.own? roles %>
- <%= link_to tag(:img, :src => asset_path('edit.png'), :width => 32, :height => 32), polymorphic_path(item, :action => :edit) %>
- <%= link_to tag(:img, :src => asset_path('remove.png'), :width => 32, :height => 32), item, confirm: 'Are you sure?', :method => :delete %>
- <% end %>
- <% when 'account' %>
- <% if item.own? roles %>
- <%= link_to tag(:img, :src => asset_path('edit.png'), :width => 32, :height => 32), '/home/configure' %>
- <% end %>
- <% when 'template' %>
- <%= render path_name + '/' + edit['name'], :item => item %>
- <% else %>
- <% 'no config' %>
- <% end %>
- </div>
- <% end %>
</li>
<% end %>
</ul>