From ea015e966a71fc46a5a5f2a454d607d1c14a9ce6 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 21 Jul 2017 16:42:05 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6+?= =?UTF-8?q?=E6=9C=80=E7=83=AD/=E6=9C=80=E6=96=B0=E7=BB=84=E5=90=88?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=98=BE=E7=A4=BA=E5=87=BA=E6=9D=A5=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=8D=E5=87=86=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/_answer_form.html.erb | 8 +++++--- app/views/challenges/_edit_scoring.html.erb | 2 +- app/views/challenges/_score_form.html.erb | 4 +++- app/views/challenges/_skill_form.html.erb | 4 +++- app/views/shixuns/_shixun_list.html.erb | 4 ++-- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/app/views/challenges/_answer_form.html.erb b/app/views/challenges/_answer_form.html.erb index 9e7ed5cde..11007ca74 100644 --- a/app/views/challenges/_answer_form.html.erb +++ b/app/views/challenges/_answer_form.html.erb @@ -20,7 +20,9 @@
  • 保存 - 取消 + <% if @challenge.answer %> + 取消 + <% end %>
  • \ No newline at end of file diff --git a/app/views/challenges/_edit_scoring.html.erb b/app/views/challenges/_edit_scoring.html.erb index 4c19ce5bd..307f8d74c 100644 --- a/app/views/challenges/_edit_scoring.html.erb +++ b/app/views/challenges/_edit_scoring.html.erb @@ -18,7 +18,7 @@
  • - <%= @challenge.score %>分 + <%= @challenge.score.nil? ? 0 : @challenge.score %>分
  • diff --git a/app/views/challenges/_score_form.html.erb b/app/views/challenges/_score_form.html.erb index 7f8e66622..ff8801819 100644 --- a/app/views/challenges/_score_form.html.erb +++ b/app/views/challenges/_score_form.html.erb @@ -24,7 +24,9 @@
  • 保存 - 取消 + <% if !@challenge.score.nil? %> + 取消 + <% end %>
  • diff --git a/app/views/challenges/_skill_form.html.erb b/app/views/challenges/_skill_form.html.erb index e7f0f81b9..d711ab15a 100644 --- a/app/views/challenges/_skill_form.html.erb +++ b/app/views/challenges/_skill_form.html.erb @@ -11,7 +11,7 @@ <% end %> <% end %> -
    +
    " id="add_shixun_skill">
    @@ -44,6 +44,7 @@ $(".task-tag-input").attr("value",""); } $("#shixun_skill_input").val(""); + $("#add_shixun_skill").hide(); } function close_tag(thisObj){ @@ -54,6 +55,7 @@ function challenge_skill_update(){ var nSkill = $(".knowledge_frame"); + add_tag(); if (nSkill.length > 0){ $("#challenge_skill_update").submit(); }else{ diff --git a/app/views/shixuns/_shixun_list.html.erb b/app/views/shixuns/_shixun_list.html.erb index db2105df6..2b0dcec9e 100644 --- a/app/views/shixuns/_shixun_list.html.erb +++ b/app/views/shixuns/_shixun_list.html.erb @@ -1,9 +1,9 @@
    From 1b55407a874e4e3bc757822c36d451eb173c4628 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 21 Jul 2017 16:57:47 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=AF=B7=E5=9C=A8=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E7=9A=84=E5=8F=B3=E4=BE=A7=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E2=80=9C=E6=96=B0=E5=BB=BA=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E2=80=9D=E2=80=9C=E4=B8=8B=E4=B8=80=E4=BB=BB=E5=8A=A1=E2=80=9D?= =?UTF-8?q?=EF=BC=88=E5=A6=82=E6=9E=9C=E6=9C=89=E7=9A=84=E8=AF=9D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/challenges_controller.rb | 5 +++++ app/views/challenges/edit.html.erb | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index 953a3575f..89e298286 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -92,6 +92,11 @@ class ChallengesController < ApplicationController end def edit + challenge_num = Challenge.where(:shixun_id => @shixun).count + challenge_pos = @challenge.position + if challenge_pos < challenge_num + @next_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos+1).first + end @tab = params[:tab].blank? ? 1 : params[:tab].to_i @editor = params[:editor] # 编辑模式 end diff --git a/app/views/challenges/edit.html.erb b/app/views/challenges/edit.html.erb index 55bae7a68..521b6c719 100644 --- a/app/views/challenges/edit.html.erb +++ b/app/views/challenges/edit.html.erb @@ -19,6 +19,12 @@

    阶段编辑(第<%= @challenge.position %>关)

    + <% unless @next_challenge.blank? %> + 下一阶段 + <% end %> + <% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %> + 新建阶段 + <% end %>
    diff --git a/app/views/challenges/_skill_form.html.erb b/app/views/challenges/_skill_form.html.erb index d711ab15a..b1f6b80e8 100644 --- a/app/views/challenges/_skill_form.html.erb +++ b/app/views/challenges/_skill_form.html.erb @@ -49,8 +49,8 @@ function close_tag(thisObj){ // 获取父节点的id - var obj = thisObj.parentNode.id; - $("#"+obj).remove(); + var obj = $(thisObj).parent(); + $(obj).remove(); } function challenge_skill_update(){ From f3f9aea32cd72e3b8193bc2e83de738e95596c99 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 21 Jul 2017 17:21:03 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9C=AC=E5=85=B3=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E4=BF=9D=E5=AD=98=E5=A5=BD=EF=BC=8C=E7=84=B6?= =?UTF-8?q?=E5=90=8E=E7=82=B9=E5=87=BB=E7=BC=96=E8=BE=91=EF=BC=8C=E5=86=8D?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=8F=96=E6=B6=88=EF=BC=8C=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=86=85=E5=AE=B9=E4=B8=8D=E8=A7=81=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/_task_pass_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/challenges/_task_pass_form.html.erb b/app/views/challenges/_task_pass_form.html.erb index 30ab40395..b5ca126ed 100644 --- a/app/views/challenges/_task_pass_form.html.erb +++ b/app/views/challenges/_task_pass_form.html.erb @@ -31,7 +31,7 @@ <% if params[:action] == "new" %> 取消 <% else %> - 取消 + 取消 <% end %>