diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index ebd2ece..8bdbd72 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -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) diff --git a/app/views/admin/announcements/_index.html.erb b/app/views/admin/announcements/_index.html.erb index b321dd3..dca66ce 100644 --- a/app/views/admin/announcements/_index.html.erb +++ b/app/views/admin/announcements/_index.html.erb @@ -16,14 +16,28 @@ <%= b.status_for_table %> - <%= b.category.title %> + + <%= b.category.title rescue "" %> + <% if (b.category.disable rescue false) %> + <%= t(:disabled) %> + <% end %> + <% if b.expired? %> <%= b.title %> <%= t(:expired) %> <% elsif !b.approved? %> - <%= b.title %> <%= t(:pending) %> + <% if (b.category.disable rescue false) %> + <%= b.title %> + <% else %> + <%= b.title %> + <% end %> + <%= t(:pending) %> <% else %> - <%= b.title %> + <% if (b.category.disable rescue false) %> + <%= b.title %> + <% else %> + <%= b.title %> + <% end %> <% end %>