Sha256: c4a0b9ad89838ebbf8f8a1d7fd0430f448c7549f747a12b75d45020641566e24

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

<% p = params.dup %>
<% if Alchemy::Picture.tag_counts.any? %>
  <h2><%= _t("Filter by tag") %></h2>
  <%= js_filter_field '#tag_list li' %>
  <ul>
    <% Alchemy::Picture.tag_counts.each do |t| %>
      <% picture_tags = filtered_by_tag?(t) ? tag_filter(remove: t) : tag_filter(add: t) %>
      <%= content_tag 'li', name: t.name, class: p[:tagged_with].try(:split, ',').try(:include?, t.name) ? 'active' : nil do %>
        <%= link_to(
          "#{t.name} (#{t.count})",
          url_for(
            p.delete_if { |k, v| k == "page" }.merge(
              action: 'index',
              tagged_with: picture_tags
            )
          ),
          remote: request.xhr?,
          class: 'please_wait'
        ) %>
      <% end %>
    <% end %>
  </ul>
  <% if p[:tagged_with].present? %>
    <%= link_to(
      render_icon('delete-small') + _t('Remove tag filter'),
      url_for(p.delete_if { |k, v| k == "tagged_with" }.merge(action: 'index')),
      remote: request.xhr?,
      class: 'button small with_icon please_wait'
    ) %>
  <% end %>
<% end %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
alchemy_cms-2.6.3 app/views/alchemy/admin/pictures/_tag_list.html.erb
alchemy_cms-2.6.2.1 app/views/alchemy/admin/pictures/_tag_list.html.erb
alchemy_cms-2.6.2 app/views/alchemy/admin/pictures/_tag_list.html.erb
alchemy_cms-2.6.1 app/views/alchemy/admin/pictures/_tag_list.html.erb
alchemy_cms-2.6.0 app/views/alchemy/admin/pictures/_tag_list.html.erb
alchemy_cms-2.6.0.rc5 app/views/alchemy/admin/pictures/_tag_list.html.erb