From a996e658a9d8b074bd6f3c4bf4d2f1699a069157 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 4 Nov 2015 14:50:39 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=8D=95=E4=B8=AA=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=E8=87=AA=E5=8A=A8=E5=90=8C=E6=AD=A5=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...e_rep_if_fault.rake => gitlab_to_git.rake} | 0 lib/tasks/sync_sigle_rep.rake | 24 +++++++++++++++++++ lib/trustie/gitlab/sync.rb | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) rename lib/tasks/{update_rep_if_fault.rake => gitlab_to_git.rake} (100%) create mode 100644 lib/tasks/sync_sigle_rep.rake diff --git a/lib/tasks/update_rep_if_fault.rake b/lib/tasks/gitlab_to_git.rake similarity index 100% rename from lib/tasks/update_rep_if_fault.rake rename to lib/tasks/gitlab_to_git.rake diff --git a/lib/tasks/sync_sigle_rep.rake b/lib/tasks/sync_sigle_rep.rake new file mode 100644 index 000000000..6b7be700f --- /dev/null +++ b/lib/tasks/sync_sigle_rep.rake @@ -0,0 +1,24 @@ +#coding=utf-8 + +namespace :sync_rep do + desc "sync some projects which just have sigle repository" + task :sigle => :environment do + projects = Project.where("id =?",24) + projects.each do |project| + # 针对类型为Git并且只有一个版本库的项目 + if project.repositories && project.repositories.count == 1 && project.repositories.first.type == "Repository::Git" + rep = project.repositories.first + s = Trustie::Gitlab::Sync.new + s.sync_project(project, path: rep.identifier, import_url: rep.url) + rep.type = 'Repository::Gitlab' + rep.save + puts "*************************************" + puts project.id + puts rep.id + puts rep.identifier + puts rep.url + puts project.user_id + end + end + end +end \ No newline at end of file diff --git a/lib/trustie/gitlab/sync.rb b/lib/trustie/gitlab/sync.rb index 3a8e8380c..de4bec70b 100644 --- a/lib/trustie/gitlab/sync.rb +++ b/lib/trustie/gitlab/sync.rb @@ -66,7 +66,7 @@ module Trustie if opt[:password] import_url.sub('@', ":#{opt[:password]}@") end - + # import url http://xianbo_trustie2:1234@repository.trustie.net/xianbo/trustie2.git # can use password gproject = self.g.create_project(path, From 1133b35169b67a138f8b049467c0824e996f0e45 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 4 Nov 2015 15:24:24 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BD=9C=E4=B8=9Atag=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20=E4=BD=9C=E4=B8=9A=E6=88=AA=E6=AD=A2=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=B2=BE=E7=A1=AE=E5=88=B0=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_homework.html.erb | 14 +++++++++---- .../users/_user_homework_detail.html.erb | 20 ++++++++++++------- public/stylesheets/courses.css | 2 +- public/stylesheets/new_user.css | 2 +- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 77f7d97dd..be7945cc0 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -13,25 +13,31 @@ <% end %> TO <%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%> -
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 3d841b087..f9743d7c3 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -10,7 +10,7 @@ TO <%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%>
-
<% end %>
- <%= l(:label_end_time)%>:<%= homework_common.end_time%> + <%= l(:label_end_time)%>:<%= homework_common.end_time%> 23:59
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 317a21d02..22560f0aa 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -966,7 +966,7 @@ a:hover.icon_remove{background:url(../images/course/icons.png) -20px -338px no-r .ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd; } .W50{ width:50px;} .W200{ width:200px;} -.m_w480{max-width: 480px;} +.m_w505{max-width: 505px;} .m_w500{max-width: 500px;} .m_w530{max-width: 530px;} .ProResultTable{ color:#888888;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 6a296b941..061ad0561 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1073,7 +1073,7 @@ a:hover.icon_remove{background:url(../images/course/icons.png) -20px -338px no-r .ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd; } .W50{ width:50px;} .W200{ width:200px;} -.m_w480{max-width: 480px;} +.m_w505{max-width: 505px;} .m_w530{max-width: 530px;} .ProResultTable{ color:#888888;} .T_C{ text-align:center;} From 58b7250d39ea64dc76789c3e77a0df4ad64912db Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 4 Nov 2015 16:19:25 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=A1=B9=E7=9B=AE=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8C=E6=AD=A5=E5=8F=82=E6=95=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/sync_sigle_rep.rake | 4 +--- lib/trustie/gitlab/sync.rb | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/tasks/sync_sigle_rep.rake b/lib/tasks/sync_sigle_rep.rake index 6b7be700f..b99221c83 100644 --- a/lib/tasks/sync_sigle_rep.rake +++ b/lib/tasks/sync_sigle_rep.rake @@ -3,7 +3,7 @@ namespace :sync_rep do desc "sync some projects which just have sigle repository" task :sigle => :environment do - projects = Project.where("id =?",24) + projects = Project.all projects.each do |project| # 针对类型为Git并且只有一个版本库的项目 if project.repositories && project.repositories.count == 1 && project.repositories.first.type == "Repository::Git" @@ -16,8 +16,6 @@ namespace :sync_rep do puts project.id puts rep.id puts rep.identifier - puts rep.url - puts project.user_id end end end diff --git a/lib/trustie/gitlab/sync.rb b/lib/trustie/gitlab/sync.rb index de4bec70b..8c84984ee 100644 --- a/lib/trustie/gitlab/sync.rb +++ b/lib/trustie/gitlab/sync.rb @@ -76,6 +76,7 @@ module Trustie wall_enabled: false, issues_enabled: false, snippets_enabled: false, + merge_requests_enabled: true, public: false, user_id: gid, import_url: import_url From 496aeb4456095dc03af7785a164c6f82885226bf Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 4 Nov 2015 16:23:08 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E2=80=9C=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/_development_group.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/projects/_development_group.html.erb b/app/views/projects/_development_group.html.erb index e51683295..ec8562885 100644 --- a/app/views/projects/_development_group.html.erb +++ b/app/views/projects/_development_group.html.erb @@ -49,7 +49,7 @@ <% end %> (<%= @project.repositories.count %>) <% if (User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project)) && rep_is_gitlab?(@project) %> - <%= link_to "+"+l(:project_module_create_repository), url_for(:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories') , :class => "subnav_green" %> + <%= link_to "+"+l(:project_gitlab_create_repository), url_for(:controller => 'projects', :action => 'settings', :id => @project.id, :tab=>'repositories') , :class => "subnav_green" %> <% end %>
<% end %> From 35c60c325339bc1e2416a2123beb794a6ae0169e Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 5 Nov 2015 09:37:56 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E4=BD=9C=E5=93=81=E4=BF=A1=E6=81=AF=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/index.html.erb | 27 +++++++++++++++---- app/views/users/_course_homework.html.erb | 18 ++++++------- .../users/_user_homework_detail.html.erb | 20 +++++++------- public/stylesheets/courses.css | 5 +++- public/stylesheets/new_user.css | 7 +++-- 5 files changed, 50 insertions(+), 27 deletions(-) diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 78f11737b..8f1f0033e 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -120,14 +120,31 @@
- + <% if @homework.homework_detail_manual%> - <% if @homework.homework_detail_manual.comment_status == 1%> - 未开启匿评 + <% if @homework.homework_detail_manual.comment_status == 0 %> + 未发布 + <% elsif @homework.homework_detail_manual.comment_status == 1%> + <% if @homework.anonymous_comment == 0%> + 未开启匿评 + <% else %> + 匿评已禁用 + <% end %> + 作品提交中 <% elsif @homework.homework_detail_manual.comment_status == 2%> - 匿评中 + <% if @homework.anonymous_comment == 0%> + 匿评中 + <% else %> + 匿评已禁用 + <% end %> + 教师评阅中 <% elsif @homework.homework_detail_manual.comment_status == 3%> - 匿评已结束 + <% if @homework.anonymous_comment == 0%> + 匿评已结束 + <% else %> + 匿评已禁用 + <% end %> + 教师评阅中 <% end%> <% end%> [ 隐藏作业信息 ] diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index be7945cc0..f442e34e4 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -19,25 +19,25 @@ <% if activity.homework_detail_manual%> <% if activity.homework_detail_manual.comment_status == 1%> <% if activity.anonymous_comment == 0%> - 未开启匿评 + 未开启匿评 <% else %> - 匿评已禁用 + 匿评已禁用 <% end %> - 作品提交中 + 作品提交中 <% elsif activity.homework_detail_manual.comment_status == 2%> <% if activity.anonymous_comment == 0%> - 匿评中 + 匿评中 <% else %> - 匿评已禁用 + 匿评已禁用 <% end %> - 教师评阅中 + 教师评阅中 <% elsif activity.homework_detail_manual.comment_status == 3%> <% if activity.anonymous_comment == 0%> - 匿评已结束 + 匿评已结束 <% else %> - 匿评已禁用 + 匿评已禁用 <% end %> - 教师评阅中 + 教师评阅中 <% end%> <% end%>
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index f9743d7c3..1947c8ce8 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -16,28 +16,28 @@ <% if homework_common.homework_detail_manual%> <% if homework_common.homework_detail_manual.comment_status == 0 %> - 未发布 + 未发布 <% elsif homework_common.homework_detail_manual.comment_status == 1%> <% if homework_common.anonymous_comment == 0%> - 未开启匿评 + 未开启匿评 <% else %> - 匿评已禁用 + 匿评已禁用 <% end %> - 作品提交中 + 作品提交中 <% elsif homework_common.homework_detail_manual.comment_status == 2%> <% if homework_common.anonymous_comment == 0%> - 匿评中 + 匿评中 <% else %> - 匿评已禁用 + 匿评已禁用 <% end %> - 教师评阅中 + 教师评阅中 <% elsif homework_common.homework_detail_manual.comment_status == 3%> <% if homework_common.anonymous_comment == 0%> - 匿评已结束 + 匿评已结束 <% else %> - 匿评已禁用 + 匿评已禁用 <% end %> - 教师评阅中 + 教师评阅中 <% end%> <% end%> diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 22560f0aa..7a3d43469 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -178,7 +178,9 @@ a.f_grey:hover {color:#000000;} /*.upbtn{ margin:42px 0 0 10px; border:none; color:#999; width:150px;}*/ .red_btn_cir{ background:#e74c3c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} .green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} -.grey_btn_cir{ background:#b2b2b2; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} +.green_homework_btn_cir{ background:#28be6c; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} +.grey_btn_cir{ background:#b2b2b2; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} +.grey_homework_btn_cir{ background:#b2b2b2; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} .blue_btn_cir{ background:#3498db; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} .orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} .sticky_btn_cir{ background:#269ac9; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} @@ -966,6 +968,7 @@ a:hover.icon_remove{background:url(../images/course/icons.png) -20px -338px no-r .ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd; } .W50{ width:50px;} .W200{ width:200px;} +.m_w460{max-width: 460px;} .m_w505{max-width: 505px;} .m_w500{max-width: 500px;} .m_w530{max-width: 530px;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 061ad0561..0b45685ee 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -293,8 +293,10 @@ a:hover.bgreen_n_btn{background:#08a384;} .more_btn{-moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #9DCEFF; color:#9DCEFF; border-radius:3px; padding:0px 3px;} .upbtn{ margin:42px 0 0 10px; border:none; color:#999; width:150px;} .red_btn_cir{ background:#e74c3c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} -.green_btn_cir{ background:#28be6c; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} -.grey_btn_cir{ background:#b2b2b2; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} +.green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} +.green_homework_btn_cir{ background:#28be6c; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} +.grey_btn_cir{ background:#b2b2b2; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} +.grey_homework_btn_cir{ background:#b2b2b2; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} .blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} .orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} .sticky_btn_cir{ background:#269ac9; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;} @@ -1073,6 +1075,7 @@ a:hover.icon_remove{background:url(../images/course/icons.png) -20px -338px no-r .ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd; } .W50{ width:50px;} .W200{ width:200px;} +.m_w460{max-width: 460px;} .m_w505{max-width: 505px;} .m_w530{max-width: 530px;} .ProResultTable{ color:#888888;} From 48cef54b9e3ad59315863f41d03be2e1b5a4f01f Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 5 Nov 2015 10:40:24 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E6=97=B6=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=B1=95=E5=BC=80=E5=AD=A6=E7=94=9F=E7=9A=84=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_programing_work_show.html.erb | 32 ++++++++-------- app/views/student_work/_show.html.erb | 38 +++++++++---------- .../student_work/_student_work_list.html.erb | 10 ++++- app/views/student_work/show.js.erb | 4 +- 4 files changed, 46 insertions(+), 38 deletions(-) diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index b5ff8f064..dbf7291cb 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -3,21 +3,21 @@
  • 上交时间: - <%=format_time @work.created_at %> + <%=format_time work.created_at %>
  • - <% if @work.user == User.current && @homework.homework_detail_manual.comment_status == 1 %> + <% if work.user == User.current && @homework.homework_detail_manual.comment_status == 1 %>
  • - <%= link_to("", student_work_path(@work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %> + <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %>
  • <%= link_to "",new_student_work_path(:homework => @homework.id),:class => "pic_edit"%>
  • <% end%> - <% if @homework.homework_detail_manual.comment_status == 3 && @work.user != User.current%> + <% if @homework.homework_detail_manual.comment_status == 3 && work.user != User.current%> -
  • +
  • <%= render :partial => 'student_work_praise' %>
  • <% end%> @@ -26,7 +26,7 @@
  • 编程代码:
    - <%= text_format(@work.description) if @work.description%> + <%= text_format(work.description) if work.description%>
  • @@ -37,10 +37,10 @@ 测试结果:
    - <% @work.student_work_tests.each_with_index do |test, index| %> + <% work.student_work_tests.each_with_index do |test, index| %>

    - 第<%= @work.student_work_tests.count - index%>次测试 + 第<%= work.student_work_tests.count - index%>次测试

    <%= test.created_at.to_s(:db) %> @@ -79,24 +79,24 @@ <% end%>
  • - <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && @work.user != User.current )%> + <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%> -
    - <%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%> +
    + <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
    <% end%>
-
- <%@student_work_scores.each do |score|%> -
- <%= render :partial => 'student_work_score',:locals => {:score => score,:is_last => score == @student_work_scores.last}%> +
+ <%student_work_scores.each do |student_score|%> +
+ <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
<% end%>
- 收起 + 收起
\ No newline at end of file diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index cfc4129a8..1f3d44258 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -3,21 +3,21 @@
  • 上交时间: - <%=format_time @work.created_at %> + <%=format_time work.created_at %>
  • - <% if @work.user == User.current && @homework.homework_detail_manual.comment_status == 1 %> + <% if work.user == User.current && @homework.homework_detail_manual.comment_status == 1 %>
  • - <%= link_to("", student_work_path(@work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %> + <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %>
  • - <%= link_to "",edit_student_work_path(@work),:class => "pic_edit"%> + <%= link_to "",edit_student_work_path(work),:class => "pic_edit"%>
  • <% end%> - <% if @homework.homework_detail_manual.comment_status == 3 && @work.user != User.current%> + <% if @homework.homework_detail_manual.comment_status == 3 && work.user != User.current%> -
  • +
  • <%= render :partial => 'student_work_praise' %>
  • <% end%> @@ -25,50 +25,50 @@ - <% if @work.project%> + <% if work.project%>
  • 关联项目: - <%= link_to( @work.project.name, project_path(@work.project.id), :class => "linkBlue" )%> + <%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
  • <% end%>
  • 内容:
    - <%= text_format(@work.description) if @work.description%> + <%= text_format(work.description) if work.description%>
  • 附件: - <% if @work.attachments.empty?%> + <% if work.attachments.empty?%> 尚未提交附件 <% else%>
    - <%= render :partial => 'work_attachments_status', :locals => {:attachments => @work.attachments, :status => @homework.homework_detail_manual.comment_status} %> + <%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments, :status => @homework.homework_detail_manual.comment_status} %>
    <% end%>
  • - <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && @work.user != User.current )%> + <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%> -
    - <%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%> +
    + <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
    <% end%>
-
- <%@student_work_scores.each do |score|%> -
- <%= render :partial => 'student_work_score',:locals => {:score => score,:is_last => score == @student_work_scores.last}%> +
+ <%student_work_scores.each do |student_score|%> +
+ <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
<% end%>
- 收起 + 收起
\ No newline at end of file diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index e23fcceda..c8248d86a 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -35,6 +35,14 @@ <%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work}%> <% end%>
-
+
+ <% if student_work.user == User.current %> + <% if @homework.homework_type == 2%> + <%=render :partial => 'programing_work_show', :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %> + <% else %> + <%=render :partial => 'show' , :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %> + <% end %> + <% end %> +
<% end%> \ No newline at end of file diff --git a/app/views/student_work/show.js.erb b/app/views/student_work/show.js.erb index e6b99c146..d61c4b9a1 100644 --- a/app/views/student_work/show.js.erb +++ b/app/views/student_work/show.js.erb @@ -3,9 +3,9 @@ if($("#about_hwork_<%= @work.id%>").children().length > 0){ } else{ <% if @homework.homework_type == 2%> - $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show') %>"); + $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>"); <% else%> - $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show') %>"); + $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>"); <% end%> $('#score_<%= @work.id%>').peSlider({range: 'min'}); } \ No newline at end of file