From b0ef2b6957fdebefef2ec9ac85c11d55e5716c44 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 1 Aug 2012 20:07:54 +0800 Subject: [PATCH] Multi language and side bar update --- app/controllers/gridfs_controller.rb | 2 +- app/views/layouts/_side_bar.html.erb | 11 +++++++++++ config/locales/en.yml | 1 + config/locales/zh_tw.yml | 1 + .../panel/gallery/back_end/tags_controller.rb | 8 ++++++++ vendor/built_in_modules/gallery/config/routes.rb | 1 + 6 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/tags_controller.rb diff --git a/app/controllers/gridfs_controller.rb b/app/controllers/gridfs_controller.rb index 4be7ec17..b7f926b1 100644 --- a/app/controllers/gridfs_controller.rb +++ b/app/controllers/gridfs_controller.rb @@ -3,7 +3,7 @@ require 'mongo' class GridfsController < ActionController::Metal def serve - gridfs_path = env["PATH_INFO"].gsub("/gridfs/", "").force_encoding("UTF-8") + gridfs_path = (params[:path]+'.'+params[:format]).gsub("/gridfs/", "").force_encoding("UTF-8") begin gridfs_file = Mongo::GridFileSystem.new(Mongoid.database).open(gridfs_path, 'r') self.response_body = gridfs_file.read diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb index e0028938..2d15e037 100644 --- a/app/views/layouts/_side_bar.html.erb +++ b/app/views/layouts/_side_bar.html.erb @@ -67,6 +67,17 @@ <% end -%> <% end -%> +<%= content_tag :li, :class => active_for_controllers('orbit_galleries','tags') do -%> + <%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.orbit_gallery'), panel_gallery_back_end_orbit_gallery_path %> + + <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('orbit_gallery') ) do -%> + <%#= content_tag :li, link_to(t('admin.ad.all_banners'), admin_ad_banners_path), :class => active_for_action('ad_banners', 'index') %> + <%#= content_tag :li, link_to(t('admin.ad.new_banner'), new_admin_ad_banner_path), :class => active_for_action('ad_banners', 'new') %> + <%#= content_tag :li, link_to(t('admin.ad.new_image'), new_ad_image_admin_ad_banners_path), :class => active_for_action('ad_images', 'new') %> + <%= content_tag :li, link_to(t('gallery.tags'), panel_gallery_back_end_tags_path), :class => active_for_action('/panel/orbit_gallery/back_end/tags', 'index') %> + <%= content_tag :li, link_to(t('admin.module.authorization'),admin_module_app_manager_auth_proc_path(ModuleApp.first(conditions: {title: "orbit_gallery"}))), :class => active_for_app_auth('orbit_gallery') if (is_admin? rescue nil) %> + <% 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 -%> diff --git a/config/locales/en.yml b/config/locales/en.yml index 05ad2969..44bdcb6f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -86,6 +86,7 @@ en: object: "Access Denied for you don't have permission for this object" action: Action ad_banner: AD Banner + orbit_gallery: Gallery ad: sec_place_holder: Enter 3 if 3 sec ab_fx: FX diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 0306e5c4..c2e299f8 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -80,6 +80,7 @@ zh_tw: object: 拒絕存取因你不是網站管理者 action: 操作 ad_banner: 廣告輪播 + orbit_gallery: 活動花絮 ad: sec_place_holder: 3秒請輸入3 ab_fx: 轉場特效 diff --git a/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/tags_controller.rb b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/tags_controller.rb new file mode 100644 index 00000000..c115a159 --- /dev/null +++ b/vendor/built_in_modules/gallery/app/controllers/panel/gallery/back_end/tags_controller.rb @@ -0,0 +1,8 @@ +class Panel::Gallery::BackEnd::TagsController < Admin::TagsController + + def initialize + super + @app_title = 'orbit_gallery' + end + +end diff --git a/vendor/built_in_modules/gallery/config/routes.rb b/vendor/built_in_modules/gallery/config/routes.rb index d295f913..65de562d 100644 --- a/vendor/built_in_modules/gallery/config/routes.rb +++ b/vendor/built_in_modules/gallery/config/routes.rb @@ -18,6 +18,7 @@ Rails.application.routes.draw do match "set_cover" => "orbit_galleries#set_cover" match "delete_images" => "orbit_galleries#delete_images" match "update_album" => "orbit_galleries#update_album" + resources :tags end end end