Fix status bugs

This commit is contained in:
Bernie Chiu 2013-09-17 16:16:37 +08:00
parent 1edc134691
commit 21009961ef
2 changed files with 23 additions and 11 deletions

View File

@ -59,10 +59,10 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController
response = http.request(request) response = http.request(request)
# binding.pry # binding.pry
if response.code != "200" if response.code != "200"
new_status = "轉介其他單位" + "(" + response.code + ")" new_status = "轉介其他單位"
current_reply.update_attributes(status: new_status) current_reply.update_attributes(status: new_status)
else else
new_status = "轉介其他單位" + "(" + " Success!" + ")" new_status = "轉介其他單位"
current_reply.update_attributes(status: new_status) current_reply.update_attributes(status: new_status)
end end

View File

@ -1,18 +1,30 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { var local_host = "<%= request.host %>:<%= request.port %>";
// if ($("#ask_reply_status").val() == '轉介其他單位') { $('.dept_options').show(); }
$("#ask_reply_status").change(function() {
var local_host = "<%= request.host %>:<%= request.port %>";
function hide_current_host_name(localhost) {
$('input[type=checkbox]').each(function() { $('input[type=checkbox]').each(function() {
if ($(this).val() == local_host) { if ($(this).val() == local_host) {
$(this).addClass("hide"); $(this).addClass("hide");
$(this).next().addClass("hide"); $(this).next().addClass("hide");
} }
}); });
}
$(document).ready(function() {
if ($("#ask_reply_status").val() == '轉介其他單位') {
var local_host = "<%= request.host %>:<%= request.port %>";
hide_current_host_name(local_host);
$('.dept_options').show();
}
$("#ask_reply_status").change(function() {
hide_current_host_name(local_host);
$('.dept_options').slideUp(); $('.dept_options').slideUp();
if ($(this).find('option:selected').attr('value') == '轉介其他單位') { if ($(this).find('option:selected').attr('value') == '轉介其他單位') {