Add tags to assets

This commit is contained in:
Christophe Vilayphiou 2012-05-16 18:19:41 +08:00
parent 617a683d00
commit 9129835f23
5 changed files with 25 additions and 1 deletions
app
controllers/admin
helpers/admin
models
views/layouts
config

View File

@ -0,0 +1,8 @@
class Admin::AssetTagsController < Admin::TagsController
def initialize
super
@app_title = 'asset'
end
end

View File

@ -20,7 +20,7 @@ module Admin::DashboardHelper
when 'news_bulletin' when 'news_bulletin'
panel_news_front_end_news_bulletin_path(object) panel_news_front_end_news_bulletin_path(object)
when'page_context' when'page_context'
panel_page_content_front_end_page_context_path(object) "/#{object.page.path}"
when'web_link' when'web_link'
panel_web_resource_front_end_web_link_path(object) panel_web_resource_front_end_web_link_path(object)
end end

5
app/models/asset_tag.rb Normal file
View File

@ -0,0 +1,5 @@
class AssetTag < Tag
has_and_belongs_to_many :assets
end

View File

@ -67,3 +67,13 @@
<%= content_tag :li, link_to(t('announcement.tags'), panel_web_resource_back_end_tags_path), :class => active_for_action('/panel/web_resource/back_end/tags', 'index') %> <%= content_tag :li, link_to(t('announcement.tags'), panel_web_resource_back_end_tags_path), :class => active_for_action('/panel/web_resource/back_end/tags', 'index') %>
<% end -%> <% end -%>
<% end -%> <% end -%>
<%= content_tag :li, :class => active_for_controllers('assets', '/admin/asset_tags', 'asset_categories') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.asset'), admin_assets_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('assets', '/admin/asset_tags', 'asset_categories')) do -%>
<%= content_tag :li, link_to(t('admin.all_assets'), admin_assets_path), :class => active_for_action('assets', 'index') %>
<%= content_tag :li, link_to(t('admin.add_new'), new_admin_asset_path), :class => active_for_action('assets', 'new') %>
<%= content_tag :li, link_to(t('admin.categories'), admin_asset_categories_path), :class => active_for_action('asset_categories', 'index') %>
<%= content_tag :li, link_to(t('admin.tags'), admin_asset_tags_path), :class => active_for_action('/admin/asset_tags', 'index') %>
<% end -%>
<% end -%>

View File

@ -19,6 +19,7 @@ Orbit::Application.routes.draw do
end end
end end
resources :asset_categories resources :asset_categories
resources :asset_tags
resources :app_auths resources :app_auths
resources :object_auths do resources :object_auths do
match 'new_interface/:ob_type/:title/new' => "object_auths_new_interface#new" ,:as => :init_ob_auth,:via => :get match 'new_interface/:ob_type/:title/new' => "object_auths_new_interface#new" ,:as => :init_ob_auth,:via => :get