added categories for authorizations
This commit is contained in:
parent
4f974b1427
commit
977d3a6191
|
@ -3,6 +3,7 @@ class Admin::AdBannersController < OrbitAdminController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@banners = Banner.all
|
@banners = Banner.all
|
||||||
|
@categories = @module_app.categories.collect{|c|[c.title, c.id]}
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
|
@ -2,6 +2,7 @@ class Banner
|
||||||
include Mongoid::Document
|
include Mongoid::Document
|
||||||
include Mongoid::Timestamps
|
include Mongoid::Timestamps
|
||||||
include OrbitTag::Taggable
|
include OrbitTag::Taggable
|
||||||
|
include OrbitCategory::Categorizable
|
||||||
|
|
||||||
field :ad_fx, type: String
|
field :ad_fx, type: String
|
||||||
field :height, type: Integer
|
field :height, type: Integer
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
<span class="banner_set">H:</span>
|
<span class="banner_set">H:</span>
|
||||||
<%= f.number_field :height, in: 10..1000, step: 10, class: 'input-mini', onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;", id: 'height' %>
|
<%= f.number_field :height, in: 10..1000, step: 10, class: 'input-mini', onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;", id: 'height' %>
|
||||||
|
|
||||||
|
<%= f.label :category_id, t('ad_banner.categories') %>
|
||||||
|
<%= f.select :category_id, @categories, {} %>
|
||||||
|
|
||||||
<%= f.label :ad_fx, t('ad_banner.effect') %>
|
<%= f.label :ad_fx, t('ad_banner.effect') %>
|
||||||
<%= f.select :ad_fx, Banner::FX_TYPES, {}, {class: 'ad_banner_ad_fx', id: 'ad_fx'} %>
|
<%= f.select :ad_fx, Banner::FX_TYPES, {}, {class: 'ad_banner_ad_fx', id: 'ad_fx'} %>
|
||||||
<p class="suckIE hide"><i class="icons-warning"></i> <%= t('ad_banner.no_ie_10_effect_support') %></p>
|
<p class="suckIE hide"><i class="icons-warning"></i> <%= t('ad_banner.no_ie_10_effect_support') %></p>
|
||||||
|
|
|
@ -21,6 +21,14 @@ module AdBanner
|
||||||
:priority=>1,
|
:priority=>1,
|
||||||
:active_for_action=>{'admin/ad_banners'=>"index"},
|
:active_for_action=>{'admin/ad_banners'=>"index"},
|
||||||
:available_for => 'users'
|
:available_for => 'users'
|
||||||
|
|
||||||
|
context_link 'categories',
|
||||||
|
:link_path=>"admin_module_app_categories_path" ,
|
||||||
|
:link_arg=>"{:module_app_id=>ModuleApp.find_by(:key=>'ad_banner').id}",
|
||||||
|
:priority=>3,
|
||||||
|
:active_for_action=>{'admin/ad_banners'=>'categories'},
|
||||||
|
:active_for_category => 'AdBanner',
|
||||||
|
:available_for => 'managers'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue