Fix check box selections appearance

Conflicts:
	vendor/built_in_modules/ask_new/app/controllers/panel/ask/back_end/ask_replies_controller.rb
This commit is contained in:
Bernie Chiu 2013-09-11 17:02:36 +08:00 committed by chris
parent b7bf180df2
commit c361a7a201
2 changed files with 17 additions and 4 deletions

View File

@ -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

View File

@ -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;
}
</style>
<div id="ask_question_reply">
@ -56,8 +70,8 @@ $(document).ready(function() {
<tr>
<td colspan="5" class="dept_options">
<div class="dept_options">
<%= 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, "營繕組") %>