From 9987e4290b80f15fc588d929486e0c9d00648180 Mon Sep 17 00:00:00 2001 From: manson Date: Tue, 13 May 2014 15:07:50 +0800 Subject: [PATCH] Update category, tag and some translations --- app/helpers/orbit_backend_helper.rb | 4 +-- app/views/admin/tags/_tag_form.html.erb | 16 +++++------ app/views/admin/tags/index.html.erb | 2 +- config/initializers/orbit_tag.rb | 4 +-- config/locales/new_ui.zh_tw.yml | 2 +- config/locales/zh_tw.yml | 37 +++++++++++++++++++++++++ 6 files changed, 51 insertions(+), 14 deletions(-) diff --git a/app/helpers/orbit_backend_helper.rb b/app/helpers/orbit_backend_helper.rb index 3b19e6d..1dca626 100644 --- a/app/helpers/orbit_backend_helper.rb +++ b/app/helpers/orbit_backend_helper.rb @@ -83,8 +83,8 @@ module OrbitBackendHelper render :partial => '/admin/categories/select_form', :locals => {:f=> f, :module_app=>module_app, :categories=>module_app.categories.enabled } end - def select_tag(f, module_app, object) - render :partial => '/admin/tags/tag_form', :locals => {:f=> f, :module_app=>module_app, :object=>object, :tags=>module_app.tags } + def select_tag(f, module_app) + render :partial => '/admin/tags/tag_form', :locals => {:f=> f, :module_app=>module_app, :tags=>module_app.tags } end end diff --git a/app/views/admin/tags/_tag_form.html.erb b/app/views/admin/tags/_tag_form.html.erb index 2e675bc..b3350d3 100644 --- a/app/views/admin/tags/_tag_form.html.erb +++ b/app/views/admin/tags/_tag_form.html.erb @@ -1,12 +1,12 @@ -
- + +
<% tags.each do |tag| %> -
+
+ @@ -53,8 +53,8 @@ type : "post", data: $("input[name^='tag']").serialize(), }).done(function(data){ - $("#select_tags").append(''); + $("#select_tags .controls").append(''); $("#add_tag_btn").css("margin-left", "180px"); $('#tagModal').modal('hide'); }); diff --git a/app/views/admin/tags/index.html.erb b/app/views/admin/tags/index.html.erb index f341a3d..8064504 100644 --- a/app/views/admin/tags/index.html.erb +++ b/app/views/admin/tags/index.html.erb @@ -46,7 +46,7 @@ <% if @is_module_tag %>
- + <%= form_tag add_from_default_admin_module_app_tags_path(:module_app_id=>@module_app.id), id: "filter-default-tag", method: :post, remote: true do %>
    diff --git a/config/initializers/orbit_tag.rb b/config/initializers/orbit_tag.rb index 4a23af1..8a0e2fd 100644 --- a/config/initializers/orbit_tag.rb +++ b/config/initializers/orbit_tag.rb @@ -1,11 +1,11 @@ OrbitApp.registration "Tag", type: 'ModuleApp' do - module_label 'module_name.tag' + module_label 'tag' base_url File.expand_path File.dirname(__FILE__) authorizable side_bar do - head_label_i18n 'module_name.tag', icon_class: "icons-tag" + head_label_i18n 'tags', icon_class: "icons-tag" head_link_path "admin_tags_path" active_for_controllers (['admin/tags']) diff --git a/config/locales/new_ui.zh_tw.yml b/config/locales/new_ui.zh_tw.yml index 88b4028..048b828 100644 --- a/config/locales/new_ui.zh_tw.yml +++ b/config/locales/new_ui.zh_tw.yml @@ -74,4 +74,4 @@ zh_tw: category: 更新類別時發生錯誤 tag: 更新標籤時發生錯誤 url_alt: 註解 - use_default: Use Default + use_default: 使用預設 diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index c06ab0a..4cfb3be 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -28,6 +28,42 @@ zh_tw: password: 密碼 all: 全部 add: 新增 + basic: 基本 + title: 標題 + url: 網址 + description: 描述 + new_: 新增 + category: 類別 + categories: 類別 + new_category: 新增類別 + tags: 標籤 + new_tag: 新增標籤 + authorization: 授權 + list_: 列表 + status: 狀態 + top: 置頂 + hot: 熱門 + hide: 隱藏 + is_top: 置頂 + is_hot: 熱門 + is_hidden: 隱藏 + close: 關閉 + clear: 清除 + create_: 建立 + start_date: 開始日期 + end_date: 結束日期 + last_modified: 最後修改者 + subtitle: 副標題 + content: 內容 + link: 連結 + file_: 檔案 + preview: 預覽 + image: 封面圖片 + member_: 成員 + help: 幫助 + frequency: 頻率 + edit: 編輯 + delete_: 刪除 site: system_preference: 系統狀態 @@ -66,5 +102,6 @@ zh_tw: register: 註冊 registered: 已註冊 + module: 模組 module_name: category: 類別