Merge branch 'develop' into dev_newproject

This commit is contained in:
huang 2016-11-07 17:18:36 +08:00
commit 0ef3dbf5f8
3 changed files with 12 additions and 31 deletions

View File

@ -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|

View File

@ -73,24 +73,6 @@ 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]
@ -103,7 +85,6 @@ class RepositoriesController < ApplicationController
}
end
end
end
def forked
@project = Project.find(params[:id])

View File

@ -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)])