Hide Approval button when bulletin is checked.
This commit is contained in:
parent
6b151b1fb6
commit
382932036d
|
@ -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 %>
|
||||
|
|
Loading…
Reference in New Issue