Add category disable function

This commit is contained in:
Bernie Chiu 2013-08-28 11:24:10 +08:00 committed by chris
parent 47301de00d
commit ee416dec58
5 changed files with 17 additions and 30 deletions

View File

@ -12,4 +12,9 @@ include ActionView::Helpers::UrlHelper
link_to t(:category_auth),admin_object_auth_ob_auth_path(oa) link_to t(:category_auth),admin_object_auth_ob_auth_path(oa)
end end
def show_toggle_dictionary_btn(dictionary_vocab_category)
trans_path = "dictionary.backend"
return dictionary_vocab_category.disable ? t("#{trans_path}.close") : t("#{trans_path}.open")
end
end end

View File

@ -5,6 +5,7 @@
<ul class="nav nav-pills hide"> <ul class="nav nav-pills hide">
<% if is_admin?%> <% if is_admin?%>
<li><%= link_to t(:edit), edit_panel_dictionary_back_end_dictionary_vocab_category_path(dictionary_vocab_category), :remote => true %></li> <li><%= link_to t(:edit), edit_panel_dictionary_back_end_dictionary_vocab_category_path(dictionary_vocab_category), :remote => true %></li>
<li><%= link_to show_toggle_dictionary_btn(dictionary_vocab_category) , panel_dictionary_back_end_dictionary_vocab_category_path(dictionary_vocab_category), :confirm => t(:sure?), :method => :delete, :remote => true, :class=> "dictionary_toggle" %></li>
<% end %> <% end %>
<%if is_manager? || is_admin? %> <%if is_manager? || is_admin? %>
<li><%= show_anc_cate_permission_link(dictionary_vocab_category) %></li> <li><%= show_anc_cate_permission_link(dictionary_vocab_category) %></li>

View File

@ -0,0 +1 @@
$("#<%= dom_id @dictionary_vocab_category %>").find(".dictionary_toggle").text("<%= show_toggle_archive_btn(@dictionary_vocab_category) %>");

View File

@ -1,18 +1,10 @@
en: en:
archive:
archive: Archive
Title: Title
Files: Files
Category: Category
frontend:
archive: Archive Frontend
widget:
index: Archive Widget
en:
dictionary: dictionary:
backend:
close: Close
open: Open
update:
success_: Update Success
frontend: frontend:
dictionary: Dictionary Frontend dictionary: Dictionary Frontend
dictionary: Dictionary dictionary: Dictionary

View File

@ -1,22 +1,10 @@
zh_tw: zh_tw:
archive:
archive: 檔案室
Title: 標題
Files: 檔案
Category: 類別
frontend:
archive: 檔案室前台
widget:
index: 檔案室Widget
mongoid:
attributes:
archive_file:
sort_number: 排序數
zh_tw:
dictionary: dictionary:
backend:
close: 關閉
open: 開啟
update:
success_: 更新成功
frontend: frontend:
dictionary: 字典前台 dictionary: 字典前台
dictionary: 字彙辭典 dictionary: 字彙辭典