archive/app/views/admin/archive_files/_feed.html.erb

83 lines
3.0 KiB
Plaintext
Raw Normal View History

<tr>
<td>
<%= feed.title %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(feed) %>
<li><a href="#" class="edit-feed" data-feed-id="<%= feed.id.to_s %>"><%= t(:edit) %></a></li>
<li><a href="/admin/archive_file/deletefeed?id=<%= feed.id.to_s %>" class="delete-feed text-error" ><%= t(:delete_) %></a></li>
<% end %>
</ul>
</div>
</td>
<td>
<div class="tags">
<div id="tags-list">
<ul class="tags-groups checkbox-card module-tags">
<% tags_to_remove = [] %>
<% feed.tag_ids.each do |t| %>
<% tag = Tag.find(t) rescue nil %>
<% if !tag.nil? %>
<li class="filter-item module">
<a href="#" onclick="return false;">
<% @site_in_use_locales.each_with_index do |locale,index| %>
<span class="tag"><%= tag.name_translations[locale] %></span>
<% if index < (@site_in_use_locales.count - 1) %>
/
<% end %>
<% end %>
</a>
</li>
<% else %>
<% tags_to_remove << t %>
<% end %>
<% end %>
<% if !tags_to_remove.blank?
tags_to_remove.each do |t|
feed.tag_ids.delete(t)
end
feed.save
end %>
</ul>
</div>
</div>
</td>
<td>
<div class="categories">
<div id="categories-list">
<ul class="tags-groups checkbox-card module-categories">
<% categories_to_remove = [] %>
<% feed.category_ids.each do |c| %>
<% category = Category.find(c) rescue nil %>
<% if !category.nil? %>
<li class="filter-item module">
<a href="#" onclick="return false;">
<% @site_in_use_locales.each_with_index do |locale,index| %>
<span class="tag"><%= category.title_translations[locale] %></span>
<% if index < (@site_in_use_locales.count - 1) %>
/
<% end %>
<% end %>
</a>
</li>
<% else %>
<% categories_to_remove << c %>
<% end %>
<% end %>
<% if !categories_to_remove.blank?
categories_to_remove.each do |c|
feed.category_ids.delete(c)
end
feed.save
end %>
</ul>
</div>
</div>
</td>
<td>
<a href="/xhr/archive_files/rssfeed/<%= feed.uid %>.rss" target="_blank">RSS Feed</a>
</td>
<td>
<a href="/xhr/archive_files/feed/<%= feed.uid %>.json" target="_blank">JSON Feed</a>
</td>
</tr>