starting ad_banner auth
This commit is contained in:
parent
c35cd2e3a6
commit
f663985a40
|
@ -12,5 +12,15 @@ module Admin::AdBannerHelper
|
||||||
printable_ad_images.shuffle!
|
printable_ad_images.shuffle!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show_ad_banner_permission_link(ad_banner)
|
||||||
|
type = 'edit'
|
||||||
|
oa = ad_banner.get_object_auth_by_title(type)
|
||||||
|
if oa.nil?
|
||||||
|
ad_banner.object_auths.new(title: type ).save
|
||||||
|
oa = ad_banner.get_object_auth_by_title(type)
|
||||||
|
end
|
||||||
|
# link_to t('announcement.bulletin.cate_auth'), edit_admin_object_auth_path(oa)
|
||||||
|
link_to t('admin.ad.cate_auth'),admin_object_auth_ob_auth_path(oa)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -20,6 +20,9 @@
|
||||||
<ul class="clear">
|
<ul class="clear">
|
||||||
<%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %>
|
<%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %>
|
||||||
</ul>
|
</ul>
|
||||||
|
<% if is_manager? || is_admin? %>
|
||||||
|
<%= show_ad_banner_permission_link ad_banner_tab%>
|
||||||
|
<% end -%>
|
||||||
<%#= render :partial => 'new_add_banner_file', :object => ad_banner_tab.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %>
|
<%#= render :partial => 'new_add_banner_file', :object => ad_banner_tab.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %>
|
||||||
</div>
|
</div>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
|
@ -84,6 +84,7 @@ zh_tw:
|
||||||
sec_place_holder: 3秒請輸入3
|
sec_place_holder: 3秒請輸入3
|
||||||
ab_fx: 轉場特效
|
ab_fx: 轉場特效
|
||||||
all_banners: 輪播清單
|
all_banners: 輪播清單
|
||||||
|
cate_auth: 分類授權
|
||||||
banner_best_size: Banner 尺寸
|
banner_best_size: Banner 尺寸
|
||||||
new_banner: 新增輪播
|
new_banner: 新增輪播
|
||||||
new_image: 新增橫幅
|
new_image: 新增橫幅
|
||||||
|
|
|
@ -2,7 +2,7 @@ module Panel::Announcement::BackEnd::BulletinsHelper
|
||||||
|
|
||||||
def show_approval_link(bulletin)
|
def show_approval_link(bulletin)
|
||||||
by_bulletin = (!bulletin.is_expired? and !bulletin.is_checked?)
|
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_user = (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager? or is_admin?)
|
||||||
by_bulletin and by_user
|
by_bulletin and by_user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Reference in New Issue