From c361a7a20137c4f45e7d630ddb9e73e7ac09d6f8 Mon Sep 17 00:00:00 2001 From: Bernie Chiu Date: Wed, 11 Sep 2013 17:02:36 +0800 Subject: [PATCH] Fix check box selections appearance Conflicts: vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_replies_controller.rb --- .../ask/back_end/ask_replies_controller.rb | 3 +-- .../ask/back_end/ask_questions/edit.html.erb | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_replies_controller.rb b/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_replies_controller.rb index ce233ea72..9ed18e048 100644 --- a/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_replies_controller.rb +++ b/vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_replies_controller.rb @@ -32,7 +32,6 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController send_request(dns, @ask_question, @ask_reply) end unless params[:school].nil? - redirect_to panel_ask_back_end_ask_questions_path, notice: t('ask.reply_success') end @@ -75,7 +74,7 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController new_status = "轉介其他單位" + "(" + response.code + ")" current_reply.update_attributes(status: new_status) else - new_status = "轉介其他單位" + "(" + "succes!" + ")" + new_status = "轉介其他單位" + "(" + "success!" + ")" current_reply.update_attributes(status: new_status) end end diff --git a/vendor/built_in_modules/ask_new/app/views/panel/ask/back_end/ask_questions/edit.html.erb b/vendor/built_in_modules/ask_new/app/views/panel/ask/back_end/ask_questions/edit.html.erb index 90825c6d9..f22ed63ce 100644 --- a/vendor/built_in_modules/ask_new/app/views/panel/ask/back_end/ask_questions/edit.html.erb +++ b/vendor/built_in_modules/ask_new/app/views/panel/ask/back_end/ask_questions/edit.html.erb @@ -2,7 +2,18 @@ $(document).ready(function() { if ($("#ask_reply_status").val() == '轉介其他單位') { $('.dept_options').show(); } + $("#ask_reply_status").change(function() { + + var local_host = "<%= request.host %>:<%= request.port %>"; + + $('input[type=checkbox]').each(function() { + if ($(this).val() == local_host) { + $(this).addClass("hide"); + $(this).next().addClass("hide"); + } + }); + $('.dept_options').slideUp(); if ($(this).find('option:selected').attr('value') == '轉介其他單位') { $('.dept_options').slideDown(); @@ -16,6 +27,9 @@ $(document).ready(function() { .dept_options { display: none; } +.hide { + display: none; +}
@@ -56,8 +70,8 @@ $(document).ready(function() {
- <%= check_box("school", "depts", {:multiple => true}, "localhost:3000", nil) %><%= label_tag(:dep1, "總務長室暨總務處秘書室") %> - <%= check_box("school", "depts", {:multiple => true}, "localhost:4000", nil) %><%= label_tag(:dep2, "文書組") %> + <%= check_box("school", "depts", {:multiple => true}, "localhost:3000", nil) %><%= label_tag("localhost:3000", "總務長室暨總務處秘書室") %> + <%= check_box("school", "depts", {:multiple => true}, "localhost:4000", nil) %><%= label_tag("localhost:4000", "文書組") %> <%= check_box("school", "depts", {:multiple => true}, "事務組", nil) %><%= label_tag(:dep3, "事務組") %> <%= check_box("school", "depts", {:multiple => true}, "保管組", nil) %><%= label_tag(:dep4, "保管組") %> <%= check_box("school", "depts", {:multiple => true}, "營繕組", nil) %><%= label_tag(:dep5, "營繕組") %>