fix ad_image size hints. fix orbit backend controller error when changing language.

This commit is contained in:
Matthew K. Fu JuYuan 2012-05-16 17:16:48 +08:00
parent befd3bcdec
commit 0647698012
5 changed files with 5 additions and 1 deletions

View File

@ -13,6 +13,7 @@ class OrbitBackendController< ApplicationController
def setup_vars def setup_vars
@app_title = request.fullpath.split('/')[2] @app_title = request.fullpath.split('/')[2]
@app_title = request.fullpath.split('/')[1] if(@app_title == "back_end") @app_title = request.fullpath.split('/')[1] if(@app_title == "back_end")
@app_title.gsub!(/[?].*/,'')
@module_app = ModuleApp.first(conditions: {:key => @app_title} ) @module_app = ModuleApp.first(conditions: {:key => @app_title} )
end end

View File

@ -7,6 +7,7 @@ class AdBanner
field :title field :title
field :transition_msec,type: Integer field :transition_msec,type: Integer
field :ad_fx #TODO Design should explain field :ad_fx #TODO Design should explain
field :best_size,:default => ''
before_save :save_or_destroy before_save :save_or_destroy
validates_uniqueness_of :title validates_uniqueness_of :title

View File

@ -80,7 +80,7 @@
<!--請程式務必將圖片尺寸加入到行內裡--> <!--請程式務必將圖片尺寸加入到行內裡-->
<%= image_tag @ad_image.file rescue ''%> <%= image_tag @ad_image.file rescue ''%>
</div> </div>
<span class="alert widgetInfo">此區塊圖片尺寸請使用580px × 225px</span> <span class="alert widgetInfo"><%= 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?%></span>
<div class="controls file-upload input-prepend"> <div class="controls file-upload input-prepend">
<label class="control-label add-on btn" for="input-upload"> <label class="control-label add-on btn" for="input-upload">
<%= t(:browse) %> <%= t(:browse) %>

View File

@ -98,6 +98,7 @@ en:
transition_sec: Transition time transition_sec: Transition time
trans_unit_sec: sec trans_unit_sec: sec
update_banner: Update Banner update_banner: Update Banner
widget_info_for_ad_image_size: "Best size with: %{best_size}"
add: Add add: Add
add_item: Add item add_item: Add item
add_language: Add language add_language: Add language

View File

@ -94,6 +94,7 @@ zh_tw:
transition_sec: 轉場單位時間 transition_sec: 轉場單位時間
trans_unit_sec: trans_unit_sec:
update_banner: 更新輪播 update_banner: 更新輪播
widget_info_for_ad_image_size: "此區塊圖片尺寸請使用 %{best_size}"
add: 新增 add: 新增
add_item: 新增項目 add_item: 新增項目
add_language: 新增語言 add_language: 新增語言