diff --git a/app/controllers/admin/categories_controller.rb b/app/controllers/admin/categories_controller.rb index 0b35aba3..8218fbcb 100644 --- a/app/controllers/admin/categories_controller.rb +++ b/app/controllers/admin/categories_controller.rb @@ -1,12 +1,6 @@ class Admin::CategoriesController < OrbitBackendController - # TODO = put back ======================== - # before_filter :force_order_for_visitor, only: [:index] - # before_filter :force_order_for_user, except: [:index] - # before_filter :for_app_sub_manager, except: [:index] - # ======================================== - before_filter :setup_vars - # ======================================== + open_for_manager def index @categories = get_categories_for_index diff --git a/app/controllers/admin/items_controller.rb b/app/controllers/admin/items_controller.rb index e364acb1..4225a0e5 100644 --- a/app/controllers/admin/items_controller.rb +++ b/app/controllers/admin/items_controller.rb @@ -2,12 +2,7 @@ class Admin::ItemsController < OrbitBackendController layout "structure" - # TODO = put back ======================== - # before_filter :authenticate_user! - # before_filter :find_parent_item - # before_filter :is_admin? - # before_filter :set_current_item - #========================================= + open_for_admin def index if params[:item_id] diff --git a/app/controllers/admin/module_tags_controller.rb b/app/controllers/admin/module_tags_controller.rb index 653b88b9..0e5ba19f 100644 --- a/app/controllers/admin/module_tags_controller.rb +++ b/app/controllers/admin/module_tags_controller.rb @@ -1,13 +1,7 @@ class Admin::ModuleTagsController < OrbitBackendController include OrbitTag::Merging - # TODO = put back ======================== - # before_filter :force_order_for_visitor, only: [:index] - # before_filter :force_order_for_user, except: [:index] - # before_filter :for_app_sub_manager, except: [:index] - # ======================================== - before_filter :setup_vars - # ======================================== + open_for_manager helper 'admin/tags' @@ -33,6 +27,7 @@ class Admin::ModuleTagsController < OrbitBackendController redirect_to admin_module_tags_url(module_app_id: @module_app_id) else @tag = ModuleTag.new(params[:module_tag]) + flash.now[:error] = t('create.error.tag') render :action => "new" end end @@ -42,6 +37,7 @@ class Admin::ModuleTagsController < OrbitBackendController if @tag.update_attributes(params[:module_tag]) redirect_to admin_module_tags_url(module_app_id: @module_app_id) else + flash.now[:error] = t('update.error.tag') render :action => "edit" end end diff --git a/app/controllers/admin/tags_controller.rb b/app/controllers/admin/tags_controller.rb index e4f437f3..3baf8651 100644 --- a/app/controllers/admin/tags_controller.rb +++ b/app/controllers/admin/tags_controller.rb @@ -1,5 +1,7 @@ class Admin::TagsController < OrbitBackendController include OrbitTag::Merging + + open_for_manager def index @tags = @module_app.module_tags diff --git a/app/views/admin/tags/_index.html.erb b/app/views/admin/tags/_index.html.erb index 74c7fe11..382b045b 100644 --- a/app/views/admin/tags/_index.html.erb +++ b/app/views/admin/tags/_index.html.erb @@ -16,14 +16,14 @@

<%= t(:default) %> <%= @tags.count %>

<% @module_apps.each do |module_app| %> <% tags = module_app.module_tags %> <% icon_name = get_module_app_icon(module_app) %>

<%= module_app.title %> <%= tags.count %>

<% end %>
diff --git a/app/views/admin/tags/_module_tag.html.erb b/app/views/admin/tags/_module_tag.html.erb deleted file mode 100644 index a6147f75..00000000 --- a/app/views/admin/tags/_module_tag.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -
  • - <% unless defined?(in_module) && module_tag.is_default %> -

    - -

    - <%= hidden_field_tag "ids[]", module_tag.id, class: "tag_id" %> - <% end %> - <% if defined?(in_module) && module_tag.is_default %> - - <%= get_tagging_count(module_tag) %> - <%= show_names_slash(module_tag) %> - - <% else %> - <%= link_to edit_admin_tag_path(module_tag), class: "open-slide" do %> - <%= get_tagging_count(module_tag) %> - <%= show_names_slash(module_tag) %> - <% end %> - <% end %> -
  • \ No newline at end of file diff --git a/app/views/admin/tags/_tag.html.erb b/app/views/admin/tags/_tag.html.erb new file mode 100644 index 00000000..c76ed016 --- /dev/null +++ b/app/views/admin/tags/_tag.html.erb @@ -0,0 +1,19 @@ +
  • + <% unless defined?(in_module) && tag.is_default %> +

    + +

    + <%= hidden_field_tag "ids[]", tag.id, class: "tag_id" %> + <% end %> + <% if defined?(in_module) && tag.is_default %> + + <%= get_tagging_count(tag) %> + <%= show_names_slash(tag) %> + + <% else %> + <%= link_to edit_admin_tag_path(tag), class: "open-slide", data: {title: t('editing.tag')} do %> + <%= get_tagging_count(tag) %> + <%= show_names_slash(tag) %> + <% end %> + <% end %> +
  • \ No newline at end of file diff --git a/config/locales/new_ui.en.yml b/config/locales/new_ui.en.yml index 0b338819..c7b0746b 100644 --- a/config/locales/new_ui.en.yml +++ b/config/locales/new_ui.en.yml @@ -69,7 +69,7 @@ en: remove_default: Are you sure you want to remove the default tags? update: error: - tag: Error when updating category + category: Error when updating category tag: Error when updating tag url_alt: Alternative text use_default: Use Default \ No newline at end of file diff --git a/config/locales/new_ui.zh_tw.yml b/config/locales/new_ui.zh_tw.yml index 908cdf23..8e540554 100644 --- a/config/locales/new_ui.zh_tw.yml +++ b/config/locales/new_ui.zh_tw.yml @@ -69,7 +69,7 @@ zh_tw: remove_default: 您確定要移除此預設標籤嗎? update: error: - tag: 更新類別時發生錯誤 + category: 更新類別時發生錯誤 tag: 更新標籤時發生錯誤 url_alt: 註解 use_default: Use Default