From 064769801292fa974ab37d3cefb13ba75095de32 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Wed, 16 May 2012 17:16:48 +0800 Subject: [PATCH] fix ad_image size hints. fix orbit backend controller error when changing language. --- app/controllers/orbit_backend_controller.rb | 1 + app/models/ad_banner.rb | 1 + app/views/admin/ad_images/_form.html.erb | 2 +- config/locales/en.yml | 1 + config/locales/zh_tw.yml | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/orbit_backend_controller.rb b/app/controllers/orbit_backend_controller.rb index e27e5b00..98882ec3 100644 --- a/app/controllers/orbit_backend_controller.rb +++ b/app/controllers/orbit_backend_controller.rb @@ -13,6 +13,7 @@ class OrbitBackendController< ApplicationController def setup_vars @app_title = request.fullpath.split('/')[2] @app_title = request.fullpath.split('/')[1] if(@app_title == "back_end") + @app_title.gsub!(/[?].*/,'') @module_app = ModuleApp.first(conditions: {:key => @app_title} ) end diff --git a/app/models/ad_banner.rb b/app/models/ad_banner.rb index 6163a81f..18c6d448 100644 --- a/app/models/ad_banner.rb +++ b/app/models/ad_banner.rb @@ -7,6 +7,7 @@ class AdBanner field :title field :transition_msec,type: Integer field :ad_fx #TODO Design should explain + field :best_size,:default => '' before_save :save_or_destroy validates_uniqueness_of :title diff --git a/app/views/admin/ad_images/_form.html.erb b/app/views/admin/ad_images/_form.html.erb index be5f2b47..1513fa05 100644 --- a/app/views/admin/ad_images/_form.html.erb +++ b/app/views/admin/ad_images/_form.html.erb @@ -80,7 +80,7 @@ <%= image_tag @ad_image.file rescue ''%> - 此區塊圖片尺寸請使用580px × 225px + <%= t("admin.ad.widget_info_for_ad_image_size",:best_size=> @ad_image.ad_banner.best_size) if !@ad_image.ad_banner.best_size.empty?%>