Merge branch 'develop' into weixin_guange

This commit is contained in:
yuanke 2016-09-28 10:52:13 +08:00
commit 0d968a0025
184 changed files with 3470 additions and 1845 deletions

2
.gitignore vendored
View File

@ -6,6 +6,8 @@
/config/database.yml /config/database.yml
/config/configuration.yml /config/configuration.yml
/config/additional_environment.rb /config/additional_environment.rb
/config/oneapm.yml
/config/environments/production.rb
/files/* /files/*

View File

@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the SyllabusMember controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -1,3 +1,4 @@
# encoding: utf-8
# Redmine - project management software # Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang # Copyright (C) 2006-2013 Jean-Philippe Lang
# #
@ -685,6 +686,61 @@ class ApplicationController < ActionController::Base
:content_type => 'application/atom+xml' :content_type => 'application/atom+xml'
end end
def issue_ratio_change done_ratio, status_id
if done_ratio == 100 || status_id == 3
"已完成"
else
done_ratio.to_s + "%"
end
end
def issue_priority_change priority_id
case priority_id
when 1
""
when 2
"正常"
when 3
""
when 4
"紧急"
when 5
"立即"
end
end
def issue_status_change status_id
case status_id
when 1
"新增"
when 2
"正在解决"
when 3
"已解决"
when 4
"反馈"
when 5
"关闭"
when 6
"拒绝"
end
end
def issue_tracker_change tracker_id
case tracker_id
when 1
"缺陷"
when 2
"功能"
when 3
"支持"
when 4
"任务"
when 5
"周报"
end
end
def self.accept_rss_auth(*actions) def self.accept_rss_auth(*actions)
if actions.any? if actions.any?
self.accept_rss_auth_actions = actions self.accept_rss_auth_actions = actions

View File

@ -58,10 +58,9 @@ class HomeworkCommonController < ApplicationController
def edit def edit
@user = User.current @user = User.current
@is_in_course = params[:is_in_course] @hw_status = params[:hw_status].to_i
@is_manage = params[:is_manage] @is_manage = params[:is_manage]
@course_activity = params[:course_activity].to_i if @hw_status != 1
if @is_in_course.to_i == 1 || @course_activity == 1
@left_nav_type = 3 @left_nav_type = 3
respond_to do |format| respond_to do |format|
format.html{render :layout => 'base_courses'} format.html{render :layout => 'base_courses'}
@ -160,18 +159,19 @@ class HomeworkCommonController < ApplicationController
create_works_list @homework create_works_list @homework
end end
@hw_status = params[:hw_status].to_i
if params[:is_manage] == "1" if params[:is_manage] == "1"
redirect_to manage_or_receive_homeworks_user_path(User.current.id) redirect_to manage_or_receive_homeworks_user_path(User.current.id)
elsif params[:is_manage] == "2" elsif params[:is_manage] == "2"
redirect_to my_homeworks_user_path(User.current.id) redirect_to my_homeworks_user_path(User.current.id)
elsif params[:is_in_course] == "1" elsif @hw_status == 1
redirect_to homework_common_index_path(:course => @course.id)
elsif params[:is_in_course] == "0"
redirect_to user_homeworks_user_path(User.current.id)
elsif params[:is_in_course] == "-1" && params[:course_activity] == "0"
redirect_to user_path(User.current.id) redirect_to user_path(User.current.id)
elsif params[:is_in_course] == "-1" && params[:course_activity] == "1" elsif @hw_status == 2
redirect_to course_path(@course.id) redirect_to course_path(@course.id)
elsif @hw_status == 5
redirect_to student_work_index_url(:homework => @homework.id)
else
redirect_to homework_common_index_path(:course => @course.id)
end end
end end
end end
@ -181,14 +181,13 @@ class HomeworkCommonController < ApplicationController
if @homework.destroy if @homework.destroy
respond_to do |format| respond_to do |format|
format.html { format.html {
if params[:is_in_course] == "1" @hw_status = params[:hw_status].to_i
redirect_to homework_common_index_path(:course => @course.id) if @hw_status == 1
elsif params[:is_in_course] == "0"
redirect_to user_homeworks_user_path(User.current.id)
elsif params[:is_in_course] == "-1" && params[:course_activity] == "0"
redirect_to user_path(User.current.id) redirect_to user_path(User.current.id)
elsif params[:is_in_course] == "-1" && params[:course_activity] == "1" elsif @hw_status == 2
redirect_to course_path(@course.id) redirect_to course_path(@course.id)
else
redirect_to homework_common_index_path(:course => @course.id)
end end
} }
end end
@ -246,8 +245,8 @@ class HomeworkCommonController < ApplicationController
@statue = 3 @statue = 3
end end
@user_activity_id = params[:user_activity_id].to_i @user_activity_id = params[:user_activity_id].to_i
@is_in_course = params[:is_in_course].to_i @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity].to_i @is_teacher = User.current.admin? || User.current.allowed_to?(:as_teacher, @course)
end end
#关闭匿评 #关闭匿评
@ -265,8 +264,8 @@ class HomeworkCommonController < ApplicationController
send_message_anonymous_comment(@homework, m_status = 3) send_message_anonymous_comment(@homework, m_status = 3)
Mailer.send_mail_anonymous_comment_close(@homework).deliver Mailer.send_mail_anonymous_comment_close(@homework).deliver
@user_activity_id = params[:user_activity_id].to_i @user_activity_id = params[:user_activity_id].to_i
@is_in_course = params[:is_in_course].to_i @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity].to_i @is_teacher = User.current.admin? || User.current.allowed_to?(:as_teacher, @course)
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -294,8 +293,7 @@ class HomeworkCommonController < ApplicationController
end end
@percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100) @percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100)
@user_activity_id = params[:user_activity_id].to_i @user_activity_id = params[:user_activity_id].to_i
@is_in_course = params[:is_in_course].to_i @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity].to_i
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -307,8 +305,7 @@ class HomeworkCommonController < ApplicationController
else else
@user_activity_id = -1 @user_activity_id = -1
end end
@is_in_course = params[:is_in_course] if params[:is_in_course] @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity] if params[:course_Activity]
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -321,8 +318,8 @@ class HomeworkCommonController < ApplicationController
@homework.update_column('is_open', 0) @homework.update_column('is_open', 0)
end end
@user_activity_id = params[:user_activity_id] @user_activity_id = params[:user_activity_id]
@is_in_course = params[:is_in_course] if params[:is_in_course] @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity] if params[:course_Activity] @is_teacher = User.current.admin? || User.current.allowed_to?(:as_teacher,@course)
end end
def alert_open_student_works def alert_open_student_works
@ -331,8 +328,7 @@ class HomeworkCommonController < ApplicationController
else else
@user_activity_id = -1 @user_activity_id = -1
end end
@is_in_course = params[:is_in_course] if params[:is_in_course] @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity] if params[:course_Activity]
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -363,8 +359,7 @@ class HomeworkCommonController < ApplicationController
else else
@user_activity_id = -1 @user_activity_id = -1
end end
@is_in_course = params[:is_in_course] @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity].to_i
end end
#设置匿评参数 #设置匿评参数
@ -381,8 +376,8 @@ class HomeworkCommonController < ApplicationController
@homework_detail_manual.evaluation_num = params[:evaluation_num] @homework_detail_manual.evaluation_num = params[:evaluation_num]
@homework_detail_manual.save @homework_detail_manual.save
@user_activity_id = params[:user_activity_id].to_i @user_activity_id = params[:user_activity_id].to_i
@is_in_course = params[:is_in_course].to_i @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity].to_i @is_teacher = User.current.admin? || User.current.allowed_to?(:as_teacher,@course)
end end
end end
@ -393,8 +388,7 @@ class HomeworkCommonController < ApplicationController
else else
@user_activity_id = -1 @user_activity_id = -1
end end
@is_in_course = params[:is_in_course] @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity].to_i
end end
private private

View File

@ -58,52 +58,79 @@ class IssuesController < ApplicationController
include ApplicationHelper include ApplicationHelper
def index def index
# 为了性能所有用了两种模式issue的@query查询所有的没有优势
# 但是对过滤条件很有有时
if params[:set_filter] != "1"
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'
if User.current.member_of?(@project)
@issues_filter = Issue.where(:project_id => @project.id).order('updated_on desc')
else
@issues_filter = Issue.where(:project_id => @project.id, :is_private => 0).order('updated_on desc')
end
open_and_close_num(@project)
@issue_count = @issues_filter.count
@limit = 10
@is_remote = true
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
@offset ||= @issue_pages.offset
@issues = paginateHelper @issues_filter, @limit
respond_to do |format|
format.js
format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young
format.api {Issue.load_visible_relations(@issues) if include_in_api_response?('relations')}
format.xls {filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}.xls"
send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}
end
else
retrieve_query retrieve_query
sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria) sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
sort_update(@query.sortable_columns) sort_update(@query.sortable_columns)
@query.sort_criteria = sort_criteria.to_a @query.sort_criteria = sort_criteria.to_a
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base' @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'
if @query.valid? if @query.valid?
case params[:format] @tracker_id = params[:tracker_id]
when 'csv', 'pdf'
@limit = 10#Setting.issues_export_limit.to_i
when 'atom'
@limit = 10#Setting.feeds_limit.to_i
when 'xml', 'json'
@offset, @limit = api_offset_and_limit({:limit => 10})
else
@limit = 10#per_page_option
end
@assign_to_id = params[:assigned_to_id] @assign_to_id = params[:assigned_to_id]
@author_id = params[:author_id] @author_id = params[:author_id]
@priority_id = params[:priority_id]
@status_id = params[:status_id] @status_id = params[:status_id]
@subject = params[:subject] @subject = params[:subject]
@done_ratio = params[:done_ratio] @done_ratio = params[:done_ratio]
@fixed_version_id = params[:fixed_version_id]
@issue_count = @query.issue_count @issue_count = @query.issue_count
@issue_pages = Paginator.new @issue_count, @limit, params['page'] @test = params[:test]
params[:page] = (params[:page] || 1).to_i + 1 #页码需要加1 @project_sort = 'issues.updated_on desc'
@offset ||= @issue_pages.offset if params[:test] != "0"
@issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version], case @test
:order => 'issues.updated_on desc', when "1"
:offset => @offset, @project_sort = 'issues.created_on desc'
:limit => @limit) when "2"
if params[:set_filter] @project_sort = 'issues.created_on asc'
@set_filter = params[:set_filter] when "3"
@project_sort = 'issues.updated_on desc'
when "4"
@project_sort = 'issues.updated_on asc'
end end
@issue_count_by_group = @query.issue_count_by_group end
open_and_close_num(@project)
@issues_filter_assign_count = @query.issues.select{|issue| issue.assigned_to_id == User.current.id }.count
@issues_filter_author_count = @query.issues.select{|issue| issue.author_id == User.current.id }.count
@issues_filter = @query.issues(:order => @project_sort)
@limit = 10
@is_remote = true
@issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
@offset ||= @issue_pages.offset
@issues = paginateHelper @issues_filter, @limit
respond_to do |format| respond_to do |format|
format.js format.js
format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young
format.api { format.api {Issue.load_visible_relations(@issues) if include_in_api_response?('relations')}
Issue.load_visible_relations(@issues) if include_in_api_response?('relations')
}
# format.json { render :json => @issues.map { |issue| issue.to_json}} #:json => @issues.map { |issue| issue.to_json} # format.json { render :json => @issues.map { |issue| issue.to_json}} #:json => @issues.map { |issue| issue.to_json}
format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") } format.atom { render_feed(@issues, :title => "#{@project || Setting.app_title}: #{l(:label_issue_plural)}") }
format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') } format.csv { send_data(query_to_csv(@issues, @query, params), :type => 'text/csv; header=present', :filename => 'issues.csv') }
format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') } format.pdf { send_data(issues_to_pdf(@issues, @project, @query), :type => 'application/pdf', :filename => 'issues.pdf') }
format.xls {filename = "#{@project.name.to_s}_#{l(:label_issue_list_xls)}.xls"
send_data(issue_list_xls(@issues_filter), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}
end end
else else
respond_to do |format| respond_to do |format|
@ -113,10 +140,22 @@ class IssuesController < ApplicationController
format.js format.js
end end
end end
end
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
render_404 render_404
end end
# 获取issue的开启统计数
def open_and_close_num project
if User.current.member_of?(project)
@issue_open_count = Issue.where("project_id=#{project.id} and status_id in (1,2,3,4,6)").count
@issue_close_count = Issue.where(:project_id => project.id, :status_id => 5 ).count
else
@issue_open_count = Issue.where("project_id=#{project.id} and status_id in (1,2,3,4,6) and is_private = 0").count
@issue_close_count = Issue.where(:project_id => project.id, :status_id => 5, :is_private => 0).count
end
end
def show def show
# 打开编辑内容 # 打开编辑内容
@is_edit = true unless params[:edit].nil? @is_edit = true unless params[:edit].nil?

View File

@ -38,47 +38,45 @@ class MessagesController < ApplicationController
# Show a topic and its replies # Show a topic and its replies
def show def show
@isReply = true @isReply = true
page = params[:page] # page = params[:page]
# Find the page of the requested reply # # Find the page of the requested reply
if params[:r] && page.nil? # if params[:r] && page.nil?
offset = @topic.children.count(:conditions => ["#{Message.table_name}.id < ?", params[:r].to_i]) # offset = @topic.children.count(:conditions => ["#{Message.table_name}.id < ?", params[:r].to_i])
page = 1 + offset / REPLIES_PER_PAGE # page = 1 + offset / REPLIES_PER_PAGE
end # end
all_comments = [] all_comments = []
@reply_count = get_all_children(all_comments, @topic).count @replies = get_all_children(all_comments, @topic)
@reply_count = @replies.count
@reply = Message.new(:subject => "RE: #{@message.subject}") @reply = Message.new(:subject => "RE: #{@message.subject}")
if @course if @course
messages_replies = @topic.children. #@replies = @topic.children.
includes(:author, :attachments, {:board => :project}). #includes(:author, :attachments, :praise_tread_cache, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC"). #reorder("#{Message.table_name}.created_on DESC").
#limit(@reply_pages.per_page). #limit(@reply_pages.per_page).
#offset(@reply_pages.offset). #offset(@reply_pages.offset).
all #all
@replies = paginateHelper messages_replies,10 #@replies = paginateHelper messages_replies,10
@reply = Message.new(:subject => "RE: #{@message.subject}")
@left_nav_type = 2 @left_nav_type = 2
render :action => "show", :layout => "base_courses"#by young render :action => "show", :layout => "base_courses"#by young
elsif @project elsif @project
@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page #@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
@replies = @topic.children. # @replies = @topic.children.
includes(:author, :attachments, {:board => :project}). # includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC"). # reorder("#{Message.table_name}.created_on DESC").
limit(@reply_pages.per_page). # limit(@reply_pages.per_page).
offset(@reply_pages.offset). # offset(@reply_pages.offset).
all # all
@reply = Message.new(:subject => "RE: #{@message.subject}")
render :action => "show", :layout => "base_projects"#by young render :action => "show", :layout => "base_projects"#by young
else else
@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page # @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
@replies = @topic.children. # @replies = @topic.children.
includes(:author, :attachments, {:board => :project}). # includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC"). # reorder("#{Message.table_name}.created_on DESC").
limit(@reply_pages.per_page). # limit(@reply_pages.per_page).
offset(@reply_pages.offset). # offset(@reply_pages.offset).
all # all
@reply = Message.new(:subject => "RE: #{@message.subject}")
@organization = @org_subfield.organization @organization = @org_subfield.organization
render :action => "show", :layout => "base_org"#by young render :action => "show", :layout => "base_org"#by young
end end
@ -92,7 +90,13 @@ class MessagesController < ApplicationController
@message.board = @board @message.board = @board
@message.safe_attributes = params[:message] @message.safe_attributes = params[:message]
if request.post? if request.post?
@message.save_attachments(params[:attachments]) if @project
is_public = @project.is_public
elsif @course
is_public = @course.is_public
end
# 公开项目/课程上传的资源是公开的,私有项目上传的是私有的
@message.save_attachments_containers(params[:attachments], User.current, is_public)
if @message.save if @message.save
# 更新kindeditor上传的图片资源所有者 # 更新kindeditor上传的图片资源所有者
if params[:asset_id] if params[:asset_id]

View File

@ -325,27 +325,27 @@ class ProjectsController < ApplicationController
end end
# 版本库统计图 # 版本库统计图
unless @project.gpid.nil? || @project.project_score.changeset_num == 0 # unless @project.gpid.nil? || @project.project_score.changeset_num == 0
# rep_statics_commit = @project.rep_statics.order("commits_num desc") # # rep_statics_commit = @project.rep_statics.order("commits_num desc")
rep_statics_commit = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by commits_num desc limit 10") # rep_statics_commit = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by commits_num desc limit 10")
rep_statics_code = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by changeset desc limit 10") # rep_statics_code = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by changeset desc limit 10")
# rep_statics_code = @project.rep_statics.sort_by {|u| u.changeset}.reverse # # rep_statics_code = @project.rep_statics.sort_by {|u| u.changeset}.reverse
@a_uname = rep_statics_commit.map {|s| s.uname } # @a_uname = rep_statics_commit.map {|s| s.uname }
@a_uname_code = rep_statics_code.map {|s| s.uname } # @a_uname_code = rep_statics_code.map {|s| s.uname }
@a_commits_num = rep_statics_commit.map {|s| s.commits_num.to_i } # @a_commits_num = rep_statics_commit.map {|s| s.commits_num.to_i }
@a_commits_add = rep_statics_code.map {|s| s.add.to_i } # @a_commits_add = rep_statics_code.map {|s| s.add.to_i }
@a_commits_del = rep_statics_code.map {|s| s.del.to_i } # @a_commits_del = rep_statics_code.map {|s| s.del.to_i }
@a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i } # @a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i }
g = Gitlab.client # g = Gitlab.client
begin # begin
gid = @project.gpid # gid = @project.gpid
g_project = g.project(gid) # g_project = g.project(gid)
g_branch = g_project.default_branch.to_s # g_branch = g_project.default_branch.to_s
rescue =>e # rescue =>e
logger.error("get default branch failed: " + e) # logger.error("get default branch failed: " + e)
end # end
@rev = g_branch.nil? ? "master" : g_branch # @rev = g_branch.nil? ? "master" : g_branch
end # end
# 根据对应的请求,返回对应的数据 # 根据对应的请求,返回对应的数据
respond_to do |format| respond_to do |format|
format.html format.html

View File

@ -34,7 +34,7 @@ class RepositoriesController < ApplicationController
before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo, :stats, :quality_analysis] before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo, :stats, :quality_analysis]
before_filter :find_repository, :only => [:edit, :update, :destroy, :committers] before_filter :find_repository, :only => [:edit, :update, :destroy, :committers]
before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo, :to_gitlab, :forked, :project_archive] before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo, :to_gitlab, :forked, :project_archive, :export_rep_static]
before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue] before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue]
before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :commit_diff, :project_archive, :quality_analysis] before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked, :commit_diff, :project_archive, :quality_analysis]
# 链接gitlab # 链接gitlab
@ -69,6 +69,20 @@ class RepositoriesController < ApplicationController
end end
def export_rep_static
@project = Project.find(params[:id])
gpid = @project.gpid
rev = params[:rev]
cycle = params[:cycle]
respond_to do |format|
format.html
format.xls{
filename = "#{@project.name.to_s}_#{l(:label_rep_xls)}.xls"
send_data(export_rep_xls(gpid, :rev => rev, :cycle => "1"), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}
end
end
def forked def forked
@project = Project.find(params[:id]) @project = Project.find(params[:id])
@repository = Repository.where("project_id =? and type =?", @project.id, "Repository::Gitlab") @repository = Repository.where("project_id =? and type =?", @project.id, "Repository::Gitlab")

View File

@ -521,6 +521,7 @@ class StudentWorkController < ApplicationController
# 消息传过来的ID # 消息传过来的ID
@message_student_work_id = params[:student_work_id] @message_student_work_id = params[:student_work_id]
@left_nav_type = 3 @left_nav_type = 3
@tab = params[:tab].to_i
respond_to do |format| respond_to do |format|
format.js format.js
format.html format.html
@ -1012,8 +1013,7 @@ class StudentWorkController < ApplicationController
redirect_to student_work_index_url(:homework => @homework.id) redirect_to student_work_index_url(:homework => @homework.id)
else else
@user_activity_id = params[:user_activity_id].to_i @user_activity_id = params[:user_activity_id].to_i
@is_in_course = params[:is_in_course].to_i @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity].to_i
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -1035,8 +1035,7 @@ class StudentWorkController < ApplicationController
student_work.save student_work.save
end end
@user_activity_id = params[:user_activity_id].to_i @user_activity_id = params[:user_activity_id].to_i
@is_in_course = params[:is_in_course].to_i @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity].to_i
end end
def revise_attachment def revise_attachment
@ -1058,8 +1057,7 @@ class StudentWorkController < ApplicationController
def new_student_work_project def new_student_work_project
@user_activity_id = params[:user_activity_id].to_i @user_activity_id = params[:user_activity_id].to_i
@is_in_course = params[:is_in_course].to_i @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity].to_i
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -1078,8 +1076,8 @@ class StudentWorkController < ApplicationController
@project.is_leader = 1 @project.is_leader = 1
if @project.save if @project.save
@user_activity_id = params[:user_activity_id].to_i @user_activity_id = params[:user_activity_id].to_i
@is_in_course = params[:is_in_course].to_i @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity].to_i @is_teacher = User.current.allowed_to?(:as_teacher,@homework.course) || User.current.admin?
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -1129,8 +1127,8 @@ class StudentWorkController < ApplicationController
relate_pro = StudentWorkProject.where("user_id = #{User.current.id} and homework_common_id = #{@homework.id}").first relate_pro = StudentWorkProject.where("user_id = #{User.current.id} and homework_common_id = #{@homework.id}").first
if relate_pro.destroy if relate_pro.destroy
@user_activity_id = params[:user_activity_id].to_i @user_activity_id = params[:user_activity_id].to_i
@is_in_course = params[:is_in_course].to_i @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity].to_i @is_teacher = User.current.allowed_to?(:as_teacher,@homework.course) || User.current.admin?
respond_to do |format| respond_to do |format|
format.js format.js
end end

View File

@ -0,0 +1,64 @@
class SyllabusMemberController < ApplicationController
def syl_member_autocomplete
@syllabus = Syllabus.find(params[:syllabus])
@flag = params[:flag] || false
respond_to do |format|
format.js
end
end
def create
@syllabus = Syllabus.find(params[:syllabus])
if params[:membership].nil?
@fail_hint = l(:label_blank_user_lists_for_org)
else
member_ids = params[:membership][:user_ids]
last_rank = @syllabus.syllabus_members.order("rank asc").last.rank
user_ids = @syllabus.syllabus_members.map{|sy| sy.user_id}
member_ids.each_with_index do |user_id, i|
unless user_ids.include?(user_id.to_i)
member = SyllabusMember.create(:user_id => user_id, :rank => last_rank + 1 + i)
@syllabus.syllabus_members << member
end
end
@members = @syllabus.syllabus_members.order("rank asc")
end
respond_to do |format|
format.js
end
end
def destroy
member = SyllabusMember.find(params[:id])
@syllabus = member.syllabus
after_syl_members = @syllabus.syllabus_members.where("rank > #{member.rank}")
after_syl_members.update_all("rank = rank - 1")
member.destroy
@members = @syllabus.syllabus_members.order("rank asc")
respond_to do |format|
format.js
end
end
def update_rank
member = SyllabusMember.find(params[:id])
@syllabus = member.syllabus
members = @syllabus.syllabus_members
if params[:opr] == 'up' && member.rank > 2
before_mem = members.where("rank = #{member.rank - 1}").first
if before_mem && member.update_attribute('rank', member.rank - 1)
before_mem.update_attribute('rank', before_mem.rank + 1)
end
elsif params[:opr] == 'down' && member.rank > 1 && member.rank < members.count
after_mem = members.where("rank = #{member.rank + 1}").first
if after_mem && member.update_attribute('rank', member.rank + 1)
after_mem.update_attribute('rank', after_mem.rank - 1)
end
end
@members = @syllabus.syllabus_members.order("rank asc")
respond_to do |format|
format.js
end
end
end

View File

@ -6,7 +6,7 @@ class SyllabusesController < ApplicationController
include CoursesHelper include CoursesHelper
before_filter :is_logged, :only => [:index, :show, :edit, :new, :update, :destroy, :delete_syllabus] before_filter :is_logged, :only => [:index, :show, :edit, :new, :update, :destroy, :delete_syllabus]
before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist, :edit_syllabus_eng_name, :edit_syllabus_title, :update_base_info, :delete_syllabus, :delete_des] before_filter :find_syllabus, :only => [:show, :edit, :update, :destroy, :syllabus_courselist, :edit_syllabus_eng_name, :edit_syllabus_title, :update_base_info, :delete_syllabus, :delete_des, :members]
def index def index
user = User.current user = User.current
@syllabuses = user.syllabuses @syllabuses = user.syllabuses
@ -170,6 +170,15 @@ class SyllabusesController < ApplicationController
end end
end end
def members
@members = @syllabus.syllabus_members.includes(:user => {:user_extensions => [], :courses => []}).order("rank asc")
@show = params[:show] ? params[:show].to_i : 0
respond_to do |format|
format.js
format.html{render :layout => 'base_syllabus'}
end
end
private private
def find_syllabus def find_syllabus
@syllabus = Syllabus.find params[:id] @syllabus = Syllabus.find params[:id]

View File

@ -115,8 +115,7 @@ class UsersController < ApplicationController
else else
@user_activity_id = -1 @user_activity_id = -1
end end
@is_in_course = params[:is_in_course].to_i @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity].to_i
when 'JournalsForMessage' when 'JournalsForMessage'
@reply = JournalsForMessage.find params[:reply_id] @reply = JournalsForMessage.find params[:reply_id]
@user_activity_id = params[:user_activity_id] @user_activity_id = params[:user_activity_id]
@ -1123,11 +1122,8 @@ class UsersController < ApplicationController
quotes_homework = HomeworkCommon.find params[:quotes].to_i quotes_homework = HomeworkCommon.find params[:quotes].to_i
quotes_homework.update_column(:quotes, quotes_homework.quotes+1) quotes_homework.update_column(:quotes, quotes_homework.quotes+1)
end end
if params[:is_in_course] == "1"
redirect_to homework_common_index_path(:course => homework.course_id) redirect_to homework_common_index_path(:course => homework.course_id)
else
redirect_to user_homeworks_user_path(User.current.id)
end
end end
end end
else else
@ -1683,7 +1679,7 @@ class UsersController < ApplicationController
container_type = 'Project' container_type = 'Project'
act_type = 'Issue' act_type = 'Issue'
when "project_message" when "project_message"
container_type = 'Course' container_type = 'Project'
act_type = 'Message' act_type = 'Message'
when "user_journals" when "user_journals"
container_type = 'Principal' container_type = 'Principal'
@ -2156,11 +2152,9 @@ class UsersController < ApplicationController
@user = User.current @user = User.current
if !params[:search].nil? if !params[:search].nil?
search = "%#{params[:search].to_s.strip.downcase}%" search = "%#{params[:search].to_s.strip.downcase}%"
@course = @user.courses.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search) @course = @user.courses.not_deleted.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search)
.select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 }
else else
@course = @user.courses @course = @user.courses.not_deleted
.select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 }
end end
@search = params[:search] @search = params[:search]
@type = params[:type] @type = params[:type]
@ -2178,7 +2172,7 @@ class UsersController < ApplicationController
@user = User.current @user = User.current
if !params[:search].nil? if !params[:search].nil?
search = "%#{params[:search].to_s.strip.downcase}%" search = "%#{params[:search].to_s.strip.downcase}%"
@projects = @user.projects.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search) @projects = @user.projects.visible.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search)
else else
@projects = @user.projects.visible @projects = @user.projects.visible
end end
@ -3575,8 +3569,7 @@ class UsersController < ApplicationController
obj = HomeworkCommon.where('id = ?', params[:id].to_i).first obj = HomeworkCommon.where('id = ?', params[:id].to_i).first
@type = 'HomeworkCommon' @type = 'HomeworkCommon'
@journals = obj.journals_for_messages.reorder("created_on desc") @journals = obj.journals_for_messages.reorder("created_on desc")
@is_in_course = params[:is_in_course].to_i if params[:is_in_course] @hw_status = params[:hw_status].to_i if params[:hw_status]
@course_activity = params[:course_activity].to_i if params[:course_activity]
@is_teacher = User.current.allowed_to?(:as_teacher,obj.course) @is_teacher = User.current.allowed_to?(:as_teacher,obj.course)
@user_activity_id = params[:user_activity_id].to_i if params[:user_activity_id] @user_activity_id = params[:user_activity_id].to_i if params[:user_activity_id]
end end

View File

@ -54,7 +54,6 @@ class VersionsController < ApplicationController
@versions = @versions.slice(@offset, @limit) @versions = @versions.slice(@offset, @limit)
#end by young #end by young
@issues_by_version = {} @issues_by_version = {}
if @selected_tracker_ids.any? && @versions.any? if @selected_tracker_ids.any? && @versions.any?
issues = Issue.visible.all( issues = Issue.visible.all(
@ -81,6 +80,11 @@ class VersionsController < ApplicationController
all all
} }
format.api format.api
# format.xls {
# @issues = @version.fixed_issues.visible.includes(:status, :tracker, :priority).reorder("#{Tracker.table_name}.position, #{Issue.table_name}.id").all
# filename = "#{@version.name.to_s}_#{l(:label_issue_list_xls)}.xls"
# send_data(issue_list_xls(@issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
# }
end end
end end

View File

@ -110,8 +110,8 @@ class WordsController < ApplicationController
else else
@user_activity_id = -1 @user_activity_id = -1
end end
@is_in_course = params[:is_in_course].to_i @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity].to_i @is_teacher = User.current.allowed_to?(:as_teacher, @homework.course) || User.current.admin?
elsif @journal_destroyed.jour_type == 'Syllabus' elsif @journal_destroyed.jour_type == 'Syllabus'
@syllabus = Syllabus.find @journal_destroyed.jour_id @syllabus = Syllabus.find @journal_destroyed.jour_id
@count = @syllabus.journals_for_messages.count @count = @syllabus.journals_for_messages.count
@ -308,10 +308,9 @@ class WordsController < ApplicationController
update_org_activity(@homework_common.class,@homework_common.id) update_org_activity(@homework_common.class,@homework_common.id)
respond_to do |format| respond_to do |format|
format.js{ format.js{
@user_activity_id = params[:user_activity_id] @user_activity_id = params[:user_activity_id].to_i
@is_in_course = params[:is_in_course] @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity] @is_teacher = User.current.allowed_to?(:as_teacher, @homework_common.course) || User.current.admin?
@homework_common_id = params[:homework_common_id]
} }
end end
else else
@ -344,8 +343,8 @@ class WordsController < ApplicationController
respond_to do |format| respond_to do |format|
format.js{ format.js{
@user_activity_id = params[:user_activity_id].to_i @user_activity_id = params[:user_activity_id].to_i
@is_in_course = params[:is_in_course].to_i @hw_status = params[:hw_status].to_i
@course_activity = params[:course_activity].to_i @is_teacher = User.current.allowed_to?(:as_teacher, @homework_common.course) || User.current.admin?
} }
end end
else else

View File

@ -63,6 +63,69 @@ module ApplicationHelper
result result
end end
# 项目版本库导出Excel功能
def export_rep_xls(gpid, options = {})
g = Gitlab.client
cycle = params[:cycle]
rev = params[:rev]
if cycle == "week"
statics = g.rep_stats_week(gpid, :rev => rev)
elsif cycle == "month"
statics = g.rep_stats_month(gpid, :rev => rev)
end
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "版本库"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
sheet1.row(0).concat([l(:rep_branch),l(:rep_author),l(:rep_changeset),l(:rep_code_add),l(:rep_code_delete),l(:rep_code_modified),l(:rep_sode_time),l(:rep_sode_cycle),l(:rep_author_mail)])
count_row = 1
statics.each do |static|
user = User.where(:mail => static.email).first
sheet1[count_row,0] = rev
sheet1[count_row,1] = user.nil? ? static.uname : user.show_name
sheet1[count_row,2] = static.commits_num
sheet1[count_row,3] = static.add
sheet1[count_row,4] = static.del
sheet1[count_row,5] = static.changes
sheet1[count_row,6] = Time.now.strftime('%Y-%m-%d %H:%M:%S')
sheet1[count_row,7] = cycle == "week" ? "最近1周" : "最近一月"
sheet1[count_row,8] = static.email
count_row += 1
end
book.write xls_report
xls_report.string
end
# 项目issue列表导出Excel功能
def issue_list_xls issues
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "issues"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
sheet1.row(0).concat([l(:issue_xls_id),l(:issue_xls_tracker_id),l(:issue_xls_title),l(:issue_xls_description),l(:issue_xls_status),l(:issue_xls_assign),l(:issue_xls_priority),l(:issue_xls_author),l(:issue_xls_created_at),l(:milestone),l(:issue_xls_start),l(:issue_xls_due),l(:issue_xls_ratio)])
count_row = 1
issues.each do |issue|
sheet1[count_row,0] = issue.id
sheet1[count_row,1] = issue_tracker_change(issue.tracker_id)
sheet1[count_row,2] = issue.subject
sheet1[count_row,3] = (issue.description.gsub(/<\/?.*?>/,"")).html_safe
sheet1[count_row,4] = issue_status_change(issue.status_id)
sheet1[count_row,5] = issue.assigned_to.try(:show_name)
sheet1[count_row,6] = issue_priority_change(issue.priority_id)
sheet1[count_row,7] = issue.author.show_name
sheet1[count_row,8] = issue.created_on.nil? ? issue.created_on : issue.created_on.strftime('%Y-%m-%d %H:%M:%S')
sheet1[count_row,9] = issue.fixed_version.try(:name)
sheet1[count_row,10] = issue.start_date.nil? ? issue.start_date : issue.start_date.strftime('%Y-%m-%d')
sheet1[count_row,11] = issue.due_date.nil? ? issue.due_date : issue.due_date.strftime('%Y-%m-%d')
sheet1[count_row,12] = issue_ratio_change(issue.done_ratio, issue.status_id)
count_row += 1
end
book.write xls_report
xls_report.string
end
# 获取用户单位 # 获取用户单位
# 优先获取高校信息如果改信息不存在则获取occupation # 优先获取高校信息如果改信息不存在则获取occupation
def get_occupation_from_user user def get_occupation_from_user user
@ -1799,7 +1862,11 @@ module ApplicationHelper
end end
def link_to_function(name, function, html_options={}) def link_to_function(name, function, html_options={})
content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(:class => " c_purple")) content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(:class => "BlueCirBtnMini ml10",:style => "display:inline-block; height:20px; line-height:20px;"))
end
def link_to_function_none(name, function, html_options={})
content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(:style => "display:inline-block; height:20px; line-height:20px;"))
end end
# Helper to render JSON in views # Helper to render JSON in views
@ -1821,8 +1888,8 @@ module ApplicationHelper
end end
def check_all_links(form_name) def check_all_links(form_name)
link_to_function(l(:button_check_all), "checkAll('#{form_name}', true)") + "&nbsp;&nbsp;".html_safe + " | "+ "&nbsp;&nbsp;".html_safe + link_to_function_none(l(:button_check_all), "checkAll('#{form_name}', true)") + "&nbsp;&nbsp;".html_safe + " | "+ "&nbsp;&nbsp;".html_safe +
link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)") link_to_function_none(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
end end
# 本次修改,修改为只显示关闭的所占%比 # 本次修改,修改为只显示关闭的所占%比
@ -2689,15 +2756,15 @@ module ApplicationHelper
end end
#获取匿评相关连接代码 #获取匿评相关连接代码
def homework_anonymous_comment (homework, is_in_course, user_activity_id = -1, course_activity = -1) def homework_anonymous_comment (homework, hw_status, user_activity_id = -1)
if homework.homework_detail_manual.comment_status == 0 ||Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") if homework.homework_detail_manual.comment_status == 0 ||Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "作业截止日期之前不可以启动匿评" link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "作业截止日期之前不可以启动匿评"
elsif homework.student_works.has_committed.count >= 2 && homework.homework_detail_manual#作业份数大于2 elsif homework.student_works.has_committed.count >= 2 && homework.homework_detail_manual#作业份数大于2
case homework.homework_detail_manual.comment_status case homework.homework_detail_manual.comment_status
when 1 when 1
link = link_to '启动匿评', Setting.protocol + "://" + Setting.host_name + "/homework_common/" + homework.id.to_s + "/alert_anonymous_comment?is_in_course=" + is_in_course.to_s + "&user_activity_id=" + user_activity_id.to_s + "&course_activity=" + course_activity.to_s, id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'postOptionLink' link = link_to '启动匿评', Setting.protocol + "://" + Setting.host_name + "/homework_common/" + homework.id.to_s + "/alert_anonymous_comment?hw_status=" + hw_status.to_s + "&user_activity_id=" + user_activity_id.to_s, id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'postOptionLink'
when 2 when 2
link = link_to '关闭匿评', Setting.protocol + "://" + Setting.host_name + "/homework_common/" + homework.id.to_s + "/alert_anonymous_comment?is_in_course=" + is_in_course.to_s + "&user_activity_id=" + user_activity_id.to_s + "&course_activity=" + course_activity.to_s, id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'postOptionLink' link = link_to '关闭匿评', Setting.protocol + "://" + Setting.host_name + "/homework_common/" + homework.id.to_s + "/alert_anonymous_comment?hw_status=" + hw_status.to_s + "&user_activity_id=" + user_activity_id.to_s, id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'postOptionLink'
when 3 when 3
# link = link_to "匿评结束","javascript:void(0)", :class => "postOptionLink", :title => "匿评结束" # link = link_to "匿评结束","javascript:void(0)", :class => "postOptionLink", :title => "匿评结束"
end end
@ -2745,7 +2812,7 @@ module ApplicationHelper
count = homework.student_works.has_committed.count count = homework.student_works.has_committed.count
if User.current.member_of_course?(homework.course) if User.current.member_of_course?(homework.course)
if is_teacher #老师显示作品数量 if is_teacher #老师显示作品数量
link_to "作品(#{count})", student_work_index_url_in_org(homework.id), :class => "c_blue" link_to "作品(#{count})", student_work_index_url_in_org(homework.id, 2), :class => "c_blue"
else #学生显示提交作品、修改作品等按钮 else #学生显示提交作品、修改作品等按钮
work = cur_user_works_for_homework homework work = cur_user_works_for_homework homework
project = cur_user_projects_for_homework homework project = cur_user_projects_for_homework homework
@ -2763,20 +2830,20 @@ module ApplicationHelper
end end
else else
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 #匿评作业,且作业状态不是在开启匿评之前 if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品" link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "开启匿评后不可修改作品"
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "匿评已结束" link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "匿评已结束"
elsif homework.homework_type == 2 && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")#编程作业不能修改作品 elsif homework.homework_type == 2 && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")#编程作业不能修改作品
link_to "修改作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue' link_to "修改作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_blue'
elsif Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") && work.user_id == User.current.id 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 "修改作品(#{count})", edit_student_work_url_without_domain(work.id),:class => 'c_blue' link_to "修改作品(#{count})", edit_student_work_url_without_domain(work.id),:class => 'c_blue'
else else
link_to "查看作品(#{count})", student_work_index_url_in_org(homework.id), :class => 'c_blue', :title => "作业截止后不可修改作品" link_to "查看作品(#{count})", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "作业截止后不可修改作品"
end end
end end
end end
else else
link_to "作品(#{count})",student_work_index_url_in_org(homework.id),:class => "c_blue" link_to "作品(#{count})",student_work_index_url_in_org(homework.id, 2),:class => "c_blue"
end end
end end
@ -2799,15 +2866,15 @@ module ApplicationHelper
end end
else else
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前 if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_url_in_org(homework.id), :class => 'hw_btn_green2 fr mt5', :title => "开启匿评后不可修改作品", :target => '_blank' link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green2 fr mt5', :title => "开启匿评后不可修改作品", :target => '_blank'
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
link_to "查看作品",student_work_index_url_in_org(homework.id), :class => 'hw_btn_green2 fr mt5', :title => "匿评已结束", :target => '_blank' link_to "查看作品",student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green2 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")#编程作业不能修改作品 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_green2 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 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_green2 fr mt5', :target => '_blank'
else else
link_to "查看作品", student_work_index_url_in_org(homework.id), :class => 'hw_btn_green2 fr mt5', :title => "作业截止后不可修改作品", :target => '_blank' link_to "查看作品", student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green2 fr mt5', :title => "作业截止后不可修改作品", :target => '_blank'
end end
end end
end end
@ -3136,13 +3203,13 @@ def homework_common_index_url_in_org(course_id)
Setting.protocol + "://" + Setting.host_name + "/homework_common?course=" + course_id.to_s Setting.protocol + "://" + Setting.host_name + "/homework_common?course=" + course_id.to_s
end end
def student_work_index_url_in_org(homework_id, is_focus = '', show_work_id = '') def student_work_index_url_in_org(homework_id, tab = 1, is_focus = '', show_work_id = '')
if is_focus != '' if is_focus != ''
Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + "&is_focus=" + is_focus.to_s Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + "&tab=" + tab.to_s + "&is_focus=" + is_focus.to_s
elsif show_work_id != '' elsif show_work_id != ''
Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + "&show_work_id=" + show_work_id.to_s Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + "&tab=" + tab.to_s + "&show_work_id=" + show_work_id.to_s
else else
Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s Setting.protocol + "://" + Setting.host_name + "/student_work?homework=" + homework_id.to_s + "&tab=" + tab.to_s
end end
end end
@ -3246,7 +3313,12 @@ end
#获取所有子节点 #获取所有子节点
def get_all_children result, jour def get_all_children result, jour
if (jour.kind_of? JournalsForMessage) || (jour.kind_of? Message) || (jour.kind_of? BlogComment) || (jour.kind_of? OrgDocumentComment) if jour.kind_of? Message
jour.children.includes(:author, :praise_tread_cache).each do |jour_child|
result << jour_child
get_all_children result, jour_child
end
elsif (jour.kind_of? JournalsForMessage) || (jour.kind_of? BlogComment) || (jour.kind_of? OrgDocumentComment)
jour.children.each do |jour_child| jour.children.each do |jour_child|
result << jour_child result << jour_child
get_all_children result, jour_child get_all_children result, jour_child

View File

@ -57,12 +57,12 @@ module HomeworkCommonHelper
end end
#根据传入作业确定跳转到开启匿评还是关闭匿评功能 #根据传入作业确定跳转到开启匿评还是关闭匿评功能
def alert_anonyoms_path homework,homework_detail_manual,user_activity_id,is_in_course,course_activity def alert_anonyoms_path homework,homework_detail_manual,user_activity_id,hw_status
link = "" link = ""
if homework_detail_manual.comment_status == 1 if homework_detail_manual.comment_status == 1
link = start_anonymous_comment_homework_common_url homework.id,:user_activity_id=>user_activity_id,:is_in_course=>is_in_course,:course_activity=>course_activity link = start_anonymous_comment_homework_common_url homework.id,:user_activity_id=>user_activity_id,:hw_status=>hw_status
elsif homework_detail_manual.comment_status == 2 elsif homework_detail_manual.comment_status == 2
link = stop_anonymous_comment_homework_common_url homework.id,:user_activity_id=>user_activity_id,:is_in_course=>is_in_course,:course_activity=>course_activity link = stop_anonymous_comment_homework_common_url homework.id,:user_activity_id=>user_activity_id,:hw_status=>hw_status
end end
link link
end end

View File

@ -57,6 +57,15 @@ module IssuesHelper
"<strong>#{@cached_label_priority}</strong>: #{h(issue.priority.name)}".html_safe "<strong>#{@cached_label_priority}</strong>: #{h(issue.priority.name)}".html_safe
end end
def states_done_ratio(issue)
done_ratio = issue.done_ratio
if done_ratio == 100
"<span class='c_green' style='display:inline-block;'>#{l(:label_done_ratio_endding)}</span>".html_safe
else
"<span class='c_orange' style='display:inline-block;'>#{l(:label_done_ratio_doing)}</span>".html_safe
end
end
def issue_heading(issue) def issue_heading(issue)
#h("#{issue.tracker} ##{issue.id}") #h("#{issue.tracker} ##{issue.id}")
# h("#{issue.tracker} #{issue.source_from}") # h("#{issue.tracker} #{issue.source_from}")
@ -117,6 +126,11 @@ module IssuesHelper
end end
end end
def options_for_version_isuue_list(project)
versions = Version.where(:project_id => project, :status => "open").map{|version| [version.name, version.id]}.unshift(["里程碑", 0])
end
def render_issue_subject_with_tree(issue) def render_issue_subject_with_tree(issue)
s = '' s = ''
ancestors = issue.root? ? [] : issue.ancestors.visible.all ancestors = issue.root? ? [] : issue.ancestors.visible.all

View File

@ -255,16 +255,20 @@ module QueriesHelper
# Give it a name, required to be valid # Give it a name, required to be valid
@query = IssueQuery.new(:name => "_") @query = IssueQuery.new(:name => "_")
@query.project = @project @query.project = @project
params[:f] = %w(subject status_id priority_id author_id assigned_to_id created_on) unless params[:status_id].nil? params[:f] = %w(subject tracker_id status_id done_ratio author_id assigned_to_id fixed_version_id created_on) unless params[:status_id].nil?
params[:op] = {'subject' => "~" , params[:op] = {'subject' => "~" ,
'status_id' => ( params[:status_id] == '0' ? "!":"=" ), 'status_id' => ( params[:status_id] == '0' ? "!":"=" ),
'priority_id' => ( params[:priority_id] == '0' ? "!":"=" ), 'author_id' =>(params[:author_id] == '0' ? "!":"=" ),
'author_id' => ( params[:author_id] == '0' ? "!":"=" ), 'done_ratio' => ( params[:done_ratio]== '-1' ? "!":"="),
'tracker_id' => ( params[:tracker_id] == '0' ? "!":"=" ),
'fixed_version_id' => ( params[:fixed_version_id] == '0' ? "!":"=" ),
'assigned_to_id' => ( params[:assigned_to_id] == '0' ? "!":"=" )} unless params[:status_id].nil? 'assigned_to_id' => ( params[:assigned_to_id] == '0' ? "!":"=" )} unless params[:status_id].nil?
params[:v] = {'subject' => [params[:subject]], params[:v] = {'subject' => [params[:subject]],
'status_id' => [params[:status_id]], 'status_id' => [params[:status_id]],
'priority_id' => [params[:priority_id]],
'author_id' => [params[:author_id]], 'author_id' => [params[:author_id]],
'done_ratio' => [params[:done_ratio]],
'tracker_id' => [params[:tracker_id]],
'fixed_version_id' => [params[:fixed_version_id]],
'assigned_to_id' => [params[:assigned_to_id]]} unless params[:status_id].nil? 'assigned_to_id' => [params[:assigned_to_id]]} unless params[:status_id].nil?
if(params[:status_id] != nil) if(params[:status_id] != nil)
if( params[:issue_create_date_start]!=nil && params[:issue_create_date_start]!='' && if( params[:issue_create_date_start]!=nil && params[:issue_create_date_start]!='' &&

View File

@ -0,0 +1,17 @@
module SyllabusMemberHelper
include ApplicationHelper
def find_user_not_in_current_syllabus_by_name syllabus
if params[:q] && params[:q].lstrip.rstrip != ""
scope = Principal.active.sorted.not_member_of_syllabus(syllabus).like(params[:q])
else
scope = []
end
principals = paginateHelper scope,10
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :id => 'principals', :class => 'sy_new_tchlist')
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
link_to text, host_with_protocol + "/syllabus_member/syl_member_autocomplete?" + parameters.merge(:q => params[:q],:flag => true,:syllabus=> syllabus, :format => 'js').to_query, :remote => true
}
s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "syllabus_member_pagination_links" )
end
end

View File

@ -4,6 +4,20 @@ module SyllabusesHelper
Syllabus.tagged_with(tag_name).order('updated_at desc') Syllabus.tagged_with(tag_name).order('updated_at desc')
end end
def find_user_not_in_current_syllabus_by_name syllabus
if params[:q] && params[:q].lstrip.rstrip != ""
scope = Principal.active.sorted.not_member_of_syllabus(syllabus).like(params[:q])
else
scope = []
end
principals = paginateHelper scope,10
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :id => 'principals', :class => 'sy_new_tchlist')
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
link_to text, host_with_protocol + "/syllabus_member/syl_member_autocomplete?" + parameters.merge(:q => params[:q],:flag => true,:syllabus=> syllabus, :format => 'js').to_query, :remote => true
}
s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "syllabus_member_pagination_links" )
end
def teacher_count syllabus def teacher_count syllabus
count = 0 count = 0
courses = syllabus.courses courses = syllabus.courses

View File

@ -344,7 +344,7 @@ module WatchersHelper
def exit_project_link(project) def exit_project_link(project)
link_to(l(:label_exit_project),exit_cur_project_path(project.id), link_to(l(:label_exit_project),exit_cur_project_path(project.id),
:remote => true, :confirm => l(:lable_sure_exit_project), :remote => true, :confirm => l(:lable_sure_exit_project),
:class => "pr_join_a_quit" ) :class => "sy_btn_grey mr5" )
end end
#项目关注、取消关注 #项目关注、取消关注
@ -361,7 +361,7 @@ module WatchersHelper
:object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort)) :object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort))
method = watched ? 'delete' : 'post' method = watched ? 'delete' : 'post'
link_to text, url, :remote => true, :method => method, link_to text, url, :remote => true, :method => method,
:class => "pr_join_a" ,:id=>id :class => "sy_btn_pink mr5" ,:id=>id
end end
# 申请加入项目 # 申请加入项目
@ -372,9 +372,9 @@ module WatchersHelper
method = 'post' method = 'post'
@applied_flag = project.instance_of?(Project) @applied_flag = project.instance_of?(Project)
if applied if applied
link = "<a class ='pr_join_a'>#{text}</a>" link = "<a class ='sy_btn_pink mr5'>#{text}</a>"
else else
link = link_to(text, url, :remote => true, :method => method, :id => "#{project.id}", :class => "pr_join_a") link = link_to(text, url, :remote => true, :method => method, :id => "#{project.id}", :class => "sy_btn_pink mr5")
end end
link.html_safe link.html_safe
# if applied # if applied

View File

@ -89,7 +89,7 @@ class AtMessage < ActiveRecord::Base
status = -1 status = -1
end end
when 'JournalsForMessage' when 'JournalsForMessage'
if at_message.jour && at_message.jour.course if at_message.jour && defined? at_message.jour.course
#作业回复 #作业回复
shield_type = "Course" shield_type = "Course"
container_id = at_message.jour.course.id container_id = at_message.jour.course.id
@ -99,7 +99,7 @@ class AtMessage < ActiveRecord::Base
else else
type = "journal_for_message" type = "journal_for_message"
detail_id = topic.id detail_id = topic.id
detail_title = at_message.subject detail_title = topic.notes.nil? ? "" : topic.notes
end end
else else
status = -1 status = -1

View File

@ -12,6 +12,8 @@ class BlogComment < ActiveRecord::Base
belongs_to :last_reply, :class_name => 'BlogComment', :foreign_key => 'last_comment_id' belongs_to :last_reply, :class_name => 'BlogComment', :foreign_key => 'last_comment_id'
# 虚拟关联 # 虚拟关联
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_one :praise_tread_cache, as: :object, dependent: :destroy
acts_as_watchable acts_as_watchable
validates_presence_of :title, :content validates_presence_of :title, :content

View File

@ -27,6 +27,8 @@ class Comment < ActiveRecord::Base
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy
#end #end
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_one :praise_tread_cache, as: :object, dependent: :destroy
acts_as_event :datetime => :updated_on, acts_as_event :datetime => :updated_on,
:description => :comments, :description => :comments,
:type => 'news', :type => 'news',

View File

@ -13,6 +13,7 @@ class Contest < ActiveRecord::Base
has_many :join_in_competitions, foreign_key: 'competition_id', :dependent => :destroy has_many :join_in_competitions, foreign_key: 'competition_id', :dependent => :destroy
has_many :join_in_contests, class_name: 'JoinInCompetition', foreign_key: 'competition_id', :dependent => :destroy has_many :join_in_contests, class_name: 'JoinInCompetition', foreign_key: 'competition_id', :dependent => :destroy
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_one :praise_tread_cache, as: :object, dependent: :destroy
has_many :contestnotifications, :dependent => :destroy, :include => :author has_many :contestnotifications, :dependent => :destroy, :include => :author

View File

@ -19,6 +19,8 @@ class HomeworkCommon < ActiveRecord::Base
has_many :student_works_evaluation_distributions, :through => :student_works #一个作业的分配的匿评列表 has_many :student_works_evaluation_distributions, :through => :student_works #一个作业的分配的匿评列表
has_many :journals_for_messages, :as => :jour, :dependent => :destroy has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :apply_homeworks, :dependent => :destroy has_many :apply_homeworks, :dependent => :destroy
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_one :praise_tread_cache, as: :object, dependent: :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy #用户活动 has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy #用户活动
# 课程动态 # 课程动态
has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy

View File

@ -53,6 +53,7 @@ class Issue < ActiveRecord::Base
has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy
# end # end
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_one :praise_tread_cache, as: :object, dependent: :destroy
# ForgeMessage虚拟关联(多态) # ForgeMessage虚拟关联(多态)
has_many :forge_messages, :class_name => 'ForgeMessage',:as =>:forge_message ,:dependent => :destroy has_many :forge_messages, :class_name => 'ForgeMessage',:as =>:forge_message ,:dependent => :destroy

View File

@ -35,6 +35,8 @@ class Journal < ActiveRecord::Base
# 被ForgeMessage虚拟关联 # 被ForgeMessage虚拟关联
has_many :forge_messages, :class_name => 'ForgeMessage',:as =>:forge_message ,:dependent => :destroy has_many :forge_messages, :class_name => 'ForgeMessage',:as =>:forge_message ,:dependent => :destroy
has_many :at_messages, as: :at_message, dependent: :destroy has_many :at_messages, as: :at_message, dependent: :destroy
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_one :praise_tread_cache, as: :object, dependent: :destroy
acts_as_attachable acts_as_attachable
attr_accessor :indice attr_accessor :indice
acts_as_tree :counter_cache => :comments_count, :order => "#{Journal.table_name}.created_on ASC" acts_as_tree :counter_cache => :comments_count, :order => "#{Journal.table_name}.created_on ASC"

View File

@ -68,6 +68,8 @@ class JournalsForMessage < ActiveRecord::Base
has_many :user_feedback_messages, :class_name => 'UserFeedbackMessage', :as =>:journals_for_message, :dependent => :destroy has_many :user_feedback_messages, :class_name => 'UserFeedbackMessage', :as =>:journals_for_message, :dependent => :destroy
has_many :at_messages, as: :at_message, dependent: :destroy has_many :at_messages, as: :at_message, dependent: :destroy
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_one :praise_tread_cache, as: :object, dependent: :destroy
validates :notes, presence: true, if: :is_homework_jour? validates :notes, presence: true, if: :is_homework_jour?
after_create :act_as_activity, :act_as_course_activity, :act_as_course_message, after_create :act_as_activity, :act_as_course_activity, :act_as_course_message,

View File

@ -48,6 +48,8 @@ class Memo < ActiveRecord::Base
acts_as_attachable acts_as_attachable
has_many :user_score_details, :class_name => 'UserScoreDetails',:as => :score_changeable_obj has_many :user_score_details, :class_name => 'UserScoreDetails',:as => :score_changeable_obj
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_one :praise_tread_cache, as: :object, dependent: :destroy
# 消息 # 消息
has_many :memo_messages, :class_name =>'MemoMessage', :dependent => :destroy has_many :memo_messages, :class_name =>'MemoMessage', :dependent => :destroy
# end # end

View File

@ -26,6 +26,7 @@ class Message < ActiveRecord::Base
belongs_to :board,:touch => true belongs_to :board,:touch => true
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id' belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_one :praise_tread_cache, as: :object, dependent: :destroy
# has_many :org_subfield_messages, :dependent => :destroy # has_many :org_subfield_messages, :dependent => :destroy
# has_many :org_subfields, :through => :org_subfield_messages # has_many :org_subfields, :through => :org_subfield_messages

View File

@ -40,6 +40,9 @@ class News < ActiveRecord::Base
has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy
#end #end
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_one :praise_tread_cache, as: :object, dependent: :destroy
#转发表 #转发表
has_many :forwards, :as => :from, :dependent => :destroy has_many :forwards, :as => :from, :dependent => :destroy

View File

@ -6,6 +6,8 @@ class OrgDocumentComment < ActiveRecord::Base
belongs_to :organization belongs_to :organization
belongs_to :creator, :class_name => 'User', :foreign_key => 'creator_id' belongs_to :creator, :class_name => 'User', :foreign_key => 'creator_id'
has_many :editor_of_documents, :dependent => :destroy has_many :editor_of_documents, :dependent => :destroy
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_one :praise_tread_cache, as: :object, dependent: :destroy
acts_as_tree :order => "#{OrgDocumentComment.table_name}.sticky asc, #{OrgDocumentComment.table_name}.created_at desc" acts_as_tree :order => "#{OrgDocumentComment.table_name}.sticky asc, #{OrgDocumentComment.table_name}.created_at desc"
acts_as_attachable acts_as_attachable
has_many :org_acts, :class_name => 'OrgActivity',:as =>:org_act ,:dependent => :destroy has_many :org_acts, :class_name => 'OrgActivity',:as =>:org_act ,:dependent => :destroy

View File

@ -1,5 +1,6 @@
class PraiseTreadCache < ActiveRecord::Base class PraiseTreadCache < ActiveRecord::Base
attr_accessible :object_id,:object_type,:praise_num,:tread_num attr_accessible :object_id,:object_type,:praise_num,:tread_num
belongs_to :object, :polymorphic => true
def plus(flag,num) def plus(flag,num)
case flag case flag

View File

@ -97,6 +97,16 @@ class Principal < ActiveRecord::Base
end end
} }
scope :not_member_of_syllabus, lambda {|syllabus|
syllabuses = [syllabus] unless syllabus.is_a?(Array)
if syllabuses.empty?
where("1=0")
else
ids = syllabuses.map(&:id)
where("#{Principal.table_name}.id NOT IN (SELECT DISTINCT user_id FROM #{SyllabusMember.table_name} WHERE syllabus_id IN (?))", ids)
end
}
scope :sorted, lambda { order(*Principal.fields_for_order_statement)} scope :sorted, lambda { order(*Principal.fields_for_order_statement)}
scope :applied_members, lambda {|project| scope :applied_members, lambda {|project|

View File

@ -305,6 +305,11 @@ class Project < ActiveRecord::Base
errors[:identifier].blank? && !(new_record? || identifier.blank?) errors[:identifier].blank? && !(new_record? || identifier.blank?)
end end
# returns project's creater
def creater
User.find(self.user_id).try(:show_name)
end
# returns latest created projects # returns latest created projects
# non public projects will be returned only if user is a member of those # non public projects will be returned only if user is a member of those
def self.latest(user=nil, count=5) def self.latest(user=nil, count=5)

View File

@ -9,6 +9,9 @@ class Syllabus < ActiveRecord::Base
belongs_to :user belongs_to :user
has_many :courses has_many :courses
has_many :journals_for_messages, :as => :jour, :dependent => :destroy has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :syllabus_members, :dependent => :destroy
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_one :praise_tread_cache, as: :object, dependent: :destroy
attr_accessible :description, :user_id, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course attr_accessible :description, :user_id, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course
safe_attributes 'title','user', 'description', 'eng_name', 'syllabus_type', 'credit', 'hours', 'theory_hours', 'practice_hours', 'credit', 'applicable_major', 'pre_course' safe_attributes 'title','user', 'description', 'eng_name', 'syllabus_type', 'credit', 'hours', 'theory_hours', 'practice_hours', 'credit', 'applicable_major', 'pre_course'

View File

@ -0,0 +1,5 @@
class SyllabusMember < ActiveRecord::Base
belongs_to :syllabus
belongs_to :user
attr_accessible :rank, :user_id, :syllabus_id
end

View File

@ -91,6 +91,7 @@ class User < Principal
has_many :homework_attaches, :through => :homework_users has_many :homework_attaches, :through => :homework_users
has_many :homework_evaluations has_many :homework_evaluations
has_many :syllabuses, :dependent => :destroy has_many :syllabuses, :dependent => :destroy
has_many :syllabus_members, :dependent => :destroy
#问卷相关关关系 #问卷相关关关系
has_many :poll_users, :dependent => :destroy has_many :poll_users, :dependent => :destroy
has_many :poll_votes, :dependent => :destroy has_many :poll_votes, :dependent => :destroy

View File

@ -1,16 +1,10 @@
<div class="project_r_h"> <div class="project_r_h" style="width:730px;">
<h2 class="project_h2"><%= @query.new_record? ? l(:label_calendar) : h(@query.name) %></h2> <h2 class="project_h2"><%= @query.new_record? ? l(:label_calendar) : h(@query.name) %></h2>
</div> </div>
<%= form_tag({:controller => 'calendars', :action => 'show', :project_id => @project}, <%= form_tag({:controller => 'calendars', :action => 'show', :project_id => @project},
:method => :get, :id => 'query_form') do %> :method => :get, :id => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %> <%= hidden_field_tag 'set_filter', '1' %>
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
</div>
</fieldset>
<p style="float:right;"> <p style="float:right;">
<%= link_to_previous_month(@year, @month) %> | <%= link_to_next_month(@year, @month) %> <%= link_to_previous_month(@year, @month) %> | <%= link_to_next_month(@year, @month) %>
</p> </p>
@ -40,3 +34,7 @@
<% end %> <% end %>
<% html_title(l(:label_calendar)) -%> <% html_title(l(:label_calendar)) -%>
<script>
$("#RSide").css("width","730px");
</script>

View File

@ -1,4 +1,4 @@
<table class="cal" style="width: 100%;table-layout: fixed;"> <table id="calender" class="cal" style="width: 100%;table-layout: fixed;">
<thead> <thead>
<tr> <tr>
<th scope="col" title="<%= l(:label_week) %>" class="week-number"></th> <th scope="col" title="<%= l(:label_week) %>" class="week-number"></th>
@ -20,13 +20,13 @@
<div class="<%= i.css_classes %> <%= 'starting' if day == i.start_date %> <%= 'ending' if day == i.due_date %> tooltip"> <div class="<%= i.css_classes %> <%= 'starting' if day == i.start_date %> <%= 'ending' if day == i.due_date %> tooltip">
<%= h("#{i.project} -") unless @project && @project == i.project %> <%= h("#{i.project} -") unless @project && @project == i.project %>
<%= link_to_issue i, :truncate => 30 %> <%= link_to_issue i, :truncate => 30 %>
(<%= states_done_ratio i %>)
<span class="tip"><%= render_issue_tooltip i %></span> <span class="tip"><%= render_issue_tooltip i %></span>
</div> </div>
<% else %> <% else %>
<span class="icon icon-package"> <span class="icon icon-package"></span>
<%= h("#{i.project} -") unless @project && @project == i.project %> <%= h("#{i.project} -") unless @project && @project == i.project %>
<%= link_to_version i%> <%= link_to_version i%>
</span>
<% end %> <% end %>
<% end %> <% end %>
</td> </td>

View File

@ -60,7 +60,7 @@
<% act = activity.course_act %> <% act = activity.course_act %>
<% case activity.course_act_type.to_s %> <% case activity.course_act_type.to_s %>
<% when 'HomeworkCommon' %> <% when 'HomeworkCommon' %>
<%= render :partial => 'users/course_homework', :locals => {:activity => act, :user_activity_id => activity.id, :course_activity => 1} %> <%= render :partial => 'users/course_homework', :locals => {:activity => act, :user_activity_id => activity.id, :hw_status => 2} %>
<% when 'News' %> <% when 'News' %>
<%= render :partial => 'users/course_news', :locals => {:activity => act, :user_activity_id => activity.id} %> <%= render :partial => 'users/course_news', :locals => {:activity => act, :user_activity_id => activity.id} %>
<% when 'Message' %> <% when 'Message' %>

View File

@ -7,9 +7,9 @@
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;} span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
div.ke-toolbar .ke-outline{border:none;} div.ke-toolbar .ke-outline{border:none;}
div.respond-form .reply_btn{margin-left:565px;margin-top:5px;} div.respond-form .reply_btn{margin-left:625px;margin-top:5px;}
div.recall_con{width:570px;} div.recall_con{width:570px;}
div.recall_con .reply_btn{margin-left:525px;margin-top:5px;} div.recall_con .reply_btn{margin-left:585px;margin-top:5px;}
/*.ke-container{height: 80px !important;}*/ /*.ke-container{height: 80px !important;}*/
</style> </style>
<%= content_for(:header_tags) do %> <%= content_for(:header_tags) do %>
@ -19,7 +19,7 @@
<script > <script >
init_KindEditor_data('',80); init_KindEditor_data('',80);
</script> </script>
<div class="msg_box fl mb10" id='leave-message'> <div class="msg_box fl mb10" id='leave-message' style="width:730px;">
<h4><%= l(:label_leave_message) %></h4> <h4><%= l(:label_leave_message) %></h4>
<% if !User.current.logged?%> <% if !User.current.logged?%>

View File

@ -5,7 +5,7 @@
<div class="ping_dispic"> <div class="ping_dispic">
<%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %> <%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %>
</div> </div>
<div class="ping_discon upload_img" style="width: 610px;" onmouseover="$('#delete_reply_<%=journal.id %>').show();" onmouseout="$('#delete_reply_<%=journal.id %>').hide();"> <div class="ping_discon upload_img" style="width: 670px;" onmouseover="$('#delete_reply_<%=journal.id %>').show();" onmouseout="$('#delete_reply_<%=journal.id %>').hide();">
<div class="ping_distop f14"> <div class="ping_distop f14">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> --> <!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span> <span>

View File

@ -26,7 +26,7 @@
} }
} }
</script> </script>
<%= render :partial => 'users/user_homework_detail', :locals => {:homework_common => homework_common,:is_in_course => is_in_course} %> <%= render :partial => 'users/course_homework', :locals => {:activity => homework_common,:user_activity_id => homework_common.id, :hw_status => 3} %>
<% end%> <% end%>
<% if homework_commons.count == 10%> <% if homework_commons.count == 10%>
<%= link_to "点击展开更多",homework_search_course_path(course_id,:page => page,:search=>search),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%> <%= link_to "点击展开更多",homework_search_course_path(course_id,:page => page,:search=>search),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%>

View File

@ -2,7 +2,7 @@
<!-- <#%= stylesheet_link_tag 'css', :media => 'all' %> --> <!-- <#%= stylesheet_link_tag 'css', :media => 'all' %> -->
<div class="courseRSide fl"> <div class="courseRSide fl">
<div class="project_r_h"> <div class="project_r_h" style="width:730px;">
<h2 class="project_h2"><%= l(:label_contest_userresponse) %></h2> <h2 class="project_h2"><%= l(:label_contest_userresponse) %></h2>
</div> </div>

View File

@ -1,5 +1,5 @@
<% if @page == 0 %> <% if @page == 0 %>
$("#user_homework_list").replaceWith("<%= escape_javascript( render :partial => 'courses/user_homework_search_list',:locals => {:homework_commons => @homeworks, :page => @page, :is_in_course => 1,:course_id => @course.id,:search=>@search} )%>"); $("#user_homework_list").replaceWith("<%= escape_javascript( render :partial => 'courses/user_homework_search_list',:locals => {:homework_commons => @homeworks, :page => @page, :course_id => @course.id,:search=>@search} )%>");
<% else %> <% else %>
$("#user_show_more_homework").replaceWith("<%= escape_javascript( render :partial => 'courses/user_homework_search_list',:locals => {:homework_commons => @homeworks, :page => @page, :is_in_course => 1,:course_id => @course.id,:search=>@search} )%>"); $("#user_show_more_homework").replaceWith("<%= escape_javascript( render :partial => 'courses/user_homework_search_list',:locals => {:homework_commons => @homeworks, :page => @page, :course_id => @course.id,:search=>@search} )%>");
<% end %> <% end %>

View File

@ -17,12 +17,13 @@
<div class="cl"></div> <div class="cl"></div>
<li class="ml45"> <li class="ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>
<input type="text" name="course[name]" id="new_course_name" class="courses_input" maxlength="100" placeholder="例如:软件工程计算机系A班" onkeyup="regex_course_name('new');"> <input type="text" name="course[name]" id="new_course_name" class="courses_input" maxlength="100" placeholder="例如:计算机系2016秋季A班" onkeyup="regex_course_name('new');">
<span class="c_red" id="new_course_name_notice" style="display: none;">班级名称不能为空且至少有两个字符</span> <span class="c_red" id="new_course_name_notice" style="display: none;">班级名称不能为空且至少有两个字符</span>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li class="ml125 mb5 fontGrey3"><span class="success-icon mr25">正确示例计算机系2016秋季A班</span></li> <li class="ml125 mb5 fontGrey3"><span class="success-icon mr25">正确示例计算机系2016秋季A班</span></li>
<li class="ml125 mb10 fontGrey3"><span class="error-icon">错误示例:软件工程 - 计算机系2016秋季A班</span></li> <li class="ml125 mb10 fontGrey3"><span class="error-icon">错误示例:软件工程 - 计算机系2016秋季A班</span></li>
<li class="ml125 mt10 mb10 fontGrey2" style="max-width: 544px;">班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。</li>
<li class="ml45"> <li class="ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_class_period)%>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:label_class_period)%>&nbsp;&nbsp;</label>
<input type="text" name="class_period" id="new_class_period" class="hwork_input02" onkeyup="regex_course_class_period('new');" placeholder="例如54" maxlength="6"> <input type="text" name="class_period" id="new_class_period" class="hwork_input02" onkeyup="regex_course_class_period('new');" placeholder="例如54" maxlength="6">

View File

@ -84,7 +84,7 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="homeworkInfo" id="homeworkInformation"> <div class="homeworkInfo mb10" id="homeworkInformation">
<div class=""> <div class="">
<div class="homepagePostTitle fl hidden m_w460" title="<%= @exercise.exercise_name %>"><%= @exercise.exercise_name %></div> <div class="homepagePostTitle fl hidden m_w460" title="<%= @exercise.exercise_name %>"><%= @exercise.exercise_name %></div>
<% if @exercise.exercise_status == 1 %> <% if @exercise.exercise_status == 1 %>

View File

@ -1,4 +1,4 @@
<div class="project_r_h"> <div class="project_r_h" style="width:730px;">
<h2 class="project_h2"><% @gantt.view = self %> <h2 class="project_h2"><% @gantt.view = self %>
<%= @query.new_record? ? l(:label_gantt) : h(@query.name) %></h2> <%= @query.new_record? ? l(:label_gantt) : h(@query.name) %></h2>
</div> </div>
@ -8,12 +8,12 @@
:year => params[:year], :months => params[:months]}, :year => params[:year], :months => params[:months]},
:method => :get, :id => 'query_form') do %> :method => :get, :id => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %> <%= hidden_field_tag 'set_filter', '1' %>
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>"> <!--<fieldset id="filters" class="collapsible <%#= @query.new_record? ? "" : "collapsed" %>">-->
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> <!--<legend onclick="toggleFieldset(this);"><%#= l(:label_filter_plural) %></legend>-->
<div style="<%= @query.new_record? ? "" : "display: none;" %>"> <!--<div style="<%#= @query.new_record? ? "" : "display: none;" %>">-->
<%= render :partial => 'queries/filters', :locals => {:query => @query} %> <!--<%#= render :partial => 'queries/filters', :locals => {:query => @query} %>-->
</div> <!--</div>-->
</fieldset> <!--</fieldset>-->
<fieldset class="collapsible collapsed"> <fieldset class="collapsible collapsed">
<legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend> <legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
<div style="display: none;"> <div style="display: none;">
@ -22,7 +22,7 @@
<td> <td>
<fieldset> <fieldset>
<legend><%= l(:label_related_issues) %></legend> <legend><%= l(:label_related_issues) %></legend>
<label> <label style="padding:10px;">
<%= check_box_tag "draw_rels", params["draw_rels"], params[:set_filter].blank? || params[:draw_rels] %> <%= check_box_tag "draw_rels", params["draw_rels"], params[:set_filter].blank? || params[:draw_rels] %>
<% rels = [IssueRelation::TYPE_BLOCKS, IssueRelation::TYPE_PRECEDES] %> <% rels = [IssueRelation::TYPE_BLOCKS, IssueRelation::TYPE_PRECEDES] %>
<% rels.each do |rel| %> <% rels.each do |rel| %>
@ -37,7 +37,7 @@
<td> <td>
<fieldset> <fieldset>
<legend><%= l(:label_gantt_progress_line) %></legend> <legend><%= l(:label_gantt_progress_line) %></legend>
<label> <label style="padding:10px;">
<%= check_box_tag "draw_progress_line", params[:draw_progress_line], params[:draw_progress_line] %> <%= check_box_tag "draw_progress_line", params[:draw_progress_line], params[:draw_progress_line] %>
<%= l(:label_display) %> <%= l(:label_display) %>
</label> </label>
@ -48,10 +48,10 @@
</div> </div>
</fieldset> </fieldset>
<p class="contextual"> <!--<p class="contextual">-->
<%= gantt_zoom_link(@gantt, :in) %> <!--<%#= gantt_zoom_link(@gantt, :in) %>-->
<%= gantt_zoom_link(@gantt, :out) %> <!--<%#= gantt_zoom_link(@gantt, :out) %>-->
</p> <!--</p>-->
<p class="buttons"> <p class="buttons">
<%= text_field_tag 'months', @gantt.months, :size => 2 %> <%= text_field_tag 'months', @gantt.months, :size => 2 %>
@ -99,9 +99,9 @@
t_height = g_height + headers_height t_height = g_height + headers_height
%> %>
<% if @gantt.truncated %> <%# if @gantt.truncated %>
<p class="warning"><%= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %></p> <!--<p class="warning"><%#= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %></p>-->
<% end %> <%# end %>
<table style="width:100%; border:0; border-collapse: collapse;"> <table style="width:100%; border:0; border-collapse: collapse;">
<tr> <tr>
@ -119,6 +119,7 @@
style += "width: #{subject_width}px;" style += "width: #{subject_width}px;"
style += "height: #{headers_height}px;" style += "height: #{headers_height}px;"
style += 'background: #eee;' style += 'background: #eee;'
style += 'z-index: 1;'
%> %>
<%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %> <%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %>
<% <%
@ -293,10 +294,7 @@
</tr> </tr>
</table> </table>
<% other_formats_links do |f| %>
<%= f.link_to 'PDF', :url => params.merge(@gantt.params) %>
<%= f.link_to('PNG', :url => params.merge(@gantt.params)) if @gantt.respond_to?('to_image') %>
<% end %>
<% end # query.valid? %> <% end # query.valid? %>
<% content_for :sidebar do %> <% content_for :sidebar do %>
@ -319,3 +317,7 @@
$("#draw_progress_line").change(drawGanttHandler); $("#draw_progress_line").change(drawGanttHandler);
}); });
<% end %> <% end %>
<script>
$("#RSide").css("width","730px");
</script>

View File

@ -32,7 +32,7 @@
</p> </p>
<% end %> <% end %>
<div class="ni_btn"> <div class="ni_btn">
<a href="javascript:" class="tijiao" onclick="clickOK('<%= alert_anonyoms_path @homework,@homework_detail_manual,@user_activity_id,@is_in_course,@course_activity%>');" style="margin-bottom: 20px;" > <a href="javascript:" class="tijiao" onclick="clickOK('<%= alert_anonyoms_path @homework,@homework_detail_manual,@user_activity_id,@hw_status%>');" style="margin-bottom: 20px;" >
确&nbsp;&nbsp;定 确&nbsp;&nbsp;定
</a> </a>
<a href="javascript:" class="tijiao" onclick="clickCanel();" style="margin-bottom: 20px;"> <a href="javascript:" class="tijiao" onclick="clickCanel();" style="margin-bottom: 20px;">

View File

@ -22,7 +22,7 @@
</p> </p>
<% end %> <% end %>
<div class="ni_btn"> <div class="ni_btn">
<a href="javascript:" class="tijiao" onclick="clickOK('<%= open_student_works_homework_common_path(@homework, :user_activity_id => @user_activity_id,:is_in_course=>@is_in_course, :course_activity => @course_activity)%>');" style="margin-bottom: 20px;" > <a href="javascript:" class="tijiao" onclick="clickOK('<%= open_student_works_homework_common_path(@homework, :user_activity_id => @user_activity_id,:hw_status=>@hw_status)%>');" style="margin-bottom: 20px;" >
确&nbsp;&nbsp;定 确&nbsp;&nbsp;定
</a> </a>
<a href="javascript:" class="tijiao" onclick="clickCanel();" style="margin-bottom: 20px;"> <a href="javascript:" class="tijiao" onclick="clickCanel();" style="margin-bottom: 20px;">

View File

@ -1,4 +1,4 @@
<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => homework_commons,:page => 0,:is_in_course => 1,:course_id => course_id} %> <%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => homework_commons,:page => 0,:course_id => course_id} %>
<div style="width:210px; text-align:center; margin:0 auto;"> <div style="width:210px; text-align:center; margin:0 auto;">
<ul class="wlist" style=" border:none; display:inline-block; float:none; margin-top:10px;"> <ul class="wlist" style=" border:none; display:inline-block; float:none; margin-top:10px;">

View File

@ -1,5 +1,5 @@
<div class="markPopup" id="popbox02"> <div class="markPopup" id="popbox02">
<%= form_for('new_form',:url => {:controller => 'homework_common',:action => 'set_evaluation_attr',:homework => @homework.id,:user_activity_id=>user_activity_id,:is_in_course=>is_in_course,:course_activity=>course_activity},:method => "post",:remote => true) do |f|%> <%= form_for('new_form',:url => {:controller => 'homework_common',:action => 'set_evaluation_attr',:homework => @homework.id,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post",:remote => true) do |f|%>
<span class="uploadText">匿评设置</span> <span class="uploadText">匿评设置</span>
<div class="cl"></div> <div class="cl"></div>

View File

@ -1,4 +1,4 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity => @course_activity}) %>'); $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>');
showModal('ajax-modal', '500px'); showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" + $('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +

View File

@ -1,5 +1,5 @@
<script type="text/javascript"> <script type="text/javascript">
<% if @is_in_course.to_i == 1 || @course_activity == 1 %> <% if @hw_status != 1 %>
$(function(){ $(function(){
$("#RSide").removeAttr("id"); $("#RSide").removeAttr("id");
$("#Container").css("width","1000px"); $("#Container").css("width","1000px");
@ -23,18 +23,16 @@
window.location.href='<%=manage_or_receive_homeworks_user_path(User.current.id) %>'; window.location.href='<%=manage_or_receive_homeworks_user_path(User.current.id) %>';
<% elsif @is_manage.to_i == 2 %> <% elsif @is_manage.to_i == 2 %>
window.location.href='<%=my_homeworks_user_path(User.current.id) %>'; window.location.href='<%=my_homeworks_user_path(User.current.id) %>';
<% elsif @is_in_course.to_i == 1 %> <% elsif @hw_status == 3 %>
window.location.href='<%=homework_common_index_path(:course => @course.id) %>'; window.location.href='<%=homework_common_index_path(:course => @course.id) %>';
<% elsif @is_in_course.to_i == 0 %> <% elsif @hw_status == 1 %>
window.location.href='<%=user_homeworks_user_path(User.current.id) %>';
<% elsif @is_in_course.to_i == -1 && @course_activity == 0 %>
window.location.href='<%=user_path(User.current.id) %>'; window.location.href='<%=user_path(User.current.id) %>';
<% elsif @is_in_course.to_i == -1 && @course_activity == 1 %> <% elsif @hw_status == 2 %>
window.location.href='<%=course_path(@course.id) %>'; window.location.href='<%=course_path(@course.id) %>';
<% end %> <% end %>
} }
</script> </script>
<div class="homepageRightBanner mb10 <%= (@is_in_course == 1 || @course_activity == 1) ? 'ml10' : '' %>"> <div class="homepageRightBanner mb10 <%= (@hw_status == 2 || @hw_status == 3 || @hw_status == 5) ? 'ml10' : '' %>">
<div class="NewsBannerName">编辑作业</div> <div class="NewsBannerName">编辑作业</div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -56,8 +54,7 @@
<% end %> <% end %>
<%= form_for @homework do |f| %> <%= form_for @homework do |f| %>
<input type="text" name="is_in_course" class="none" value="<%= @is_in_course%>"/> <input type="text" name="hw_status" class="none" value="<%= @hw_status%>"/>
<input type="text" name="course_activity" class="none" value="<%= @course_activity%>"/>
<input type="text" name="is_manage" class="none" value="<%= @is_manage%>"/> <input type="text" name="is_manage" class="none" value="<%= @is_manage%>"/>
<div id="HomeWorkCon"> <div id="HomeWorkCon">
<%= render :partial => 'users/user_homework_form', :locals => { :homework => @homework,:f => f,:edit_mode => true } %> <%= render :partial => 'users/user_homework_form', :locals => { :homework => @homework,:f => f,:edit_mode => true } %>

View File

@ -1,7 +1,10 @@
<% if @user_activity_id.to_i == -1 %> <% if @hw_status == 5 %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); $("#homework_post_brief").html("<%= escape_javascript(render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher}) %>");
sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>");
<% else %> <% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:hw_status=>@hw_status}) %>");
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); <% end %>
<% if @user_activity_id != @homework.id %>
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
<% else %>
sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>");
<% end %> <% end %>

View File

@ -1,4 +1,4 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity =>@course_activity,:remote=>true}) %>'); $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status,:remote=>true}) %>');
showModal('ajax-modal', '350px'); showModal('ajax-modal', '350px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" + $('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +

View File

@ -1,8 +1,11 @@
clickCanel(); clickCanel();
<% if @user_activity_id != -1 %> <% if @hw_status == 5 %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@courae_activity}) %>"); $("#homework_post_brief").html("<%= escape_javascript(render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher}) %>");
<% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:hw_status=>@hw_status}) %>");
<% end %>
<% if @user_activity_id != @homework.id %>
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
<% else %> <% else %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>");
sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>"); sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>");
<% end %> <% end %>

View File

@ -1,13 +1,15 @@
<% if @statue == 1%> <% if @statue == 1%>
alert('启动成功'); alert('启动成功');
<% if @user_activity_id == -1 %> <% if @hw_status == 5 %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); $("#homework_post_brief").html("<%= escape_javascript(render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher}) %>");
$("#evaluation_start_time_<%=@homework.id %>").html("匿评开启时间:<%=format_time(Time.now) %>");
sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>");
<% else %> <% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:hw_status=>@hw_status}) %>");
<% end %>
$("#evaluation_start_time_<%=@user_activity_id %>").html("匿评开启时间:<%=format_time(Time.now) %>"); $("#evaluation_start_time_<%=@user_activity_id %>").html("匿评开启时间:<%=format_time(Time.now) %>");
<% if @user_activity_id != @homework.id %>
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
<% else %>
sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>");
<% end %> <% end %>
/*$("#<%#= @homework.id %>_start_anonymous_comment").replaceWith('<%#= escape_javascript(link_to "关闭匿评", alert_anonymous_comment_homework_common_path(@homework), remote: true, id:"#{@homework.id}_stop_anonymous_comment",:class => "postOptionLink")%>');*/ /*$("#<%#= @homework.id %>_start_anonymous_comment").replaceWith('<%#= escape_javascript(link_to "关闭匿评", alert_anonymous_comment_homework_common_path(@homework), remote: true, id:"#{@homework.id}_stop_anonymous_comment",:class => "postOptionLink")%>');*/
<% elsif @statue == 2 %> <% elsif @statue == 2 %>

View File

@ -1,4 +1,4 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att',:locals => {:user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity =>@course_activity,:remote=>true}) %>'); $('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att',:locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status,:remote=>true}) %>');
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}; 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};
showModal('ajax-modal', '350px'); showModal('ajax-modal', '350px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();

View File

@ -1,12 +1,14 @@
alert('关闭成功'); alert('关闭成功');
<% if @user_activity_id == -1 %> <% if @hw_status == 5 %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>"); $("#homework_post_brief").html("<%= escape_javascript(render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher}) %>");
$("#evaluation_end_time_<%=@homework.id %>").html("匿评关闭时间:<%=format_time(Time.now) %>");
sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>");
<% else %> <% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>"); $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:hw_status=>@hw_status}) %>");
$("#evaluation_end_time_<%=@user_activity_id %>").html("匿评关闭时间:<%=format_time(Time.now) %>"); <% end %>
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", 'UserActivity'); $("#evaluation_end_time_<%=@homework.id %>").html("匿评关闭时间:<%=format_time(Time.now) %>");
<% if @user_activity_id != @homework.id %>
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
<% else %>
sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>");
<% end %> <% end %>
/* /*
$("#<%#= @homework.id %>_stop_anonymous_comment").replaceWith('');*/ $("#<%#= @homework.id %>_stop_anonymous_comment").replaceWith('');*/

View File

@ -0,0 +1,16 @@
<% issue_list(issues) do |issue, level| -%>
<script>
$(function () {
sd_create_editor_from_data(<%= issue.id%>, null, "100%", "<%= issue.class.name %>");
});
</script>
<%= render :partial => 'issues/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %>
<% end %>
<div style="text-align:center;">
<div class="pages" style="width:auto; display:inline-block;">
<ul id="issue_list_pagination">
<%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</ul>
<div class="cl"></div>
</div>
</div>

View File

@ -25,6 +25,14 @@
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li> <li>
<label class="label">来源:</label>
<select class="w150">
<option>客户</option>
<option>用户</option>
<option>其他</option>
</select>
</li>
<div class="cl"></div>
<li> <li>
<label class="label"><%= l(:field_assigned_to) %></label> <label class="label"><%= l(:field_assigned_to) %></label>
<% if @issue.safe_attribute? 'assigned_to_id' %> <% if @issue.safe_attribute? 'assigned_to_id' %>
@ -36,7 +44,7 @@
<div class="cl"></div> <div class="cl"></div>
<li> <li>
<% if @issue.safe_attribute?('fixed_version_id') && @issue.assignable_versions.any? %> <% if @issue.safe_attribute?('fixed_version_id') && @issue.assignable_versions.any? %>
<label class="label"><%= l(:field_fixed_version) %></label> <label class="label"><%= l(:milestone) %></label>
<%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version), <%= 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}, {:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
:class => "w150" %> :class => "w150" %>
@ -74,7 +82,13 @@
<label class="label02"><%= l(:field_estimated_hours) %></label> <label class="label02"><%= l(:field_estimated_hours) %></label>
<% if @issue.safe_attribute? 'estimated_hours' %> <% 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') %>
<span class="mt3 ml5"><%= l(:field_hours) %></span> <% end %>
</li>
<div class="cl"></div>
<li>
<label class="label02">实际工时 (H)</label>
<% if @issue.safe_attribute? 'estimated_hours' %>
<%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true %>
<% end %> <% end %>
</li> </li>
<div class="cl"></div> <div class="cl"></div>

View File

@ -40,7 +40,7 @@
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<% unless @issue.disabled_core_fields.include?('fixed_version_id') %> <% unless @issue.disabled_core_fields.include?('fixed_version_id') %>
<li><p class="label03" >&nbsp;目标版本&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p" style="width:120px;"><%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %></span> <li><p class="label03" >&nbsp;<%=l(:milestone)%>&nbsp;&nbsp;:&nbsp;</p><span class="pro_info_p" style="width:120px;"><%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %></span>
</li> </li>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>

View File

@ -18,6 +18,10 @@
<label class="fl ml5 mt3" for="issue_is_private" id="issue_is_private_tips"><%= l(:field_is_private_tips)%></label> <label class="fl ml5 mt3" for="issue_is_private" id="issue_is_private_tips"><%= l(:field_is_private_tips)%></label>
<% end %> <% end %>
</li> </li>
<!--<li>-->
<!--<input type="checkbox" class="ml30">-->
<!--<label class="fl ml5 mt3">不需要评审</label>-->
<!--</li>-->
<div class="cl"></div> <div class="cl"></div>
<!--<li>--> <!--<li>-->
<!--<%# if @issue.safe_attribute? 'project_id' %>--> <!--<%# if @issue.safe_attribute? 'project_id' %>-->

View File

@ -0,0 +1 @@
<span class="issues_nav_tag ml5" ><%= @issues_filter_assign_count %></span>

View File

@ -0,0 +1 @@
<span class="issues_nav_tag ml5" ><%= @issue_count %></span>

View File

@ -0,0 +1 @@
<span class="issues_nav_tag ml5"><%= @issues_filter_author_count %><%#= @project.issues.where(:author_id => User.current.id ).visible.all.count %></span>

View File

@ -6,6 +6,11 @@
</script> </script>
<%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %> <%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %>
<% end %> <% end %>
<% if issues.count == 10%> <div style="text-align:center;">
<%= link_to "点击展开更多",project_issues_path({:project_id => project.id}.merge(params)),:id => "show_more_issues",:remote => "true",:class => "loadMore mt10 f_grey"%> <div class="pages" style="width:auto; display:inline-block;">
<% end%> <ul id="issue_list_pagination">
<%= pagination_links_full @issue_pages, @issue_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</ul>
<div class="cl"></div>
</div>
</div>

View File

@ -0,0 +1,93 @@
<div class="issues_con fl">
<div class="clear mb5">
<a href="<%= new_project_issue_path(@project)%>" class="sy_btn_green fl mr10">新 增</a>
<div class="issues_statistics fl">
<ul>
<li>所有<a href="javascript:void(0);" class="issues_greycirbg_btn "><%= @project.project_score.issue_num %></a></li>
<li>开启<a href="javascript:void(0);" class="issues_greycirbg_btn "><%= @project.issues.where('status_id in (1,2,3,4,6)').visible.all.count %></a></li>
<li>关闭<a href="javascript:void(0);" class="issues_greycirbg_btn "><%= @project.issues.where(:status_id => 5 ).visible.all.count %></a></li>
</ul>
</div><!--issues_statistics end-->
<a href="<%=project_issues_path(:project_id => @project, :format => 'xls')%>" class="hw_btn_blue fr" alt="导出EXCEL">导出EXCEL</a>
</div>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %>
<div class="clear mb10">
<div class="hw_search_box fl ">
<input class="hw_search-input" placeholder="请输入问题名称" type="text" id="v_subject" name="subject" onkeypress="EnterPress(event)" onkeydown="EnterPress()">
<a href="javascript:void(0);" class="hw_btn_search" onclick="remote_function();" ></a>
</div>
<a href="javascript:void(0);" class="sy_btn_grey fl ml5" onclick="nh_reset_form();">清除</a>
<div class="calendar_div fr">
<input name="issue_create_date_end" nhname="date_val" type="hidden"/>
<input type="text" nhname="date_show" id="issue_create_date_end_show" class="InputBox fl W120 calendar_input" readonly="readonly" size="13" placeholder="结束日期">
<%= calendar_for('issue_create_date_end_show')%>
</div>
<div class="calendar_div fr">
<input name="issue_create_date_start_show" nhname="date_val" type="hidden"/>
<input type="text" nhname="date_show" id="issue_create_date_start_show" class="InputBox fl W120 calendar_input" readonly="readonly" size="13" placeholder="开始日期">
<%= calendar_for('issue_create_date_start_show')%>
</div>
<!--<input type="text" placeholder="开始日期" class="issues_calendar_input fl " ><a href="" class="issues_data_img fl" style="border-right:none;"></a>-->
<!--<input type="text" placeholder="结束日期" class="issues_calendar_input fl " ><a href="" class="issues_data_img fl"></a>-->
</div>
<div class="issues_con_list" style="position: relative;">
<ul id="issues_list_nav" >
<li id="issues_list_nav_1" class="issues_nav_hover" onclick="HoverLi(1);">
<a href="javascript:void(0);" onclick="all_reset_form();" id="issues_type_1" >所有<span class="issues_nav_tag ml5"><%= @project.project_score.issue_num %></span></a>
</li>
<li id="issues_list_nav_2" onclick="HoverLi(2);">
<a href="javascript:void(0);" onclick="switch_assign_to(<%= User.current.id %>)" id="issues_type_2" >指派给我<span class="issues_nav_tag ml5"><%= @project.issues.where(:assigned_to_id => User.current.id ).visible.all.count %></span></a>
</li>
<li id="issues_list_nav_3" onclick="HoverLi(3);">
<a href="javascript:void(0);" onclick="createByMe(<%= User.current.id %>)" id="issues_type_3" >我的发布<span class="issues_nav_tag ml5"><%= @project.issues.where(:author_id => User.current.id ).visible.all.count %></span></a>
</li>
<div class="cl"></div>
</ul>
<div class="issues_filter ">
<div class="issues_form_filter mt5 mr5">
<%= select(:issue, :tracker_id, [["缺陷",1],["功能",2],["支持",3],["任务",4],["周报",5]].unshift(["类型",0]),
{:include_blank => false, :selected => @tracker_id ? @tracker_id : 0},
{:onchange => "remote_function();", :id => "tracker_id", :name => "tracker_id", :class => "fl issues_filter_select_min"}) %>
<%= select( :issue, :user_id, principals_options_for_isuue_list(@project),
{ :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0},
{:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"fl"})
%>
<%= select(:issue, :fixed_version_id, options_for_version_isuue_list(@project),
{:include_blank => false, :selected => @fixed_version_id ? @fixed_version_id : 0},
{:onchange => "remote_function();", :id => "fixed_version_id", :name => "fixed_version_id", :class => "f1"}) %>
<%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]),
{ :include_blank => false,:selected=>@status_id ? @status_id : 0
},
{:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"fl issues_filter_select_min"}
) %>
<%= select(:issue, :done_ratio, [["10%",1],["20%",2],["30%",3],["40%",4],["50%",5],["60%",6],["70%",7],["80%",8],["90%",9],["10%",10]].unshift(["完成度",0]),
{:include_blank => false, :selected => @done_ratio ? @done_ratio : 0 },
{:onchange => "remote_function();", :id => "done_ratio", :name => "done_ratio", :class => "f1"}) %>
<%= select(:issue, :test, [["最早创建",1],["最早更新",2]].unshift(["排序",0]),
{:include_blank => false, :selected => @order ? @order : 0 },
{:onchange => "remote_function();", :id => "test", :name => "test", :class => "fr issues_filter_select_min"}) %>
</div>
<div class="cl"></div>
</div><!--issues_filter end-->
<% if @issues.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% else %>
<div id="issue_list">
<%= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %>
</div>
<% end %>
<%#= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %>
</div><!--issues_con_list end-->
<% end %>
<% end %>
</div>

View File

@ -0,0 +1,74 @@
<% unless activity.author.nil? %>
<div class="issues_list_box clear" id="user_activity_<%= user_activity_id%>">
<div class="issues_ciricons fl ">
<% if activity.status_id.to_i == 5 %>
<span class="issues_ciricons_02"></span>
<% else %>
<span class="issues_ciricons_01"></span>
<% end %>
</div>
<div class=" fl ml5">
<div class="issues_list_titlebox clear">
<a href="<%= issue_path(activity) %>" class="issues_list_title fl" target="_blank" title="<%= activity.subject.to_s %>"><%= activity.subject.to_s %></a>
<% if activity.journals.count > 0%>
<span class="issues_icons_mes fl mr5 ml5"></span>
<span class="fl mr5 mt3"><%= activity.journals.count %></span>
<% end %>
<div class="cl"></div>
</div>
<div class="issues_list_small">
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "fl issues_list_name" %>
<% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "fl issues_list_name" %>
<% end %>
<p class="fl ml10"> <span class="mr5"><%=format_time(activity.created_on) %></span>发布</p>
</div>
</div>
<ul class="issues_list_txt fr">
<li class="issues_list_min c_grey">
<% case activity.tracker_id %>
<% when 1%>
缺陷
<% when 2%>
功能
<% when 3%>
支持
<% when 4%>
任务
<% when 5%>
周报
<% end %>
</li>
<!--li class="c_grey">
<#% if activity.try(:author).try(:realname) == ' ' %>
<%#= link_to activity.try(:author), user_path(activity.author_id), :class => "c_grey" %>
<#% else %>
<%#= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "c_grey" %>
<%# end %>
</li-->
<li class="c_grey">
<% unless activity.assigned_to_id.nil? %>
<% if activity.try(:assigned_to).try(:realname).empty? %>
<%= link_to activity.assigned_to, user_path(activity.assigned_to_id), :class => "c_grey" %>
<% else %>
<%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "c_grey" %>
<% end %>
<% end %></li>
<li class="c_grey" style="width: 60px; padding-right: 10px" title="<%= activity.fixed_version %>"><%= activity.fixed_version %></li>
<li class="issues_list_min c_grey" ><%= activity.status.name%></li>
<li class="<%=(activity.done_ratio == 100 ? 'c_red' : 'c_green') %>"><%= activity.done_ratio %>%</li>
<li class="issues_list_min">
<%= link_to "", issue_path(activity.id, :edit => 'true'), :class => 'sy_icons_edit fl mt15', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
<% if !defined?(project_id) && !defined?(user_id) %>
<%= link_to "", issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'sy_icons_del fl mt15' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% elsif defined?(project_id) %>
<%= link_to "", issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'sy_icons_del fl mt15' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% elsif defined?(user_id) %>
<%= link_to "", issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'sy_icons_del fl mt15' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% end %>
</li>
</ul>
</div>
<% end %>

View File

@ -2,7 +2,20 @@
<%= import_ke(enable_at: true,init_activity: true) %> <%= import_ke(enable_at: true,init_activity: true) %>
<% end %> <% end %>
<script> <script xmlns="http://www.w3.org/1999/html">
//issues列表
/*function g(o){
return document.getElementById(o);
}
function HoverLi(n){
//如果有N个标签,就将i<=N;
for(var i=1;i<=3;i++){
g('issues_list_nav_'+i).className='issues_nav_nomal';
}
g('issues_list_nav_'+n).className='issues_nav_hover';
}*/
$(function(){ $(function(){
$("#RSide").removeAttr("id"); $("#RSide").removeAttr("id");
$("#Container").css("width","1000px"); $("#Container").css("width","1000px");
@ -30,12 +43,39 @@
// } // }
// }); // });
} }
function nh_reset_form() {
$("#issue_query_form")[0].reset(); function remote_function_export(project_id) {
$("input[nhname='date_val']").val('');//涛哥的火狐reset 清不掉这个值 我擦 // $("#export_issue_hidden").attr("value","1");
remote_function(); // $("#issue_query_form").attr("set_filter","1");
// $("#issue_query_form").attr("action","/projects/"+project_id+"/issues.xls");
// $("#issue_query_form").submit();
// $("#issue_query_form").attr("action","/projects/"+project_id+"/issues");
// $("#issue_query_form").removeAttr("format");
// $("#issue_query_form").attr("set_filter","0");
// $("#export_issue_hidden").attr("value","0");
var tracker_id = $("#tracker_id").attr("value");
var subject = $("#v_subject").attr("value");
var assigned_to_id = $("#assigned_to_id").attr("value");
var fixed_version_id = $("#fixed_version_id").attr("value");
var status_id = $("#status_id").attr("value");
var done_ratio = $("#done_ratio").attr("value");
var test = $("#test").attr("value");
var author_id = $("#author_id").attr("value");
var issue_create_date_start = $("#issue_date_start_issue_export").attr("value");
var issue_create_date_end = $("#issue_date_end_issue_export").attr("value");
$("#sendexcel").attr("href","/projects/"+project_id+"/issues.xls?export=true&set_filter=1&tracker_id="+tracker_id+"&assigned_to_id="+assigned_to_id+"&fixed_version_id="+fixed_version_id+"&status_id="+status_id+"&done_ratio="+done_ratio+"&test="+test+"&author_id="+author_id+"&subject="+subject+"&issue_create_date_start="+issue_create_date_start+"&issue_create_date_end="+issue_create_date_end);
///projects/1811/issues.xls?export=true&set_filter=1
} }
// function nh_reset_form() {
// $("#issue_query_form")[0].reset();
// $("input[nhname='date_val']").val('');//涛哥的火狐reset 清不掉这个值 我擦
// remote_function();
// }
function EnterPress(e){ function EnterPress(e){
var e = e || window.event; var e = e || window.event;
if(e.keyCode == 13){ if(e.keyCode == 13){
@ -43,150 +83,204 @@
} }
} }
// 点击的时候让过滤条件选中assign_to
function switch_assign_to(assign) {
var assign = "option[value =" + assign + "]";
$("#issues_type_2").click(function(){
});
$("select[id='assigned_to_id']").find(assign).attr("selected", "selected");
$("select[id='author_id']").val('');
remote_function();
}
// 点击的时候让过滤条件选中user_id
function createByMe(user_id) {
var user = "option[value =" + user_id + "]";
$("#createByMe").click(function(){
});
$("select[id='author_id']").find(user).attr("selected", "selected");
remote_function();
}
// 清楚表单所有选项
function all_reset_form() {
$("#issue_query_form")[0].reset();
$("select[id='author_id']").val('');
$("select[id='assigned_to_id']").val('');
$("input[nhname='date_val']").val('');
remote_function();
}
</script> </script>
<div class="homepageRight mt0 ml10" >
<div class="homepageRightBanner">
<div class="NewsBannerName"><%= l(:label_issue_tracking) %></div>
</div>
<div class="resources mt10" >
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %>
<div class="problem_search fr" >
<input class="problem_search_input fl" id="v_subject" type="text" name="subject" placeholder="请输入问题名称" onkeypress="EnterPress(event)" onkeydown="EnterPress()">
<a href="javascript:void(0)" class="problem_search_btn fl" onclick="remote_function();" >搜索</a>
<a href="javascript:void(0)" class="grey_btn fl ml10 f14" onclick="nh_reset_form();" >清空</a>
</div><!--problem_search end-->
<%#= link_to '新建问题', new_project_issue_path(@project) , :class => "green_u_btn fr ml10" %>
<p class="problem_p fl" ><%= l(:label_issues_sum) %><a href="javascript:void(0)" class="c_red"><%= @project.project_score.issue_num %></a>
<%= l(:lable_issues_undo) %><a href="javascript:void(0)" class="c_red"><%= @project.issues.where('status_id in (1,2,4,6)').visible.all.count %> </a>
</p>
<div class="homepageRight mt0 ml10" >
<div class="issues_con fl">
<div class="clear mb5">
<a href="<%= new_project_issue_path(@project)%>" class="sy_btn_green fl mr10">新 增</a>
<div class="issues_statistics fl">
<ul>
<li>所有<a class="issues_greycirbg_btn "><%= @project.project_score.issue_num %></a></li>
<li>开启<a class="issues_greycirbg_btn "><%#= @issues_filter_assign_count %><%= @issue_open_count %></a></li>
<li>关闭<a class="issues_greycirbg_btn "><%#= @issues_filter_author_count %><%= @issue_close_count %></a></li>
</ul>
</div><!--issues_statistics end-->
<!--<input type="button" class="hw_btn_blue fr" value="导出EXCEL" onclick="remote_function_export('<%= @project.id %>')">-->
<a href="<%=project_issues_path(:project_id => @project, :format => 'xls', :export => true, :set_filter => "1")%>" id="sendexcel" class="hw_btn_blue fr" alt="导出EXCEL" onclick="remote_function_export('<%= @project.id %>')">导出EXCEL</a>
</div>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'xls', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %>
<%= hidden_field_tag 'export_issue_hidden', '0' %>
<!--<input id="exprot_issues_hidden" value="0" type="hidden">-->
<div class="clear mb10">
<div class="hw_search_box fl ">
<input class="hw_search-input" placeholder="请输入问题名称" type="text" id="v_subject" name="subject" onkeypress="EnterPress(event)" onkeydown="EnterPress()">
<a href="javascript:void(0);" class="hw_btn_search" onclick="remote_function();" ></a>
</div>
<a href="javascript:void(0);" class="sy_btn_grey fl ml5" onclick="all_reset_form();">清除</a>
<div class="calendar_div fr">
<input id="issue_date_end_issue_export" name="issue_create_date_end" nhname="date_val" type="hidden"/>
<input type="text" nhname="date_show" id="issue_create_date_end_show" class="InputBox fl W120 calendar_input" readonly="readonly" size="13" placeholder="结束日期">
<%= calendar_for('issue_create_date_end_show')%>
</div>
<div class="calendar_div fr">
<input id="issue_date_start_issue_export" name="issue_create_date_start" nhname="date_val" type="hidden"/>
<input type="text" nhname="date_show" id="issue_create_date_start_show" class="InputBox fl W120 calendar_input" readonly="readonly" size="13" placeholder="开始日期">
<%= calendar_for('issue_create_date_start_show')%>
</div>
<!--<input type="text" placeholder="开始日期" class="issues_calendar_input fl " ><a href="" class="issues_data_img fl" style="border-right:none;"></a>-->
<!--<input type="text" placeholder="结束日期" class="issues_calendar_input fl " ><a href="" class="issues_data_img fl"></a>-->
</div>
<div class="issues_con_list" style="position: relative;">
<ul id="issues_list_nav" >
<li id="issues_list_nav_1" onclick="HoverLi(1);all_reset_form();">
<a href="javascript:void(0);" onclick="all_reset_form();" id="issues_type_1" >所有
<span id="issue_filter_all"><%= render :partial => "issues/issue_filter_all" %></span></a>
</li>
<!--li id="issues_list_nav_2" onclick="HoverLi(2);">
<a href="javascript:void(0);" onclick="switch_assign_to(<%#= User.current.id %>)" id="issues_type_2" >指派给我
<span id="issue_assigned_count"><%#= render :partial => "issues/issue_filter" %></span>
</a>
</li>
<li id="issues_list_nav_3" onclick="HoverLi(3);">
<a href="javascript:void(0);" onclick="createByMe(<%#= User.current.id %>)" id="issues_type_3" >我的发布
<span id="issue_author_count"><%#= render :partial => "issues/issue_filter_author" %></span>
</a>
</li-->
<div class="cl"></div> <div class="cl"></div>
<div id="filter_form" class="fl">
</ul>
<div class="issues_filter ">
<div class="issues_form_filter mt5 mr5">
<%= select(:issue, :tracker, [["缺陷",1],["功能",2],["支持",3],["任务",4],["周报",5]].unshift(["类型",0]),
{:include_blank => false, :selected => @tracker_id ? @tracker_id : 0},
{:onchange => "remote_function();", :id => "tracker_id", :name => "tracker_id", :class => "fl issues_filter_select_min"}) %>
<%#= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]),
{ :include_blank => false,:selected=>@author_id ? @author_id : 0},
{:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:class=>"fl "}
)
%>
<%= select( :issue, :user_id, principals_options_for_isuue_list(@project), <%= select( :issue, :user_id, principals_options_for_isuue_list(@project),
{ :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0 { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0
}, },
{:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"w90 mr18"} {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"fl"}
)
%>
<%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
{ :include_blank => false,:selected=>@priority_id ? @priority_id : 0
},
{:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"w90 mr18"}
) )
%> %>
<%= select(:issue, :fixed_version, options_for_version_isuue_list(@project),
{:include_blank => false, :selected => @fixed_version_id ? @fixed_version_id : 0},
{:onchange => "remote_function();", :id => "fixed_version_id", :name => "fixed_version_id", :class => "fl"}) %>
<%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]),
{ :include_blank => false,:selected=>@status_id ? @status_id : 0 { :include_blank => false,:selected=>@status_id ? @status_id : 0
}, },
{:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"w90 mr18"} {:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"fl issues_filter_select_min"}
) )
%> %>
<%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]), <%#= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]),
{ :include_blank => false,:selected=>@author_id ? @author_id : 0 { :include_blank => false,:selected=>@priority_id ? @priority_id : 0
}, },
{:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:class=>"w90 mr18"} {:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"fl"}
) )
%> %>
</div><!--filter_form end-->
<div> <%#= select(:issue, :done_ratio, [["10%",1],["20%",2],["30%",3],["40%",4],["50%",5],["60%",6],["70%",7],["80%",8],["90%",9],["100%",10]].unshift(["完成度",0]),
<div class="fl">&nbsp;</div> {:include_blank => false, :selected => @done_ratio ? @done_ratio : 0 },
<div> {:onchange => "remote_function();", :id => "done_ratio", :name => "done_ratio", :class => "f1"}) %>
<input name="issue_create_date_start" nhname="date_val" type="hidden"/> <%= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }).unshift(["完成度",-1]),
<%= text_field_tag 'issue_create_date_start_show', '创建日期起始',:readonly=>true, :size=>13, :nhname=>'date_show',:style=>'float:left;'%> {:include_blank => false, :selected => @done_ratio ? @done_ratio : -1},
<%= calendar_for('issue_create_date_start_show') %> {:onchange=>"remote_function();",:id=>"done_ratio",:name=>"done_ratio",:class=>"fl"}) %>
</div>
<div style="float:left;">&nbsp;-&nbsp;</div>
<div> <%#= select(:issue, :test, [["最新创建",1],["最早创建",2],["最近更新",3],["最早更新", 4]].unshift(["排序",0]),
<input name="issue_create_date_end" nhname="date_val" type="hidden"/> {:include_blank => false, :selected => @order ? @order : 0 },
<%= text_field_tag 'issue_create_date_end_show', '创建日期结束',:readonly=>true, :size=>13, :nhname=>'date_show',:style=>'float:left;'%> {:onchange => "remote_function();", :id => "test", :name => "test", :class => "fr issues_filter_select_min"}) %>
<%= calendar_for('issue_create_date_end_show') %>
</div> <%= select(:issue, :test, [["最新创建",1],["最早创建",2],["最近更新",3],["最早更新", 4]].unshift(["排序",0]),
{:include_blank => false, :selected => @test ? @test : 0 },
{:onchange => "remote_function();", :id => "test", :name => "test", :class => "fr issues_filter_select_min"}) %>
<%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]),
{ :include_blank => false,:selected=>@author_id ? @author_id : 0},
{:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:style=>"display:none;"}
)
%>
<%#= select(:issue, :tracker_id, [["缺陷",1],["功能",2],["支持",3],["任务",4],["周报",5]].unshift(["类型",0]),
{:include_blank => false, :selected => @tracker_id ? @tracker_id : 0},
{:onchange => "remote_function();", :id => "tracker_id", :name => "tracker_id", :class => "fl issues_filter_select_min"}) %>
<%#= select( :issue, :user_id, principals_options_for_isuue_list(@project),
{ :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0},
{:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"fl"})
%>
<%#= select(:issue, :fixed_version_id, options_for_version_isuue_list(@project),
{:include_blank => false, :selected => @fixed_version_id ? @fixed_version_id : 0},
{:onchange => "remote_function();", :id => "fixed_version_id", :name => "fixed_version_id", :class => "f1"}) %>
<%#= select( :issue, :status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]),
{ :include_blank => false,:selected=>@status_id ? @status_id : 0
},
{:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"fl issues_filter_select_min"}
) %>
<%#= select( :issue,:done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
{:include_blank => false, :selected => @done_ratio ? @done_ratio : 0},
{:onchange=>"remote_function();",:id=>"done_ratio",:name=>"done_ratio",:class=>"fl"}) %>
<%#= select(:issue, :done_ratio, [["10%",1],["20%",2],["30%",3],["40%",4],["50%",5],["60%",6],["70%",7],["80%",8],["90%",9],["10%",10]].unshift(["完成度",0]),
{:include_blank => false, :selected => @done_ratio ? @done_ratio : 0 },
{:onchange => "remote_function();", :id => "done_ratio", :name => "done_ratio", :class => "f1"}) %>
<%#= select(:issue, :test, [["最早创建",1],["最早更新",2]].unshift(["排序",0]),
{:include_blank => false, :selected => @order ? @order : 0 },
{:onchange => "remote_function();", :id => "test", :name => "test", :class => "fr issues_filter_select_min"}) %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div><!--issues_filter end-->
<% end %> <% end %>
<div class="cl"></div>
<% end %> <% end %>
</div>
<div class="contextual">
<% if !@query.new_record? && @query.editable_by?(User.current) %>
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
<%= delete_link query_path(@query) %>
<% end %>
</div>
<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
<div style="clear:right; ">
</div>
<%= error_messages_for 'query' %>
<% if @query.valid? %>
<% if @issues.empty? %> <% if @issues.empty? %>
<p class="nodata"> <p class="nodata"><%= l(:label_no_data) %></p>
<%= l(:label_no_data) %>
</p>
<% else %> <% else %>
<div id="issue_list"> <div id="issue_list">
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %> <%= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %>
</div>
<% end %>
<!--<div style="float: left; padding-top: 30px">-->
<!--<%# other_formats_links do |f| %>-->
<!--<%#= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>-->
<!--<%#= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %>-->
<!--<%#= f.link_to 'PDF', :url => params %>-->
<!--<%# end %>-->
<!--</div>-->
<div id="csv-export-options" style="display:none;">
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
<%= form_tag(params.merge({:format => 'csv', :page => nil}), :method => :get, :id => 'csv-export-form') do %>
<p>
<label>
<%= radio_button_tag 'columns', 'all' %>
<%= l(:description_all_columns) %>
</label>
</p>
<p>
<label>
<%= check_box_tag 'description', '1', @query.has_column?(:description) %>
<%= l(:field_description) %>
</label>
</p>
<p class="buttons">
<%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
</p>
<% end %>
</div> </div>
<% end %> <% end %>
<%= call_hook(:view_issues_index_bottom, {:issues => @issues, :project => @project, :query => @query}) %> <%#= render :partial => 'issues/all_list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project,:subject=>@subject} %>
<% content_for :sidebar do %> </div><!--issues_con_list end-->
<%= render :partial => 'issues/sidebar' %>
<% end %>
<% content_for :header_tags do %> </div>
<%= auto_discovery_link_tag(:atom,
{:query_id => @query, :format => 'atom',
:page => nil, :key => User.current.rss_key},
:title => l(:label_issue_plural)) %>
<%= auto_discovery_link_tag(:atom,
{:controller => 'journals', :action => 'index',
:query_id => @query, :format => 'atom',
:page => nil, :key => User.current.rss_key},
:title => l(:label_changes_details)) %>
<% end %>
<%= context_menu issues_context_menu_path %>
</div> </div>

View File

@ -1,6 +1,7 @@
//$("#issue_list").html("<%#= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count})%>"); //$("#issue_list").html("<%#= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count})%>");
<% if @set_filter && @issue_pages.page == 1%> //只有搜索的第一页才需要替换整个issue_list其余的都是替换show_more_issues //$("#issue_assigned_count").html("<%#= escape_javascript(render :partial => 'issues/issue_filter') %>");
$("#issue_list").html("<%= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project})%>"); $("#issue_filter_all").html("<%= escape_javascript(render :partial => 'issues/issue_filter_all') %>");
<%else%> //$("#issue_author_count").html("<%#= escape_javascript(render :partial => 'issues/issue_filter_author') %>");
$("#show_more_issues").replaceWith("<%= escape_javascript( render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count,:project=>@project} )%>"); $("#issue_list").html("<%= escape_javascript(render :partial => 'issues/all_list',:locals => {:issues => @issues, :query => @query, :issue_pages=> @issue_pages, :issue_count => @issue_count, :project=> @project})%>");
<%end%> $("#issue_list_pagination").html('<%= pagination_links_full @issue_pages, @issue_count, :issues => @issues, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');

View File

@ -0,0 +1,46 @@
<div class="sy_class_infobox mb10 clear">
<div class="sy_class_logo fl">
<div class="pr" style="width: 110px; height:110px;">
<% if User.current.logged? && (User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) || User.current.admin?) %>
<%=link_to image_tag(url_to_avatar(@project), width:"110", height: "110", :id => 'nh_source_tx'), my_clear_user_avatar_temp_path(:course => @project.id), :remote => true%>
<div class="homepageEditProfile undis">
<%=link_to '', my_clear_user_avatar_temp_path(:project => @project.id), :class => 'homepageEditProfileIcon', :title => '点击编辑头像', :remote => true %>
</div>
<% else %>
<%= image_tag(url_to_avatar(@project), :width => "110", :height => "110", :alt => "项目logo") %>
<% end %>
</div>
</div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @project %>
<div class="sy_class_id fl"><p><%= l(:label_project_ivite_code)%><br /><span class="sy_corange"><%= (User.current.member_of?(@project) || User.current.admin?) ? @project.invite_code : "******" %></span></p></div>
<div class="sy_class_info fl ml15">
<div class="sy_class_titbox clear">
<h3 class="fl sy_class_title">
<a href="javascript:void(0);"class="mr5 c_dark"><%= @project.creater %></a>/
<a href="javascript:void(0);"class=" ml5 c_dark"><%= @project.name %></a>
</h3>
<span class="sy_new_orange fl ml10 mt5"><%= @project.is_public? ? l(:label_public) : l(:label_private) %></span>
</div>
<p class="sy_cgrey">
<span class=" mr15">项目评分:
<% if @project.project_type == 0 %>
<%# unless static_project_score(@project.project_score) == 0 %>
<%= link_to(format("%.2f" ,static_project_score(@project.project_score)).to_i,
{:controller => 'projects',
:action => 'show_projects_score',
:remote => true,
:id => @project.id}, :class => "sy_cblue" ) %>
<%# end %>
<% end %>
</span>
<span class=" mr15">浏览:<a class="sy_corange"><%= @project.visits.to_i %></a></span>
<span class=" mr15">关注:<%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'sy_corange' %></span>
<span class=" mr15">成员:<%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'sy_corange', :id => 'project_members_number' %></span>
</p>
<div class="mt15 clear" id="join_exit_project_div">
<%= render 'layouts/join_exit_project' %>
</div>
</div>
<div class="cl"></div>
</div>

View File

@ -3,38 +3,49 @@
<div class="scrollsidebar" id="scrollsidebar"> <div class="scrollsidebar" id="scrollsidebar">
<div class="side_content"> <div class="side_content">
<div class="side_list"> <div class="side_list">
<div class="side_title"> <div style="background-color:#fff; padding:10px 0; border:1px solid #aaa; border-bottom:none;">
<a title="<%= l(:button_hide) %>" class="close_btn"> <span class="fontGrey3 f14 ml40" style="vertical-align:top;">问题和建议</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> <span class="close_btn side-bar-circle fr mt3 mr10" title="隐藏"><span class="side-bar-content" style="left:4px; font-family:'微软雅黑, 宋体'"></span></span>
</a>
</div> </div>
<div class="side_center"> <div style="background-color:#fff; border-left:1px solid #aaa; border-right:1px solid #aaa;">
<div class="custom_service"> <div class="custom_service tac">
<% get_memo %> <% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
<%= f.text_area :subject, :id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %> <%= f.text_area :subject, :id=>"subject", :class => "opnionText mb5", :placeholder => "完善您的基本资料后,可在此输入问题和建议", :disabled => "disabled" %>
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %> <%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
<label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label> <!--<span class="c_grey fl ml10">还能输入<span id="textCount" class="c_orange">50</span>个字符</span>-->
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;height:21px" id="" onclick=""> <!--<a href="javascript:void(0);" class="linkBlue f14 fr mr10" style="height:21px;" id="" onclick="f_submit();">-->
<%= l(:label_submit)%> <%#= l(:label_submit)%>
</a> <!--</a>-->
<div class="cl"></div>
<% end %> <% end %>
</div> </div>
<div class="mt5" style="color: #269ac9;cursor: default"> </div>
<div style="background-color:#fff; border:1px solid #aaa; border-top:none; padding-top:5px;">
<div class="fl mt5 ml10 tac">
<!--<a target="hiddentab" href="http://wpa.qq.com/msgrd?v=1&uin=1554253403&site=qq&menu=yes" style="color: #269ac9;">--> <!--<a target="hiddentab" href="http://wpa.qq.com/msgrd?v=1&uin=1554253403&site=qq&menu=yes" style="color: #269ac9;">-->
<%#= l(:label_technical_support) %> <%#= l(:label_technical_support) %>
<!--白&nbsp;&nbsp;&nbsp;羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad--> <!--白&nbsp;&nbsp;&nbsp;羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad-->
<!--<p style="text-align: center"> 请加入师姐师兄答疑群</p> <p style="text-align: center"></p>--> <!--<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 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 border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="Trustie师姐师兄答疑群" title="Trustie师姐师兄答疑群"></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>
<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>
</div>
<div class="cl"></div>
</div> </div>
</div> </div>
<div class="side_bottom"></div>
</div> </div>
<div class="show_btn tac">
<div style=" border:1px solid #aaa;">
<div style="height:79px;">
<img src="/images/dialog.png" width="18" class="mt10 mb5" />
<span class="f14 fontBlue">提<br />问</span>
</div>
<span class="closeSidebar f16">×</span>
</div> </div>
<div class="show_btn">
<span><%= l(:label_submit)%></span>
<a href="javascript:void(0)" class="closeSidebar"></a>
</div> </div>
</div> </div>

View File

@ -1,19 +1,18 @@
<div class="pr_info_join fl">
<!--关注:非项目成员--> <!--关注:非项目成员-->
<div id="join_in_project_applied">
<%= render :partial => "projects/applied_status" %> <%= render :partial => "projects/applied_status" %>
</div>
<!--配置项目--> <!--配置项目-->
<% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %> <% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %>
<%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %> <%= link_to "#{l(:button_configure)}", settings_project_path(@project), :class => "sy_btn_blue mr5" %>
<% end %> <% end %>
<!--项目类型--> <!--项目类型-->
<% if (User.current.login? && User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager")) || User.current.admin? %> <!--<%# if (User.current.login? && User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager")) || User.current.admin? %>-->
<%= link_to "<span class='#{typeclass}'></span>#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%> <!--<%#= link_to "<span class='#{typeclass}'></span>#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%>-->
<% end %> <!--<%# end %>-->
<!--退出项目--> <!--退出项目-->
<% if (User.current.member_of? @project) && User.current.login? && !User.current.admin && <% if (User.current.member_of? @project) && User.current.login? && !User.current.admin &&
!Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %> !Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %>
<%= exit_project_link(@project) %> <%= exit_project_link(@project) %>
<% end %> <% end %>
</div>

View File

@ -15,7 +15,7 @@
<%= f.text_area :subject, :id=>"subject", :class => "opnionText mb5", :placeholder => l(:label_feedback_tips) %> <%= f.text_area :subject, :id=>"subject", :class => "opnionText mb5", :placeholder => l(:label_feedback_tips) %>
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %> <%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
<span class="c_grey fl ml10">还能输入<span id="textCount" class="c_orange">50</span>个字符</span> <span class="c_grey fl ml10">还能输入<span id="textCount" class="c_orange">50</span>个字符</span>
<a href="javascript:void(0);" class="linkBlue f14 fr mr10" style="height:21px;" id="" onclick="f_submit();"> <a href="javascript:void(0);" class="linkBlue f12 fr mr10" style="height:21px;" id="" onclick="f_submit();">
<%= l(:label_submit)%> <%= l(:label_submit)%>
</a> </a>
<div class="cl"></div> <div class="cl"></div>

View File

@ -1,10 +1,12 @@
<h3 class="sy_right_title">教师团队 <h3 class="sy_right_title">教师团队
<a href="javascript:void(0);" class="sy_cmore fr mr10 none" >增加教师</a> <% if User.current == @syllabus.user || User.current.admin? %>
<a href="<%=members_syllabus_path(syllabus, :show => 1) %>" class="sy_cmore fr mr10">增加教师</a>
<% end %>
<div class="cl"></div> <div class="cl"></div>
</h3> </h3>
<ul class="sy_teachers_list"> <ul class="sy_teachers_list">
<% teacher = syllabus.user %> <% members.each do |member| %>
<%# teachers.each do |teacher| %> <% teacher = member.user %>
<li > <li >
<%= link_to image_tag(url_to_avatar(teacher), :width => "60", :height => "60", :class => "sy_teachers_img fl mr15"), user_path(teacher), :target => "_blank", :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(teacher), :width => "60", :height => "60", :class => "sy_teachers_img fl mr15"), user_path(teacher), :target => "_blank", :alt => "用户头像" %>
<div class="sy_teachers_txt fl"> <div class="sy_teachers_txt fl">
@ -17,5 +19,5 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>
<%# end %> <% end %>
</ul> </ul>

View File

@ -1,19 +1,16 @@
<% courses.each do |course|%> <% courses.each do |course|%>
<li> <li class="pr">
<span class="user_icons_class"></span> <span class="user_icons_class"></span>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %> <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<p href="javascript:void(0);" id="show_course_<%= course.id %>" class="course_list_menu pr" > <p href="javascript:void(0);" id="show_course_<%= course.id %>" class="course_list_menu" >
<% title = "<span class='course-name'>#{course.syllabus.title}</span>".html_safe %> <%= link_to course.syllabus.title + course.name, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => 'display:block;'%>
<%= link_to title, syllabus_path(course.syllabus_id), :target => '_blank', :class => 'hidden', :style => "max-width:91px; display:inline-block;"%>
<font class="fb c_grey" style="height:39px; line-height:39px; vertical-align:top;">·</font>
<% classes = "<span class='course-name'>#{course.name}</span>".html_safe %>
<%= link_to classes, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => "max-width:91px; display:inline-block;"%>
<span class="sub-menu-title c_dark">
课程名称:<%= course.syllabus.title %><br />
班级名称:<%= course.name+''+current_time_and_term(course)+'' %><br />
班级属性:<%= course.is_public? ? '公开' : '私有' %>
</span>
</p> </p>
<div class="sub-menu-title c_dark">
<em></em>
<font></font>
<div>课程:<%= link_to course.syllabus.title, syllabus_path(course.syllabus_id), :target => '_blank' %></div>
<div>班级:<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :target => '_blank' %></div>
</div>
<%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), <%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course),
:id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+""+current_time_and_term(course)+""%> :id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+""+current_time_and_term(course)+""%>
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %> <% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
@ -113,25 +110,26 @@
} }
$(".course_list_menu").each(function(){ $(".course_list_menu").each(function(){
var courseWidth = $(this).children().eq(0).children().width();
var classWidth = $(this).children().eq(2).children().width();
var newClassWidth = 182 - courseWidth;
var newCourseWidth = 182 - classWidth;
console.log(courseWidth, classWidth);
if(courseWidth < 91 && classWidth > 91){
$(this).children().eq(2).css("max-width",newClassWidth + "px");
}
if(classWidth < 91 && courseWidth > 91){
$(this).children().eq(0).css("max-width",newCourseWidth + "px");
}
})
$(".course-name").each(function(){
$(this).mouseenter(function(){ $(this).mouseenter(function(){
$(this).parent().parent().children().eq(3).show(); $(".sub-menu-title").hide();
$(this).next().stop();
$(this).next().show();
}); });
$(this).mouseleave(function(){ $(this).mouseleave(function(){
$(this).parent().parent().children().eq(3).hide(); $(this).next().delay(500).hide(0);
}); });
}) })
$(".sub-menu-title").each(function(){
var boxWidth = $(this).width();
var leftAttr = boxWidth + 30
$(this).css("left",-leftAttr);
$(this).mouseover(function(){
$(this).stop();
$(this).show();
});
$(this).mouseout(function(){
$(this).delay(500).hide(0);
});
});
</script> </script>

View File

@ -12,7 +12,7 @@
<%= favicon %> <%= favicon %>
<%= javascript_heads %> <%= javascript_heads %>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','prettify','repository' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','prettify','repository','css/gantt', 'css/calendar' %>
<%= javascript_include_tag 'cookie','project',"avatars", 'header','prettify','select_list_move','attachments' %> <%= javascript_include_tag 'cookie','project',"avatars", 'header','prettify','select_list_move','attachments' %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
@ -47,88 +47,17 @@
<div class="cl"></div> <div class="cl"></div>
<div id="content"> <div id="content">
<%= render :partial => 'layouts/base_project_top' %>
<div id="LSide" class="fl"> <div id="LSide" class="fl">
<div class="project_info">
<div class="pr_info_logo fl mr10 mb5">
<div class="pr" style="width: 64px; height:64px;">
<% if User.current.logged? && (User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) || User.current.admin?)%>
<%=link_to image_tag(url_to_avatar(@project),width:"60", height: "60", :id=>'nh_source_tx'), my_clear_user_avatar_temp_path(:project => @project.id), :remote => true%>
<div class="homepageEditProfile undis">
<%=link_to '', my_clear_user_avatar_temp_path(:project => @project.id), :remote => true, :class => 'homepageEditProfileIcon', :title => '点击编辑Logo' %>
</div>
<% else %>
<%= image_tag(url_to_avatar(@project), :width => "60", :height => "60", :alt => "项目logo") %>
<% end %>
</div>
</div>
<div class="pr_info_id fl mb5 f14">
<%= l(:label_project_ivite_code)%>
<%= (User.current.member_of?(@project) || User.current.admin?) ? @project.invite_code : "******" %>
</div>
<!--关注、申请加入/退出项目-->
<div id="join_exit_project_div">
<% text = @project.project_new_type == 1 ? l(:label_development_team) : (@project.project_new_type == 2 ? l(:label_research_group) : l(:label_friend_organization))%>
<% typeclass = @project.project_new_type == 1 ? "pr_kafa" : (@project.project_new_type == 2 ? "pr_keyan" : "pr_friend")%>
<%= render 'layouts/join_exit_project',{:text => text, :typeclass => typeclass} %>
</div>
<!-- 项目得分 -->
<div class="cl"></div>
<div>
<%= link_to "#{@project.name}", project_path(@project.id), :class=>"pr_info_name fl c_dark fb break_word" %>
<% if @project.is_public? %>
<span class="img_private"><%= l(:label_public)%></span>
<% else %>
<span class="img_private"><%= l(:label_private)%></span>
<% end %>
</div>
<div class="cl"></div>
<%# 更新访问数,刷新的时候更新访问次数 %>
<% update_visiti_count @project %>
<%# over %>
<div>
<% if @project.project_type == 0 %>
<% unless static_project_score(@project.project_score) == 0 %>
<span class="fb f14 "><%= l(:label_project_score)%> :</span>
<%= link_to(format("%.2f" ,static_project_score(@project.project_score)).to_i,
{:controller => 'projects',
:action => 'show_projects_score',
:remote => true,
:id => @project.id}, :class => "c_orange f14" ) %>
<% end %>
<% end %>
</div>
<!--参数-->
<div class="pr_info_foot">
<%= l(:label_member) %><%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'info_foot_num c_blue', :id => 'project_members_number' %>
<span>|&nbsp;</span>
<%= l(:label_user_watcher) %><%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'info_foot_num c_blue' %>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<span>|&nbsp;</span>
<%= l(:project_module_attachments) %>
<% @project.project_score.attach_num %>
<%= link_to "#{@project.project_score.attach_num }", project_files_path(@project), :class => 'info_foot_num c_blue', :id=>'project_files_count_info' %></span>
<% end %>
</div>
<div class="cl"></div>
</div><!--参数 end-->
<!--邀请加入--> <!--邀请加入-->
<div class="subNavBox"> <div class="subNavBoxProject">
<div id="project_memu_list"> <div id="project_memu_list">
<% if @project.project_new_type == 1 || @project.project_new_type.nil? %>
<%= render :partial => 'projects/development_group', :locals => {:project => @project} %> <%= render :partial => 'projects/development_group', :locals => {:project => @project} %>
<% elsif @project.project_new_type == 2 %>
<%= render :partial => 'projects/research_team', :locals => {:project => @project} %>
<% else %>
<%= render :partial => 'projects/friend_group', :locals => {:project => @project} %>
<% end %>
</div> </div>
</div>
<!-- end --> <!--项目侧导航 end-->
</div><!--项目侧导航 end-->
<div class="cl"></div> <div class="cl"></div>
<!-- 项目描述 --> <!-- 项目描述 -->
<div class="project_intro"> <div class="project_intro">
<div id="course_description" class="course_description"> <div id="course_description" class="course_description">
@ -155,7 +84,6 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div><!--项目标签 end--> </div><!--项目标签 end-->
<div class="fontGrey5 mt10 ml10 mb10">访问计数 <%= @project.visits.to_i %> 自2016年5月</div> <div class="fontGrey5 mt10 ml10 mb10">访问计数 <%= @project.visits.to_i %> 自2016年5月</div>
</div> </div>
</div> </div>

View File

@ -60,11 +60,12 @@
<%= yield %> <%= yield %>
</div><!--sy_con_l end--> </div><!--sy_con_l end-->
<div class="sy_con_r fr mb10"> <div class="sy_con_r fr mb10">
<% members = @syllabus.syllabus_members.order("rank asc") %>
<div class="sy_right_box" id="syllabus_base_info"> <div class="sy_right_box" id="syllabus_base_info">
<%= render :partial => 'layouts/syllabus_base_info', :locals => {:syllabus => @syllabus} %> <%= render :partial => 'layouts/syllabus_base_info', :locals => {:syllabus => @syllabus} %>
</div> </div>
<div class="sy_right_box"> <div class="sy_right_box" id="syllabus_teacher_list">
<%= render :partial => 'layouts/syllabus_teacher_list', :locals => {:syllabus => @syllabus} %> <%= render :partial => 'layouts/syllabus_teacher_list', :locals => {:syllabus => @syllabus, :members => members} %>
</div> </div>
</div><!--sy_con_r end--> </div><!--sy_con_r end-->
<div class="cl"></div> <div class="cl"></div>
@ -123,16 +124,18 @@
} }
function g(o){return document.getElementById(o);} function g(o){return document.getElementById(o);}
function HoverLi(n){ function HoverLi(n){
for(var i=1;i<=2;i++){ //for(var i=1;i<=2;i++){
//g('sy_tab_nav_'+i).className='sy_tab_nomal'; //g('sy_tab_nav_'+i).className='sy_tab_nomal';
//g('sy_tab_con_'+i).className='undis'; //g('sy_tab_con_'+i).className='undis';
} //}
//g('sy_tab_con_'+n).className='dis'; //g('sy_tab_con_'+n).className='dis';
//g('sy_tab_nav_'+n).className='sy_tab_hover'; //g('sy_tab_nav_'+n).className='sy_tab_hover';
if(n == 1) { if(n == 1) {
window.location.href = '<%=syllabus_path(@syllabus) %>'; window.location.href = '<%=syllabus_path(@syllabus) %>';
} else { } else if(n == 2) {
window.location.href = '<%=syllabus_courselist_syllabus_path(@syllabus) %>'; window.location.href = '<%=syllabus_courselist_syllabus_path(@syllabus) %>';
} else if(n == 3) {
window.location.href = '<%=members_syllabus_path(@syllabus) %>';
} }
} }
//侧导航栏配置设置 //侧导航栏配置设置

View File

@ -163,7 +163,7 @@
<ul class="users_accordion mb10"> <ul class="users_accordion mb10">
<li id="user_01" class="user_icons_course"> <li id="user_01" class="user_icons_course">
<%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %> <%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %>
<font class="show-all-sub"><%= link_to '全部',{:controller => "users", :action => "user_courselist", :id => @user.id}, :class => "linkGrey2" %></font> <font class="show-all-sub"><%= link_to '全部',{:controller => "users", :action => "user_courselist", :id => @user.id}, :style => "color:#aaa;" %></font>
<% courses = @user.favorite_courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %> <% courses = @user.favorite_courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %>
<div class="<%= courses.empty? ? 'none' : ''%>" id="homepage_left_course_list"> <div class="<%= courses.empty? ? 'none' : ''%>" id="homepage_left_course_list">
<%=render :partial => 'layouts/homepage_left_course_list', :locals => {:courses => courses} %> <%=render :partial => 'layouts/homepage_left_course_list', :locals => {:courses => courses} %>
@ -191,7 +191,7 @@
<ul class="users_accordion mb10"> <ul class="users_accordion mb10">
<li id="user_06" class="user_icons_project"> <li id="user_06" class="user_icons_project">
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :id => 'user_project_list'%> <%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :id => 'user_project_list'%>
<font class="show-all-sub"><%= link_to '全部',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :class => 'linkGrey2'%></font> <font class="show-all-sub"><%= link_to '全部',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :style => "color:#aaa;" %></font>
<% projects = @user.favorite_projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%> <% projects = @user.favorite_projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%>
<div class="<%= projects.empty? ? 'none' : ''%>" id="homepage_left_project_list"> <div class="<%= projects.empty? ? 'none' : ''%>" id="homepage_left_project_list">
<%=render :partial => 'layouts/homepage_left_project_list', :locals => {:projects => projects} %> <%=render :partial => 'layouts/homepage_left_project_list', :locals => {:projects => projects} %>

View File

@ -93,10 +93,10 @@
</span> </span>
</div> </div>
</div> </div>
<% all_comments = []%> <%# all_comments = []%>
<% comments = get_all_children(all_comments, @topic) %> <%# comments = get_all_children(all_comments, @topic) %>
<div class="" id="reply_div_<%= @topic.id %>"> <div class="" id="reply_div_<%= @topic.id %>">
<% comments.each_with_index do |reply,i| %> <% @replies.each do |reply| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_message_description_<%= reply.id %>'); showNormalImage('reply_message_description_<%= reply.id %>');

View File

@ -127,10 +127,10 @@
</div> </div>
<div class="homepagePostReplyBannerTime"></div> <div class="homepagePostReplyBannerTime"></div>
</div> </div>
<% all_comments = [] %> <%# all_comments = [] %>
<% comments = get_all_children(all_comments, @topic) %> <%# comments = get_all_children(all_comments, @topic) %>
<div class="" id="reply_div_<%= @topic.id %>"> <div class="" id="reply_div_<%= @topic.id %>">
<% comments.each_with_index do |reply, i| %> <% @replies.each_with_index do |reply, i| %>
<script type="text/javascript"> <script type="text/javascript">
$(function () { $(function () {
showNormalImage('reply_message_description_<%= reply.id %>'); showNormalImage('reply_message_description_<%= reply.id %>');

View File

@ -157,10 +157,10 @@
</span> </span>
</div> </div>
</div> </div>
<% all_comments = []%> <%# all_comments = []%>
<% comments = get_all_children(all_comments, @topic) %> <%# comments = get_all_children(all_comments, @topic) %>
<div class="" id="reply_div_<%= @topic.id %>"> <div class="" id="reply_div_<%= @topic.id %>">
<% comments.each_with_index do |reply,i| %> <% @replies.each_with_index do |reply,i| %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
showNormalImage('reply_message_description_<%= reply.id %>'); showNormalImage('reply_message_description_<%= reply.id %>');

View File

@ -7,7 +7,7 @@ if($("#course_avatar_form").length > 0) {
window.location.href = "<%=settings_course_path(@course) %>"; window.location.href = "<%=settings_course_path(@course) %>";
} }
<% elsif @project %> <% elsif @project %>
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@project), :id=>'nh_source_tx',:style=>"width:60px;height:60px;overflow:hidden",:alt=>"项目logo") %>'); $("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@project), :id=>'nh_source_tx',:style=>"width:110px;height:110px;overflow:hidden",:alt=>"项目logo") %>');
if($("#project_avatar_form").length > 0) { if($("#project_avatar_form").length > 0) {
window.location.href = "<%=settings_project_path(@project) %>"; window.location.href = "<%=settings_project_path(@project) %>";
} }

View File

@ -63,7 +63,7 @@
<% if act.container_type == 'Course' %> <% if act.container_type == 'Course' %>
<% case act.org_act_type.to_s %> <% case act.org_act_type.to_s %>
<% when 'HomeworkCommon' %> <% when 'HomeworkCommon' %>
<%= render :partial => 'users/course_homework', :locals => {:activity => HomeworkCommon.find(act.org_act_id),:user_activity_id =>act.id,:course_activity => 0} %> <%= render :partial => 'users/course_homework', :locals => {:activity => HomeworkCommon.find(act.org_act_id),:user_activity_id =>act.id, :hw_status => 4} %>
<% when 'News' %> <% when 'News' %>
<%= render :partial => 'users/course_news', :locals => {:activity => News.find(act.org_act_id),:user_activity_id =>act.id} %> <%= render :partial => 'users/course_news', :locals => {:activity => News.find(act.org_act_id),:user_activity_id =>act.id} %>
<% when 'Message'%> <% when 'Message'%>

View File

@ -73,7 +73,7 @@
<% work = cur_user_works_for_homework activity %> <% work = cur_user_works_for_homework activity %>
<% if activity.end_time < Date.today && !is_teacher && !work.nil? && work.user == User.current %> <% if activity.end_time < Date.today && !is_teacher && !work.nil? && work.user == User.current %>
<div class="homepagePostSubmit"> <div class="homepagePostSubmit">
<%=link_to "追加附件", student_work_index_url_in_org(activity.id, 1), :class => 'c_blue', :title => "可追加作品修订附件" %> <%=link_to "追加附件", student_work_index_url_in_org(activity.id, 2, 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
</div> </div>
<% end %> <% end %>
<% if activity.homework_type == 2 && is_teacher%> <% if activity.homework_type == 2 && is_teacher%>
@ -161,9 +161,9 @@
<div class="fl mr10 w100" style="text-align:center;"> <div class="fl mr10 w100" style="text-align:center;">
<a href="javascript:void(0);" class="linkBlue"> <a href="javascript:void(0);" class="linkBlue">
<% if User.current.member_of_course?(activity.course) || User.current.admin? || activity.is_open == 1 %> <% if User.current.member_of_course?(activity.course) || User.current.admin? || activity.is_open == 1 %>
<%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_url_in_org(activity.id, '', sw.id), :alt => "学生头像" %> <%= link_to image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40"), student_work_index_url_in_org(activity.id, 2, '', sw.id), :alt => "学生头像" %>
<p class="w100 hidden"> <p class="w100 hidden">
<%= link_to sw.user.show_name, student_work_index_url_in_org(activity.id, '', sw.id)%> <%= link_to sw.user.show_name, student_work_index_url_in_org(activity.id, 2, '', sw.id)%>
</p> </p>
<% else %> <% else %>
<%= image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40", :title => '该作业的作品暂未公开') %> <%= image_tag(url_to_avatar(User.find sw.user_id), :width => "40", :height => "40", :title => '该作业的作品暂未公开') %>

View File

@ -1,13 +1,13 @@
<% if PraiseTread.praised(activity) %> <% if PraiseTread.praised(activity) %>
<a href='<%= praise_tread_praise_plus_path({:obj_id=>activity.id,:obj_type=>activity.class,:user_activity_id=>user_activity_id,:type=>type }) %>' data-remote="true" class="<%=type == 'reply'? 'fr' : 'ml15' %> likeButton" title="点赞" > <a href='<%= praise_tread_praise_plus_path({:obj_id=>activity.id,:obj_type=>activity.class,:user_activity_id=>user_activity_id,:type=>type }) %>' data-remote="true" class="<%=type == 'reply'? 'fr' : 'ml15' %> likeButton" title="点赞" >
<span class="likeText">赞</span> <span class="likeText">赞</span>
<% num = get_praise_num(activity) %> <% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
<span class="likeNum"><%= num > 0 ? "#{num}" : "" %></span> <span class="likeNum"><%= num > 0 ? "#{num}" : "" %></span>
</a> </a>
<% else %> <% else %>
<a href='<%= praise_tread_praise_minus_path({:obj_id=>activity.id,:obj_type=>activity.class,:user_activity_id=>user_activity_id,:type=>type }) %>' data-remote="true" class="<%=type == 'reply'? 'fr' : 'ml15' %> likeButton" title="取消点赞" > <a href='<%= praise_tread_praise_minus_path({:obj_id=>activity.id,:obj_type=>activity.class,:user_activity_id=>user_activity_id,:type=>type }) %>' data-remote="true" class="<%=type == 'reply'? 'fr' : 'ml15' %> likeButton" title="取消点赞" >
<span class="likeText">已赞</span> <span class="likeText">已赞</span>
<% num = get_praise_num(activity) %> <% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
<span class="likeNum"><%= num > 0 ? "#{num}" : "" %></span> <span class="likeNum"><%= num > 0 ? "#{num}" : "" %></span>
</a> </a>
<% end %> <% end %>

View File

@ -4,6 +4,7 @@
<% if AppliedProject.where(:user_id => User.current, :project_id => @project_id).first.nil? %> <% if AppliedProject.where(:user_id => User.current, :project_id => @project_id).first.nil? %>
<%= join_in_project_link(@project, User.current) %> <%= join_in_project_link(@project, User.current) %>
<% else %> <% else %>
等待审批 <a class="sy_btn_blue mr5">等待审批</a>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -13,7 +13,7 @@
<% end %> <% end %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :class => "subnav_green" %> <%= link_to "", new_project_issue_path(@project) , :class => "publish-icon fr mr10 mt2", :title => "发布问题" %>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
@ -24,7 +24,7 @@
<a class="subnav_num">(<%= @project.project_score.board_num %>)</a> <a class="subnav_num">(<%= @project.project_score.board_num %>)</a>
<% end %> <% end %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %> <%= link_to "", project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "publish-icon fr mr10 mt2", :title => "发布新帖" %>
<% end %> <% end %>
</div> </div>
<% end%> <% end%>
@ -36,7 +36,7 @@
<% end %> <% end %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<%#= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %> <%#= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<a class="subnav_green m195" href="javascript:void(0);" onclick="project_files_upload();">+上传资源</a> <a class="publish-icon fr mr10 mt2" href="javascript:void(0);" onclick="project_files_upload();" title="上传资源"></a>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>
@ -46,7 +46,7 @@
<%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "f14 c_blue02" %> <%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "f14 c_blue02" %>
<%= link_to "(#{pull_request_count(@project)})", project_pull_requests_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %> <%= link_to "(#{pull_request_count(@project)})", project_pull_requests_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<%= link_to "+新建请求", new_project_pull_request_path(:project_id => @project.id), :class => "subnav_green" %> <%= link_to "", new_project_pull_request_path(:project_id => @project.id), :class => "publish-icon fr mr10 mt2", :title => "新建请求" %>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>

View File

@ -3,7 +3,7 @@
<% for journal in journals %> <% for journal in journals %>
<div class="ping_C" id='word_li_<%= journal.id.to_s %>'> <div class="ping_C" id='word_li_<%= journal.id.to_s %>'>
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %></div> <div class="ping_dispic"><%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %></div>
<div class="ping_discon" style="width: 610px;" onmouseover="$('#delete_reply_<%=journal.id %>').show();" onmouseout="$('#delete_reply_<%=journal.id %>').hide();"> <div class="ping_discon" style="width: 670px;" onmouseover="$('#delete_reply_<%=journal.id %>').show();" onmouseout="$('#delete_reply_<%=journal.id %>').hide();">
<div class="ping_distop f14"> <div class="ping_distop f14">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> --> <!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span><%= link_to journal.user.show_name, user_path(journal.user), :class => 'c_blue fb fl mb10 f14', :target => "_blank" %> <span><%= link_to journal.user.show_name, user_path(journal.user), :class => 'c_blue fb fl mb10 f14', :target => "_blank" %>

View File

@ -7,15 +7,15 @@
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;} span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
div.ke-toolbar .ke-outline{border:none;} div.ke-toolbar .ke-outline{border:none;}
div.respond-form .reply_btn{margin-left:565px;margin-top:5px;} div.respond-form .reply_btn{margin-left:626px;margin-top:5px;}
div.recall_con{width:570px;} div.recall_con{width:570px;}
div.recall_con .reply_btn{margin-left:525px;margin-top:5px;} div.recall_con .reply_btn{margin-left:585px;margin-top:5px;}
</style> </style>
<%= content_for(:header_tags) do %> <%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %> <%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %> <% end %>
<div class="msg_box" id='leave-message' nhname='new_message' style="height:auto;"> <div class="msg_box" id='leave-message' nhname='new_message' style="height:auto; width:728px;">
<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% reply_allow = JournalsForMessage.create_by_user? User.current %>
<h4><%= l(:label_user_response) %></h4> <h4><%= l(:label_user_response) %></h4>
<% if !User.current.logged?%> <% if !User.current.logged?%>
@ -27,7 +27,7 @@
<% else %> <% else %>
<%= form_for('new_form', :method => :post, :html => {:id => 'project_feedback_form', :multipart => true}, <%= form_for('new_form', :method => :post, :html => {:id => 'project_feedback_form', :multipart => true},
:url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%> :url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%>
<%= f.text_area 'project_message', :rows => 3, :cols => 65, <%= f.text_area 'project_message', :rows => 3, :cols => 65, :style => "width:718px",
:placeholder => "#{l(:label_welcome_my_respond)}",:nhname=>'new_message_textarea' %> :placeholder => "#{l(:label_welcome_my_respond)}",:nhname=>'new_message_textarea' %>
<p nhname="contentmsg"></p> <p nhname="contentmsg"></p>
<div class="fl mt10" style="padding-top:5px;" nhname="toolbar_container"></div> <div class="fl mt10" style="padding-top:5px;" nhname="toolbar_container"></div>

View File

@ -1,4 +1,4 @@
<div class="st_list"> <div class="st_list2">
<div class="st_box"> <div class="st_box">
<a href="#" class="fr fb mb5" >加入时间</a> <a href="#" class="fr fb mb5" >加入时间</a>
<div class="cl"></div><!--st_box_top end--> <div class="cl"></div><!--st_box_top end-->

View File

@ -18,16 +18,16 @@
<!--<%#= link_to l(:project_module_code_review), {controller: 'code_review', action: 'index', id: @project.id} %>--> <!--<%#= link_to l(:project_module_code_review), {controller: 'code_review', action: 'index', id: @project.id} %>-->
<!--<%# end %>--> <!--<%# end %>-->
<!--</li>--> <!--</li>-->
<!--<li>--> <li>
<!--<%# unless @project.enabled_modules.where("name = 'calendar'").empty? %>--> <% unless @project.enabled_modules.where("name = 'calendar'").empty? %>
<!--<%#= link_to l(:project_module_calendar),project_calendar_path(@project) %>--> <%= link_to l(:project_module_calendar),project_calendar_path(@project) %>
<!--<%# end %>--> <% end %>
<!--</li>--> </li>
<!--<li>--> <li>
<!--<%# unless @project.enabled_modules.where("name = 'gantt'").empty? %>--> <% unless @project.enabled_modules.where("name = 'gantt'").empty? %>
<!--<%#= link_to l(:project_module_gantt) ,project_gantt_path(@project) %>--> <%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %>
<!--<%# end %>--> <% end %>
<!--</li>--> </li>
<!--<li>--> <!--<li>-->
<!--<%# unless @project.enabled_modules.where("name = 'documents'").empty? %>--> <!--<%# unless @project.enabled_modules.where("name = 'documents'").empty? %>-->
<!--<%#= link_to l(:project_module_documents), project_documents_path(@project) %>--> <!--<%#= link_to l(:project_module_documents), project_documents_path(@project) %>-->

View File

@ -1,4 +1,4 @@
<div class="project_r_h"> <div class="project_r_h" style="width:730px;">
<h2 class="project_h2"><%= l(:label_project_tool_response)%></h2> <h2 class="project_h2"><%= l(:label_project_tool_response)%></h2>
</div> </div>
<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% reply_allow = JournalsForMessage.create_by_user? User.current %>
@ -48,3 +48,7 @@ function checkMaxLength() {
</script> </script>
<% html_title(l(:label_project_tool_response)) -%> <% html_title(l(:label_project_tool_response)) -%>
<script>
$("#RSide").css("width","730px");
</script>

View File

@ -1,4 +1,4 @@
<div class="project_r_h"> <div class="project_r_h" style="width:730px;">
<h2 class="project_h2 fl"><%= @subPage_title %></h2> <h2 class="project_h2 fl"><%= @subPage_title %></h2>
<% if is_project_manager?(User.current, @project) %> <% if is_project_manager?(User.current, @project) %>
<span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;"> <span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
@ -11,3 +11,7 @@
<%= render :partial => @render_file, :locals => {:members => @members} %> <%= render :partial => @render_file, :locals => {:members => @members} %>
</div> </div>
<script>
$("#RSide").css("width","730px");
</script>

View File

@ -16,15 +16,16 @@
<% end%> <% end%>
<% end%> <% end%>
$("div[nhname='pro_setting']").show(); $("div[nhname='pro_setting']").show();
$("#RSide").css('width',"730px");
}); });
</script> </script>
<div class="project_r_h"> <div class="project_r_h" style="width:730px;">
<h2 class="project_h2">配置</h2> <h2 class="project_h2">配置</h2>
</div> </div>
<!--通过admin界面配置不同角色显示不同的模块--> <!--通过admin界面配置不同角色显示不同的模块-->
<div class=" pro_setting" nhname="pro_setting" style="display:none;"> <div nhname="pro_setting" style="display:none; width:730px;">
<div id="pro_st_tb_" class="pro_st_tb_"> <div id="pro_st_tb_" class="pro_st_tb_">
<ul> <ul>
<% show_memu = show_project_memu User.current%> <% show_memu = show_project_memu User.current%>
@ -39,7 +40,7 @@
<% end %> <% end %>
<li id="pro_st_tb_5" class="<%= show_memu == 'join_org' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(5);">组织</li> <li id="pro_st_tb_5" class="<%= show_memu == 'join_org' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(5);">组织</li>
<% if User.current.allowed_to?(:manage_versions, @project) %> <% if User.current.allowed_to?(:manage_versions, @project) %>
<li id="pro_st_tb_4" class="<%= show_memu == 'manage_versions' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(4);">版本</li> <li id="pro_st_tb_4" class="<%= show_memu == 'manage_versions' ? 'pro_st_hovertab' : 'pro_st_normaltab'%>" onclick="project_setting(4);"><%= l(:milestone) %></li>
<% end %> <% end %>
<!--<li id="pro_st_tb_5" class="pro_st_normaltab" onclick="project_setting(5);">问题类别</li>--> <!--<li id="pro_st_tb_5" class="pro_st_normaltab" onclick="project_setting(5);">问题类别</li>-->
<% if User.current.allowed_to?(:manage_repository, @project) %> <% if User.current.allowed_to?(:manage_repository, @project) %>

Some files were not shown because too many files have changed in this diff Show More