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 %> 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 @@ -
- <%@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 @@ -
- <%@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/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/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 diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 77f7d97dd..f442e34e4 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..1947c8ce8 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -10,28 +10,34 @@ 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/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..b99221c83 --- /dev/null +++ b/lib/tasks/sync_sigle_rep.rake @@ -0,0 +1,22 @@ +#coding=utf-8 + +namespace :sync_rep do + desc "sync some projects which just have sigle repository" + task :sigle => :environment do + projects = Project.all + 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 + 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..8c84984ee 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, @@ -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 diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 317a21d02..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,7 +968,8 @@ 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_w460{max-width: 460px;} +.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..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,7 +1075,8 @@ 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_w460{max-width: 460px;} +.m_w505{max-width: 505px;} .m_w530{max-width: 530px;} .ProResultTable{ color:#888888;} .T_C{ text-align:center;}