From e9aa22cdee2c8102fa41401cb141735731f13e99 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 16 Mar 2018 17:37:14 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E8=AF=84=E9=98=85=E5=BC=B9=E6=A1=86=E4=B8=AD?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E2=80=9C=E5=B1=95=E5=BC=80=E8=AF=84?= =?UTF-8?q?=E9=98=85=E8=AF=A6=E6=83=85=E2=80=9D=E7=9A=84=E5=A4=8D=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_add_score.html.erb | 6 ++++++ app/views/student_work/_programing_work_show.html.erb | 4 ++-- app/views/student_work/_show.html.erb | 6 +++--- app/views/student_work/add_score.js.erb | 3 ++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/views/student_work/_add_score.html.erb b/app/views/student_work/_add_score.html.erb index 53c269802..94c0b8205 100644 --- a/app/views/student_work/_add_score.html.erb +++ b/app/views/student_work/_add_score.html.erb @@ -24,6 +24,12 @@ <%end%> 提交 + <% if show_or_hide %> + + + + + <% end %>
<% end%> diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index 920f42131..cf5ebb448 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -112,7 +112,7 @@ <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%> <% end%>
@@ -124,7 +124,7 @@
-
+
diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index 570642db2..c3772f479 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -84,7 +84,7 @@ <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
- <%= render :partial => 'add_score',:locals => {:work => work,:score => score,:is_member_work => is_member_work}%> + <%= render :partial => 'add_score',:locals => {:work => work,:score => score,:is_member_work => is_member_work, :show_or_hide => !student_work_scores.empty?}%>
<% end%>
@@ -101,7 +101,7 @@ <% if @is_teacher %>
- <%= render :partial => 'add_score',:locals => {:work => work,:score => score,:is_member_work => is_member_work}%> + <%= render :partial => 'add_score',:locals => {:work => work,:score => score,:is_member_work => is_member_work, :show_or_hide => !student_work_scores.empty?}%>
<% end%>
@@ -109,7 +109,7 @@ <% end %> -
+
diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb index f7fad7088..9c39f6997 100644 --- a/app/views/student_work/add_score.js.erb +++ b/app/views/student_work/add_score.js.erb @@ -1,5 +1,5 @@ <% is_member_work = @homework.homework_type == 3 && @work.student_work_projects.empty? %> -$("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'add_score',:locals => {:work => @work,:score => @new_score,:is_member_work => is_member_work}) %>"); +$("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'add_score',:locals => {:work => @work,:score => @new_score,:is_member_work => is_member_work, :show_or_hide => !@student_work_scores.empty?}) %>"); $('#score_<%= @work.id%>').peSlider({range: 'min'}); <%# if @is_new%> @@ -12,6 +12,7 @@ $('#score_<%= @work.id%>').peSlider({range: 'min'}); $("#score_list_<%= @work.id%>").html("<%=escape_javascript(render :partial => 'student_work_score_records', :locals => {:student_work_scores => @student_work_scores, :is_member_work => is_member_work}) %>"); var num = $("#work_num_<%= @work.id%>").html(); $("#score_list_<%= @work.id%>").removeAttr("style"); +$("#show_or_hide_work_score_<%= @work.id %>").attr("checked", true); <% if @is_teacher %> <% if @homework.homework_type == 3 %> From 5b03de859693c4c2838771ef087dfc42086b03e4 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 20 Mar 2018 17:22:57 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_homework_base_info.html.erb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/views/users/_homework_base_info.html.erb b/app/views/users/_homework_base_info.html.erb index 7b5e17a5e..cddb72e86 100644 --- a/app/views/users/_homework_base_info.html.erb +++ b/app/views/users/_homework_base_info.html.erb @@ -69,16 +69,18 @@ <% projects = activity.student_work_projects.where("is_leader = 1") %> <% unless projects.empty? %> <% sort_projects = project_sort_update projects %> -
-
- <% first_pro_act = sort_projects.first %> - <% first_pro = Project.find first_pro_act.project_id %> - <% commit_time = first_pro.project_score.commit_time %> - <%# one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %> - # <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(first_pro_act.updated_at) ? commit_time : first_pro_act.updated_at %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目 + <% unless sort_projects.empty? %> +
+
+ <% first_pro_act = sort_projects.first %> + <% first_pro = Project.find first_pro_act.project_id %> + <% commit_time = first_pro.project_score.commit_time %> + <%# one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %> + # <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(first_pro_act.updated_at) ? commit_time : first_pro_act.updated_at %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目 +
+
-
-
+ <% end %> <% end %> <% end %>
From cb8148d8a00b632a00c232d6ee5840fb49c1f49f Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 21 Mar 2018 17:09:56 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=88=AB=E4=BA=BA=E5=AF=B9=E8=87=AA?= =?UTF-8?q?=E5=B7=B1=E7=9A=84=E8=AF=84=E5=88=86=E8=AE=B0=E5=BD=95=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=98=BE=E7=A4=BA=EF=BC=8C=E4=B9=9F=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E5=8F=AF=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_add_score.html.erb | 6 ------ app/views/student_work/_programing_work_show.html.erb | 9 ++++++++- app/views/student_work/_show.html.erb | 11 +++++++++-- app/views/student_work/add_score.js.erb | 3 +-- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/app/views/student_work/_add_score.html.erb b/app/views/student_work/_add_score.html.erb index 94c0b8205..53c269802 100644 --- a/app/views/student_work/_add_score.html.erb +++ b/app/views/student_work/_add_score.html.erb @@ -24,12 +24,6 @@ <%end%> 提交 - <% if show_or_hide %> - - - - - <% end %>
<% end%> diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index cf5ebb448..6c21c5036 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -129,7 +129,14 @@
- 收起 +
+ <% if !student_work_scores.empty? %> + 收起 + 展开评阅详情 + <% else %> + 收起 + <% end %> +