Merge branch 'develop' into dev_newproject
This commit is contained in:
commit
0ef3dbf5f8
|
@ -50,7 +50,7 @@ class AdminController < ApplicationController
|
|||
cycle = params[:cycle]
|
||||
g = Gitlab.client
|
||||
users_results = []
|
||||
User.first(13).each do |user|
|
||||
User.all.each do |user|
|
||||
unless user.mail.nil?
|
||||
user_mail = user.mail
|
||||
user.projects.where("gpid is not null").each do |project|
|
||||
|
|
|
@ -73,35 +73,16 @@ class RepositoriesController < ApplicationController
|
|||
|
||||
def export_rep_static
|
||||
# 管理员界面导出所有项目
|
||||
if params[:cycle] == "admin_week" || params[:cycle] == "admin_month" || params[:cycle] == "admin_all"
|
||||
if User.current.admin?
|
||||
@project = Project.find(params[:id])
|
||||
gpid = @project.gpid
|
||||
rev = params[:rev]
|
||||
cycle = params[:cycle]
|
||||
cycle_name = (params[:cycle] == "admin_week" ? "每周" : (params[:cycle] == "admin_month" ? "每月" : "所有"))
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.xls{
|
||||
filename = "#{l(:label_user_rep_xls)}_#{l(:cycle_name)}_.xls"
|
||||
send_data(admin_export_rep_xls(gpid, :rev => rev, :cycle => "1"), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
|
||||
}
|
||||
end
|
||||
else
|
||||
render_403
|
||||
end
|
||||
else
|
||||
@project = Project.find(params[:id])
|
||||
gpid = @project.gpid
|
||||
rev = params[:rev]
|
||||
cycle = params[:cycle]
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.xls{
|
||||
filename = "#{@project.name.to_s}_#{l(:label_rep_xls)}.xls"
|
||||
send_data(export_rep_xls(gpid, :rev => rev, :cycle => cycle), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
|
||||
}
|
||||
end
|
||||
@project = Project.find(params[:id])
|
||||
gpid = @project.gpid
|
||||
rev = params[:rev]
|
||||
cycle = params[:cycle]
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.xls{
|
||||
filename = "#{@project.name.to_s}_#{l(:label_rep_xls)}.xls"
|
||||
send_data(export_rep_xls(gpid, :rev => rev, :cycle => cycle), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ module ApplicationHelper
|
|||
end
|
||||
xls_report = StringIO.new
|
||||
book = Spreadsheet::Workbook.new
|
||||
sheet1 = book.create_worksheet :name => "版本库"
|
||||
sheet1 = book.create_worksheet :name => l(:project_module_repository)
|
||||
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
|
||||
sheet1.row(0).default_format = blue
|
||||
sheet1.row(0).concat([l(:rep_branch),l(:rep_author),l(:rep_changeset),l(:rep_code_add),l(:rep_code_delete),l(:rep_code_modified),l(:rep_sode_time),l(:rep_sode_cycle),l(:rep_author_mail)])
|
||||
|
|
Loading…
Reference in New Issue