added categories for authorizations

This commit is contained in:
Harry Bomrah 2014-12-01 18:05:55 +08:00
parent 4f974b1427
commit 977d3a6191
4 changed files with 13 additions and 0 deletions

View File

@ -3,6 +3,7 @@ class Admin::AdBannersController < OrbitAdminController
def index
@banners = Banner.all
@categories = @module_app.categories.collect{|c|[c.title, c.id]}
end
def show

View File

@ -2,6 +2,7 @@ class Banner
include Mongoid::Document
include Mongoid::Timestamps
include OrbitTag::Taggable
include OrbitCategory::Categorizable
field :ad_fx, type: String
field :height, type: Integer

View File

@ -19,6 +19,9 @@
<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.label :category_id, t('ad_banner.categories') %>
<%= f.select :category_id, @categories, {} %>
<%= f.label :ad_fx, t('ad_banner.effect') %>
<%= 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>

View File

@ -21,6 +21,14 @@ module AdBanner
:priority=>1,
:active_for_action=>{'admin/ad_banners'=>"index"},
: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