diff --git a/app/controllers/admin/registered_sites_controller.rb b/app/controllers/admin/registered_sites_controller.rb index dd90b4f..0981d53 100644 --- a/app/controllers/admin/registered_sites_controller.rb +++ b/app/controllers/admin/registered_sites_controller.rb @@ -33,6 +33,10 @@ class Admin::RegisteredSitesController < OrbitAdminController end def change_access_status + if !request.xhr? + redirect_to admin_registered_sites_path(:page => params[:page]) + return + end status = params[:status] site = RegisteredSite.find_by(:uid => params[:uid]) case status diff --git a/app/views/admin/registered_sites/change_access_status.js.erb b/app/views/admin/registered_sites/change_access_status.js.erb index 9592967..e4ac3a7 100644 --- a/app/views/admin/registered_sites/change_access_status.js.erb +++ b/app/views/admin/registered_sites/change_access_status.js.erb @@ -1,16 +1 @@ -$("#index_table").html("<%= j render 'index' %>"); -var atags = $(".pagination a"); -if (atags.length > 0){ - atags.each(function(){ - var el = $(this); - if(el.attr("href")){ - var url = "http://" + window.location.host + el.attr("href"); - uri = new URL(url); - if(uri.searchParams.get("page")){ - $(this).attr("href","/<%= locale.to_s %>/admin/registered_sites?page=" + uri.searchParams.get("page")); - }else{ - $(this).attr("href","/<%= locale.to_s %>/admin/registered_sites"); - } - } - }) -} \ No newline at end of file +$("#index_table").html("<%= j render 'index' %>"); \ No newline at end of file