Hide Approval button when bulletin is checked.
This commit is contained in:
parent
1c7c283083
commit
3fcb902663
|
@ -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
|
|
@ -39,7 +39,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 %>
|
||||
|
|
Reference in New Issue