Merge branch 'develop' into cxt_course

This commit is contained in:
cxt 2016-11-15 16:57:33 +08:00
commit 2dc717df0c
99 changed files with 762 additions and 468 deletions

View File

@ -24,7 +24,7 @@ gem 'rubyzip'
gem 'delayed_job_active_record'#, :group => :production
gem 'daemons'
gem 'grape', '~> 0.9.0'
gem 'grape-entity'
gem 'grape-entity', '= 0.4.5'
gem 'rack-cors', :require => 'rack/cors'
gem 'seems_rateable', '~> 1.0.13'
gem 'rails', '~> 3.2'

View File

@ -1,3 +1,4 @@
#coding=utf-8
module Mobile
module Entities
class Issue <Grape::Entity
@ -19,13 +20,13 @@ module Mobile
when :issue_priority
get_issue_priority_api issue.priority_id
when :issue_assigned_to
(get_user(issue.assigned_to_id)).login
issue.assigned_to_id.nil? ? "未指派" : (get_user(issue.assigned_to_id)).login
when :issue_status
IssueStatus.find(issue.status_id).name
when :comment_count
issue.journals.where("notes is not null and notes != ''").count
# all_comments = []
# get_all_children(all_comments, f).count
# all_comments = []
# get_all_children(all_comments, f).count
when :project_name
issue.project.name
when :praise_count

View File

@ -34,11 +34,11 @@ class HomeworkCommonController < ApplicationController
@homeworks = paginateHelper @homework_commons,10
#设置at已读
@homeworks.each do |homework|
homework.journals_for_messages.each do |j|
User.current.at_messages.unviewed('JournalsForMessage', j.id).each {|x| x.viewed!}
end
# homework.journals_for_messages.each do |j|
# User.current.at_messages.unviewed('JournalsForMessage', j.id).each {|x| x.viewed!}
# end
homework.delay.set_jour_viewed
end
@left_nav_type = 3
respond_to do |format|
format.js

View File

@ -234,8 +234,10 @@ 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
@issue.assigned_to_id = nil if @issue.assigned_to_id == 0
if @issue.save
#params[:issue][:assigned_to_id] = nil if params[:issue][:assigned_to_id].to_i == 0
senduser = User.find(params[:issue][:assigned_to_id])
issue_id = @issue.id
issue_title = params[:issue][:subject]
@ -282,15 +284,18 @@ class IssuesController < ApplicationController
# 用户编辑更改issue
def update
# params[:assigned_to_id] = nil if params[:assigned_to_id].to_i == 0
if params[:issue_detail]
issue = Issue.find(params[:id])
issue = update_user_issue_detail(issue, params)
@issue.assigned_to_id = nil if @issue.assigned_to_id == 0
@saved = update_user_issue_detail(issue, params)
return
else
# 修改实例变量的值
return unless update_issue_from_params
@issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
@issue.assigned_to_id = nil if @issue.assigned_to_id == 0
saved = false
begin
@saved = @issue.save_issue_with_child_records(params, @time_entry)

View File

@ -533,7 +533,7 @@ class ProjectsController < ApplicationController
@project.update_attribute(:is_public, 1)
end
end
# by young
# include CoursesHelper
def member
# 消息"同意加入项目"
@ -597,6 +597,12 @@ class ProjectsController < ApplicationController
end
def member_forked
@forked_projects = Project.where(:forked_from_project_id => @project.id)
# @forked_members = 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 +762,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 +955,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"
@ -1208,10 +1204,6 @@ class UsersController < ApplicationController
#引入资源列表根据关键词过滤
def user_ref_resource_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"
@ -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

@ -13,7 +13,7 @@ class WechatsController < ActionController::Base
# elsif join_project_request(request)
# sendBindProject(request, {invite_code: content})
# else
request.reply.text "您的意见已收到,非常感谢~ \n更多问题可以通过以下方式联系我们:\n官方QQ群173184401\n我们会认真聆听您的意见和建议。"
request.reply.text "您的意见已收到,非常感谢~ \n更多问题可以通过以下方式联系我们:\n官方QQ群373967360\n我们会认真聆听您的意见和建议。"
# end
end
@ -137,7 +137,7 @@ class WechatsController < ActionController::Base
on :fallback, respond: 'fallback message'
on :click, with: 'FEEDBACK' do |request, key|
request.reply.text "如有问题反馈,请您:\n1、直接切换至输入框发微信给我们。\n2、加入QQ群173184401,直接互动。\n\n如您有合作事宜洽谈,请联系:\n王林春 老师\n手机13467631747\nQQ494496321"
request.reply.text "如有问题反馈,请您:\n1、直接切换至输入框发微信给我们。\n2、加入QQ群373967360,直接互动。\n\n如您有合作事宜洽谈,请联系:\n王林春 老师\n手机13467631747\nQQ494496321"
end
on :click, with: 'MY_NEWS' do |request, key|

View File

@ -54,6 +54,18 @@ module ApplicationHelper
Project.find(forked_from_project_id)
end
# 判断当前用户是否已经fork过当前项目
# project: current_project
def has_forked_cur_project project
cur_user_projects = Project.where(:user_id => User.current.id)
if cur_user_projects.count == 0
false
else
has_forked = cur_user_projects.select{|cur_user_project| cur_user_project.forked_from_project_id == project.id}
has_forked.length > 0 ? true : false
end
end
# 通过系统外部邮箱查找用户,如果用户不存在则用邮箱替换
def get_user_by_mail mail
user = User.find_by_mail(mail)
@ -67,12 +79,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
@ -1013,7 +1025,7 @@ module ApplicationHelper
def project_member_check_box_tags_ex name, principals
s = ''
principals.each do |principal|
s << "<li class='mb5'>#{ check_box_tag name, principal.id, false, :id => nil} #{h link_to principal.userInfo, user_url_in_org( principal.id)}</li>\n"
s << "<li class='mb5'>#{ check_box_tag name, principal.id, false, :id => nil} #{h link_to principal.userInfo, user_url_in_org( principal), :target => "_blank"}</li>\n"
end
s.html_safe
end
@ -2934,32 +2946,34 @@ module ApplicationHelper
#根据传入作业确定显示为提交作品、补交作品、查看作品等
def student_for_homework_common homework
if User.current.member_of_course?(homework.course)
if User.current.allowed_to?(:as_teacher, homework.course)
link_to "查看作品", student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green fr mt5', :title => "查看作品", :target => '_blank'
else User.current.member_of_course?(homework.course)
work = cur_user_works_for_homework homework
project = cur_user_projects_for_homework homework
if work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
link_to "查看详情", homework_common_index_path(:course_id => homework.course_id), :class => 'hw_btn_green2 fr mt5',:title => '查看分组作业详情', :target => '_blank'
link_to "查看详情", homework_common_index_path(:course_id => homework.course_id), :class => 'hw_btn_green fr mt5',:title => '查看分组作业详情', :target => '_blank'
else
link_to "提交作品", new_student_work_url_without_domain(homework.id),:class => 'hw_btn_green2 fr mt5', :target => '_blank'
link_to "提交作品", new_student_work_url_without_domain(homework.id),:class => 'hw_btn_green fr mt5', :target => '_blank'
end
elsif work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d")
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
link_to "查看详情", homework_common_index_path(:course_id => homework.course_id), :class => 'hw_btn_green2 fr mt5',:title => '查看分组作业详情', :target => '_blank'
link_to "查看详情", homework_common_index_path(:course_id => homework.course_id), :class => 'hw_btn_green fr mt5',:title => '查看分组作业详情', :target => '_blank'
else
link_to "补交作品", new_student_work_url_without_domain(homework.id),:class => 'btn_orange_big fr mt5', :target => '_blank'
end
else
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green2 fr mt5', :title => "开启匿评后不可修改作品", :target => '_blank'
link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green fr mt5', :title => "开启匿评后不可修改作品", :target => '_blank'
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
link_to "查看作品",student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green2 fr mt5', :title => "匿评已结束", :target => '_blank'
link_to "查看作品",student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green fr mt5', :title => "匿评已结束", :target => '_blank'
elsif homework.homework_type == 2 && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")#编程作业不能修改作品
link_to "修改作品", new_student_work_url_without_domain(homework.id),:class => 'hw_btn_green2 fr mt5', :target => '_blank'
link_to "修改作品", new_student_work_url_without_domain(homework.id),:class => 'hw_btn_green fr mt5', :target => '_blank'
elsif Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") && work.user_id == User.current.id
link_to "修改作品", edit_student_work_url_without_domain(work.id),:class => 'hw_btn_green2 fr mt5', :target => '_blank'
link_to "修改作品", edit_student_work_url_without_domain(work.id),:class => 'hw_btn_green fr mt5', :target => '_blank'
else
link_to "查看作品", student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green2 fr mt5', :title => "作业截止后不可修改作品", :target => '_blank'
link_to "查看作品", student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green fr mt5', :title => "作业截止后不可修改作品", :target => '_blank'
end
end
end

View File

@ -39,7 +39,7 @@ module MembersHelper
end
principals = paginateHelper scope,10
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true){|text, parameters, options|
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q],:flag => true, :format => 'js')), :remote => true
}
s + content_tag('ul', links,:class => 'wlist', :id => "course_member_pagination_links" )

View File

@ -73,20 +73,50 @@ class HomeworkCommon < ActiveRecord::Base
if self.homework_detail_manual.comment_status == 0
self.course_messages.destroy_all
else
self.course.members.each do |m|
# if m.user_id != self.user_id
#self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
if count == 0
ws = WechatService.new
name = self.course.syllabus.nil? ? self.course.name : self.course.syllabus.title+""+self.course.name
ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name}#{l(:label_new_homework_template)}", name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。")
end
# end
end
# self.course.members.each do |m|
# # if m.user_id != self.user_id
# #self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
# rolesids = []
# m.roles.each do |role|
# rolesids << role.id
# end
# if rolesids.include?(10)
# count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
# if count == 0
# ws = WechatService.new
# name = self.course.syllabus.nil? ? self.course.name : self.course.syllabus.title+" • "+self.course.name
# ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name}#{l(:label_new_homework_template)}", name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。")
# end
# end
# # end
# end
self.delay.send_homework_wechat_message_delay
end
end
end
#作业微信通知delay
def send_homework_wechat_message_delay
self.course.members.each do |m|
# if m.user_id != self.user_id
#self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
rolesids = []
m.roles.each do |role|
rolesids << role.id
end
if rolesids.include?(10)
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
if count == 0
ws = WechatService.new
name = self.course.syllabus.nil? ? self.course.name : self.course.syllabus.title+""+self.course.name
ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name}#{l(:label_new_homework_template)}", name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。")
end
end
# end
end
end
#动态的更新
def update_activity
update_course_activity(self.class, self.id)
@ -135,6 +165,12 @@ class HomeworkCommon < ActiveRecord::Base
# end
# end
def set_jour_viewed
self.journals_for_messages.each do |j|
User.current.at_messages.unviewed('JournalsForMessage', j.id).each {|x| x.viewed!}
end
end
delegate :language_name, :language, :to => :homework_detail_programing
end

View File

@ -78,7 +78,7 @@ class JournalsForMessage < ActiveRecord::Base
:act_as_principal_activity, :act_as_student_score
after_create :reset_counters!
#after_update :update_activity
after_destroy :reset_counters!
# after_destroy :reset_counters!
after_save :be_user_score
after_destroy :down_user_score, :down_course_score

View File

@ -4,7 +4,7 @@ class StudentWork < ActiveRecord::Base
belongs_to :homework_common
belongs_to :user
has_many :student_work_projects
has_many :student_work_projects, :dependent => :destroy
has_many :student_works_evaluation_distributions, :dependent => :destroy
has_many :student_works_scores, :dependent => :destroy
belongs_to :project

View File

@ -322,9 +322,10 @@ class User < Principal
end
# id 转换成 登录名
# def to_param
# self.login.to_i > 0 ? id : login
# end
# 如果是整数就去ID否则就取login
def to_param
(self.login.to_i.to_s == self.login || self.login.include?(".") || self.login.include?("%") || self.login.include?("?")) ? 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 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 %>
<% unless @attachment.container.nil? %>
$("#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%>")) {

View File

@ -1,3 +1,6 @@
$('#issue_confirm').removeAttr("disabled");
$('#issue_confirm').css('background-color', '#3b94d6');
$('#issue_confirm').css('cursor','pointer');
var fileSpan = $('#attachments_<%= j params[:attachment_id] %>');
<% if(!@attachment.nil? && @attachment.new_record?) %>
fileSpan.hide();

View File

@ -21,9 +21,9 @@
<ul class="list-file">
<li><span class="item_list fl"></span>
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl" %>
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=> activity.author, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl" %>
<% else %>
<%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl"%>
<%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl"%>
<% end %>
<%# if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %>
<!--<span class="font_normal ml10 fr">[已设为首页]</span>-->

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

@ -1,6 +1,6 @@
<% is_teacher = User.current.allowed_to?(:as_teacher, @course) || User.current.admin? %>
<% if members.any? %>
<table class="sy_new_table clear sy_new_table_width" cellpadding="0" cellspacing="0">
<table class="sy_new_table clear sy_new_table_width" cellpadding="0" cellspacing="0" id="student_list_table">
<thead>
<tr class="clear">
<th class="sy_th6">序号</th>
@ -123,7 +123,7 @@
<%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id, :group_id => @group && @group != -1 ? @group.id : (@group && @group == -1 ? -1 : 0)},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %>
<div class="select-class-option">
<span class="hidden" style="display:inline-block; vertical-align:middle; max-width:70px;"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
<a href="javascript:void(0)" class="sy_icons_edit pic_edit_icon" alt="编辑" style="background-position:0 5px;"></a>
<a href="javascript:void(0)" class="sy_icons_edit pic_edit_icon fr mt9 options_show_or_hide" alt="编辑" style="background-position:0 5px;"></a>
</div>
<%= select( :name,:group_id, course_group_option(@course),
{ :include_blank => false,:selected => member.course_group_id},
@ -136,7 +136,7 @@
</td>
<% if is_teacher %>
<td>
<a href="javascript:void(0)" onClick="delete_confirm_box('<%=delete_member_course_path(@course, :member_id => member.id) %>', '确认删除该成员吗?');" class="sy_icons_del fl"></a>
<a href="javascript:void(0)" onClick="delete_confirm_box('<%=delete_member_course_path(@course, :member_id => member.id) %>', '确认删除该成员吗?');" class="sy_icons_del fl options_show_or_hide"></a>
</td>
<% end %>
</tr>
@ -159,6 +159,11 @@
<script>
$(document).ready(function(){
// $("#student_list_table").mouseover(function(){
// $(".options_show_or_hide").show();
// }).mouseout(function(){
// $(".options_show_or_hide").hide();
// });
$(".pic_edit_icon").click(function(){
$(this).parent().hide();
$(this).parent().next().show();

View File

@ -2,3 +2,4 @@ hideModal();
$("#member_li_<%=params[:member_id] %>").html("");
$("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>");
$("#group_children_list").html("<%= escape_javascript( render :partial => 'layouts/group_children_list', :locals => {:course => @course})%>");
$("#student_number").html("<%= studentCount(@course) %>");

View File

@ -15,7 +15,7 @@ alert("班级已过期\n请联系班级管理员重启班级。(在配置班级
alert("您已经加入了班级");
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
<% elsif @state == 4 %>
alert("您加入的班级不存在");
alert("您输入的邀请码错误");
<% elsif @state == 5 %>
alert("您还未登录");
<% elsif @state == 6 %>

View File

@ -3,3 +3,4 @@
*/
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @members})%>");
$("#group_children_list").html("<%= escape_javascript( render :partial => 'layouts/group_children_list', :locals => {:course => @course})%>");

View File

@ -1,5 +1,5 @@
<p ondblclick=show_edit_file_description('<%= file.id %>')>
<span style="white-space:nowrap;">资源描述:</span><% if file.description.blank? %><span style="color:#C5C5BE; cursor:pointer;" title="双击可编辑">双击添加描述</span><% else %><span style="cursor:pointer;" title="双击可编辑" class="break_word"><%= file.description %></span><% end %>
<span style="white-space:nowrap;">资源描述:</span><% if file.description.blank? %><span style="color:#C5C5BE; cursor:pointer;" title="双击可编辑">双击添加描述</span><% else %><span id="file_description_tip_<%= file.id %>" style="cursor:pointer;" title="双击可编辑" class="break_word"><%= file.description %></span><% end %>
<%#= file.description.blank? ? "该资源暂无描述" : file.description %>
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :onclick => "show_edit_file_description("+file.id.to_s+");"%>
</p>

View File

@ -45,7 +45,7 @@
</div>
<%= form_tag(edit_file_description_org_subfield_file_path(file, :org_subfield_id => org_subfield.id ),:remote=>'true', :method => :post, :id=>"files_query_form_#{file.id}") do %>
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" name="file_description_edit" id="file_description_edit_<%= file.id %>"
onblur="commit_files_description('#files_query_form_<%= file.id %>');"><%= file.description %></textarea>
onblur="commit_files_description('#files_query_form_<%= file.id %>','#file_description_edit_<%= file.id %>','#file_description_show_<%= file.id %>','#file_description_tip_<%= file.id %>');"><%= file.description %></textarea>
<% end %>
</div>
<% else %>
@ -117,7 +117,13 @@
<% end%>
<script>
function commit_files_description(id) {
function commit_files_description(id,des_id,show_id,tip_id) {
if($(tip_id).text() == $(des_id).val()){
$(des_id).hide();
$(show_id).show();
return;
}
$(id).submit();
}
</script>

View File

@ -42,7 +42,7 @@
</div>
<%= form_tag(edit_file_description_project_file_path(file, :project_id => project.id),:remote=>'true', :method => :post, :id=>"files_query_form_#{file.id}") do %>
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" name="file_description_edit" id="file_description_edit_<%= file.id %>"
onblur="commit_files_description('#files_query_form_<%= file.id %>');"><%= file.description %></textarea>
onblur="commit_files_description('#files_query_form_<%= file.id %>','#file_description_edit_<%= file.id %>','#file_description_show_<%= file.id %>','#file_description_tip_<%= file.id %>');"><%= file.description %></textarea>
<% end %>
</div>
<% else %>
@ -73,7 +73,13 @@
</ul>
<script>
function commit_files_description(id) {
function commit_files_description(id,des_id,show_id,tip_id) {
if($(tip_id).text() == $(des_id).val()){
$(des_id).hide();
$(show_id).show();
return;
}
$(id).submit();
}
</script>

View File

@ -44,11 +44,11 @@
</div>
<%= form_tag(edit_file_description_course_file_path(file, :course_id => @course.id),:remote=>'true', :method => :post, :id=>"files_query_form_#{file.id}") do %>
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" name="file_description_edit" id="file_description_edit_<%= file.id %>"
onblur="commit_files_description('#files_query_form_<%= file.id %>');"><%= file.description %></textarea>
onblur="commit_files_description('#files_query_form_<%= file.id %>','#file_description_edit_<%= file.id %>','#file_description_show_<%= file.id %>','#file_description_tip_<%= file.id %>');"><%= file.description %></textarea>
<% 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 %>
@ -105,7 +105,13 @@
</div>
<div class="cl"></div>
<script>
function commit_files_description(id) {
function commit_files_description(id,des_id,show_id,tip_id) {
if($(tip_id).text() == $(des_id).val()){
$(des_id).hide();
$(show_id).show();
return;
}
$(id).submit();
}
</script>

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">
@ -62,7 +62,8 @@
<a href="javascript:void(0);" onclick="issueDetailShow();" class="sy_btn_grey mr5 fr" > 取消 </a>
<% end %>
<!--<a href="javascript:void(0);" class="sy_btn_blue mr5 fr"> 保存并继续</a>-->
<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="sy_btn_blue mr5 fr" id="issue_confirm"> 保存</a>
<!--<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="sy_btn_blue mr5 fr" id="issue_confirm"> 保存</a>-->
<input onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="sy_btn_blue fr mr5" id="issue_confirm" style="width: 28px;color: #FFF" value="保存">
</li>
</ul>
<ul class="fl pro_new_conbox_right ml10 mb10">
@ -86,7 +87,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 +98,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 +110,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 +133,7 @@
:onchange => "PrecentChange(this.value)",
:class => "w150" %>
<% end %>
<li class=" clear">完成度</li>
</li>
</ul>
<% end %>
@ -153,4 +158,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

@ -61,7 +61,7 @@
<li class="clear">
<span class="pro_new_conbox_leftspan fl">指派给</span>
<span class="pro_new_conbox_rightspan fl ml10">
<a href="" class="c_blue" ><%= @issue.assigned_to ? @issue.assigned_to.show_name : "--" %></a></span>
<a href="<%= @issue.assigned_to_id.nil? ? "javascript:void(0)" : user_path(@issue.assigned_to) %>" class="c_blue" ><%= @issue.assigned_to ? @issue.assigned_to.show_name : "--" %></a></span>
</li>
<% end %>
<% unless @issue.disabled_core_fields.include?('fixed_version_id') %>

View File

@ -7,7 +7,7 @@
<div class="side_list">
<div style="background-color:#fff; padding:10px 0; border:1px solid #aaa; border-bottom:none;">
<span class="fontGrey3 f14 ml40" style="vertical-align:top;">问题和建议</span>
<span class="hide-side-bar side-bar-circle fr mt3 mr10" title="关闭"><span class="side-bar-content" style="font-family:'微软雅黑, 宋体'">×</span></span>
<!--<span class="hide-side-bar side-bar-circle fr mt3 mr10" title="关闭"><span class="side-bar-content" style="font-family:'微软雅黑, 宋体'">×</span></span>-->
<span class="close_btn side-bar-circle fr mt3 mr10" title="隐藏"><span class="side-bar-content" style="left:4px; font-family:'微软雅黑, 宋体'"></span></span>
</div>
<div style="background-color:#fff; border-left:1px solid #aaa; border-right:1px solid #aaa;">
@ -31,11 +31,11 @@
<!--白&nbsp;&nbsp;&nbsp;羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad-->
<!--<p style="text-align: center"> 请加入师姐师兄答疑群</p> <p style="text-align: center"></p>-->
<!--<a href="mqqapi://card/show_pslcard?src_type=internal&version=1&uin=173184401&card_type=group&source=qrcode">QQ群号173184401</a>-->
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=fb938b1f6f991fc100f3d32b6ef38b7888dd4097c71d0eb8b239eaa8749a6afd"><img src="/images/QQ_Logo.png" width="30" style="cursor:default; border:1px solid #ddd; padding:20px; cursor:pointer;" /></a>
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=064e805dac955b8aea158c4b0dd3f033b8841bcee175fd619613f0e4ac4d8151"><img src="/images/QQ_Logo.png" width="30" style="cursor:default; border:1px solid #ddd; padding:20px; cursor:pointer;" /></a>
<p class="fontGrey3" style="padding-bottom:10px; padding-top:3px;">加入QQ群</p>
</div>
<div class="fr mr10 tac">
<img src="/images/wechat/trustie_QR.jpg" width="80" style="display:inline-block; margin-right:-5px;" /><p class="fontGrey3" style="padding-bottom:10px;">关注官方微信</p>
<img src="/images/wechat/trustie_QR.jpg" width="80" style="display:inline-block; margin-right:-5px;" /><p class="fontGrey3" style="padding-bottom:10px;">关注微信APP</p>
</div>
<div class="cl"></div>
</div>

View File

@ -68,11 +68,11 @@
</li>
<% if hidden_unproject_infos %>
<li>
<%= link_to '我的课程',{:controller => "users", :action => "user_courselist", :id => User.current.id}, :class => "menuGrey" %>
<%= link_to '我的课程',{:controller => "users", :action => "user_courselist", :id => User.current}, :class => "menuGrey" %>
</li>
<% end %>
<li>
<%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%>
<%= link_to "我的组织", user_organizations_user_path(:id => User.current), :class => "menuGrey"%>
</li>
<li>
<%= link_to "新建组织", new_organization_path, :class => "menuGrey"%>

View File

@ -6,7 +6,7 @@
<div class="side_list">
<div style="background-color:#fff; padding:10px 0; border:1px solid #aaa; border-bottom:none;">
<span class="fontGrey3 f14 ml40" style="vertical-align:top;">问题和建议</span>
<span class="hide-side-bar side-bar-circle fr mt3 mr10" title="关闭"><span class="side-bar-content">×</span></span>
<!--<span class="hide-side-bar side-bar-circle fr mt3 mr10" title="关闭"><span class="side-bar-content">×</span></span>-->
<span class="close_btn side-bar-circle fr mt3 mr10" title="隐藏"><span class="side-bar-content" style="left:4px;"></span></span>
</div>
<div style="background-color:#fff; border-left:1px solid #aaa; border-right:1px solid #aaa;">
@ -30,11 +30,11 @@
<!--白&nbsp;&nbsp;&nbsp;羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad-->
<!--<p style="text-align: center"> 请加入师姐师兄答疑群</p> <p style="text-align: center"></p>-->
<!--<a href="mqqapi://card/show_pslcard?src_type=internal&version=1&uin=173184401&card_type=group&source=qrcode">QQ群号173184401</a>-->
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=fb938b1f6f991fc100f3d32b6ef38b7888dd4097c71d0eb8b239eaa8749a6afd"><img src="/images/QQ_Logo.png" width="30" style="cursor:default; border:1px solid #ddd; padding:20px; cursor:pointer;" /></a>
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=064e805dac955b8aea158c4b0dd3f033b8841bcee175fd619613f0e4ac4d8151"><img src="/images/QQ_Logo.png" width="30" style="cursor:default; border:1px solid #ddd; padding:20px; cursor:pointer;" /></a>
<p class="fontGrey3" style="padding-bottom:10px; padding-top:3px;">加入QQ群</p>
</div>
<div class="fr mr10 tac">
<img src="/images/wechat/trustie_QR.jpg" width="80" style="display:inline-block; margin-right:-5px;" /><p class="fontGrey3" style="padding-bottom:10px;">关注官方微信</p>
<img src="/images/wechat/trustie_QR.jpg" width="80" style="display:inline-block; margin-right:-5px;" /><p class="fontGrey3" style="padding-bottom:10px;">关注微信APP</p>
</div>
<div class="cl"></div>
</div>

View File

@ -2,7 +2,7 @@
<% if User.current.logged?%>
<% if User.current == target%>
<li style="width: 119px; float: left; border-right: 1px solid #ddd;"><%= link_to("个人资料", my_account_path, :class => "user_editinfo") %></li>
<li style="width: 118px; float: left;"><%= link_to '个人主页', homepage_user_path(@user.login), :class => "user_editinfo", :target => '_blank' %></li>
<li style="width: 118px; float: left;"><%= link_to '个人主页', homepage_user_path(@user), :class => "user_editinfo", :target => '_blank' %></li>
<li class="cl"></li>
<% else%>
<li style="width: 119px; float: left; border-right: 1px solid #ddd;">

View File

@ -119,7 +119,7 @@
<% end %>
<div class="user_info_inner">
<div class=" user_leftinfo_namebox" >
<a href="javascript:void(0);" class="user_leftinfo_name"><%=@user.show_name %></a>
<%= link_to @user.show_name, user_path(@user), :class => "user_leftinfo_name" %>
<% if @user.user_extensions && @user.user_extensions.identity %>
<span class="user_cirbtn_yellow" ><%= get_user_roll @user %></span>
<% end%>
@ -134,19 +134,19 @@
</div>
<ul class="user_atten clear">
<li>
<a href="<%=user_blogs_path(:user_id => @user.id) %>">
<a href="<%=user_blogs_path(:user_id => @user) %>">
<strong>博客</strong><br />
<span class="sy_cgrey"><%=@user.blog.blog_comments.where("#{BlogComment.table_name}.parent_id is null").count %></span>
</a>
</li>
<li>
<a href="<%=user_watchlist_user_path(@user.id) %>">
<a href="<%=user_watchlist_user_path(@user) %>">
<strong>关注</strong><br />
<span class="sy_cgrey"><%=User.watched_by(@user.id).count %></span>
<span class="sy_cgrey"><%=User.watched_by(@user).count %></span>
</a>
</li>
<li>
<a href="<%=user_fanslist_user_path(@user.id) %>">
<a href="<%=user_fanslist_user_path(@user) %>">
<strong>粉丝</strong><br />
<span class="sy_cgrey"><%= @user.watcher_users.count %></span>
</a>

View File

@ -189,7 +189,7 @@
<% if @issues.first || @project_messages.first || @issues_journals.first || @wiki_contents.first || @project_news.first || @project_news_comments.first || @project_journal_messages.first ||
@project_attachments.first %>
<div class="wmail_main" style="padding:20px 10px 0px;">
<h3 class="wmail_h2" style="color:#474646; "><%= l(:label_project_overview_new)%></h3>
<h3 class="wmail_h2" style="color:#474646; "><%= l(:label_project_overview_new) %></h3>
<% if !@issues.first.nil? || !@issues_journals.first.nil? %>
<ul class="wmail_ul" style="margin-left:10px; border-bottom:1px dashed #cfcfcf; padding-bottom:15px; width:1020px; margin-bottom:15px;">
<span class="wmail_h4" style="color:#666; font-size:14px; margin-bottom:5px;" >

View File

@ -103,8 +103,8 @@
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<% end %>
<% else %>
<!-- link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" -->
<a href = "javascript:void(0);" class = "homepageMenuText" onclick = "$('#PostDomain_<%= field.id %>').slideToggle();"><%= field.name %></a>
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<!--<a href = "javascript:void(0);" class = "homepageMenuText" onclick = "$('#PostDomain_<%#= field.id %>').slideToggle();"><%#= field.name %></a>-->
<% end %>
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %>

View File

@ -1,7 +1,7 @@
<% members.each do |member|%>
<ul class="orgListRow">
<% username = User.find(member.user_id).realname.blank? ? User.find(member.user_id).login : User.find(member.user_id).realname %>
<li class="orgListUser hidden"><a href="<%= user_url_in_org(member.user_id) %>" class="linkBlue"><%= username %></a></li>
<li class="orgListUser hidden"><a href="<%= user_url_in_org(member.user) %>" class="linkBlue"><%= username %></a></li>
<li class="orgListRole">
<%= get_org_member_role_name member %>
<%= form_for(member, {:as => :org_member, :remote => true, :url => Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s,

View File

@ -10,11 +10,9 @@
<% members.each do |member| %>
<div class="st_boxlist">
<a href="javascript:" class="st_img">
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
</a>
<%= member.user.nil? ? '' : (link_to image_tag(url_to_avatar(member.user), :width => 32, :height => 32), user_path(member.user), :class => "st_img") %>
<span class="fl ml10 c_grey"><%= l(:label_username)%></span>
<%= link_to(member.user.show_name, user_url_in_org(member.user_id),:class => "ml5 c_blue02") %><br />
<%= link_to(member.user.show_name, user_url_in_org(member.user),:class => "ml5 c_blue02") %><br />
<span class="fl c_grey ml10">身份:<%= member.user.admin_of_org?(organization)?"组织管理员":"组织成员" %></span>
<% if member.created_at %>
<span class="fr c_grey"><%= format_time(member.created_at) %></span>

View File

@ -1,12 +1,12 @@
<div class="resources mt10" id="organization_document_<%= document.id %>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(document.creator_id) %>
<%= link_to image_tag(url_to_avatar(User.find(document.creator)), :width => 45, :heigth => 45), user_url_in_org(document.creator) %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => User.find(document.creator_id)} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo">
<%= link_to document.creator.show_name, user_url_in_org(document.creator.id), :class => "newsBlue mr15" %>
<%= link_to document.creator.show_name, user_url_in_org(document.creator), :class => "newsBlue mr15" %>
TO&nbsp;&nbsp;<%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
|
<span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span>

View File

@ -17,8 +17,9 @@
</li>
<% end %>
</div>
<p class="none c_red" style="margin-left: 33px;" id="error_show"></p>
<div class="cl"></div>
<a href="javascript:void(0);" class="fr sy_btn_blue mr35" onclick="submit_quote();">导&nbsp;&nbsp;入</a>
<a href="javascript:void(0);" class="fr sy_btn_blue mr35" id="submit_quote" onclick="submit_quote();">导&nbsp;&nbsp;入</a>
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="hideModal();">取&nbsp;&nbsp;消</a>
<% end -%>
</div>
@ -38,6 +39,7 @@
closeModal();
}else{
$('#error_show').html('您没有选择任何问卷');
$('#error_show').show();
}
}
</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 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", forked_pop_project_path(@project),
: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,17 @@
<div class="pro_new_info mb10">
<h2 class="clear">成员<span class="fr pro_new_font mr15" >本页面展示Fork了 <%= link_to @project.owner.try(:show_name), user_path(@project.owner) %>/<%= link_to @project.name, project_path(@project) %> 的用户</span></h2>
<ul class="clear pro_new_users_box">
<% @forked_projects.each do |project| %>
<li class="clear">
<%= link_to image_tag(url_to_avatar(project.owner), :width => "50", :height => "50"), user_path(project.owner), :alt => "用户头像", :class => "pro_new_users fl mr5" %>
<div class="fl mt5 clear">
<%= link_to project.owner.try(:show_name), user_path(project.owner), :class => "pro_new_users mt5 fl" %>
<span class="ml5 mr5 mt5 fl"> / </span>
<%= link_to project.name, project_path(project), :class => "pro_new_users mt5 fl" %>
<br/>
<span class=" c_grey mt3"><%=h time_tag(project.created_on) %>前</span>
</div>
</li>
<% end %>
</ul>
</div>

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

@ -70,7 +70,7 @@
<% members.each do |member| %>
<tr>
<th><%= i += 1 %></th>
<th><%= link_to member.principal.show_name, user_path(member.principal) %></th>
<th><%= link_to member.principal.show_name, user_path(member.principal), :target => "_blank" %></th>
<th>
<% if User.current.language == "zh" %>

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>
@ -21,7 +23,8 @@
</li>
<div class="cl mb10"></div>
</ul>
<a href="javascript:void(0);" class="fr sy_btn_grey " onclick="pro_st_show_ban1();">取消</a><a href="javascript:void(0);" onclick="project_version_commit();" class="fr sy_btn_blue mr5">保存</a>
<a href="javascript:void(0);" class="fr sy_btn_grey " onclick="pro_st_show_ban1();">取消</a>
<a href="javascript:void(0);" onclick="project_version_commit();" class="fr sy_btn_blue mr5">保存</a>
</div>
<% end %>
<script>

View File

@ -1,11 +1,13 @@
<!--新版项目头部结束-->
<div class="pro_new_info mb10">
<div class="pro_new_info mb10 break_word" style="padding-bottom: 5px" >
<div id="project_invite_code"><%= render :partial => 'projects/invite_code' %></div>
<div id="project_description_code" >
<% if @project.description.blank? %>
<p class="break_word"><%= @project.name %></p>
<p class="break_word" style="padding-top:5px"><%= @project.name %></p>
<% else %>
<p class="break_word"><%=h @project.description.html_safe %></p>
<p class="break_word" style="padding-top:5px"><%=h @project.description.html_safe %></p>
<% end %>
</div>
</div>
<input type="hidden" value="<%= @type %>" name="type" id="user_activities_type">
@ -35,3 +37,6 @@
<%= render :partial => "project_activities", :locals => {:forge_acts => @events_pages, :page => 0, :type => @type} %>
</div>
<script>
autoUrl('project_description_code');
</script>

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,21 @@
<div class="autoscroll">
<table class="list entries" id="browser" style="table-layout: fixed;">
<tbody>
<table class="list entries mt5" id="browser" style="table-layout: fixed;">
<% unless @path.blank? %>
<tbody>
<tr style="border: 1px solid #DDD; border-bottom:none;">
<td>
<a href="javascript:history.go(-1)" class="fl linkBlue2 mt3" >
<span class="new_roadmap_icons_back mr5"></span>
返回上级目录
</a>
</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
<% end %>
<tbody style="line-height: 1.9;">
<%= render :partial => 'dir_list_content' %>
</tbody>
</table>

View File

@ -0,0 +1,25 @@
<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">
<% if has_forked_cur_project(@project) %>
您已经Fork过该项目点击“确定”将会跳入您Fork的项目主页请问是否继续
<% else %>
Fork将在后台执行<br>平台将为您创建一个新的同名项目和版本库,请问是否继续?
<% end %>
</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

@ -12,12 +12,12 @@
<script>
$(".icons_sy_close").live('click',function(){
$(this).parent().parent().next().next().show();
$(this).parent().parent().parent().next().show();
$(this).removeClass("icons_sy_close");
$(this).addClass("icons_sy_open");
});
$(".icons_sy_open").live('click',function(){
$(this).parent().parent().next().next().hide();
$(this).parent().parent().parent().next().hide();
$(this).addClass("icons_sy_close");
$(this).removeClass("icons_sy_open");
});

View File

@ -1,4 +1,5 @@
<div class="sy_courses_open f14 fontGrey3">
<div>
<span class="icons_sy_open fl mr5" title="点击展开/收起详情" style="cursor: pointer;"></span>
<span class="fl" style="width:280px;">
<span class="hidden fl" style="max-width:220px;"><%= student_work.name %></span>
@ -39,6 +40,7 @@
</div>
</div>
<% end %>
</div>
<div class="cl"></div>
</div>
<div class="fl sy_p_grey">

View File

@ -55,14 +55,14 @@
<td class="hworkStName float-none <%= @homework.homework_type == 2 ? 'w180' : 'w190' %>" title="姓名" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
匿名
</td>
<td class="hworkStID <%= @homework.homework_type == 2 ? 'w180' : 'w190' %> float-none" title="学号">
<td class="hworkStID <%= @homework.homework_type == 2 ? 'w180' : 'w190' %> float-none" title="学号" onclick="show_student_work('<%= student_work_path(student_work)%>');">
--
</td>
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
<td class="hworkName pr10 w220 float-none student_work_<%= student_work.id%>">
<td class="hworkName pr10 w220 float-none student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');">
<div style="text-align: left">匿名</div>
</td>
<td class="hworkPrName float-none mr10 student_work_<%= student_work.id%>" title="">
<td class="hworkPrName float-none mr10 student_work_<%= student_work.id%>" title="" onclick="show_student_work('<%= student_work_path(student_work)%>');">
匿名
</td>
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>

View File

@ -11,7 +11,10 @@
<span class="c_red ml80" id="new_syllabus_name_notice" style="display: none;">课程名称不能为空且至少有两个字符</span>
</li>
<div class="cl"></div>
<li class="ml125 fontGrey3"><span class="success-icon mr25">正确示例:软件工程</span><span class="error-icon">错误示例2016软件工程</span></li>
<li class="ml125 fontGrey3"><span class="success-icon mr70">正确示例:</span><span class="error-icon">错误示例:</span></li>
<li class="ml125 mt5 fontGrey3"><span class="ml25 mr70">软件工程</span><span style="margin-left: 37px;">2016软件工程</span></li>
<li class="ml125 mt5 fontGrey3"><span class="ml25 mr70">统计学原理</span><span style="margin-left: 25px;">统计学原理计算机系</span></li>
<li class="ml125 mt5 fontGrey3"><span class="ml25 mr70">并行处理</span><span style="margin-left: 36px;">并行处理2016秋季A班</span></li>
<li class="mt10 ml45">
<label><span class="c_white">*</span>&nbsp;<%= l(:label_tags_course_eng_name)%>&nbsp;&nbsp;</label>
<input type="text" name="eng_name" id="new_syllabus_eng_name" placeholder="例如Software Engineering" class="name_input" maxlength="100">
@ -29,7 +32,7 @@
<em style="top: 9px;"></em>
<span style="top: 9px;"></span>
<p>
课程是针对一个具体的学科方向开展的教学内容与进程安排<br/>本质上,一门课程就是一个教学计划
课程是针对一个具体的学科方向开展的教学内容与进程安排<br/>本质上,一门课程就是一个教学计划<br/><br/>班级是实行教学任务的群体,创建班级后才能开展在线教学
</p>
</div>
</div><!--talknew end-->

View File

@ -1,8 +1,8 @@
<div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user), :alt => "用户头像" %>
</div>
<div class="orig_right fl">
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %>
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user), :class => "content-username" %>
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="orig_content ">
<% if comment.class == Journal %>

View File

@ -1,15 +1,15 @@
<div class="resources mt10">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.teacher), :width => "50", :height => "50"), user_path(activity.tea_id), :alt => "用户头像" %>
<%= link_to image_tag(url_to_avatar(activity.teacher), :width => "50", :height => "50"), user_path(activity.teacher), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<% if activity.try(:teacher).try(:realname) == ' ' %>
<%= link_to activity.try(:teacher), user_path(activity.tea_id), :class => "newsBlue mr15" %>
<%= link_to activity.try(:teacher), user_path(activity.teacher), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:teacher).try(:realname), user_path(activity.tea_id), :class => "newsBlue mr15" %>
<%= link_to activity.try(:teacher).try(:realname), user_path(activity.teacher), :class => "newsBlue mr15" %>
<% end %>
TO
<%= link_to activity.name.to_s+" | 班级", course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue" %>

View File

@ -2,12 +2,12 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %>
<%#= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<%= link_to activity.user.show_name, user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
<%= link_to activity.user.show_name, user_path(activity.user,:host=>Setting.host_user), :class => "newsBlue mr15" %>
TO <!--+"(课程名称)" -->
<% if hw_status == 3 || hw_status == 5 %>
<%= link_to activity.course.name, course_path(activity.course_id), :class => "newsBlue"%>

View File

@ -1,12 +1,12 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<%= link_to activity.user.show_name, user_path(activity.user_id), :class => "newsBlue mr15" %>
<%= link_to activity.user.show_name, user_path(activity.user), :class => "newsBlue mr15" %>
TO
<% course=Course.find(activity.jour_id) %>
<%= link_to course.name.to_s+" | 班级留言", course_feedback_path(course), :class => "newsBlue" %>

View File

@ -1,12 +1,12 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" onmouseover="$('#message_setting_<%= user_activity_id%>').show();" onmouseout="$('#message_setting_<%= user_activity_id%>').hide();">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author, :host => Setting.host_user), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<%= link_to activity.author.show_name, user_path(activity.author_id, :host=>Setting.host_user), :class => "newsBlue mr15" %>
<%= link_to activity.author.show_name, user_path(activity.author, :host=>Setting.host_user), :class => "newsBlue mr15" %>
TO
<%= link_to activity.course.name.to_s+" | #{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue mr5"%>
</div>

View File

@ -1,12 +1,12 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
<%= link_to activity.author.show_name, user_path(activity.author), :class => "newsBlue mr15" %>
TO <!--+"(课程名称)"-->
<%= link_to activity.course.name.to_s+" | 班级通知", course_news_index_path(activity.course), :class => "newsBlue" %>
</div>

View File

@ -5,15 +5,15 @@
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<!-- <a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a>-->
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<% if activity.try(:user).try(:realname) == ' ' %>
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
<%= link_to activity.try(:user), user_path(activity.user), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:user).try(:realname), user_path(activity.user_id), :class => "newsBlue mr15" %>
<%= link_to activity.try(:user).try(:realname), user_path(activity.user), :class => "newsBlue mr15" %>
<% end %>
TO
<% course = Course.find(activity.polls_group_id) %>

View File

@ -1,5 +1,5 @@
<div class="homepagePostReplyPublisher">
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user), :class => "newsBlue mr10 f14" %>
<%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %>
</div>
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>

View File

@ -8,7 +8,7 @@
</script>
<li class="homepagePostReplyContainer" nhname="reply_rec">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').hide();">
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>

View File

@ -1,5 +1,5 @@
<div class="homepagePostReplyPublisher">
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user), :class => "newsBlue mr10 f14" %>
<%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %>
</div>
<% if !comment.parent.nil? %>

View File

@ -8,7 +8,7 @@
</script>
<li class="homepagePostReplyContainer" nhname="reply_rec">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').hide();">
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>

View File

@ -2,15 +2,15 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word" style="width:620px">
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<%= link_to activity.try(:author), user_path(activity.author), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author), :class => "newsBlue mr15" %>
<% end %> TO
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
</div>

View File

@ -10,7 +10,7 @@
<% end %>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10">
<% if User.current.logged? %>
<div nhname='new_message_<%= user_activity_id %>' style="display:none;">

View File

@ -1,12 +1,12 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word" style="width:620px">
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
<%= link_to activity.author.show_name, user_path(activity.author), :class => "newsBlue mr15" %>
TO
<%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%>
<!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>-->

View File

@ -1,18 +1,18 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
<%= link_to activity.author.show_name, user_path(activity.author), :class => "newsBlue mr15" %>
TO <!--+"(课程名称)"-->
<%= link_to activity.author.name.to_s+" | 博客", user_blogs_path(:user_id=>activity.author_id), :class => "newsBlue ml15" %>
<%= link_to activity.author.name.to_s+" | 博客", user_blogs_path(:user_id=>activity.author), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word"> <!--+"(通知标题)"-->
<div class="fl">
<%= link_to activity.title.to_s, user_blog_blog_comment_path(:user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id,:in_act => true), :class => "postGrey" %>
<%= link_to activity.title.to_s, user_blog_blog_comment_path(:user_id => activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id,:in_act => true), :class => "postGrey" %>
<% if activity.locked%>
<span class="locked_btn_cir ml10" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<% end%>

View File

@ -1,12 +1,12 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" style="<%= activity.private == 1? 'background-color:#cecece;':'' %>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<%= link_to activity.user.show_name, user_path(activity.user_id), :class => "newsBlue mr15" %>
<%= link_to activity.user.show_name, user_path(activity.user), :class => "newsBlue mr15" %>
TO
<% if activity.jour %>
<%= link_to activity.jour.show_name+""+(activity.jour.login ? activity.jour.login : activity.jour.show_name ).to_s+")的"+ (activity.private == 1? "私信":"留言"),

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="ml4 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-zh-CN.js"></script>
<!--里程碑列表开始-->
<div class="new_roadmap_conbox mb10" >
<div class="new_roadmap_navbox clear">

View File

@ -1,2 +1,7 @@
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);
$('#version_index_create_name').datepicker(datepickerOptions);
});

View File

@ -1,3 +1,4 @@
<script type="text/javascript" src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js"></script>
<!--里程碑详情开始-->
<div class="new_roadmap_conbox mb10">
<div class="new_roadmap_info_top clear ">
@ -67,9 +68,11 @@
<% @issues.each do |issue| %>
<tr>
<td>#<%= issue.id %></td>
<td><p class="new_roadmap_info_title" title="<%= issue.subject %>"><%= issue.subject %></p> </td>
<td><a href="<%= issue_path(issue) %>" class="new_roadmap_info_title" title="<%= issue.subject %>" target="_blank"><%= issue.subject %></a> </td>
<td> <%= issue.tracker %> </td>
<td><p class="new_roadmap_info_name"><%= User.find(issue.try(:assigned_to_id)).show_name %></p></td>
<td><a href="<%= issue.assigned_to_id.nil? ? "" : user_path(issue.assigned_to) %>" class="new_roadmap_info_name" target="_blank">
<%= User.find(issue.try(:assigned_to_id)).nil? ? "" : User.find(issue.try(:assigned_to_id)).show_name %></a>
</td>
<td><%= format_time issue.updated_on %></td>
<td><%= issue.status.name %></td>
<td><span class="<%= issue.done_ratio == 100 ? "c_green" : "c_red" %>" ><%= issue.done_ratio %>%</span></td>

View File

@ -776,6 +776,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'
@ -795,6 +796,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]
@ -809,7 +811,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

@ -0,0 +1,8 @@
class UpdateAssginToId < ActiveRecord::Migration
def up
Issue.where(:assigned_to_id => 0).update_all(:assigned_to_id => nil)
end
def down
end
end

View File

@ -0,0 +1,8 @@
class UpdateFixedVersionId < ActiveRecord::Migration
def up
Issue.where(:fixed_version_id => 0).update_all(:fixed_version_id => nil)
end
def down
end
end

View File

@ -0,0 +1,17 @@
class DeleteNullStudnetWorkProject < ActiveRecord::Migration
def up
count = StudentWorkProject.all.count / 30 + 2
transaction do
for i in 1 ... count do i
StudentWorkProject.page(i).per(30).each do |sp|
if !sp.student_work_id.nil? && sp.student_work.nil?
sp.destroy
end
end
end
end
end
def down
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20161111070615) do
ActiveRecord::Schema.define(:version => 20161114092115) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -1870,6 +1870,7 @@ ActiveRecord::Schema.define(:version => 20161111070615) do
t.integer "is_leader"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "course_id"
end
add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id"

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

@ -91,6 +91,10 @@ function addFile_board(inputEl, file, eagerUpload, id,btnId) {
function addFile(inputEl, file, eagerUpload,btnId) {
var attachments_frame = '#attachments_fields';
// $("#issue_confirm").attr('href', '#');
$('#issue_confirm').attr("disabled",true);
$('#issue_confirm').css('background-color','#c1c1c1');
$('#issue_confirm').css('cursor','default');
if (true) {
deleteallfiles = $(inputEl).data('deleteAllFiles');
var attachmentId = addFile.nextAttachmentId++;
@ -103,10 +107,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; max-width:270px;'
}).val(file.name),
// $('<input>', {
// 'type': 'text',
@ -127,7 +131,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;}
@ -183,6 +184,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;}
@ -193,6 +195,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.mt6{ margin-top:6px;}
.mt7 {margin-top:7px;}
.mt8{ margin-top:8px !important;}
.mt9{ margin-top:9px !important;}
.mt10{ margin-top:10px !important;}
.mt12 { margin-top:12px !important;}
.mt15 {margin-top:15px;}
@ -237,7 +240,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;
}
@ -699,6 +696,21 @@ a.sy_btn_blue{
-o-border-radius:3px;
border-radius:3px;
}
input.sy_btn_blue{
display: inline-block;
color: #fff;
background: #3b94d6;
text-align: center;
font-size: 12px;
padding:0 15px;
height: 30px;
line-height: 30px;
-webkit-border-radius:3px;
-moz-border-radius:3px;
-o-border-radius:3px;
border-radius:3px;
cursor:pointer;
}
a:hover.sy_btn_blue{ background: #2788d0;}
a.hw_btn_blue{
display: inline-block;
@ -875,7 +887,7 @@ a:hover.btn_newpro_grey,a:active.btn_newpro_grey{ background: #eaeaea;}
/*项目简介*/
.pro_new_info{ border:1px solid #ddd; background-color:#fff; width: 998px;}
.pro_new_info h2{ background: #fff; font-size: 14px; color: #333; height: 40px; line-height: 40px; padding-left: 15px; border-bottom:1px solid #e5e5e5;}
.pro_new_info p{ padding:15px; color: #666;}
.pro_new_info p{ padding-bottom:2px; padding-left: 15px; color: #666; padding-right: 5px}
.pro_new_info_weight{ font-size: 16px; font-weight: bold;}
/* 新版项目配置*/
.pro_new_setting_leftnav{ width: 162px; border:1px solid #ddd; background-color:#fff; padding:3px; padding-bottom: 0;}
@ -1010,3 +1022,12 @@ textarea.muban_textarea{ width: 98.5%;border:1px solid #ddd; background:#fff; co
/* 课程大纲 */
.icons_tishi{ width: 110px; height: 110px;margin: 135px auto 20px;}
.sy_tab_con_p{ font-size: 16px;text-align: center; margin-bottom:100px; color:#888;}
/* 成员列表20161101byLB*/
.pro_new_font{ font-weight: normal; color: #666; font-size: 12px;}
.pro_new_users_box{ margin:0 10px;}
.pro_new_users_box li{ width:25%; float: left; margin:10px 0;}
.pro_new_users{ }
a.pro_new_users { max-width:80px; overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; word-break:break-all; display: inline-block; font-weight: bold; color: #666;}
a:hover.pro_new_users {color: #3b94d6}
.pro_new_users img{ width:40px;height:40px; border: 3px solid #fff;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;}
.pro_new_users img:hover{border: 3px solid #e6e6e6;}

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;}