From 85d6bbe1c9023be534d68072d019eed84fa6835e Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Wed, 11 Jul 2012 17:56:31 +0800 Subject: [PATCH] add i18n variable. fix web_links for disable category --- Gemfile.lock | 4 ---- .../announcement/back_end/bulletins_controller.rb | 3 +-- .../announcement/config/locales/zh_tw.yml | 3 ++- .../panel/news/back_end/news_bulletins_controller.rb | 3 +-- .../built_in_modules/news/config/locales/zh_tw.yml | 3 ++- .../web_resource/back_end/web_links_controller.rb | 12 ++++-------- 6 files changed, 10 insertions(+), 18 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5d74a545c..44c696169 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -109,7 +109,6 @@ GEM jquery-rails railties (>= 3.1.0) json (1.6.5) - libv8 (3.3.10.4) linecache19 (0.5.12) ruby_core_source (>= 0.1.4) mail (2.3.3) @@ -256,8 +255,6 @@ GEM sunspot_rails (1.3.3) nokogiri sunspot (= 1.3.3) - therubyracer (0.9.9) - libv8 (~> 3.3.10) thor (0.14.6) tilt (1.3.3) tinymce-rails (3.4.8) @@ -335,7 +332,6 @@ DEPENDENCIES spork sprockets sunspot-rails-tester - therubyracer tinymce-rails tire uglifier diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb index f6b7911d2..b7e824de9 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb @@ -144,8 +144,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController respond_to do |format| if @bulletin.save - # format.html { redirect_to(panel_announcement_back_end_bulletin_url(@bulletin), :notice => t('announcement.create_bulletin_success')) } - format.html { redirect_to(panel_announcement_back_end_bulletins_url, :notice => t('announcement.create_bulletin_success')) } + format.html { redirect_to(panel_announcement_back_end_bulletins_url, :notice => t('bulletin.create_bulletin_success')) } format.xml { render :xml => @bulletin, :status => :created, :location => @bulletin } format.js else diff --git a/vendor/built_in_modules/announcement/config/locales/zh_tw.yml b/vendor/built_in_modules/announcement/config/locales/zh_tw.yml index 55931284c..ab0086fb9 100644 --- a/vendor/built_in_modules/announcement/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/announcement/config/locales/zh_tw.yml @@ -79,7 +79,8 @@ zh_tw: fact_check: 公告審核 delete: 刪除 edit: 編輯 - + update_bulletin_success: 成功更新公告 + create_bulletin_success: 成功新增公告 # action: 行動 # add_language: 新增語言 # admin: 管理 diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb index 7e1195e91..302baf2b5 100644 --- a/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb +++ b/vendor/built_in_modules/news/app/controllers/panel/news/back_end/news_bulletins_controller.rb @@ -148,8 +148,7 @@ class Panel::News::BackEnd::NewsBulletinsController < OrbitBackendController respond_to do |format| if @news_bulletin.save - # format.html { redirect_to(panel_news_back_end_news_bulletin_url(@news_bulletin), :notice => t('news.create_news_bulletin_success')) } - format.html { redirect_to(panel_news_back_end_news_bulletins_url, :notice => t('news.create_news_bulletin_success')) } + format.html { redirect_to(panel_news_back_end_news_bulletins_url, :notice => t('news_bulletin.create_news_bulletin_success')) } format.xml { render :xml => @news_bulletin, :status => :created, :location => @news_bulletin } format.js else diff --git a/vendor/built_in_modules/news/config/locales/zh_tw.yml b/vendor/built_in_modules/news/config/locales/zh_tw.yml index 9d0030d2c..15e5be17c 100644 --- a/vendor/built_in_modules/news/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/news/config/locales/zh_tw.yml @@ -77,7 +77,8 @@ zh_tw: edit: 編輯 update_success: 分類更新成功 update_failed: 分類更新失敗 - + create_news_bulletin_success: 新增新聞成功 + update_success: 更新新聞成功 # action: 行動 # add_language: 新增語言 diff --git a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb index 8189a05e1..40db805fa 100644 --- a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb +++ b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb @@ -3,6 +3,9 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController before_filter :authenticate_user! # before_filter :for_app_manager,:except => [:index,:show] before_filter :for_app_sub_manager,:except => [:index] + before_filter :only => [ :new,:edit,:update] do |controller| + controller.get_categorys('WebLinkCategory') + end def index @@ -43,8 +46,6 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController # GET /web_links/1.xml def show @web_link = WebLink.find(params[:id]) - # get_categorys - respond_to do |format| format.html # show.html.erb format.xml { render :xml => @web_link } @@ -54,12 +55,8 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController # GET /web_links/new # GET /web_links/new.xml def new - @web_link = WebLink.new - - get_categorys - - get_tags + get_tags respond_to do |format| format.html # new.html.erb @@ -70,7 +67,6 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController # GET /web_links/1/edit def edit @web_link = WebLink.find(params[:id]) - get_categorys get_tags end