From 18a51f070ebc74f5f0154d2a0538581d7946f810 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 18 Jan 2013 10:37:55 +0800 Subject: [PATCH] member roles edit --- app/assets/javascripts/inc/attribute_onoff.js | 18 +++++++++--------- app/controllers/admin/infos_controller.rb | 5 ++++- .../admin/users_new_interface/_form.html.erb | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/inc/attribute_onoff.js b/app/assets/javascripts/inc/attribute_onoff.js index f1541a11..0c22901c 100644 --- a/app/assets/javascripts/inc/attribute_onoff.js +++ b/app/assets/javascripts/inc/attribute_onoff.js @@ -1,14 +1,14 @@ function checkSwitch() { - $(".groups").each(function() { - $(this).find('.form-horizontal > .hide').length < $(this).find('.form-horizontal > div').length ? $(this).removeClass("disabled") : $(this).addClass("disabled") - }); + // $(".groups").each(function() { + // $(this).find('.form-horizontal > .hide').length < $(this).find('.form-horizontal > div').length ? $(this).removeClass("disabled") : $(this).addClass("disabled") + // }); // $(".groups").addClass('disabled').has('.groups > .form-horizontal > div:not(.hide)').removeClass('disabled'); } $(document).ready(function(){ - checkSwitch(); + // checkSwitch(); $('.onoff').click(function () { - if($(this).parents("h4").length==1) { + if($(this).parent("h4").length==1) { $(this).parents(".map-block").toggleClass("disabled"); $(this).parents(".map-block").find(".form-horizontal").toggleClass("hide"); if($(this).parents(".map-block").hasClass("disabled")){ @@ -19,17 +19,17 @@ $(document).ready(function(){ $(this).siblings(".subrole_disable_field").val("false"); } } - if($(this).parents("legend").length==1) { + if($(this).parent("legend").length==1) { $(this).toggleClass("disabled"); - $(this).parents("legend").next("div").toggleClass("hide"); - if($(this).parents("legend").next("div").hasClass("hide")){ + $(this).parent("legend").next("div").toggleClass("hide"); + if($(this).parent("legend").next("div").hasClass("hide")){ $(this).text("OFF"); $(this).siblings(".subrole_disable_field").val("true"); }else{ $(this).text("ON"); $(this).siblings(".subrole_disable_field").val("false"); } - checkSwitch(); + // checkSwitch(); } return false; }); diff --git a/app/controllers/admin/infos_controller.rb b/app/controllers/admin/infos_controller.rb index d6325ef0..c35f2246 100644 --- a/app/controllers/admin/infos_controller.rb +++ b/app/controllers/admin/infos_controller.rb @@ -11,7 +11,10 @@ class Admin::InfosController < ApplicationController @roles = Role.excludes('disabled' => true) - render :template => 'admin/attributes/index' + # render :template => 'admin/attributes/index' + + redirect_to(edit_admin_info_path(Info.first.id.to_s)) + end def show diff --git a/app/views/admin/users_new_interface/_form.html.erb b/app/views/admin/users_new_interface/_form.html.erb index 76f304fa..d11de282 100644 --- a/app/views/admin/users_new_interface/_form.html.erb +++ b/app/views/admin/users_new_interface/_form.html.erb @@ -11,7 +11,7 @@