From 750a9c9d38b53bf98595e37d945af2da0e84080d Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 15 Oct 2016 19:34:58 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=AD=94=E9=A2=98?= =?UTF-8?q?=E6=8A=A5=E7=BD=91=E7=BB=9C=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/poll/show.html.erb | 77 +++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 36 deletions(-) diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index 63f7feae5..055eecc7b 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -206,24 +206,26 @@ function onblur_<%= pq.id %>(obj) { $(window).unbind('beforeunload'); - $.ajax({ - type: "post", - url: "<%= commit_answer_poll_path(@poll) %>", - data: { - poll_question_id: <%= pq.id %> , - vote_text: obj.value - }, - success: function (data) { - var dataObj = eval(data); - obj.value = dataObj.text; - var span = $('#percent'); - span.html(dataObj.percent); - }, - error: function () { - alert("网络异常,答题失败,请确认网络正常连接后再答题。"); - } - }); - + var val = $(obj).val().trim(); + if(val != "") { + $.ajax({ + type: "post", + url: "<%= commit_answer_poll_path(@poll) %>", + data: { + poll_question_id: <%= pq.id %> , + vote_text: obj.value + }, + success: function (data) { + var dataObj = eval(data); + obj.value = dataObj.text; + var span = $('#percent'); + span.html(dataObj.percent); + }, + error: function () { + alert("网络异常,答题失败,请确认网络正常连接后再答题。"); + } + }); + } } > @@ -253,24 +255,27 @@ function onblur_<%= pa.id %>(obj) { $(window).unbind('beforeunload'); - $.ajax({ - type: "post", - url: "<%= commit_answer_poll_path(@poll) %>", - data: { - poll_question_id: <%= pq.id %> , - poll_answer_id: <%= pa.id %>, - vote_text: obj.value - }, - success: function (data) { - var dataObj = eval(data); - obj.value = dataObj.text; - var span = $('#percent'); - span.html(dataObj.percent); - }, - error: function () { - alert("网络异常,答题失败,请确认网络正常连接后再答题。"); - } - }); + var val = $(obj).val().trim(); + if(val != "") { + $.ajax({ + type: "post", + url: "<%= commit_answer_poll_path(@poll) %>", + data: { + poll_question_id: <%= pq.id %>, + poll_answer_id: <%= pa.id %>, + vote_text: obj.value + }, + success: function (data) { + var dataObj = eval(data); + obj.value = dataObj.text; + var span = $('#percent'); + span.html(dataObj.percent); + }, + error: function () { + alert("网络异常,答题失败,请确认网络正常连接后再答题。"); + } + }); + } }

<%= i + 1 %>.<%= pa.answer_text%>

From bdbd2e9cf7259b8e97e8062073ee9cc996cc9673 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 18 Oct 2016 15:17:36 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=B8=8E=E9=87=8C=E7=A8=8B=E7=A2=91=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search_public_orgs_not_in_project.js.erb | 6 +- .../projects/settings/_added_orgs.html.erb | 6 +- .../projects/settings/_join_org.html.erb | 42 +++++++++-- .../projects/settings/_new_versions.html.erb | 73 ++++++++++++++++++- config/locales/commons/zh.yml | 1 + config/locales/zh.yml | 1 + 6 files changed, 112 insertions(+), 17 deletions(-) diff --git a/app/views/projects/search_public_orgs_not_in_project.js.erb b/app/views/projects/search_public_orgs_not_in_project.js.erb index cb8fb3ea2..3be806b00 100644 --- a/app/views/projects/search_public_orgs_not_in_project.js.erb +++ b/app/views/projects/search_public_orgs_not_in_project.js.erb @@ -6,12 +6,12 @@ } <% end %> $("#search_orgs_result_list").html(""); -$("#search_orgs_result_list").append(''); <% if @org_count > 15 %> $("#paginator").html(' <%= pagination_links_full @orgs_page, @org_count ,:per_page_links => true,:remote =>true,:flag=>true%>'); $("#paginator").css("display", "block"); diff --git a/app/views/projects/settings/_added_orgs.html.erb b/app/views/projects/settings/_added_orgs.html.erb index 19e0c07fe..666a7e118 100644 --- a/app/views/projects/settings/_added_orgs.html.erb +++ b/app/views/projects/settings/_added_orgs.html.erb @@ -1,8 +1,8 @@