Merge branch 'dev_newproject' into develop

This commit is contained in:
huang 2016-11-10 10:31:26 +08:00
commit 1403ebc987
43 changed files with 453 additions and 344 deletions

View File

@ -234,8 +234,8 @@ class IssuesController < ApplicationController
@issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
# 给该issue在它所在的项目中所有的issues中所在的位置给一个序号
@issue.project_issues_index = @issue.project.issues.last.nil? ? 1 : @issue.project.issues.last.project_issues_index + 1
@issue.fixed_version_id = nil if @issue.fixed_version_id == 0
if @issue.save
senduser = User.find(params[:issue][:assigned_to_id])
issue_id = @issue.id
issue_title = params[:issue][:subject]

View File

@ -27,7 +27,7 @@ class ProjectsController < ApplicationController
menu_item :feedback, :only => :feedback
menu_item :share, :only => :share
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_project]
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_project, :forked_pop]
before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course]
before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches]
before_filter :require_admin, :only => [ :copy, :unarchive, :destroy, :calendar]
@ -533,7 +533,7 @@ class ProjectsController < ApplicationController
@project.update_attribute(:is_public, 1)
end
end
# by young
# include CoursesHelper
def member
# 消息"同意加入项目"
@ -597,6 +597,10 @@ class ProjectsController < ApplicationController
end
def member_forked
@members_forked = User.find_by_sql("SELECT u.* FROM `projects` p,`users` u where p.user_id = u.id and p.forked_from_project_id = #{@project.id} ;")
end
def update_message_status(user, project)
# 更新加入项目消息
project__messages = ForgeMessage.where("forge_message_type in ('ProjectInvite', 'JoinProject', 'RemoveFromProject') and user_id =? and project_id =? ", user, project)
@ -756,6 +760,13 @@ class ProjectsController < ApplicationController
redirect_to admin_projects_url(:status => params[:status])
end
# 资源库fork弹框
def forked_pop
respond_to do |format|
format.js
end
end
def close
@project.close
redirect_to project_url(@project)
@ -942,5 +953,4 @@ class ProjectsController < ApplicationController
return projects
end
#gcmend
end

View File

@ -40,7 +40,7 @@ class RepositoriesController < ApplicationController
# before_filter :connect_gitlab, :only => [:quality_analysis, :commit_diff]
before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue]
before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :project_archive, :quality_analysis]
before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :project_archive, :quality_analysis, :commit_diff]
# 版本库新增权限
# before_filter :show_rep, :only => [:show, :stats, :revisions, :revision, :diff, :commit_diff ]
accept_rss_auth :revisions
@ -87,35 +87,34 @@ class RepositoriesController < ApplicationController
end
def forked
@project = Project.find(params[:id])
@repository = Repository.where("project_id =? and type =?", @project.id, "Repository::Gitlab")
# 如果当前用户已经fork过该项目不会新fork项目则跳至已fork的项
unless has_forked?(@project, User.current)
project = project_from_current_project(@project.id, User.current.id)
redirect_to project_path(project)
else
# 自己不能fork自己的项目
if User.current.id == @project.user_id
flash[:notice] = l(:project_gitlab_fork_own)
redirect_to repository_url(@repository)
else
g = Gitlab.client
if User.current.gid.nil?
begin
g.sync_user(User.current)
ensure
logger.error "Synv user failed ==>#{User.current.id}"
@project = Project.find(params[:id])
@repository = Repository.where("project_id =? and type =?", @project.id, "Repository::Gitlab")
# 如果当前用户已经fork过该项目不会新fork项目则跳至已fork的项
unless has_forked?(@project, User.current)
project = project_from_current_project(@project.id, User.current.id)
redirect_to project_path(project)
else
# 自己不能fork自己的项目
if User.current.id == @project.user_id
flash[:notice] = l(:project_gitlab_fork_own)
redirect_to repository_url(@repository)
else
g = Gitlab.client
if User.current.gid.nil?
begin
g.sync_user(User.current)
ensure
logger.error "Synv user failed ==>#{User.current.id}"
end
end
gproject = g.fork(@project.gpid, User.current.gid)
if gproject
copy_project(@project, gproject)
forked_count = @project.forked_count.to_i + 1
@project.update_attributes(:forked_count => forked_count)
end
end
end
gproject = g.fork(@project.gpid, User.current.gid)
if gproject
copy_project(@project, gproject)
forked_count = @project.forked_count.to_i + 1
@project.update_attributes(:forked_count => forked_count)
end
end
end
end
# 一键ZIP下载
@ -262,6 +261,7 @@ update
end
@repository.project = @project
@repository.type = 'Repository::Gitlab'
@repository.identifier = @repository.identifier.downcase
@repository.url = @repository.identifier
if request.post? && @repository.save
s = Trustie::Gitlab::Sync.new
@ -477,8 +477,14 @@ update
end
def entry
# 顶部导航
@project_menu_type = 5
entry_and_raw(false)
@content = @repository.cat(@path, @rev)
@changesets_latest_coimmit = @g.commit(@project.gpid, @entry.try(:lastrev))
# 总的提交数
@changesets_all_count = @g.user_static(@project.gpid, :rev => @rev).count
if is_entry_text_data?(@content, @path)
render :layout => 'base_projects'
end

View File

@ -1137,7 +1137,7 @@ class UsersController < ApplicationController
def user_import_resource
@user = User.current
user_course_ids = @user.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源
@attachments = Attachment.where("(author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
@attachments = Attachment.where("(author_id = #{@user.id} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
"or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))").order("created_on desc")
@type = params[:type]
@homework_id = params[:homework_id]
@ -1156,26 +1156,22 @@ class UsersController < ApplicationController
#引入资源列表根据类型过滤
def user_resource_type
if User.current.id.to_i != params[:id].to_i
render_403
return
end
user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id}
user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id }
# user_org_ids = User.current.organizations.map {|o| o.id}
if(params[:type].blank? || params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
if params[:status] == "2"
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
@attachments = get_course_resources(User.current.id, user_course_ids, @order, @score)
elsif params[:status] == "3"
@attachments = get_project_resources(params[:id], user_project_ids, @order, @score)
@attachments = get_project_resources(User.current.id, user_project_ids, @order, @score)
elsif params[:status] == "4"
@attachments = get_attch_resources(params[:id], @order, @score)
@attachments = get_attch_resources(User.current.id, @order, @score)
elsif params[:status] == "5"
@attachments = get_principal_resources(params[:id], @order, @score)
@attachments = get_principal_resources(User.current.id, @order, @score)
else
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
@attachments = get_my_resources(User.current.id, user_course_ids, user_project_ids, @order, @score)
end
elsif params[:type] == "6" # 公共资源
if params[:status] == "2"
@ -1207,11 +1203,7 @@ class UsersController < ApplicationController
#引入资源列表根据关键词过滤
def user_ref_resource_search
if User.current.id.to_i != params[:id].to_i
render_403
return
end
def user_ref_resource_searc
@resource_id = params[:mul_id]
@resource_type = params[:mul_type]
@order, @b_sort = params[:order] || "created_on", params[:sort] || "asc"
@ -1225,7 +1217,7 @@ class UsersController < ApplicationController
user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id}
user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id }
# user_org_ids = User.current.organizations.map {|o| o.id}
@attachments = get_my_resources_search(params[:id], user_course_ids, user_project_ids, @order, @score, search)
@attachments = get_my_resources_search(User.current.id, user_course_ids, user_project_ids, @order, @score, search)
elsif (params[:type].blank? || params[:type] == "6") # 公共资源
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search)
@ -2041,7 +2033,7 @@ class UsersController < ApplicationController
user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id}
user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id }
# user_org_ids = User.current.organizations.map {|o| o.id}
@user = User.find(params[:id])
@user = User.current
# 保存文件
attach = Attachment.attach_filesex_public(@user, params[:attachments], params[:attachment_type], is_public = true)
@order, @b_sort = params[:order] || "created_on", params[:sort] || "asc"
@ -2050,16 +2042,16 @@ class UsersController < ApplicationController
if(params[:type].blank? || params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
if params[:status] == "2"
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
@attachments = get_course_resources(@user.id, user_course_ids, @order, @score)
elsif params[:status] == "3"
@attachments = get_project_resources(params[:id], user_project_ids, @order, @score)
@attachments = get_project_resources(@user.id, user_project_ids, @order, @score)
elsif params[:status] == "4"
@attachments = get_attch_resources(params[:id], @order, @score)
@attachments = get_attch_resources(@user.id, @order, @score)
elsif params[:status] == "5"
@attachments = get_principal_resources(params[:id], @order, @score)
@attachments = get_principal_resources(@user.id, @order, @score)
else
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
@attachments = get_my_resources(@user.id, user_course_ids, user_project_ids, @order, @score)
end
elsif params[:type] == "6" # 公共资源
if params[:status] == "2"
@ -2109,16 +2101,16 @@ class UsersController < ApplicationController
if(params[:type].blank? || params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
if params[:status] == "2"
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
@attachments = get_course_resources(@user.id, user_course_ids, @order, @score)
elsif params[:status] == "3"
@attachments = get_project_resources(params[:id], user_project_ids, @order, @score)
@attachments = get_project_resources(@user.id, user_project_ids, @order, @score)
elsif params[:status] == "4"
@attachments = get_attch_resources(params[:id], @order, @score)
@attachments = get_attch_resources(@user.id, @order, @score)
elsif params[:status] == "5"
@attachments = get_principal_resources(params[:id], @order, @score)
@attachments = get_principal_resources(@user.id, @order, @score)
else
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
@attachments = get_my_resources(@user.id, user_course_ids, user_project_ids, @order, @score)
end
elsif params[:type] == "6" # 公共资源
if params[:status] == "2"
@ -2248,16 +2240,16 @@ class UsersController < ApplicationController
if(params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
if params[:status] == "2"
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
@attachments = get_course_resources(User.current.id, user_course_ids, @order, @score)
elsif params[:status] == "3"
@attachments = get_project_resources(params[:id], user_project_ids, @order, @score)
@attachments = get_project_resources(User.current.id, user_project_ids, @order, @score)
elsif params[:status] == "4"
@attachments = get_attch_resources(params[:id], @order, @score)
@attachments = get_attch_resources(User.current.id, @order, @score)
elsif params[:status] == "5"
@attachments = get_principal_resources(params[:id], @order, @score)
@attachments = get_principal_resources(User.current.id, @order, @score)
else
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
@attachments = get_my_resources(User.current.id, user_course_ids, user_project_ids, @order, @score)
end
elsif (params[:type].blank? || params[:type] == "6") # 公共资源
if params[:status] == "2"
@ -2408,16 +2400,16 @@ class UsersController < ApplicationController
if(params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
if params[:status] == "2"
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
@attachments = get_course_resources(User.current.id, user_course_ids, @order, @score)
elsif params[:status] == "3"
@attachments = get_project_resources(params[:id], user_project_ids, @order, @score)
@attachments = get_project_resources(User.current.id, user_project_ids, @order, @score)
elsif params[:status] == "4"
@attachments = get_attch_resources(params[:id], @order, @score)
@attachments = get_attch_resources(User.current.id, @order, @score)
elsif params[:status] == "5"
@attachments = get_principal_resources(params[:id], @order, @score)
@attachments = get_principal_resources(User.current.id, @order, @score)
else
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
@attachments = get_my_resources(User.current.id, user_course_ids, user_project_ids, @order, @score)
end
elsif (params[:type].blank? || params[:type] == "6") # 公共资源
if params[:status] == "2"
@ -2549,16 +2541,16 @@ class UsersController < ApplicationController
if(params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
if params[:status] == "2"
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
@attachments = get_course_resources(User.current.id, user_course_ids, @order, @score)
elsif params[:status] == "3"
@attachments = get_project_resources(params[:id], user_project_ids, @order, @score)
@attachments = get_project_resources(User.current.id, user_project_ids, @order, @score)
elsif params[:status] == "4"
@attachments = get_attch_resources(params[:id], @order, @score)
@attachments = get_attch_resources(User.current.id, @order, @score)
elsif params[:status] == "5"
@attachments = get_principal_resources(params[:id], @order, @score)
@attachments = get_principal_resources(User.current.id, @order, @score)
else
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
@attachments = get_my_resources(User.current.id, user_course_ids, user_project_ids, @order, @score)
end
elsif (params[:type].blank? || params[:type] == "6") # 公共资源
if params[:status] == "2"
@ -3061,16 +3053,16 @@ class UsersController < ApplicationController
if(params[:type].blank? || params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
if params[:status] == "2"
@attachments = get_course_resources(params[:id], user_course_ids, @order, @score)
@attachments = get_course_resources(User.current.id, user_course_ids, @order, @score)
elsif params[:status] == "3"
@attachments = get_project_resources(params[:id], user_project_ids, @order, @score)
@attachments = get_project_resources(User.current.id, user_project_ids, @order, @score)
elsif params[:status] == "4"
@attachments = get_attch_resources(params[:id], @order, @score)
@attachments = get_attch_resources(User.current.id, @order, @score)
elsif params[:status] == "5"
@attachments = get_principal_resources(params[:id], @order, @score)
@attachments = get_principal_resources(User.current.id, @order, @score)
else
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
@attachments = get_my_resources(User.current.id, user_course_ids, user_project_ids, @order, @score)
end
elsif (params[:type] == "6") # 公共资源
if params[:status] == "2"
@ -3115,11 +3107,6 @@ class UsersController < ApplicationController
# 导入资源
def import_resources
# 别人的资源库是没有权限去看的
if User.current.id != params[:id].to_i
render_403
return
end
@resource_id = params[:project_id].nil? ? (params[:course_id].nil? ? params[:subfield_file_id] : params[:course_id]) : params[:project_id]
@resource_type = params[:project_id].nil? ? (params[:course_id].nil? ? "SubfieldFile" : "Course") : "Project"
@order, @b_sort = params[:order] || "created_on", params[:sort] || "asc"
@ -3128,7 +3115,7 @@ class UsersController < ApplicationController
user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id } # user_org_ids = User.current.organizations.map {|o| o.id}
if(params[:type].blank? || params[:type] == "1") # 我的资源
# 修正:我的资源库的话,那么应该是我上传的所有资源加上,我加入的课程、项目、组织的所有资源
@attachments = get_my_resources(params[:id], user_course_ids, user_project_ids, @order, @score)
@attachments = get_my_resources(User.current.id, user_course_ids, user_project_ids, @order, @score)
elsif params[:type] == "6" # 公共资源
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources(user_course_ids, user_project_ids, params[:order], @score)
@ -3149,10 +3136,6 @@ class UsersController < ApplicationController
end
def import_resources_search
if User.current.id.to_i != params[:id].to_i
render_403
return
end
@resource_id = params[:mul_id]
@resource_type = params[:mul_type]
@order, @b_sort = params[:order] || "created_on", params[:sort] || "asc"
@ -3166,7 +3149,7 @@ class UsersController < ApplicationController
user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id}
user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id }
# user_org_ids = User.current.organizations.map {|o| o.id}
@attachments = get_my_resources_search(params[:id], user_course_ids, user_project_ids, @order, @score, search)
@attachments = get_my_resources_search(User.current.id, user_course_ids, user_project_ids, @order, @score, search)
elsif params[:type] == "6" # 公共资源
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_public_resources_search(user_course_ids, user_project_ids, @order, @score, search)
@ -3253,16 +3236,16 @@ class UsersController < ApplicationController
user_project_ids = User.current.projects.map {|p| p.status != 9 && p.id }
if(params[:type].nil? || params[:type].blank? || params[:type] == "1" || params[:type] == 'all') # 全部
if params[:status] == "2"
@attachments = get_course_resources_search(params[:id], user_course_ids, @order, @score, search)
@attachments = get_course_resources_search(User.current.id, user_course_ids, @order, @score, search)
elsif params[:status] == "3"
@attachments = get_project_resources_search(params[:id], user_project_ids, @order, @score, search)
@attachments = get_project_resources_search(User.current.id, user_project_ids, @order, @score, search)
elsif params[:status] == "4"
@attachments = get_attch_resources_search(params[:id], @order, @score, search)
@attachments = get_attch_resources_search(User.current.id, @order, @score, search)
elsif params[:status] == "5"
@attachments = get_principal_resources_search(params[:id], @order, @score, search)
@attachments = get_principal_resources_search(User.current.id, @order, @score, search)
else
# 公共资源库:所有公开资源或者我上传的私有资源
@attachments = get_my_resources_search(params[:id], user_course_ids, user_project_ids, @order, @score, search)
@attachments = get_my_resources_search(User.current.id, user_course_ids, user_project_ids, @order, @score, search)
end
elsif params[:type] == "6" # 公共资源
if params[:status] == "2"

View File

@ -67,12 +67,12 @@ module ApplicationHelper
end
# 重置user_path目的是将id转换成用户名
# def user_path(resource, parameters = {})
# if Fixnum === resource
# resource = User.find(resource)
# end
# super
# end
def user_path(resource, parameters = {})
if Fixnum === resource
resource = User.find(resource)
end
super
end
# 历史数据(老版本库数据)处理完则可以修改该放放
def get_rep_identifier_by_project project

View File

@ -322,9 +322,9 @@ class User < Principal
end
# id 转换成 登录名
# def to_param
# self.login.to_i > 0 ? id : login
# end
def to_param
self.login.to_i > 0 ? id : login
end
def my_blogs_count

View File

@ -2,63 +2,6 @@
input.is_public,input.is_public_checkbox{height:12px;}
input.is_public_checkbox{margin-left:4px;margin-right:4px;}
</style>
<div class="fl">
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'upload_filename readonly', :readonly => 'readonly', :style=>'border:none;') %>
<%#= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %>
<!--<span class="ispublic-label"><%#= l(:field_is_public) %>:</span>-->
<%#= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
<%= if attachment.id.nil?
#待补充代码
else
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
end
%>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<div class="cl"></div>
<% end %>
<% end %>
</span>
<% project = project %>
<div class="cl"></div>
<span class="add_attachment" style="font-weight:normal;">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%= button_tag "上传附件", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => ie8? ? '' : 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js', :project => project),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:lebel_file_uploding => l(:lebel_file_uploding),
:delete_all_files => l(:text_are_you_sure_all)
} %>
<span id="upload_file_count">
<%= l(:label_no_file_uploaded) %>
</span>
(<%= l(:label_max_size) %>:
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>
</div>
<div class="fl" id="issue_upload_attachments">
<%= render :partial=>'attachments/form_attachments', :locals => { :container => container }%>
</div>

View File

@ -0,0 +1,58 @@
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'upload_filename readonly hidden', :readonly => 'readonly', :style=>'border:none; width:460px;') %>
<%#= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %>
<!--<span class="ispublic-label"><%#= l(:field_is_public) %>:</span>-->
<%#= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
<%= if attachment.id.nil?
#待补充代码
else
link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
end
%>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<div class="cl"></div>
<% end %>
<% end %>
</span>
<% project = project %>
<div class="cl"></div>
<span class="add_attachment" style="font-weight:normal;">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%= button_tag "上传附件", :id => "upload_attachments", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => ie8? ? '' : 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js', :project => project),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:lebel_file_uploding => l(:lebel_file_uploding),
:delete_all_files => l(:text_are_you_sure_all)
} %>
<span id="upload_file_count">
<%= l(:label_no_file_uploaded) %>
</span>
(<%= l(:label_max_size) %>:
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>

View File

@ -12,6 +12,10 @@ $("#attachment_history_popub").html('<%= escape_javascript( render :partial => '
$("#attachment_history_popub").html('<%= escape_javascript( render :partial => 'files/attachment_history_popub') %>');
<% end %>
<% if params[:attachment_id] %>
$("#issue_upload_attachments").html('<%= escape_javascript( render :partial => 'attachments/form_attachments', :locals => { :container => @attachment.container }) %>');
<% end %>
<% if @is_destroy%>
$("#attachment_<%= @attachment.id%>").remove();
if(document.getElementById("revise_attachment_div_<%= @attachment.id%>")) {
@ -49,4 +53,4 @@ $("#attachment_history_popub").html('<%= escape_javascript( render :partial => '
$("#choose_revise_attach").attr("onclick","_file.click();");
}
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 end
<% end%>
<% end%>

View File

@ -1,5 +1,5 @@
<div class="autoscroll">
<table class="filecontent syntaxhl" >
<table class="filecontent syntaxhl mt5" style="width:100%">
<tbody>
<% line_num = 1 %>
<% syntax_highlight_lines(filename, Redmine::CodesetUtil.to_utf8_by_setting(content)).each do |line| %>

View File

@ -48,7 +48,7 @@
<% end %>
</div>
<% else %>
<div class="fontGrey2 mb4">
<div class="fontGrey2 mb4 break_word">
资源描述:<% if file.description.blank? %><span style="color:#C5C5BE;">未添加</span><% else %><%= file.description %><% end %>
</div>
<% end %>

View File

@ -10,7 +10,7 @@
<!-- 鼠标不能移动是因为 href="javascript:void(0);"导致的 -->
<span> <a class="files_tag_select" ondblclick="rename_tag($(this),'<%= k %>','',<%= 6 %>);"><%= k%> x<%= v%></a></span>
<% else%>
<span class="files_tag_icon" >
<span class="files_tag_icon break_word" >
<a title="双击可编辑"
onclick="search_tag_attachment('<%= search_tag_attachment_course_files_path(course)%>','<%= k%>','<%= @q%>','<%= course.id%>');"
ondblclick="rename_tag($(this),'<%= k %>','',<%= 6 %>);"><%= k%> x<%= v%></a></span>

View File

@ -1,14 +1,5 @@
<%= labelled_fields_for :issue, @issue do |f| %>
<ul class="fl pro_new_conbox_left">
<li>
<% if @issue.safe_attribute? 'tracker_id' %>
<label class="label"><span class="c_red f12">*</span>&nbsp;类型&nbsp;&nbsp;:&nbsp;</label>
<%= f.select :tracker_id, @issue.project.trackers.collect { |t| [t.name, t.id] },
{:required => true, :no_label => true},
#:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')",
:class => "w90" %>
<% end %>
</li>
<li>
<% if @issue.safe_attribute? 'subject' %>
<label class="label"><span class="c_red f12">*</span>&nbsp;主题&nbsp;&nbsp;:&nbsp;</label>
@ -36,19 +27,28 @@
<%#= wikitoolbar_for 'issue_description' %>
<% end %>
</li>
<li>
<label class="label"><span class="c_red f12">*</span><%= l(:field_status) %></label>
<li class="fl">
<% if @issue.safe_attribute? 'tracker_id' %>
<label class="label mt3"><span class="c_red f12">*</span>&nbsp;类型&nbsp;&nbsp;:&nbsp;</label>
<%= f.select :tracker_id, @issue.project.trackers.collect { |t| [t.name, t.id] },
{:required => true, :no_label => true},
#:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')",
:class => "w110" %>
<% end %>
</li>
<li class="fl ml41">
<label class="label mt3"><span class="c_red f12">*</span><%= l(:field_status) %></label>
<%# if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
<%= f.select :status_id, (@allowed_statuses.collect { |p| [p.name, p.id] }),
{:no_label => true},
:class => "w150" %>
{:no_label => true},
:class => "w110" %>
</li>
<li>
<label class="label"><span class="c_red f12">*</span><%= l(:field_priority) %></label>
<li class="fl ml41">
<label class="label mt3"><span class="c_red f12">*</span><%= l(:field_priority) %></label>
<% if @issue.safe_attribute? 'priority_id' %>
<%= f.select :priority_id, (@priorities.collect { |p| [p.name, p.id] }),
{:required => true, :no_label => true}, :disabled => !@issue.leaf?,
:class => "w150" %>
{:required => true, :no_label => true}, :disabled => !@issue.leaf?,
:class => "w110" %>
<% end %>
</li>
<li class="clear">
@ -86,7 +86,7 @@
<li class=" clear" >
<%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
{:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
{:onchange => "change_milestone_tip();",:class => "w150"} %>
{:onchange => "change_milestone_tip();", :class => "w150"} %>
</li>
<li class=" clear" id="milestone_option_tips">
<%= @issue.fixed_version.nil? ? "无里程碑" : "已指派里程碑" %>
@ -97,7 +97,8 @@
<li class=" clear" style="border:1px solid #c8c8c8;">
<% if @issue.safe_attribute? 'start_date' %>
<%= f.text_field :start_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
:required => @issue.required_attribute?('start_date'), :onchange=>"issue_start_date_change();", :class=>"fl calendar_input", :style=>"width:170px;" %>
:required => @issue.required_attribute?('start_date'), :onchange=>"issue_start_date_change();",
:class=>"fl calendar_input", :style=>"width:170px;" %>
<%= calendar_for('issue_start_date', 'start_date') if @issue.leaf? %>
<% end %>
</li>
@ -108,20 +109,22 @@
<label class="label02" ></label>
<% if @issue.safe_attribute? 'due_date' %>
<%= f.text_field :due_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
:required => @issue.required_attribute?('due_date'), :onchange=>"issue_end_date_change();", :class=>"fl calendar_input",:style=>"width: 170px;" %>
:required => @issue.required_attribute?('due_date'), :onchange=>"issue_end_date_change();",
:class=>"fl calendar_input",:style=>"width: 170px;", :placeholder=> "请选择结束日期" %>
<%= calendar_for('issue_due_date', 'start_date') if @issue.leaf? %>
<% end %>
</li>
<li class=" clear " id="option_end_date_tips">
<%= @issue.due_date.nil? ? "未选择结束日期" : "已选择结束日期" %>
</li>
<li class=" clear"><%= l(:field_estimated_hours) %></li>
<li class=" clear">
<% if @issue.safe_attribute? 'estimated_hours' %>
<%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true, :required => @issue.required_attribute?('estimated_hours') %>
<%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
:required => @issue.required_attribute?('estimated_hours'), :placeholder=> "请填写预计工时" %>
<% end %>
</li>
<li class=" clear">完成度</li>
<li class=" clear"><%= l(:field_estimated_hours) %></li>
<li class=" clear">
<% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %>
<%= f.select :done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
@ -129,6 +132,7 @@
:onchange => "PrecentChange(this.value)",
:class => "w150" %>
<% end %>
<li class=" clear">完成度</li>
</li>
</ul>
<% end %>
@ -153,4 +157,7 @@
function issue_end_date_change() {
$('#option_end_date_tips').html("已选择结束日期");
}
// 里程碑添加默认选项
$("#issue_fixed_version_id option[value='']").remove();
$('#issue_fixed_version_id').prepend("<option value='0' selected='selected'>选择里程碑</option>")
</script>

View File

@ -16,16 +16,27 @@
</li>
<% end %>
<% else %>
<!--项目收藏-->
<% my_stores = Member.where(:project_id => @project.id, :is_collect => 1).count %>
<li class="mr5 fl"><%= store_project_link(@project.id, User.current.id) %>
<%= link_to my_stores, enshrine_project_path(@project), :class => "pro_new_topbtn fl" %>
</li>
<!--项目创建者不能退出项目-->
<% if User.current.id != @project.user_id %>
<%= exit_project_link(@project) %>
<%= link_to "#{Member.where(:project_id => @project.id).count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员" %>
<li class="mr5 fl">
<a href="javascript:void(0);" class="pro_new_topbtn_left fl "> 已加入</a>
<a href="<%= project_member_path(@project) %>" class=" pro_new_topbtn fl"><%= Member.where(:project_id => @project.id).count %></a>
</li>
<%#= link_to "#{Member.where(:project_id => @project.id).count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员" %>
<% end %>
<% end %>
<!--项目fork-->
<% if @project.gpid && User.current.id != @project.user_id %>
<!-- <div class="fr mt5"><%#= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'},
:class=>"vl_btn", :target => "_blank", :confirm=>"平台将为您创建一个新的同名项目和版本库,请问是否继续?" %>
<span href="javascript:void(0);" class="vl_btn_2 fb"><%#= link_to @project.forked_count.to_i, member_forked_project_path(@project) %></span>
</div>-->
<li class="mr5 fl">
<!-- <a href="<%#= {:controller => 'repositories', :action => 'forked'} %>" class="pro_new_topbtn_left fl" target="_blank">Fork</a>-->
<%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'projects', :action => 'forked_pop'},
:class=>"pro_new_topbtn_left fl", :remote => true %>
<a href="<%= member_forked_project_path(@project) %>" class=" pro_new_topbtn fl"><%= @project.forked_count.to_i %></a>
</li>
<% end %>

View File

@ -0,0 +1,3 @@
var htmlvalue = "<%= escape_javascript(render :partial => 'repositories/forked_popbox') %>";
pop_box_new(htmlvalue,320,316);

View File

@ -0,0 +1,3 @@
<% @members_forked.each do |id| %>
<% %>
<% end %>

View File

@ -39,12 +39,12 @@
<% end %>
<li class="clear">
<label class="fl">公开&nbsp;&nbsp;</label>
<input class="fl mt8" id="project_is_public" name="project[is_public]" type="checkbox" <%= @project.is_public ? "checked" : ""%>>
<input class="fl mt8 ml5" id="project_is_public" name="project[is_public]" type="checkbox" <%= @project.is_public ? "checked" : ""%>>
<span class="fl c_grey ">(打钩为公开项目,不打钩为私有项目;私有项目仅项目成员可见。)</span>
</li>
<li class="clear mb10">
<label class="fl ">隐藏代码库&nbsp;&nbsp;</label>
<input class="fl mt8" id="project_hidden_repo" name="project[hidden_repo]" type="checkbox" <%= @project.hidden_repo ? "checked" : ""%>>
<input class="fl mt8 ml5" id="project_hidden_repo" name="project[hidden_repo]" type="checkbox" <%= @project.hidden_repo ? "checked" : ""%>>
</li>
<li class="clear">
<% if Member.where(:user_id => User.current.id, :project_id => @project.id).first.try(:roles).to_s.include?("Manager") %>

View File

@ -20,7 +20,7 @@
</tr>
</thead>
<tbody>
<% @project.shared_versions.each do |version| %>
<% @project.shared_versions.reverse.each do |version| %>
<tr>
<th class="fl hidden" style="width:156px;" title="<%= version.name %>" >
<%= link_to version.name, version_path(version), :class => "c_blue02" %>

View File

@ -12,8 +12,10 @@
</li>
<li class="mb10 clear">
<label class=" fl">&nbsp;<%= l(:milestone_date_closed) %>&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :effective_date, :size => 10, :readonly => true, :class=>"issues_calendar_input fl", :placeholder=>"结束日期", :style=>"height:28px;", :id => "setting_version_effective_date" %>
<label class=" fl" style="width:105px;border:1px solid #c8c8c8;">
<%= f.text_field :effective_date, :size => 10, :readonly => true, :class=>"issues_calendar_input fl", :placeholder=>"结束日期", :style=>"height:28px;border-left:none;border-top:none;border-bottom:none;", :id => "setting_version_effective_date" %>
<%= calendar_for('setting_version_effective_date') %>
</label>
</li>
<li class="mb10 clear">
<label class="fl">&nbsp;<%= l(:field_status) %>&nbsp;&nbsp;:&nbsp;</label>

View File

@ -1,13 +1,36 @@
<div class="git_usr_title">
<%=link_to @project.owner, user_path(@project.owner), :class => "repository-title-dec" %>
/
<span><%= link_to @repository.identifier.present? ? h(@repository.identifier) : 'root',
{:action => 'show', :id => @project,
:repository_id => @repository.identifier_param,
:path => nil, :rev => @rev },
:class => "repository-title-dec"
%>
</span>
</div>
<% unless @path.blank? %>
<%= link_to "#{@repository.identifier.present? ? h(@repository.identifier) : 'root'}", ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).try(:identifier)}), :class => "c_blue f14 fb" %>
<%#= link_to(@repository.identifier.present? ? h(@repository.identifier) : 'root',
:action => 'show', :id => @project,
:repository_id => @repository.identifier_param,
:path => nil, :rev => @rev)
%>
<%
dirs = path.split('/')
if 'file' == kind
filename = dirs.pop
end
link_path = ''
dirs.each do |dir|
next if dir.blank?
link_path << '/' unless link_path.empty?
link_path << "#{dir}"
%>
<span class="c_grey">/</span> <%= link_to h(dir), {:action => 'show', :id => @project, :repository_id => @repository.identifier_param,
:path => to_path_param(link_path), :rev => @rev}, :class => "f14 fb" %>
<% end %>
<% if filename %>
<span class="c_grey">/</span> <%= link_to h(filename),
{:action => 'changes', :id => @project, :repository_id => @repository.identifier_param,
:path => to_path_param("#{link_path}/#{filename}"), :rev => @rev}, :class => "f14 fb" %>
<% end %>
<%
# @rev is revsion or Git and Mercurial branch or tag.
# For Mercurial *tip*, @rev and @changeset are nil.
rev_text = @changeset.nil? ? @rev : format_revision(@changeset)
%>
<%#= "@ #{h rev_text}" unless rev_text.blank? %>
<% end %>
<% html_title(with_leading_slash(path)) -%>

View File

@ -1,6 +1,19 @@
<div class="autoscroll">
<table class="list entries" id="browser" style="table-layout: fixed;">
<table class="list entries mt5" id="browser" style="table-layout: fixed;">
<tbody>
<tr style="border: 1px solid #DDD; border-bottom:none;">
<td>
<a href="<%= project_roadmap_path(@project) %>" class="fl linkBlue2 mt3" >
<span class="new_roadmap_icons_back mr5"></span>
返回上级目录
</a>
</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
<tbody style="line-height: 1.9;">
<%= render :partial => 'dir_list_content' %>
</tbody>
</table>

View File

@ -0,0 +1,22 @@
<div style="width:460px;">
<div class="sy_popup_top">
<h3 class="fl">提示</h3>
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>
<div class="cl"></div>
</div>
<div class="sy_popup_con" style="width:380px;">
<ul class="sy_popup_add" >
<li class="center mb5" style="line-height:20px">
Fork将在后台执行<br>平台将为您创建一个新的同名项目和版本库,请问是否继续?
</li>
<li class="mt10">
<label class="mr27">&nbsp;</label>
<a href="javascript:void(0);" class="sy_btn_grey fl " onclick="hideModal()">取&nbsp;&nbsp;消</a>
<!-- <a href="<%#= {:controller => 'repositories', :action => 'forked'} %>" class="sy_btn_blue fl ml20" onclick="hideModal();">确&nbsp;&nbsp;定</a>-->
<%= link_to "确 定", {:controller => 'repositories', :action => 'forked'},
:class=>"sy_btn_blue fl ml20", :onclick=>"hideModal();" %>
<div class="cl"></div>
</li>
</ul>
</div>
</div>

View File

@ -0,0 +1,25 @@
<div class="recordBanner mt3">
<% if @changesets_latest_coimmit %>
<% if !user_commit_rep(@changesets_latest_coimmit.author_email).nil? %>
<%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.author_email)), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %>
<span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150 ml5"><%=link_to get_user_by_mail(@changesets_latest_coimmit.author_email).show_name, user_path(user_commit_rep(@changesets_latest_coimmit.author_email)) %></div>
<div class="fl">提交于 <%= time_tag(@changesets_latest_coimmit.created_at) %> 前:</div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span>
<% else %>
<span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150 ml5"><%= @changesets_latest_coimmit.author_email %></div>
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span>
<%end%>
<% end %>
<% if @entry && @entry.kind == 'file' %>
<%= render :partial => 'link_to_functions' %>
<% else %>
<span class="fr mr5 "><font class="fb ml2 mr2 vl_branch mt2"><%= @repository.branches.count %></font> 个分支</span>
<% end %>
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
<%=link_to "#{choise_commit_count(@changesets_all_count, @g_project.commit_count.to_i)} 提交", {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev, :page => 1 ,:commit_count =>"#{@changesets_all_count}"} %></font>
</span>
</div>

View File

@ -1,19 +1,25 @@
<% if @entry && @entry.kind == 'file' %>
<% if action_name != 'entry' %>
<%= link_to l(:label_history), {:action => 'changes', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev }, :class =>"fr mr5"%>
<% else %>
<a class="fr mr5"><%= l(:label_history) %></a>
<% end %>
<p class="mt5 mb5">
<%= link_to_if action_name != 'changes', l(:label_history), {:action => 'changes', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> |
<% if @repository.supports_cat? %>
<%= link_to_if action_name != 'entry', l(:button_view), {:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> |
<% end %>
<% if @repository.supports_cat? %>
<% if action_name != 'entry' %>
<%= link_to l(:button_view), {:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev }, :class =>"fr mr5" %>
<% else %>
<a class="fr mr5"><%= l(:button_view) %></a>
<% end %>
<% end %>
<%# if @repository.supports_annotate? %>
<%#= link_to_if action_name != 'annotate', l(:button_annotate), {:action => 'annotate', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %>
<%# end %>
<%= link_to(l(:button_download),
{:action => 'raw', :id => @project,
:repository_id => @repository.identifier_param,
:path => to_path_param(@path),
:rev => @rev}) if @repository.supports_cat? %>
<%= "(#{number_to_human_size(@entry.size)})" if @entry.size %>
</p>
<%= link_to(l(:button_download),
{:action => 'raw', :id => @project,
:repository_id => @repository.identifier_param,
:path => to_path_param(@path),
:rev => @rev}, :class => "fr mr5") if @repository.supports_cat? %>
<%= "(#{number_to_human_size(@entry.size)})" if @entry.size %>
<% end %>

View File

@ -0,0 +1,5 @@
<div class="fl"><h2 class="project_h2_repository">
<div class="git_usr_title">
<%=link_to @project.owner, user_path(@project.owner), :class => "repository-title-dec" %> / <%= link_to @project.name, project_path(@project), :class => "repository-title-dec" %>
</div></h2>
</div>

View File

@ -1,26 +1,26 @@
<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>
<div class="wrap-big">
<div class="project_r_h">
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
</div>
<div class="project_r_h">
<%= render :partial => "top" %>
</div>
<div class="repository_con " style="line-height:1.9;">
<%= render :partial => 'navigation' %>
<div class="cl"></div>
</div>
<%= render :partial => 'link_to_functions' %>
<%= render_properties(@properties) %>
<div class="mt10">
<%= render(:partial => 'revisions', :locals => {:project => @project, :path => @path , :revisions => @commits, :entry => @entry , :commits_pages => @commits_pages , :commits_count => @commits_count}) unless @commits.empty? %>
</div>
<div class="repository_con " style="line-height:1.9;">
<%= render :partial => 'navigation' %>
<div class="cl"></div>
</div>
<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>
<%= render :partial => 'link_to_functions' %>
<% html_title(l(:label_change_plural)) -%>
<%= render_properties(@properties) %>
<div class="mt10">
<%= render(:partial => 'revisions', :locals => {:project => @project, :path => @path , :revisions => @commits, :entry => @entry , :commits_pages => @commits_pages , :commits_count => @commits_count}) unless @commits.empty? %>
</div>
<div class="cl"></div>
<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
<% end %>
<% html_title(l(:label_change_plural)) -%>
</div>

View File

@ -1,15 +1,8 @@
<div class="container-big">
<div class="project_r_h" style="width:970px;">
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
<div class="project_r_h">
<%= render :partial => "top" %>
</div>
<!--<script>-->
<!--// $(document).ready(function(){-->
<!--// $("#changed-files").click(function(){-->
<!--// $("#changed-files-detail").toggle();-->
<!--// });-->
<!--// });-->
<!--</script>-->
<div class="showing-changes-info fontGrey2"> Commit <a href="javascript:void()" class="linkGrey3">
<div class="showing-changes-info fontGrey2"> Commit <a href="javascript:void(0);" class="linkGrey3">
<%= @commit_details.id %></a><br />
<li class="commit js-toggle-container">
<%= render :partial => 'commit_details', :locals => {:changeset => @commit_details} %>
@ -26,7 +19,7 @@
<% @commit_diff.each do |cd| %>
<div class="showing-changes-row fontGrey2">
<a href="javascript:void()" class="linkGrey3" id="changed-files">
<a href="javascript:void(0);" class="linkGrey3" id="changed-files">
<img src="/images/vlicon/file.png" width="18" height="20" style="vertical-align:middle;" class="mr5" /><%= cd.new_path %>
</a>
</div>

View File

@ -1,14 +1,15 @@
<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>
<div class="wrap-big">
<div style="padding-left: 8px;">
<div class="contextual">
<div class="contextual mt-5 mb5">
<%= render :partial => 'navigation' %>
</div>
<h3><%= l(:label_revision_path) %> <%= @path %></h3>
<%= render :partial => 'link_to_functions' %>
<!--目录跳转-->
<div class="fl mt3">
<%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
</div>
<div class="cl"></div>
<%= render :partial => 'latest_commit' %>
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
<% content_for :header_tags do %>

View File

@ -1,21 +1,7 @@
<%#= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
<div class="wrap-big">
<div class="project_r_h">
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
<% unless @entries.nil? %>
<a href="<%= @zip_path %>" class="btn_zipdown fr" onclick="">ZIP下载</a>
<% if User.current.member_of?(@project) && @project.is_public? %>
<% if quality_analysis(User.current.try(:login), @repository.id).nil? %>
<%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "1"), :remote => true, :class => "btn_zipdown fr" %>
<% else %>
<%= link_to "重新分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "2"), :remote => true, :class => "btn_zipdown fr" %>
<% end %>
<% end %>
<% end %>
<!--quality_analysis-->
<% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %>
<%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fr" %>
<% end %>
<%= render :partial => "top" %>
</div>
<div class="repository_con" style="line-height:1.9;">
<% if @entries.nil? %>
@ -38,40 +24,32 @@
<div class="fl c_grey02 mt5 mr5">克隆网址:</div>
<textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" ><%= @repos_url.to_s.lstrip %></textarea>
<a href="javascript:void(0);" class="clone_btn mt5" onclick="jsCopy()"><span class="vl_copy" title="点击复制版本库地址"></span></a>
<!--quality_analysis-->
<% unless @entries.nil? %>
<a href="<%= @zip_path %>" class="btn_zipdown fr" onclick="">ZIP下载</a>
<% if User.current.member_of?(@project) && @project.is_public? %>
<% if quality_analysis(User.current.try(:login), @repository.id).nil? %>
<%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "1"), :remote => true, :class => "btn_zipdown fr" %>
<% else %>
<%= link_to "重新分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "2"), :remote => true, :class => "btn_zipdown fr" %>
<% end %>
<% end %>
<% end %>
<% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %>
<%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fr" %>
<% end %>
<div class="fl mt5 ml15">
<%=link_to "代码统计", stats_repository_project_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :creator => @creator, :default_branch => @g_default_branch ), :class => "fl vl_zip" %>
</div>
<% if User.current.id != @project.user_id %>
<div class="fr mt5"><%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn", :target => "_blank", :confirm=>"平台将为您创建一个新的同名项目和版本库,请问是否继续?" %>
<span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span>
</div>
<% end %>
<div class="cl"></div>
<div class="recordBanner mt10">
<% if @changesets_latest_coimmit %>
<% if !user_commit_rep(@changesets_latest_coimmit.author_email).nil? %>
<%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.author_email)), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %>
<span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150"><%=link_to get_user_by_mail(@changesets_latest_coimmit.author_email).show_name, user_path(user_commit_rep(@changesets_latest_coimmit.author_email)) %></div>
<div class="fl">提交于 <%= time_tag(@changesets_latest_coimmit.created_at) %> 前:</div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span>
<% else %>
<span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150"><%= @changesets_latest_coimmit.author_email %></div>
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span>
<%end%>
<% end %>
<span class="fr mr5 "><font class="fb ml2 mr2 vl_branch mt2">
<%= @repository.branches.count %></font> 个分支
</span>
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
<%=link_to "#{choise_commit_count(@changesets_all_count, @g_project.commit_count.to_i)} 提交", {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev, :page => 1 ,:commit_count =>"#{@changesets_all_count}"} %></font>
</span>
<!--目录跳转-->
<div class="mt3">
<%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
</div>
<div class="cl"></div>
<%= render :partial => 'latest_commit' %>
<div class="cl"></div>
<% end %>
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>

View File

@ -1,4 +1,4 @@
<div id="muban_popup_box" style="width:820px;">
<div id="muban_popup_box" style="width:800px;">
<div class="muban_popup_top">
<h3 class="fl">编辑里程碑</h3>
<a href="javascript:void(0);" class="muban_icons_close fr" onclick="hideModal()"></a>
@ -17,18 +17,20 @@
<p class="c_orange ml100" style="display: none" id="pupub_project_setting_version_title">标题不能为空</p>
</li>
<li class="mb10 clear">
<label class=" fl">&nbsp;描述&nbsp;&nbsp;:&nbsp;</label>
<label class="fl ml5">&nbsp;描述&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :description, :maxlength => 60, :class=>"w650 fl", :style=>"height:28px;", :no_label => true %>
</li>
<!--<li class="mb10 clear">-->
<!--<label class=" fl"><span class="c_red f12">*</span>&nbsp;结束日期&nbsp;&nbsp;:&nbsp;</label>-->
<!--<%#= f.text_field :effective_date, :size => 10, :readonly => true,:class=>"issues_calendar_input fl", :id => "version_effective_date2", :placeholder=>"结束日期", :style=>"height:28px;", :no_label => true %>-->
<!--<%#= calendar_for('version_effective_date2') %>-->
<li class="mb10 clear">
<label class=" fl"><span class="c_red f12">*</span>&nbsp;日期&nbsp;&nbsp;:&nbsp;</label>
<label class=" fl" style="border:1px solid #c8c8c8;">
<%= f.text_field :effective_date, :size => 10, :readonly => true,:class=>"issues_calendar_input fl", :id => "version_effective_date2", :placeholder=>"结束日期", :style=>"height:28px;border-left:none;border-top:none;border-bottom:none", :no_label => true %>
<%#= calendar_for('version_effective_date2') %>
<!--<input type="text" placeholder="结束日期" class="issues_calendar_input fl ">-->
<!--<a href="" class="issues_data_img fl"></a>-->
</label>
</li>
<li class="mb10 clear">
<label class=" fl">&nbsp;状态&nbsp;&nbsp;:&nbsp;</label>
<label class="fl ml5">&nbsp;状态&nbsp;&nbsp;:&nbsp;</label>
<%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]},{:no_label => true },{:style=>"height:28px;"} %>
</li>
<% if params[:action] == "index" %>
@ -37,7 +39,7 @@
<input value="true" name="is_create" type="hidden">
<% end %>
</ul>
<a href="javascript:void(0);" class="fr sy_btn_grey mr45" onclick="hideModal()">取消</a>
<a href="javascript:void(0);" class="fr sy_btn_grey mr80" onclick="hideModal()">取消</a>
<a href="javascript:void(0);" class="fr sy_btn_blue mr5" onclick="popub_project_version_commit();">保存</a>
<% end %>
</div>
@ -51,8 +53,8 @@
{
if(popub_regex_version_name())
{
hideModal();
$("#popub_new_project_version_form").submit();
hideModal();
}
}

View File

@ -11,7 +11,7 @@
<tbody>
<% @version_issue_assigned_name.each do | assigned | %>
<tr>
<td><%= User.find(assigned[0]).show_name %></td>
<td><%= User.find(assigned[0]).try(:show_name) %></td>
<td><%= Issue.where(:fixed_version_id => @version.id, :assigned_to_id => assigned[0]).count %></td>
<td><%= Issue.where(:fixed_version_id => @version.id, :assigned_to_id => assigned[0], :status_id => 3).count %></td>
<td><%= Issue.where(:fixed_version_id => @version.id, :assigned_to_id => assigned[0], :status_id => 5).count %></td>

View File

@ -1,4 +1,4 @@
<div id="muban_popup_box" style="width:820px;">
<div id="muban_popup_box" style="width:800px;">
<div class="muban_popup_top">
<h3 class="fl">新建里程碑</h3>
<a href="javascript:void(0);" class="muban_icons_close fr" onclick="hideModal()"></a>
@ -17,22 +17,22 @@
<p class="c_orange ml100" style="display: none" id="pupub_project_setting_version_title">标题不能为空</p>
</li>
<li class="mb10 clear">
<label>&nbsp;描述&nbsp;&nbsp;:&nbsp;</label>
<label class="ml5">&nbsp;描述&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :description, :maxlength => 60, :class=>"w650", :style=>"height:28px;", :no_label => true %>
</li>
<!--<li class="mb10 clear">-->
<!--<label class=" fl">&nbsp;结束日期&nbsp;&nbsp;:&nbsp;</label>-->
<!--<%#= f.text_field :effective_date, :size => 10, :readonly => true, :class => "issues_calendar_input fl", :id => "version_effective_date_create", :placeholder=>"结束日期", :style=>"height:28px;", :no_label => true %>-->
<!--<%#= calendar_for('version_effective_date_create') %>-->
<!--&lt;!&ndash;<input type="text" placeholder="结束日期" class="issues_calendar_input fl ">&ndash;&gt;-->
<!--&lt;!&ndash;<a href="" class="issues_data_img fl"></a>&ndash;&gt;-->
<!--</li>-->
<li class="mb10 clear">
<label>&nbsp;状态&nbsp;&nbsp;:&nbsp;</label>
<label class=" fl ml5">&nbsp;日期&nbsp;&nbsp;:&nbsp;</label>
<label class=" fl" style="border:1px solid #c8c8c8;">
<%= f.text_field :effective_date, :size => 10, :readonly => true, :class => "issues_calendar_input fl ml3", :id => "version_index_create_name", :placeholder=>"结束日期", :style=>"height:28px;border-left:none;border-top:none;border-bottom:none;", :no_label => true %>
<%#= calendar_for('version_index_create_name') %>
</label>
</li>
<li class="mb10 clear">
<label class="ml5">&nbsp;状态&nbsp;&nbsp;:&nbsp;</label>
<%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]},{:no_label => true },{:style=>"height:28px;"} %>
</li>
</ul>
<a href="javascript:void(0);" class="fr sy_btn_grey mr45" onclick="hideModal()">取消</a>
<a href="javascript:void(0);" class="fr sy_btn_grey mr80" onclick="hideModal()">取消</a>
<a href="javascript:void(0);" class="fr sy_btn_blue mr5" onclick="popub_project_version_commit();">保存</a>
<% end %>
</div>
@ -46,8 +46,8 @@
{
if(popub_regex_version_name())
{
hideModal();
$("#popub_new_project_version_form").submit();
hideModal();
}
}

View File

@ -1,3 +1,7 @@
var htmlvalue = "<%= escape_javascript(render :partial => 'versions/edit') %>";
pop_box_new(htmlvalue,820,316);
var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
$(function() { $('#version_effective_date2').datepicker(datepickerOptions);
// $('#evaluation_end_time').datepicker(datepickerOptions);
});

View File

@ -1,3 +1,4 @@
<script type="text/javascript" src="/javascripts/i18n/jquery.ui.datepicker-en.js"></script>
<!--里程碑列表开始-->
<div class="new_roadmap_conbox mb10" >
<div class="new_roadmap_navbox clear">

View File

@ -1,2 +1,6 @@
var htmlvalue = "<%= escape_javascript(render :partial => 'versions/new_milestone') %>";
pop_box_new(htmlvalue,820,316);
var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
$(function() { $('#version_index_create_name').datepicker(datepickerOptions);
// $('#evaluation_end_time').datepicker(datepickerOptions);
});

View File

@ -775,6 +775,7 @@ RedmineApp::Application.routes.draw do
get 'member', :to => 'projects#member', :as => 'member'
match 'store_mine', :to => 'projects#store_mine', :as => 'store_mine'
match 'enshrine', :to => 'projects#enshrine', :as => 'enshrine'
match 'member_forked', :to => 'projects#member_forked', :as => 'member_forked'
get 'file', :action => 'file', :as => 'file'
get 'statistics', :action => 'statistics', :as => 'statistics'
get 'repository_tree_changes', :action => 'repository_tree_changes', :as => 'repository_tree_changes'
@ -794,6 +795,7 @@ RedmineApp::Application.routes.draw do
post 'unarchive'
post 'close'
post 'reopen'
get 'forked_pop'
get 'search_public_orgs_not_in_project'
match 'copy', :via => [:get, :post]
match 'set_public_or_private', :via => [:post]
@ -808,7 +810,6 @@ RedmineApp::Application.routes.draw do
match '/file', :to => 'projects#file', :as => 'file', :via => :get
match '/statistics', :to => 'projects#statistics', :as => 'statistics', :via => :get
match '/watcherlist', :to=>'projects#watcherlist', :as => 'watcherlist', :via => :get #add by huang
resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
collection do
get 'autocomplete'

View File

@ -103,7 +103,7 @@ feeds_limit:
default: 15
gantt_items_limit:
format: int
default: 500
default: 10000
# Maximum size of files that can be displayed
# inline through the file viewer (in KB)
file_max_size_displayed:

View File

@ -137,7 +137,7 @@ module Redmine
def issues
@issues ||= @query.issues(
:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
:order => "#{Project.table_name}.lft ASC, #{Issue.table_name}.id ASC",
:order => "#{Project.table_name}.lft DESC, #{Issue.table_name}.updated_on DESC",
:limit => @max_rows
)
end
@ -677,15 +677,16 @@ module Redmine
# Sorts a collection of issues by start_date, due_date, id for gantt rendering
def sort_issues!(issues)
issues.sort! { |a, b| gantt_issue_compare(a, b) }
# issues.sort! { |a, b| gantt_issue_compare(a, b) }
issues
end
# TODO: top level issues should be sorted by start date
def gantt_issue_compare(x, y)
if x.root_id == y.root_id
x.lft <=> y.lft
x.updated_on <=> y.updated_on
else
x.root_id <=> y.root_id
x.updated_on <=> y.updated_on
end
end

View File

@ -103,10 +103,10 @@ function addFile(inputEl, file, eagerUpload,btnId) {
fileSpan.append(
$('<input>', {
'type': 'text',
'class': 'upload_filename readonly',
'class': 'upload_filename readonly hidden',
'name': 'attachments[' + attachmentId + '][filename]',
'readonly': 'readonly',
'style': 'border:none;'
'style': 'border:none; width:464px;'
}).val(file.name),
// $('<input>', {
// 'type': 'text',
@ -127,7 +127,8 @@ function addFile(inputEl, file, eagerUpload,btnId) {
// }).toggle(!eagerUpload),
$('<a>&nbsp</a>').attr({
'href': "#",
'class': 'remove-upload'
'class': 'remove-upload',
'style': 'vertical-align:top;'
}).click(function() {
if (confirm($(inputEl).data('areYouSure'))) {
removeFile();

View File

@ -122,6 +122,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.ml36{ margin-left:36px; }
.ml38{ margin-left:38px;}
.ml40{ margin-left:40px;}
.ml41{ margin-left:41px;}
.ml45{ margin-left:45px;}
.ml48{ margin-left:48px;}
.ml50{ margin-left: 50px;}
@ -182,6 +183,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.mt-20 {margin-top:-20px;}
.mt-10 {margin-top:-10px;}
.mt-4 {margin-top:-4px;}
.mt-5 {margin-top:-5px;}
.mt-2 {margin-top:-2px;}
.mt0 {margin-top: 0px !important;}
.mt1{margin-top: 1px;}
@ -236,7 +238,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w80{ width:80px;}
.w90{ width:90px;}
.w100 {width: 100px;}
.w110{width:110px;}
.w110{width:110px !important;}
.w108 {width:108px;}
.w125{width:125px;}
.w128{ width:128px;}

View File

@ -216,9 +216,6 @@ p.percent {
float: right;
white-space: nowrap;
line-height: 1.4em;
padding-left: 10px;
padding-right: 10px;
padding-top: 5px;
font-size: 0.9em;
}

View File

@ -289,5 +289,5 @@ li.commit .commit-row-info .committed_ago {
}
.rep_mail_name{max-width: 150px; overflow: hidden; text-overflow: ellipsis;}
a.btn_zipdown{ display:block; height:25px; width:80px; text-align: center; line-height: 25px; border: 1px solid #dddddd; background-image: linear-gradient(#FCFCFC, #EEE);
color: #7f7f7f; -webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; margin-top: 7px; margin-right: 5px;}
color: #7f7f7f; -webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; margin-left: 5px;}
a:hover.btn_zipdown{color:#269ac9;}

View File

@ -34,7 +34,7 @@ li.change .copied-from:before { content: " - "}
#changes-legend { float: right; font-size: 0.8em; margin:0; margin-right: 10px; }/*by young*/
#changes-legend li { float: left; background-position: 5px 0; }
table.filecontent { border: 1px solid #e2e2e2; border-collapse: collapse; width:98%; background-color: #fafafa; }
table.filecontent { border: 1px solid #e2e2e2; border-collapse: collapse; width:99%; background-color: #fafafa; }
table.filecontent tbody {font-family:"Liberation Mono", Courier, monospace; font-size:12px;}
table.filecontent th { border: 1px solid #e2e2e2; background-color: #eee; }
table.filecontent th.filename { background-color: #e4e4d4; text-align: left; padding:5px;}