From 3f1852985ebe466d08d09403769a5dc18603813d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 09:00:08 +0800 Subject: [PATCH 01/41] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 4b655cf31..3fbd7940e 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -40,9 +40,9 @@ class HomeworkCommonController < ApplicationController # @homework_detail_programing = HomeworkDetailPrograming.new # @homework.homework_detail_programing = @homework_detail_programing # end - # respond_to do |format| - # format.html - # end + respond_to do |format| + format.html + end end #新建作业下一步 From ea8f72cce9681328dfbd57016e9594f8438759d2 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 09:24:09 +0800 Subject: [PATCH 02/41] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9Ashow?= =?UTF-8?q?=EF=BC=9A=E4=B8=A4=E4=B8=AA=E6=B5=8B=E8=AF=95=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_programing_work_show.html.erb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index 807fc80fe..7081dea8c 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -59,14 +59,6 @@
-
  • 测试结果: - - - - -
    -
    -
  • <% if @is_teacher%>
    From f4360e66dd62172085c254164edf8610446b7e0f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 09:47:20 +0800 Subject: [PATCH 03/41] =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=BC=96=E7=A8=8B?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 4b655cf31..0a33ef87a 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -144,6 +144,8 @@ class HomeworkCommonController < ApplicationController end if homework.save + homework_detail_programing.save if homework_detail_programing + homework_detail_manual.save if homework_detail_manual respond_to do |format| format.html { flash[:notice] = l(:notice_successful_create) @@ -254,7 +256,6 @@ class HomeworkCommonController < ApplicationController client.request(request) end result = JSON.parse(res.body) - homework_detail_programing.question_id = result["id"] if result["status"] && result["status"] == 0 end @homework.save_attachments(params[:attachments]) From ad43c76ce795930e3319da1efeabde985aac8173 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Jul 2015 10:21:52 +0800 Subject: [PATCH 04/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=8F=AF=E9=85=8D=E7=BD=AE=20=E5=8C=85?= =?UTF-8?q?=E6=8B=AC=E5=9B=BE=E7=89=87=E5=A4=A7=E5=B0=8F=E3=80=81=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/index.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index c03b0de76..816d6550a 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -45,10 +45,10 @@ <% if @organization.nil? %> <% unless @first_page.nil? %> - <%= l(:label_welcome_trustie_project)%>,  - <%= l(:label_welcome_trustie_project_description)%> + + <%= @first_page.description.html_safe %> <% end %> <% else %> From bf86393bb911b64060adc5cd51fc963a638de93c Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Jul 2015 10:39:07 +0800 Subject: [PATCH 05/41] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E4=B8=BB=E9=A1=B5=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/avatar/_avatar_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/avatar/_avatar_form.html.erb b/app/views/avatar/_avatar_form.html.erb index 632ea5d4d..43aaf9132 100644 --- a/app/views/avatar/_avatar_form.html.erb +++ b/app/views/avatar/_avatar_form.html.erb @@ -43,7 +43,7 @@
    -<%#= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "btn_addPic", :style => "text-decoration:none;" %> +<%= link_to l(:button_delete_file),{:controller => :avatar,:action => :delete_image,:remote=>true,:source_type=> source.class,:source_id=>source.id},:confirm => l(:text_are_you_sure), :method => :post, :class => "btn_addPic", :style => "text-decoration:none;" %> <%= l(:button_upload_photo) %> From 938d31a7612e469ea1d78c7b6c0d103cb69a6c84 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Jul 2015 11:36:21 +0800 Subject: [PATCH 06/41] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=BE=97=E5=88=86?= =?UTF-8?q?=E4=B8=BA0=20=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=A1=B9=E7=9B=AE=E5=BE=97=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_projects.html.erb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 972b3b3a6..b168e5f81 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -80,11 +80,13 @@
    <% if @project.project_type == 0 %> - <%= l(:label_project_score)%> : - <%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects', - :action => 'show_projects_score', - :remote => true, - :id => @project.id}, :class => "c_orange f14" ) %> + <% unless project_scores(@project) == 0 %> + <%= l(:label_project_score)%> : + <%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects', + :action => 'show_projects_score', + :remote => true, + :id => @project.id}, :class => "c_orange f14" ) %> + <% end %> <% end %>
    From 0e56a79622e78faad107c8fba7613fd21f771929 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 11:50:50 +0800 Subject: [PATCH 07/41] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=B8=8D=E4=BD=BF=E7=94=A8ajax=E5=B1=80?= =?UTF-8?q?=E9=83=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/news_controller.rb | 3 +-- app/views/news/_course_news.html.erb | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 9385c73ee..848c0a69d 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -71,8 +71,7 @@ class NewsController < ApplicationController scope = @course ? @course.news.course_visible : News.course_visible @news_count = scope.count - #@news_pages = Paginator.new @news_count, @limit, params['page'] - #@offset ||= scope_page.offset + @q = params[:subject] if params[:subject].nil? scope_order = scope.all(:include => [:author, :course], :order => "#{News.table_name}.created_on DESC") diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index f801aff87..e2c50fe24 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -24,8 +24,8 @@ <% end %> @@ -34,7 +34,7 @@
    <%= render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count} %> -
    +
    <% content_for :header_tags do %> <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %> <%= stylesheet_link_tag 'scm' %> From 2f497f36d0ff7381b3e7a1ee83b8c69a734fa8f9 Mon Sep 17 00:00:00 2001 From: zhangshenjerry <1375181337@qq.com> Date: Fri, 24 Jul 2015 14:00:02 +0800 Subject: [PATCH 08/41] =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E5=90=8E=E5=BB=BA=E8=AE=AE=E7=BB=99=E5=87=BA?= =?UTF-8?q?=E2=80=9C=E5=AF=86=E7=A0=81=E4=BF=AE=E6=94=B9=E6=88=90=E5=8A=9F?= =?UTF-8?q?=EF=BC=8C=E8=AF=B7=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95=E2=80=9D?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index c23266afd..57c3712f9 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -540,6 +540,7 @@ $('#my_account_form_btn').click(); }); $('#my_password_form_link').click(function(){ + alert("密码修改成功,请重新登录!"); $('#my_password_form_btn').click(); }); }); From 518ce15df5a9d13e1058c9f8fb4676fa4ec0345c Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Jul 2015 14:01:15 +0800 Subject: [PATCH 09/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=88=90=E5=91=98=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/projects/zh.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml index 6c2646acf..e47cd476c 100644 --- a/config/locales/projects/zh.yml +++ b/config/locales/projects/zh.yml @@ -350,7 +350,7 @@ zh: label_input_email: 请输入邮箱地址 label_invite_trustie_user: "邀请Trustie注册用户" - label_invite_trustie_user_tips: "输入姓名、邮箱、昵称" + label_invite_trustie_user_tips: "支持姓名、邮箱、昵称搜索!" label_user_role_null: 用户和角色不能留空! label_invite_project: 邀请您加入项目 label_mail_invite_success: 您已成功加入项目! From 430956bfe54f90c1aa24307de0224f7f69f8277e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 14:24:31 +0800 Subject: [PATCH 10/41] =?UTF-8?q?=E6=88=91=E8=A6=81=E5=8F=8D=E9=A6=88---?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E7=BC=96=E8=BE=91=E6=A1=86=E6=97=B6=E8=BE=B9?= =?UTF-8?q?=E6=A1=86=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/kindeditor/kindeditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js index a9633861e..270618522 100644 --- a/public/assets/kindeditor/kindeditor.js +++ b/public/assets/kindeditor/kindeditor.js @@ -5104,8 +5104,8 @@ KEditor.prototype = { } } }); - statusbar.removeClass('statusbar').addClass('ke-statusbar') - .append(''); + //statusbar.removeClass('statusbar').addClass('ke-statusbar') + // .append(''); if (self._fullscreenResizeHandler) { K(window).unbind('resize', self._fullscreenResizeHandler); self._fullscreenResizeHandler = null; From 24a9a5034c19897ffa7669e6c94c543cc0650d5f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 14:27:30 +0800 Subject: [PATCH 11/41] =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=AF=BC=E5=87=BA=E9=99=84=E4=BB=B6=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/index.html.erb | 30 ++++++++++++++------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 781277b57..fc82aea1e 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -55,21 +55,23 @@ <% end%> <% if @is_teacher%>
    - <% if @homework.student_works.empty?%> - <%= link_to "附件", "javascript:void(0)", class: "down_btn fr zip_download_alert", :onclick => "alert('没有学生提交作业,无法下载附件')" %> - <% else%> - <%= link_to "附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json), - remote: true, class: "down_btn fr zip_download_alert", :id => "download_homework_attachments" %> + <% unless @homework.homework_type == 2%> + <% if @homework.student_works.empty?%> + <%= link_to "附件", "javascript:void(0)", class: "down_btn fr zip_download_alert", :onclick => "alert('没有学生提交作业,无法下载附件')" %> + <% else%> + <%= link_to "附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json), + remote: true, class: "down_btn fr zip_download_alert", :id => "download_homework_attachments" %> + <% end%> +
    + 使用 + winzip + 工具进行解压可能会导致 + 下载文件乱码 + ,建议您使用 + winrar + 工具进行解压 +
    <% end%> -
    - 使用 - winzip - 工具进行解压可能会导致 - 下载文件乱码 - ,建议您使用 - winrar - 工具进行解压 -
    <%= link_to("匿评", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%> <%= link_to("缺评", absence_penalty_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%> <%= link_to l(:label_list), student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'down_btn fr'%> From cf58ea8a9f9a9ff8591962d2cc0c4b6831d26c8f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 14:31:08 +0800 Subject: [PATCH 12/41] =?UTF-8?q?=E5=AF=86=E7=A0=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E6=8F=90=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 57c3712f9..0d8159c89 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -540,7 +540,7 @@ $('#my_account_form_btn').click(); }); $('#my_password_form_link').click(function(){ - alert("密码修改成功,请重新登录!"); +// alert("密码修改成功,请重新登录!"); $('#my_password_form_btn').click(); }); }); From 4a781ea6b23cde56f39e4b72ce4f2774640a0f25 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 14:36:53 +0800 Subject: [PATCH 13/41] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=EF=BC=8C=E5=8A=A9=E6=95=99=E4=B8=8D=E5=8F=AF=E4=BB=A5=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E8=AF=BE=E7=A8=8B=E3=80=82=E4=BF=AE=E6=94=B9=E5=BC=A0?= =?UTF-8?q?=E7=94=9F=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index a1c7ae875..1623979f0 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -604,7 +604,7 @@ class CoursesController < ApplicationController def toggleCourse @course_prefs = Course.find_by_extra(@course.extra) - unless (@course_prefs.student != User.current || User.current.admin?) + unless (User.current.allowed_to?(:as_teacher,@course_prefs) || User.current.admin?) render_403 end end From 390aa632cdeb93b8bffeded6611ca16eb4f197f0 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Jul 2015 15:02:01 +0800 Subject: [PATCH 14/41] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=B8=BB=E7=89=88=E6=9C=AC=E5=BA=93=E5=90=8E=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E5=8F=AF=E4=BB=A5=E8=AE=BE=E7=BD=AE=E4=B8=BB=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/repositories_helper.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 5cbc3af5a..c77eba0c5 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -236,13 +236,14 @@ module RepositoriesHelper # 判断项目是否有主版本库 def judge_main_repository(pro) if pro.repositories.blank? - return false + status = false else - pro.repositories.sort.each do |rep| - rep.is_default? - return true + pro.repositories.each do |rep| + status = true and break if rep.is_default? + status = false end end + status end # def cvs_field_tags(form, repository) # content_tag('p', form.text_field( From 4f8170700e7702e87d3a7daeb8a8b2fae3d9214d Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 15:19:01 +0800 Subject: [PATCH 15/41] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_common/index.html.erb | 24 ++++++++++++++++++------ app/views/student_work/index.html.erb | 22 +++++++++++++++++++++- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index 2de96bca1..c0f716ed7 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -71,18 +71,30 @@ <% end%> +
    + +
    + 开发语言: +
    + <% if homework.homework_detail_programing.language.to_i == 1%> + C + <% elsif homework.homework_detail_programing.language.to_i == 2%> + C++ + <% end%> +
    +
    +
    <% end%> -
    -
    - <% unless homework.attachments.empty?%> + <% unless homework.attachments.empty?%> +
    附件:
    <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework.attachments} %>
    - <% end%> -
    -
    +
    +
    + <% end%>
    扣分标准: diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index fc82aea1e..92f6f93e0 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -139,6 +139,14 @@ <% if @homework.homework_type == 2 && @homework.homework_detail_programing%> + "> + + + <% @homework.homework_tests.each do |test|%> ">
    + 输入 + + 输出 +
    @@ -151,8 +159,20 @@ <% end%>
    +
    + +
    + 开发语言: +
    + <% if @homework.homework_detail_programing.language.to_i == 1%> + C + <% elsif @homework.homework_detail_programing.language.to_i == 2%> + C++ + <% end%> +
    +
    +
    <% end%> -
    <% unless @homework.attachments.empty?%> From 6c894e63eeade3c1c7e57b588cbea32b33d75fa4 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 15:54:09 +0800 Subject: [PATCH 16/41] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=88=86=E7=8F=AD=E7=9A=84=E9=95=BF=E5=BA=A6=E9=99=90?= =?UTF-8?q?=E5=AE=9A=E4=B8=BA20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_new_groups_name.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/courses/_new_groups_name.html.erb b/app/views/courses/_new_groups_name.html.erb index 39fa33677..fc2c5a62d 100644 --- a/app/views/courses/_new_groups_name.html.erb +++ b/app/views/courses/_new_groups_name.html.erb @@ -31,7 +31,7 @@ <% if @canShowCode%> <%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, :id => 'update_group_'+group.id.to_s) do %> <% end %> @@ -47,7 +47,7 @@
  • From 6b3882aff8853902a994b40730743fb10f252bfb Mon Sep 17 00:00:00 2001 From: zhangshenjerry <1375181337@qq.com> Date: Fri, 24 Jul 2015 16:33:53 +0800 Subject: [PATCH 17/41] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=EF=BC=9A=E5=A6=82=E5=9B=BE=E5=80=BC=E4=B8=BA0=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=BF=99=E4=BA=9B=E5=AD=97=E6=AE=B5=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_users_new.html.erb | 72 +++++++++++++++++------ app/views/my/account.html.erb | 1 - 2 files changed, 54 insertions(+), 19 deletions(-) diff --git a/app/views/layouts/base_users_new.html.erb b/app/views/layouts/base_users_new.html.erb index bbfe9a1ea..4b6bd2887 100644 --- a/app/views/layouts/base_users_new.html.erb +++ b/app/views/layouts/base_users_new.html.erb @@ -149,29 +149,65 @@
      <% if !@user.user_extensions.nil? && @user.user_extensions.identity == 0 %> -
    • 创建课程 :
    • -
    • 发布作业 :
    • + <% if(get_create_course_count(@user)) == 0 %> +
    • 创建课程 :
    • + <% end %> + <% if(get_homework_commons_count(@user)) == 0 %> +
    • 发布作业 :
    • + <% end %> + <% end %> + <% if (get_join_course_count(@user) != 0) %> +
    • 加入课程 :
    • + <% end %> + <% if @user.user_extensions.identity == 0 %> +
    • 参加匿评 :
    • + <% end %> + <% if (get_projectandcourse_attachment_count(@user) != 0) %> +
    • 发布资源 :
    • + <% end %> + <% if (get_create_project_count(@user) != 0) %> +
    • 创建项目 :
    • + <% end %> + <% if (get_join_project_count(@user) != 0) %> +
    • 加入项目 :
    • + <% end %> + <% if (get_create_issue_count(@user) != 0) %> +
    • 发布缺陷 :
    • + <% end %> + <% if (get_resolve_issue_count(@user) != 0) %> +
    • 解决缺陷 :
    • <% end %> -
    • 加入课程 :
    • -
    • 参加匿评 :
    • -
    • 发布资源 :
    • -
    • 创建项目 :
    • -
    • 加入项目 :
    • -
    • 发布缺陷 :
    • -
    • 解决缺陷 :
      <% if !@user.user_extensions.nil? && @user.user_extensions.identity == 0 %> -
    • <%= get_create_course_count(@user) %>
    • -
    • <%= get_homework_commons_count(@user) %>
    • + <% if(get_create_course_count(@user)) == 0 %> +
    • <%= get_create_course_count(@user) %>
    • + <% end %> + <% if(get_homework_commons_count(@user)) == 0 %> +
    • <%= get_homework_commons_count(@user) %>
    • + <% end %> + <% end %> + <% if (get_join_course_count(@user) != 0) %> +
    • <%= get_join_course_count(@user) %>
    • + <% end %> + <% if @user.user_extensions.identity == 0 %> +
    • <%= get_anonymous_evaluation_count(@user) %>
    • + <% end %> + <% if (get_projectandcourse_attachment_count(@user) != 0) %> +
    • <%= get_projectandcourse_attachment_count(@user) %>
    • + <% end %> + <% if (get_create_project_count(@user) != 0) %> +
    • <%= get_create_project_count(@user) %>
    • + <% end %> + <% if (get_join_project_count(@user) != 0) %> +
    • <%= get_join_project_count(@user) %>
    • + <% end %> + <% if (get_create_issue_count(@user) != 0) %> +
    • <%= get_create_issue_count(@user) %>
    • + <% end %> + <% if (get_resolve_issue_count(@user) != 0) %> +
    • <%= get_resolve_issue_count(@user) %>
    • <% end %> -
    • <%= get_join_course_count(@user) %>
    • -
    • <%= get_anonymous_evaluation_count(@user) %>
    • -
    • <%= get_projectandcourse_attachment_count(@user) %>
    • -
    • <%= get_create_project_count(@user) %>
    • -
    • <%= get_join_project_count(@user) %>
    • -
    • <%= get_create_issue_count(@user) %>
    • -
    • <%= get_resolve_issue_count(@user) %>
    diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 57c3712f9..c23266afd 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -540,7 +540,6 @@ $('#my_account_form_btn').click(); }); $('#my_password_form_link').click(function(){ - alert("密码修改成功,请重新登录!"); $('#my_password_form_btn').click(); }); }); From 71970e1942f2b00f43ed92af4e7d65a113608359 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 24 Jul 2015 16:53:21 +0800 Subject: [PATCH 18/41] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=8C=89=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=AE=B5=E6=9D=A5=E7=BB=9F=E8=AE=A1=E6=AF=8F=E4=BA=BA?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E4=BA=A4=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/repository/git.rb | 4 ++++ lib/redmine/scm/adapters/git_adapter.rb | 29 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb index c1f0020eb..f3ea8e003 100644 --- a/app/models/repository/git.rb +++ b/app/models/repository/git.rb @@ -38,6 +38,10 @@ class Repository::Git < Repository 'Git' end + def commits(authors, start_date, end_date) + scm.commits(authors, start_date, end_date) + end + def report_last_commit extra_report_last_commit end diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb index 1876190d9..81c361f6e 100644 --- a/lib/redmine/scm/adapters/git_adapter.rb +++ b/lib/redmine/scm/adapters/git_adapter.rb @@ -380,6 +380,35 @@ module Redmine nil end + def parse_commit(commits) + sum = {file: 0, insertion: 0, deletion: 0} + commits.split("\n").each do |commit| + if /(\d+)\s+?file/ =~ commit + sum[:file] += $1 .to_i + end + if /(\d+)\s+?insertion/ =~ commit + sum[:insertion] += $1.to_i + end + if /(\d+)\s+?deletion/ =~ commit + sum[:deletion] += $1.to_i + end + end + sum[:insertion] + sum[:deletion] + end + + def commits(authors, start_date, end_date) + rs = [] + authors.each do |author| + cmd_args = %W|log --pretty=tformat: --shortstat --author=#{author} --since=#{start_date} --until=#{end_date}| + commits = '' + git_cmd(cmd_args) do |io| + commits = io.read + end + rs << {author: author, num: parse_commit(commits)} + end + rs + end + class Revision < Redmine::Scm::Adapters::Revision # Returns the readable identifier def format_identifier From 69b9cbee80125e0c1043a87d036f69caa5cc4d3e Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Jul 2015 16:56:37 +0800 Subject: [PATCH 19/41] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=BB=9F=E8=AE=A1=EF=BC=88=E6=9C=AA=E5=AE=8C=E6=88=90?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/stats.html.erb | 8 ++++++++ config/locales/zh.yml | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/views/repositories/stats.html.erb b/app/views/repositories/stats.html.erb index ebb670438..ba14e18b1 100644 --- a/app/views/repositories/stats.html.erb +++ b/app/views/repositories/stats.html.erb @@ -25,5 +25,13 @@ <%# 用户最近一年的提交次数 %> <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_qoc_per_author")) %>

    +

    + <%# 用户最近六个月的代码量 %> + <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_code_six_months")) %> +

    +

    + <%# 用户最近一年的代码量 %> + <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_code_year")) %> +

    <%= link_to l(:button_back), :action => 'show', :id => @project %>

    <% html_title(l(:label_repository), l(:label_statistics)) -%> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 9b3254bb2..a5f4f4d10 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -716,8 +716,10 @@ zh: label_commits_per_month: 每月提交次数 label_commits_per_author: 每用户提交次数 label_author_commits_per_month: 用户最近一月的提交次数 - label_author_commits_six_month: 用户最近六个月的提交次数 + label_author_commits_six_month: 用户最近六个月提交次数 label_author_commits_year: 最近一年的提交次数 + label_author_code_six_month: 用户最近六个月代码量 + label_author_code_year: 用户最近一年代码量 label_view_diff: 查看差别 label_diff_inline: 直列 label_diff_side_by_side: 并排 From 19e60f753fb71ca1faba2f59c4e7a42621d133bd Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 17:14:55 +0800 Subject: [PATCH 20/41] =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=BC=96=E7=A8=8B?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 44 +++++++++---------- app/views/homework_common/new.html.erb | 28 ++++-------- 2 files changed, 31 insertions(+), 41 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 34e97e4dd..5324a0d38 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -18,28 +18,28 @@ class HomeworkCommonController < ApplicationController end def new - # @homework_type = "1" - # - # @homework = HomeworkCommon.new - # @homework.safe_attributes = params[:homework_common] - # @homework.late_penalty = 0 - # @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') - # @homework.publish_time = Time.now.strftime('%Y-%m-%d') - # - # if @homework_type == "1" - # #匿评作业相关属性 - # @homework_detail_manual = HomeworkDetailManual.new - # @homework_detail_manual.ta_proportion = 0.6 - # @homework_detail_manual.absence_penalty = 0 - # @homework_detail_manual.evaluation_num = 3 - # @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d') - # @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d') - # @homework.homework_detail_manual = @homework_detail_manual - # elsif @homework_type == "2" - # #编程作业相关属性 - # @homework_detail_programing = HomeworkDetailPrograming.new - # @homework.homework_detail_programing = @homework_detail_programing - # end + @homework_type = "1" + + @homework = HomeworkCommon.new + @homework.safe_attributes = params[:homework_common] + @homework.late_penalty = 0 + @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') + @homework.publish_time = Time.now.strftime('%Y-%m-%d') + + if @homework_type == "1" + #匿评作业相关属性 + @homework_detail_manual = HomeworkDetailManual.new + @homework_detail_manual.ta_proportion = 0.6 + @homework_detail_manual.absence_penalty = 0 + @homework_detail_manual.evaluation_num = 3 + @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d') + @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d') + @homework.homework_detail_manual = @homework_detail_manual + elsif @homework_type == "2" + #编程作业相关属性 + @homework_detail_programing = HomeworkDetailPrograming.new + @homework.homework_detail_programing = @homework_detail_programing + end respond_to do |format| format.html end diff --git a/app/views/homework_common/new.html.erb b/app/views/homework_common/new.html.erb index cdc2ceca0..6fc0fff0e 100644 --- a/app/views/homework_common/new.html.erb +++ b/app/views/homework_common/new.html.erb @@ -1,27 +1,17 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> +<%= error_messages_for 'homework_common' %>

    <%= l(:label_course_homework_new)%>

    -
    - <%= form_for("new_homework_common",:url => next_step_homework_common_index_path) do |f|%> - -

    - 请选择将要发布的作业类型 -

    - - - 人工评分的作业(支持匿名互评、灵活设置评分比例) - -
    - - - 自动评测的编程作业(支持C/C++程序的自动评分) - -
    - - 下一步 - +
    + <%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %> + <%= hidden_field_tag "course",@course.id%> + <%= render :partial => 'homework_common/homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %> + 提交 + <%#= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%> + <%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%> <% end%>
    From 9a9658baf3f0d14188d5b4241f7733a59e3834c9 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 24 Jul 2015 17:28:46 +0800 Subject: [PATCH 21/41] =?UTF-8?q?l=E7=95=99=E8=A8=80=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=88=B0=E7=94=A8=E6=88=B7=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_base_header.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index 16fa44c73..c4f61d73c 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -34,7 +34,7 @@
  • <%=link_to l(:label_my_message)+'('+User.current.count_new_jour.to_s+')', - { :controller => 'users', :action => 'user_newfeedback', id: User.current.id, host: Setting.host_user }, + {:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.host_user}, {:class => 'my-message'} if User.current.logged?%>
  • From ea93a68a84137bbc3787922130c411cfcfbf3848 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Jul 2015 17:40:43 +0800 Subject: [PATCH 22/41] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=EF=BC=9A?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=85=AD=E4=B8=AA=E6=9C=88=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E9=87=8F=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 717007f54..fc05b082d 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -465,6 +465,8 @@ update data = author_commits_six_month(@repository) when "author_qoc_per_author" data = graph_author_qoc_per_author(@repository) + when "author_code_six_months" + data = author_code_six_month(@repository) end if data headers["Content-Type"] = "image/svg+xml" @@ -696,6 +698,47 @@ update graph.burn end + # 最近六个月代码量统计 + def author_code_six_month(repository) + @date_to = Date.today + @date_from = @date_to << 6 + @date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day) + commits_by_author = Changeset.count(:group => :committer, :conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to]) + commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(40) + all_author = [] + commits_by_author.each do |cba| + all_author << cba.first + end + all_author = all_author.collect {|c| c.gsub(%r{<.+@.+>}, '') } + commits_by_author = repository.commits(all_author, @date_from, @date_to) + + fields = commits_by_author.collect {|r| r.first} + commits_data = commits_by_author.collect {|r| r.last} + + fields = fields + [""]*(10 - fields.length) if fields.length<10 + commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10 + + # Remove email adress in usernames + fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') } + + graph = SVG::Graph::BarHorizontal.new( + :height => 400, + :width => 600, + :fields => fields, + :stack => :side, + :scale_integers => true, + :show_data_values => true, + :rotate_y_labels => false, + :graph_title => l(:label_author_commits_six_month), + :show_graph_title => true + ) + graph.add_data( + :data => commits_data, + :title => l(:label_revision_plural) + ) + graph.burn + end + def check_hidden_repo project = Project.find(params[:id]) From 0a300724d318a339c433c39225674b48bd6de35d Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 24 Jul 2015 22:54:42 +0800 Subject: [PATCH 23/41] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E6=95=B0=E7=BB=84=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/repository/git.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb index f3ea8e003..041175572 100644 --- a/app/models/repository/git.rb +++ b/app/models/repository/git.rb @@ -39,7 +39,9 @@ class Repository::Git < Repository end def commits(authors, start_date, end_date) - scm.commits(authors, start_date, end_date) + scm.commits(authors, start_date, end_date).map {|commit| + [commit[:author], commit[:num]] + } end def report_last_commit From b9a902bb041baaafcd926c6aa6adf26e055526e7 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Jul 2015 23:09:28 +0800 Subject: [PATCH 24/41] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index fc05b082d..ada42e1f2 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -729,7 +729,7 @@ update :scale_integers => true, :show_data_values => true, :rotate_y_labels => false, - :graph_title => l(:label_author_commits_six_month), + :graph_title => l(:label_author_code_six_month), :show_graph_title => true ) graph.add_data( From 0a1afd7c450cb80dbd77ef9bd4968a234b5589c3 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Jul 2015 23:25:56 +0800 Subject: [PATCH 25/41] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index ada42e1f2..bc3c0af02 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -711,6 +711,8 @@ update end all_author = all_author.collect {|c| c.gsub(%r{<.+@.+>}, '') } commits_by_author = repository.commits(all_author, @date_from, @date_to) + logger.info "start******************************************************************" + commits_by_author + logger.info "end**************************************************************8" fields = commits_by_author.collect {|r| r.first} commits_data = commits_by_author.collect {|r| r.last} @@ -719,7 +721,7 @@ update commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10 # Remove email adress in usernames - fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') } + # fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') } graph = SVG::Graph::BarHorizontal.new( :height => 400, From 6aa332d1f66fda984da852a7ce54d9ca5222c27e Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Jul 2015 23:36:24 +0800 Subject: [PATCH 26/41] =?UTF-8?q?=E8=B0=83=E8=AF=95=E3=80=81=E6=89=93?= =?UTF-8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index bc3c0af02..d15b581f6 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -711,8 +711,7 @@ update end all_author = all_author.collect {|c| c.gsub(%r{<.+@.+>}, '') } commits_by_author = repository.commits(all_author, @date_from, @date_to) - logger.info "start******************************************************************" + commits_by_author - logger.info "end**************************************************************8" + Rails.logger.debug "######################################{commits_by_author}" fields = commits_by_author.collect {|r| r.first} commits_data = commits_by_author.collect {|r| r.last} @@ -721,7 +720,7 @@ update commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10 # Remove email adress in usernames - # fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') } + fields = fields.collect {|c| c.gsub(%r{<.+@.+>}, '') } graph = SVG::Graph::BarHorizontal.new( :height => 400, From c339e9071bf91752cc2ead3dcaa07956830abf00 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 24 Jul 2015 23:55:13 +0800 Subject: [PATCH 27/41] =?UTF-8?q?date=E7=B1=BB=E5=9E=8B=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E6=88=90string=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index d15b581f6..03ab9d2e3 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -710,7 +710,7 @@ update all_author << cba.first end all_author = all_author.collect {|c| c.gsub(%r{<.+@.+>}, '') } - commits_by_author = repository.commits(all_author, @date_from, @date_to) + commits_by_author = repository.commits(all_author, "#{@date_from}", "#{@date_to}") Rails.logger.debug "######################################{commits_by_author}" fields = commits_by_author.collect {|r| r.first} From 088e9b200a8e1b44759e97ad7b116f4bf071f1e9 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 25 Jul 2015 00:05:28 +0800 Subject: [PATCH 28/41] =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=8C=BA=E9=97=B4?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 03ab9d2e3..e59d90052 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -710,7 +710,7 @@ update all_author << cba.first end all_author = all_author.collect {|c| c.gsub(%r{<.+@.+>}, '') } - commits_by_author = repository.commits(all_author, "#{@date_from}", "#{@date_to}") + commits_by_author = repository.commits(all_author, "2015-01-24", "2015-07-24") Rails.logger.debug "######################################{commits_by_author}" fields = commits_by_author.collect {|r| r.first} From a04fe786ea246b10769f2da61a2d813e94e394d1 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 25 Jul 2015 00:24:59 +0800 Subject: [PATCH 29/41] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=90=8D=E5=90=8E=E7=9A=84=E7=A9=BA=E6=A0=BC=20=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=8C=BA=E9=97=B4=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index e59d90052..3dee2af3e 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -709,7 +709,8 @@ update commits_by_author.each do |cba| all_author << cba.first end - all_author = all_author.collect {|c| c.gsub(%r{<.+@.+>}, '') } + # all_author = all_author.collect {|c| c.gsub(%r{/ /<.+@.+>}, '') } + all_author = all_author.collect {|c| c.split.first } commits_by_author = repository.commits(all_author, "2015-01-24", "2015-07-24") Rails.logger.debug "######################################{commits_by_author}" From 5732d9cee24e10b04a1ba49c713325c34ee8321b Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 25 Jul 2015 10:17:03 +0800 Subject: [PATCH 30/41] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/redmine/scm/adapters/git_adapter.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb index 81c361f6e..6c56a7e24 100644 --- a/lib/redmine/scm/adapters/git_adapter.rb +++ b/lib/redmine/scm/adapters/git_adapter.rb @@ -404,6 +404,7 @@ module Redmine git_cmd(cmd_args) do |io| commits = io.read end + logger.info "git log output for #{author} #{commits}" rs << {author: author, num: parse_commit(commits)} end rs From bf5f7f8d4f8d1b2ab5ae3969fa7b6a696a11b01a Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 25 Jul 2015 11:18:09 +0800 Subject: [PATCH 31/41] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/repository/git.rb | 4 ++-- lib/redmine/scm/adapters/git_adapter.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb index 041175572..7c484e87f 100644 --- a/app/models/repository/git.rb +++ b/app/models/repository/git.rb @@ -38,8 +38,8 @@ class Repository::Git < Repository 'Git' end - def commits(authors, start_date, end_date) - scm.commits(authors, start_date, end_date).map {|commit| + def commits(authors, start_date, end_date, branch='master') + scm.commits(authors, start_date, end_date,branch).map {|commit| [commit[:author], commit[:num]] } end diff --git a/lib/redmine/scm/adapters/git_adapter.rb b/lib/redmine/scm/adapters/git_adapter.rb index 6c56a7e24..927018b34 100644 --- a/lib/redmine/scm/adapters/git_adapter.rb +++ b/lib/redmine/scm/adapters/git_adapter.rb @@ -396,10 +396,10 @@ module Redmine sum[:insertion] + sum[:deletion] end - def commits(authors, start_date, end_date) + def commits(authors, start_date, end_date, branch='master') rs = [] authors.each do |author| - cmd_args = %W|log --pretty=tformat: --shortstat --author=#{author} --since=#{start_date} --until=#{end_date}| + cmd_args = %W|log #{branch} --pretty=tformat: --shortstat --author=#{author} --since=#{start_date} --until=#{end_date}| commits = '' git_cmd(cmd_args) do |io| commits = io.read From 59a3072f818b67fea6ce275a7a8a4d984825cb4a Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 25 Jul 2015 11:20:11 +0800 Subject: [PATCH 32/41] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=8C=BA=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 3dee2af3e..092d50843 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -711,7 +711,7 @@ update end # all_author = all_author.collect {|c| c.gsub(%r{/ /<.+@.+>}, '') } all_author = all_author.collect {|c| c.split.first } - commits_by_author = repository.commits(all_author, "2015-01-24", "2015-07-24") + commits_by_author = repository.commits(all_author, "2014-01-24", "2015-07-24") Rails.logger.debug "######################################{commits_by_author}" fields = commits_by_author.collect {|r| r.first} From 405104c403e779650f0ebab4f7b2f2f3ac43f360 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 25 Jul 2015 11:46:29 +0800 Subject: [PATCH 33/41] =?UTF-8?q?=E4=BC=A0=E5=85=A5@rev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 092d50843..8243a88cd 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -711,7 +711,7 @@ update end # all_author = all_author.collect {|c| c.gsub(%r{/ /<.+@.+>}, '') } all_author = all_author.collect {|c| c.split.first } - commits_by_author = repository.commits(all_author, "2014-01-24", "2015-07-24") + commits_by_author = repository.commits(all_author, "2015-01-24", "2015-07-24", @rev) Rails.logger.debug "######################################{commits_by_author}" fields = commits_by_author.collect {|r| r.first} From 51e027fdc3c994c246dd5bf1b5178b73d4c9b30b Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sat, 25 Jul 2015 12:02:30 +0800 Subject: [PATCH 34/41] =?UTF-8?q?szzh=E7=89=B9=E6=AE=8A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 8243a88cd..781bf0766 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -711,7 +711,7 @@ update end # all_author = all_author.collect {|c| c.gsub(%r{/ /<.+@.+>}, '') } all_author = all_author.collect {|c| c.split.first } - commits_by_author = repository.commits(all_author, "2015-01-24", "2015-07-24", @rev) + commits_by_author = repository.commits(all_author, "2015-01-24", "2015-07-24", repository.id == 150 ? "szzh" : 'master') Rails.logger.debug "######################################{commits_by_author}" fields = commits_by_author.collect {|r| r.first} From fbc0f074d4d2d847e4c7757897768d1d80fdb688 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 25 Jul 2015 12:04:06 +0800 Subject: [PATCH 35/41] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=87=8F=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 092d50843..08799ef01 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -711,7 +711,7 @@ update end # all_author = all_author.collect {|c| c.gsub(%r{/ /<.+@.+>}, '') } all_author = all_author.collect {|c| c.split.first } - commits_by_author = repository.commits(all_author, "2014-01-24", "2015-07-24") + commits_by_author = repository.commits(all_author, '@date_from', "@date_to", "szzh") Rails.logger.debug "######################################{commits_by_author}" fields = commits_by_author.collect {|r| r.first} From b320a02976bca784de19541f105233d263d9a366 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 25 Jul 2015 12:06:21 +0800 Subject: [PATCH 36/41] =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 08799ef01..fc441e238 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -712,7 +712,6 @@ update # all_author = all_author.collect {|c| c.gsub(%r{/ /<.+@.+>}, '') } all_author = all_author.collect {|c| c.split.first } commits_by_author = repository.commits(all_author, '@date_from', "@date_to", "szzh") - Rails.logger.debug "######################################{commits_by_author}" fields = commits_by_author.collect {|r| r.first} commits_data = commits_by_author.collect {|r| r.last} From 839cbf2a5565ccdfe959a2c4682efcf53a6c554d Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 26 Jul 2015 13:43:56 +0800 Subject: [PATCH 37/41] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E5=B9=B4?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 13 +++++++------ config/locales/zh.yml | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 355033b8f..bbc3e1596 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -626,14 +626,14 @@ update graph.burn end - # 用户每月提交次数 + # 用户最近一年的提交次数 def graph_author_commits_per_month(repository) @date_to = Date.today - @date_from = @date_to << 1 + @date_from = @date_to << 12 @date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day) commits_by_author = Changeset.count(:all, :group => :committer, :conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to]) - commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(40) + commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(25) fields = commits_by_author.collect {|r| r.first} commits_data = commits_by_author.collect {|r| r.last} @@ -652,8 +652,9 @@ update :scale_integers => true, :show_data_values => true, :rotate_y_labels => false, - :graph_title => l(:label_author_commits_per_month), - :show_graph_title => true + :graph_title => l(:label_author_commits_year), + :show_graph_title => true, + :no_css => true ) graph.add_data( :data => commits_data, @@ -735,7 +736,7 @@ update ) graph.add_data( :data => commits_data, - :title => l(:label_revision_plural) + :title => l(:lable_revision_code_count) ) graph.burn end diff --git a/config/locales/zh.yml b/config/locales/zh.yml index a5f4f4d10..78e8379dc 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -669,6 +669,7 @@ zh: label_tag: 标签 label_revision: 修订 label_revision_plural: 修订 + lable_revision_code_count: 代码量 label_revision_id: 修订 %{value} label_associated_revisions: 相关修订版本 label_added: 已添加 From d89cba7a1fa9338a2c1baa70acda2c66770e4f9d Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 26 Jul 2015 14:12:26 +0800 Subject: [PATCH 38/41] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index bbc3e1596..41b44b6cd 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -670,7 +670,7 @@ update @date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day) commits_by_author = Changeset.count(:all, :group => :committer, :conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to]) - commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(40) + commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(25) fields = commits_by_author.collect {|r| r.first} commits_data = commits_by_author.collect {|r| r.last} @@ -705,7 +705,7 @@ update @date_from = @date_to << 6 @date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day) commits_by_author = Changeset.count(:group => :committer, :conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to]) - commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(40) + commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(25) all_author = [] commits_by_author.each do |cba| all_author << cba.first @@ -734,6 +734,10 @@ update :graph_title => l(:label_author_code_six_month), :show_graph_title => true ) + commits_data1 = [0]*12 + graph.add_data( + :data => commits_data1, + ) graph.add_data( :data => commits_data, :title => l(:lable_revision_code_count) From 46272a28cf42d41bd44257a5874dcce248ab2763 Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 26 Jul 2015 14:15:25 +0800 Subject: [PATCH 39/41] = --- app/controllers/repositories_controller.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 41b44b6cd..303e4a213 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -705,7 +705,7 @@ update @date_from = @date_to << 6 @date_from = Date.civil(@date_from.year, @date_from.month, @date_from.day) commits_by_author = Changeset.count(:group => :committer, :conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to]) - commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(25) + commits_by_author = commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}.last(40) all_author = [] commits_by_author.each do |cba| all_author << cba.first @@ -734,10 +734,6 @@ update :graph_title => l(:label_author_code_six_month), :show_graph_title => true ) - commits_data1 = [0]*12 - graph.add_data( - :data => commits_data1, - ) graph.add_data( :data => commits_data, :title => l(:lable_revision_code_count) From f37cbd3e0d6b137431044ae04422e077cbcd9eb3 Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 26 Jul 2015 14:35:41 +0800 Subject: [PATCH 40/41] =?UTF-8?q?=E4=BF=AE=E8=AE=A2=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 4 ++-- config/locales/zh.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 303e4a213..752df72ee 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -658,7 +658,7 @@ update ) graph.add_data( :data => commits_data, - :title => l(:label_revision_plural) + :title => l(:label_revision_commit_count) ) graph.burn end @@ -694,7 +694,7 @@ update ) graph.add_data( :data => commits_data, - :title => l(:label_revision_plural) + :title => l(:label_revision_commit_count) ) graph.burn end diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 78e8379dc..83ccebbe9 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -670,6 +670,7 @@ zh: label_revision: 修订 label_revision_plural: 修订 lable_revision_code_count: 代码量 + label_revision_commit_count: 提交次数 label_revision_id: 修订 %{value} label_associated_revisions: 相关修订版本 label_added: 已添加 From 26166abc44a7a945578fbef2d5979ea9fe49349b Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 27 Jul 2015 07:08:37 +0800 Subject: [PATCH 41/41] =?UTF-8?q?=E6=B8=85=E7=90=86=E5=86=97=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 2 -- app/views/repositories/stats.html.erb | 12 ------------ 2 files changed, 14 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 752df72ee..208a8bdb0 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -463,8 +463,6 @@ update data = graph_author_commits_per_month(@repository) when "author_commits_six_month" data = author_commits_six_month(@repository) - when "author_qoc_per_author" - data = graph_author_qoc_per_author(@repository) when "author_code_six_months" data = author_code_six_month(@repository) end diff --git a/app/views/repositories/stats.html.erb b/app/views/repositories/stats.html.erb index ba14e18b1..b5283629c 100644 --- a/app/views/repositories/stats.html.erb +++ b/app/views/repositories/stats.html.erb @@ -13,25 +13,13 @@

    <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_commits_per_month")) %>

    -

    - <%# 用户每月提交代码量 %> - <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_qoc_per_author")) %> -

    <%# 用户最近六个月的提交次数 %> <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_commits_six_month")) %>

    -

    - <%# 用户最近一年的提交次数 %> - <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_qoc_per_author")) %> -

    <%# 用户最近六个月的代码量 %> <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_code_six_months")) %>

    -

    - <%# 用户最近一年的代码量 %> - <%= tag("embed", :width => 670, :height => 400, :type => "image/svg+xml", :src => url_for(:controller => 'repositories', :action => 'graph', :id => @project, :repository_id => @repository.identifier_param, :graph => "author_code_year")) %> -

    <%= link_to l(:button_back), :action => 'show', :id => @project %>

    <% html_title(l(:label_repository), l(:label_statistics)) -%>