AdBanner i18n vars patch

This commit is contained in:
Matthew K. Fu JuYuan 2012-04-13 17:24:30 +08:00
parent 430b0fd9ae
commit d81ca40f90
5 changed files with 20 additions and 5 deletions

View File

@ -39,8 +39,10 @@ class Admin::AdBannersController < ApplicationController
redirect_to admin_ad_banners_url redirect_to admin_ad_banners_url
end end
def destroy_ad_image def realtime_preview
@ad_banner = AdBanner.find(params[:id])
@ad_banner.update_attributes(params[:ad_banner])
render
end end
def index def index

View File

@ -1,14 +1,14 @@
<script type="text/javascript" src="/static/jquery.cycle.all.latest.js"></script> <script type="text/javascript" src="/static/jquery.cycle.all.latest.js"></script>
<div class="tab-pane <%= "active" if ad_banner_tab==@active %>" id=<%= ad_banner_tab.title %>> <div class="tab-pane <%= "active" if ad_banner_tab==@active %>" id=<%= ad_banner_tab.title %>>
<p>尺寸</p> <p><%= t("admin.ad.banner_best_size") %></p>
<%= form_for ad_banner_tab,:url=> admin_ad_banner_path(ad_banner_tab),:method => :put,:class=>"input-medium" do |f| -%> <%= form_for ad_banner_tab,:url=> admin_ad_banner_path(ad_banner_tab),:method => :put,:class=>"input-medium" do |f| -%>
<%= f.label :ad_fx, t('admin.ad.ab_fx') %> <%= f.label :ad_fx, t('admin.ad.ab_fx') %>
<%= f.select :ad_fx ,AdBanner::FX_TYPES %> <%= f.select :ad_fx ,AdBanner::FX_TYPES %>
<%= f.label :transition_sec, t('admin.ad.transition_sec') %> <%= f.label :transition_sec, t('admin.ad.transition_sec') %>
<%= f.text_field :transition_sec,:placeholder=>"3秒請輸入3000",:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %> <%= f.text_field :transition_sec,:placeholder=>"3秒請輸入3000",:class=> "span3" %> <%= t("admin.ad.trans_unit_sec") %>
<%= f.submit %> <%= f.submit t("admin.ad.update_banner") %>
<%= f.submit 'Cancel',:type=>'reset' %> <%= f.submit t("cancel"),:type=>'reset' %>
<div> <div>
<%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %> <%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %>
<%#= render :partial => 'new_add_banner_file', :object => ad_banner_tab.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %> <%#= render :partial => 'new_add_banner_file', :object => ad_banner_tab.ad_images.build, :locals => { :field_name => "new_ad_images[]", :f => f, :classes => "r_destroy" } %>

View File

@ -42,6 +42,16 @@ en:
admin: admin:
action: Action action: Action
ad_banner: AD Banner ad_banner: AD Banner
ad:
ab_fx: FX
all_banners: AdBanner list
banner_best_size: Banner Best Size
new_banner: New banner
new_image: New image
title: Title
transition_sec: Transition time
trans_unit_sec: sec
update_banner: Update Banner
add: Add add: Add
add_item: Add item add_item: Add item
add_language: Add language add_language: Add language

View File

@ -42,11 +42,13 @@ zh_tw:
ad: ad:
ab_fx: 轉場特效 ab_fx: 轉場特效
all_banners: 輪播清單 all_banners: 輪播清單
banner_best_size: Banner 尺寸
new_banner: 新增輪播 new_banner: 新增輪播
new_image: 新增橫幅 new_image: 新增橫幅
title: 標題 title: 標題
transition_sec: 轉場單位時間 transition_sec: 轉場單位時間
trans_unit_sec: trans_unit_sec:
update_banner: 更新輪播
add: 新增 add: 新增
add_item: 新增項目 add_item: 新增項目
add_language: 新增語言 add_language: 新增語言

View File

@ -26,6 +26,7 @@ Orbit::Application.routes.draw do
resources :ad_banners do resources :ad_banners do
match 'preview/:id' => 'ad_banners#realtime_preview',:as => :realtime_preview,:via => :put
collection do collection do
match 'new_ad_image' => 'ad_images#new',:as => :new_ad_image,:via => :get match 'new_ad_image' => 'ad_images#new',:as => :new_ad_image,:via => :get
match 'new_ad_image' => 'ad_images#create',:as => :create_ad_image,:via => :post match 'new_ad_image' => 'ad_images#create',:as => :create_ad_image,:via => :post