custom_announcement/app/views/admin/custom_announcements/_feed.html.erb

51 lines
1.8 KiB
Plaintext

<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/custom_announcement/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>
<a href="/xhr/custom_announcements/rssfeed/<%= feed.uid %>.rss" target="_blank">RSS Feed</a>
</td>
<td>
<a href="/xhr/custom_announcements/feed/<%= feed.uid %>.json" target="_blank">JSON Feed</a>
</td>
</tr>