Hide Approval button when bulletin is checked.

This commit is contained in:
Matthew K. Fu JuYuan authored and Christophe Vilayphiou committed 2012-04-30 00:24:11 +08:00
1 parent 6b151b1fb6
commit 382932036d
2 files changed
+10 -1

No files matched your search

@@ -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
@@ -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 %>