diff --git a/app/controllers/admin/sites_controller.rb b/app/controllers/admin/sites_controller.rb index 723266a2..b73d66c3 100644 --- a/app/controllers/admin/sites_controller.rb +++ b/app/controllers/admin/sites_controller.rb @@ -35,6 +35,7 @@ class Admin::SitesController < ApplicationController @item = Item.find(params[:id]) @item.sitemap_enabled = !@item.sitemap_enabled @item.save + render :nothing => true end def system_info diff --git a/app/views/admin/sites/_sitemap_block.html.erb b/app/views/admin/sites/_sitemap_block.html.erb index 1981117c..37a8dc29 100644 --- a/app/views/admin/sites/_sitemap_block.html.erb +++ b/app/views/admin/sites/_sitemap_block.html.erb @@ -1,13 +1,13 @@
-

<%= sitemap_block.i18n_variable[I18n.locale] %>

- +

<%= sitemap_block.i18n_variable[I18n.locale] %>

+
\ No newline at end of file diff --git a/app/views/admin/sites/sitemap.html.erb b/app/views/admin/sites/sitemap.html.erb index a7ded89b..6e8d2cbe 100644 --- a/app/views/admin/sites/sitemap.html.erb +++ b/app/views/admin/sites/sitemap.html.erb @@ -17,14 +17,26 @@ isAnimated: true }); }); - $(document).on('click', '.onoff', function () { - $(this).parents("li").toggleClass("disabled"); - if($(this).parents("li").attr("class").indexOf("disabled") > 0){ - $(this).text('OFF') - } else { - $(this).text('ON') - } - $.getScript('admin_sites_path' + '/' + $(this).attr('id') + '/sitemap_toggle'); + $(document).on('click', 'li .onoff', function () { + $(this).parents("li").toggleClass("disabled"); + if($(this).parents("li").attr("class").indexOf("disabled") > 0){ + $(this).text("<%= t('off_upcase') %>") + } else { + $(this).text("<%= t('on_upcase') %>") + } + $.getScript('<%= admin_sites_path %>' + '/' + $(this).attr('id') + '/sitemap_toggle'); + }); + $(document).on('click', 'h4 .onoff', function () { + $(this).parents(".map-block").toggleClass("disabled"); + if($(this).parents("h4").parents("div").attr("class").indexOf("disabled") > 0){ + $(this).text("<%= t('off_upcase') %>") + $(this).parents(".map-block").find('li').addClass('disabled') + $(this).parents(".map-block").find('button').text("<%= t('off_upcase') %>") + } else { + $(this).text("<%= t('on_upcase') %>") + $(this).parents(".map-block").find('li').removeClass('disabled') + $(this).parents(".map-block").find('button').text("<%= t('on_upcase') %>") + } }); <% end %> \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 06f7ae64..508adf4c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -33,6 +33,8 @@ en: nccu: NCCU nccu_c: nccu_ldap_uid: NCCU LDAP Account + off_upcase: "OFF" + on_upcase: "ON" or_lower: or password: Password register: Register diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 00135276..7cd0b6a3 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -30,6 +30,8 @@ zh_tw: nccu_ldap_uid: iNCCU帳號 no_: "No" nothing: 無 + off_upcase: "OFF" + on_upcase: "ON" or_lower: 或 password: 密碼 register: 註冊 diff --git a/config/routes.rb b/config/routes.rb index 4b657270..c388d638 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -117,9 +117,9 @@ Orbit::Application.routes.draw do get 'mail_setting' get 'site_info' get 'sitemap' + get 'sitemap_toggle', :on => :member get 'system_info' get 'ui_theme' - put 'sitemap_toggle', :on => :member end resources :snippets resources :tags