will display merged category

This commit is contained in:
Harry Bomrah 2016-04-12 14:23:43 +08:00
parent 091bdf271f
commit 0931662e3c
2 changed files with 6 additions and 0 deletions

View File

@ -14,4 +14,9 @@ class SiteFeed
scope :enabled, ->{where(:disabled => false)} scope :enabled, ->{where(:disabled => false)}
def category
Category.find(self.merge_with_category) rescue nil
end
end end

View File

@ -51,6 +51,7 @@
<ul class="channel-sublist"> <ul class="channel-sublist">
<li class="channel-subitem" > <li class="channel-subitem" >
<span class="channel-feedname"><%= channel.feed_name %></span> <span class="channel-feedname"><%= channel.feed_name %></span>
<span class="label label-info"><%= channel.category.title rescue "" %></span>
<span class="channel-actions"> <span class="channel-actions">
<button class="btn <%= channel.disabled ? "btn-info" : "btn-warning" %> btn-small disable-feed-btn" data-feed-id="<%= channel.id.to_s %>"><%= channel.disabled ? "Enable" : "Disable" %></button> <button class="btn <%= channel.disabled ? "btn-info" : "btn-warning" %> btn-small disable-feed-btn" data-feed-id="<%= channel.id.to_s %>"><%= channel.disabled ? "Enable" : "Disable" %></button>
<button class="btn btn-danger btn-small unsubscribe-btn" data-feed-uid="<%= channel.feed_uid %>" data-feed-name="<%= channel.feed_name %>">Unsubscribe</button> <button class="btn btn-danger btn-small unsubscribe-btn" data-feed-uid="<%= channel.feed_uid %>" data-feed-name="<%= channel.feed_name %>">Unsubscribe</button>