diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index e194c32ab..2efaf591a 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -362,11 +362,36 @@ class ProjectsController < ApplicationController end # dts测试工具 - def dts_rep + def dts_dep render_403 unless User.current.admin? @dts = Dts.all end + # dts云部署 + def yun_dep + render_403 unless User.current.admin? + end + + # 软件知识库 + def soft_knowledge + render_403 unless User.current.admin? + end + + # 在线开发平台 + def online_dev + render_403 unless User.current.admin? + end + + # 软件资源库 + def soft_file + render_403 unless User.current.admin? + end + + # 软件服务 + def soft_service + render_403 unless User.current.admin? + end + #发送邮件邀请新用户 def invite_members_by_mail if User.current.member_of?(@project) || User.current.admin? diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 2921cc825..185f448ce 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -711,19 +711,19 @@ class CoursesService " limit 0,4" active_students = User.find_by_sql(sql1) if homework_count != 0 && !better_students.empty? - latest_course_dynamics <<{:type=> 6,:time=>Time.now.to_s,:count=> 4,:better_students=> better_students} + latest_course_dynamics <<{:type=> 6,:time=>"1970-01-01 0:0:0 +0800",:count=> 4,:better_students=> better_students} end unless active_students.empty? - latest_course_dynamics <<{:type=> 7,:time=>Time.now.to_s,:count=> 4,:active_students=>active_students} + latest_course_dynamics <<{:type=> 7,:time=>"1970-01-01 0:0:0 +0800",:count=> 4,:active_students=>active_students} end latest_course_dynamic = latest_course_dynamics.first unless latest_course_dynamic.nil? result << {:course_name => course.name,:current_user_is_member => current_user.member_of_course?(course),:current_user_is_teacher => is_course_teacher(current_user,course), :course_id => course.id, :course_img_url => url_to_avatar(course), :course_time => course.time, :course_term => course.term,:message => "", :dynamics => latest_course_dynamics, - :course_student_num=>course ? course.members.count : 0,:time_from_now=> distance_of_time_in_words(Time.now, latest_course_dynamic[:time].to_time) << "前"} + :course_student_num=>course ? course.members.count : 0,:time_from_now=> distance_of_time_in_words(Time.now, latest_course_dynamic[:time].to_time) << "前",:time=>latest_course_dynamic[:time].to_time} end end #返回数组集合 - result.sort! { |order, newer| newer[:update_time] <=> order[:update_time] } + result.sort! { |order, newer| newer[:time] <=> order[:time] } result end diff --git a/app/views/projects/_tools_expand.html.erb b/app/views/projects/_tools_expand.html.erb index 38104cd1e..7ba58f424 100644 --- a/app/views/projects/_tools_expand.html.erb +++ b/app/views/projects/_tools_expand.html.erb @@ -37,7 +37,12 @@
  • <% if User.current.admin? %> - <%= link_to l(:label_project_dts_new) ,dts_rep_project_path(@project), data: { confirm:'你确定要进行DTS测试吗?' } %> + <%= link_to l(:label_project_dts_new) ,dts_dep_project_path(@project), data: { confirm:'你确定要进行DTS测试吗?' } %> + <% end %> +
  • +
  • + <% if User.current.admin? %> + <%= link_to l(:label_project_dts_yun) ,yun_dep_project_path(@project) %> <% end %>
  • diff --git a/app/views/projects/dts_dep.html.erb b/app/views/projects/dts_dep.html.erb new file mode 100644 index 000000000..17630c622 --- /dev/null +++ b/app/views/projects/dts_dep.html.erb @@ -0,0 +1,72 @@ +
    +

    <%= l(:label_project_dts_statics) %>

    +
    + + + +
    +
    +

    测试分析中...

    +
    +
    0%
    +
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/app/views/projects/dts_rep.html.erb b/app/views/projects/dts_rep.html.erb deleted file mode 100644 index e62c58283..000000000 --- a/app/views/projects/dts_rep.html.erb +++ /dev/null @@ -1,30 +0,0 @@ -
    -

    <%= l(:label_project_dts_statics) %>

    -
    -

    语言:Java 总文件数:361 代码行数:48662

    - - - - - - -<% @dts.each do |dt| %> - - - - - - - - - - - - - - - - - -
    错误变量<%= dt.Variable %>起始行<%= dt.StartLine %>IP行<%= dt.IPLine %>
    缺陷代码<%= dt.IPLineCode %>
    错误描述<%= dt.Description %>
    -<% end %> \ No newline at end of file diff --git a/app/views/projects/soft_knowledge.html.erb b/app/views/projects/soft_knowledge.html.erb new file mode 100644 index 000000000..6264fabbe --- /dev/null +++ b/app/views/projects/soft_knowledge.html.erb @@ -0,0 +1,46 @@ +
    +

    <%= l(:label_project_dts_yun) %>

    +
    + + + +
    +
    +

    云化部署中...

    +
    +
    0%
    +
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/app/views/projects/yun_dep.html.erb b/app/views/projects/yun_dep.html.erb new file mode 100644 index 000000000..6264fabbe --- /dev/null +++ b/app/views/projects/yun_dep.html.erb @@ -0,0 +1,46 @@ +
    +

    <%= l(:label_project_dts_yun) %>

    +
    + + + +
    +
    +

    云化部署中...

    +
    +
    0%
    +
    + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml index 3ba438c0a..dc61b5bb0 100644 --- a/config/locales/projects/zh.yml +++ b/config/locales/projects/zh.yml @@ -92,6 +92,7 @@ zh: label_project_dts_new: DTS测试 label_project_dts_statics: DTS缺陷报告 + label_project_dts_yun: 云化部署 label_project_overview: "项目简介" label_expend_information: 展开更多信息 diff --git a/config/routes.rb b/config/routes.rb index ef88e1c26..4be8cdb6b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -385,7 +385,15 @@ RedmineApp::Application.routes.draw do get 'feedback', :action => 'feedback', :as => 'project_feedback' get 'watcherlist', :action=> 'watcherlist' - get 'dts_rep', :action=> 'dts_rep' + + # 添加dts测试工具 + get 'dts_dep', :action=> 'dts_dep' + get 'yun_dep', :action=> 'yun_dep' + get 'soft_knowledge', :action=> 'soft_knowledge' + get 'soft_file', :action=> 'soft_file' + get 'online_dev', :action=> 'online_dev' + get 'soft_service', :action=> 'soft_service' + get 'invite_members', :action=> 'invite_members' get 'invite_members_by_mail', :action=> 'invite_members_by_mail' get 'send_mail_to_member', :action => 'send_mail_to_member'