category fix

This commit is contained in:
Harry Bomrah 2014-12-11 17:42:26 +08:00
parent f90d7a4997
commit 6e6b1c9689
2 changed files with 19 additions and 3 deletions

View File

@ -82,6 +82,8 @@ class AnnouncementsController < ApplicationController
return {}
end
return {} if announcement.category.disable
tags = announcement.tags.map{|tag| {
"tag" => tag.name ,
"url" => OrbitHelper.page_for_tag(tag)

View File

@ -16,14 +16,28 @@
<td>
<%= b.status_for_table %>
</td>
<td><%= b.category.title %></td>
<td>
<%= b.category.title rescue "" %>
<% if (b.category.disable rescue false) %>
<span class='label'><%= t(:disabled) %></span>
<% end %>
</td>
<td>
<% if b.expired? %>
<%= b.title %> <span class='label'><%= t(:expired) %></span>
<% elsif !b.approved? %>
<a href="<%=page_for_bulletin(b)%>" target="_blank"><%= b.title %></a> <span class='label'><%= t(:pending) %></span>
<% if (b.category.disable rescue false) %>
<%= b.title %>
<% else %>
<a href="<%=page_for_bulletin(b)%>" target="_blank"><%= b.title %></a>
<% end %>
<span class='label'><%= t(:pending) %></span>
<% else %>
<a href="<%=page_for_bulletin(b)%>" target="_blank"><%= b.title %></a>
<% if (b.category.disable rescue false) %>
<%= b.title %>
<% else %>
<a href="<%=page_for_bulletin(b)%>" target="_blank"><%= b.title %></a>
<% end %>
<% end %>
<div class="quick-edit">
<ul class="nav nav-pills">