Hide Approval button when bulletin is checked.

This commit is contained in:
Matthew K. Fu JuYuan 2012-04-27 11:44:41 +08:00 committed by Christophe Vilayphiou
parent 6b151b1fb6
commit 382932036d
2 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,9 @@
module Panel::Announcement::BackEnd::BulletinsHelper
def show_approval_link(bulletin)
by_bulletin = (!bulletin.is_expired? and !bulletin.is_checked?)
by_user = bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?
by_bulletin and by_user
end
end

View File

@ -43,7 +43,7 @@
</li>
<%#= debugger %>
<%#= a=1 %>
<% if (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?) and !bulletin.is_expired? %>
<% if show_approval_link(bulletin) %>
<li><%= link_to t('announcement.bulletin.approval'), edit_panel_announcement_back_end_bulletin_path(bulletin) %></li><%#= #TODO add ancher so user can quick access into that part %>
<% end %>
<% end %>