Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop
Conflicts: public/stylesheets/css/project.css
This commit is contained in:
commit
fb62d4f1b2
18
Gemfile
18
Gemfile
|
@ -50,10 +50,10 @@ gem 'elasticsearch-model'
|
||||||
gem 'elasticsearch-rails'
|
gem 'elasticsearch-rails'
|
||||||
|
|
||||||
#rails 3.2.22.2 bug
|
#rails 3.2.22.2 bug
|
||||||
gem "test-unit", "~>3.0"
|
# gem "test-unit", "~>3.0"
|
||||||
|
|
||||||
### profile
|
### profile
|
||||||
gem 'oneapm_rpm'
|
# gem 'oneapm_rpm'
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem 'grape-swagger'
|
gem 'grape-swagger'
|
||||||
|
@ -63,22 +63,18 @@ group :development do
|
||||||
if RUBY_PLATFORM =~ /w32/
|
if RUBY_PLATFORM =~ /w32/
|
||||||
gem 'win32console'
|
gem 'win32console'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if RUBY_PLATFORM =~ /darwin/
|
||||||
|
gem 'puma'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
unless RUBY_PLATFORM =~ /w32/
|
|
||||||
gem 'pry-rails'
|
|
||||||
if RUBY_VERSION >= '2.0.0'
|
if RUBY_VERSION >= '2.0.0'
|
||||||
gem 'pry-byebug'
|
gem 'pry-byebug'
|
||||||
|
gem "test-unit", "~>3.0"
|
||||||
end
|
end
|
||||||
gem 'pry-stack_explorer'
|
|
||||||
if RUBY_PLATFORM =~ /darwin/
|
|
||||||
gem 'puma'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
gem 'rspec-rails', '~> 3.0'
|
gem 'rspec-rails', '~> 3.0'
|
||||||
gem 'factory_girl_rails'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Gems used only for assets and not required
|
# Gems used only for assets and not required
|
||||||
|
|
|
@ -17,17 +17,18 @@ module Mobile
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
case field
|
case field
|
||||||
|
when :download_url
|
||||||
|
"attachments/download/#{f.try(:id)}"
|
||||||
when :file_dir
|
when :file_dir
|
||||||
"attachments/download/" << f.send(:id).to_s << '/'
|
"attachments/download/" << f.send(:id).to_s << '/'
|
||||||
when :attafile_size
|
when :attafile_size
|
||||||
(number_to_human_size(f.filesize)).gsub("ytes", "").to_s
|
(number_to_human_size(f.filesize)).gsub("ytes", "").to_s
|
||||||
when :coursename
|
when :coursename
|
||||||
f.course.nil? ? "" : f.course.name
|
f.try(:course).try(:name) || ''
|
||||||
when :syllabus_title
|
when :syllabus_title
|
||||||
f.course.nil? ? "" : f.course.syllabus.nil? ? "" : f.course.syllabus.title
|
f.try(:course).try(:syllabus).try(:title) || ''
|
||||||
when :course_id
|
when :course_id
|
||||||
f.course.nil? ? 0 : f.course.id
|
f.try(:course).try(:id) || 0
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -50,6 +51,8 @@ module Mobile
|
||||||
current_user_is_teacher = is_course_teacher(current_user,instance.course)
|
current_user_is_teacher = is_course_teacher(current_user,instance.course)
|
||||||
current_user_is_teacher
|
current_user_is_teacher
|
||||||
end
|
end
|
||||||
|
|
||||||
|
attachment_expose :download_url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -180,6 +180,8 @@ module Mobile
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
expose :attachments, using: Mobile::Entities::Attachment
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -117,6 +117,9 @@ class ApplicationController < ActionController::Base
|
||||||
elsif params[:format] == 'atom' && params[:key] && request.get? && accept_rss_auth?
|
elsif params[:format] == 'atom' && params[:key] && request.get? && accept_rss_auth?
|
||||||
# RSS key authentication does not start a session
|
# RSS key authentication does not start a session
|
||||||
user = User.find_by_rss_key(params[:key])
|
user = User.find_by_rss_key(params[:key])
|
||||||
|
elsif session[:wechat_openid]
|
||||||
|
uw = UserWechat.find_by_openid(session[:wechat_openid])
|
||||||
|
user = uw.user if uw
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if user.nil? && Setting.rest_api_enabled? && accept_api_auth?
|
if user.nil? && Setting.rest_api_enabled? && accept_api_auth?
|
||||||
|
@ -509,8 +512,7 @@ class ApplicationController < ActionController::Base
|
||||||
# render_404
|
# render_404
|
||||||
# end
|
# end
|
||||||
|
|
||||||
def self.
|
def self.model_object(model)
|
||||||
model_object(model)
|
|
||||||
self.model_object = model
|
self.model_object = model
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -72,8 +72,10 @@ class AttachmentsController < ApplicationController
|
||||||
|
|
||||||
def direct_download
|
def direct_download
|
||||||
@attachment.increment_download
|
@attachment.increment_download
|
||||||
|
file_type = detect_content_type(@attachment)
|
||||||
|
|
||||||
send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),
|
send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),
|
||||||
:type => detect_content_type(@attachment),
|
:type => file_type,
|
||||||
:disposition => 'attachment' #inline can open in browser
|
:disposition => 'attachment' #inline can open in browser
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -130,11 +132,7 @@ class AttachmentsController < ApplicationController
|
||||||
def download
|
def download
|
||||||
# modify by nwb
|
# modify by nwb
|
||||||
# 下载添加权限设置
|
# 下载添加权限设置
|
||||||
if (params[:type] && params[:type] == "wechat" )
|
candown = attachment_candown @attachment
|
||||||
candown = true
|
|
||||||
else
|
|
||||||
candown = attachment_candown @attachment
|
|
||||||
end
|
|
||||||
|
|
||||||
if candown || User.current.admin? || User.current.id == @attachment.author_id
|
if candown || User.current.admin? || User.current.id == @attachment.author_id
|
||||||
if stale?(:etag => @attachment.digest)
|
if stale?(:etag => @attachment.digest)
|
||||||
|
|
|
@ -32,6 +32,13 @@ class CoursesController < ApplicationController
|
||||||
before_filter :require_login, :only => [:join, :unjoin]
|
before_filter :require_login, :only => [:join, :unjoin]
|
||||||
#before_filter :allow_join, :only => [:join]
|
#before_filter :allow_join, :only => [:join]
|
||||||
|
|
||||||
|
# 邀请码停用/启用
|
||||||
|
def set_invite_code_halt
|
||||||
|
if User.current.allowed_to?(:as_teacher, @course) || User.current.admin?
|
||||||
|
@course.update_attribute('invite_code_halt', @course.invite_code_halt == 0 ? 1 : 0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#查找组织
|
#查找组织
|
||||||
def search_public_orgs_not_in_course
|
def search_public_orgs_not_in_course
|
||||||
condition = '%%'
|
condition = '%%'
|
||||||
|
|
|
@ -82,6 +82,27 @@ class HomeworkCommonController < ApplicationController
|
||||||
@homework.publish_time = params[:homework_common][:publish_time]
|
@homework.publish_time = params[:homework_common][:publish_time]
|
||||||
end
|
end
|
||||||
homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new
|
homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new
|
||||||
|
param_end_time = Time.parse(params[:homework_common][:end_time]).strftime("%Y-%m-%d")
|
||||||
|
homework_end_time = Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d")
|
||||||
|
if homework_end_time != param_end_time
|
||||||
|
if homework_end_time > param_end_time
|
||||||
|
@homework.student_works.where("work_status = 1").each do |st|
|
||||||
|
if param_end_time < Time.parse(st.commit_time.to_s).strftime("%Y-%m-%d")
|
||||||
|
st.late_penalty = @homework.late_penalty
|
||||||
|
st.work_status = 2
|
||||||
|
st.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
@homework.student_works.where("work_status = 2").each do |st|
|
||||||
|
if param_end_time >= Time.parse(st.commit_time.to_s).strftime("%Y-%m-%d")
|
||||||
|
st.late_penalty = 0
|
||||||
|
st.work_status = 1
|
||||||
|
st.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@homework.end_time = params[:homework_common][:end_time] || Time.now
|
@homework.end_time = params[:homework_common][:end_time] || Time.now
|
||||||
@homework.course_id = params[:course_id]
|
@homework.course_id = params[:course_id]
|
||||||
if params[:homework_type] && params[:homework_type].to_i != @homework.homework_type
|
if params[:homework_type] && params[:homework_type].to_i != @homework.homework_type
|
||||||
|
|
|
@ -22,9 +22,9 @@ class IssuesController < ApplicationController
|
||||||
before_filter :authorize1, :only => [:show]
|
before_filter :authorize1, :only => [:show]
|
||||||
before_filter :find_issue, :only => [:show, :edit, :update,:add_journal, :add_journal_in_org]
|
before_filter :find_issue, :only => [:show, :edit, :update,:add_journal, :add_journal_in_org]
|
||||||
before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy]
|
before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy]
|
||||||
before_filter :find_project, :only => [:new, :create, :update_form]
|
before_filter :find_project, :only => [:new, :create, :update_form, :issue_commits, :commit_for_issue, :issue_commit_delete]
|
||||||
#before_filter :authorize, :except => [:index, :show]
|
#before_filter :authorize, :except => [:index, :show]
|
||||||
before_filter :authorize, :except => [:index,:add_journal, :add_journal_in_org,:delete_journal,:reply,:add_reply]
|
before_filter :authorize, :except => [:index,:add_journal, :add_journal_in_org,:delete_journal,:reply,:add_reply, :issue_commits, :commit_for_issue, :issue_commit_delete]
|
||||||
|
|
||||||
before_filter :find_optional_project, :only => [:index]
|
before_filter :find_optional_project, :only => [:index]
|
||||||
before_filter :check_for_default_issue_status, :only => [:new, :create]
|
before_filter :check_for_default_issue_status, :only => [:new, :create]
|
||||||
|
@ -57,6 +57,57 @@ class IssuesController < ApplicationController
|
||||||
helper :project_score
|
helper :project_score
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
|
|
||||||
|
# issue和代码提交id关联模块 --> over
|
||||||
|
# 获取某个项目的commit_ids
|
||||||
|
def issue_commits
|
||||||
|
begin
|
||||||
|
return render_404 if @project.gpid.nil?
|
||||||
|
@issue_commit_ids = (params[:issue_commit_ids].is_a?(Array) ? params[:issue_commit_ids] : params[:issue_commit_ids].split(",")) unless params[:issue_commit_ids].nil?
|
||||||
|
search = params[:search].to_s.strip
|
||||||
|
@type = params[:type]
|
||||||
|
limit = 15
|
||||||
|
g = Gitlab.client
|
||||||
|
g_project = g.project(@project.gpid)
|
||||||
|
rev = params[:branch].nil? ? g_project.default_branch : params[:branch]
|
||||||
|
@project_branches = g.branches(@project.gpid)
|
||||||
|
@branch_names = @project_branches.map{|b| b.name}
|
||||||
|
@default_branch = g_project.default_branch
|
||||||
|
# 搜索的分页需要单独处理,因为搜索不容易获取总数
|
||||||
|
if search.present?
|
||||||
|
@commits = g.commits(@project.gpid, ref_name:rev, :search => search)
|
||||||
|
@commits_count = @commits.count
|
||||||
|
@commits_pages = Paginator.new @commits_count, limit, params['page'] || 1
|
||||||
|
@offset ||= @commits_pages.offset
|
||||||
|
@commits = paginateHelper @commits,limit
|
||||||
|
else
|
||||||
|
@commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s, ref_name:rev, :search => search)
|
||||||
|
@commits_count = g.user_static(@project.gpid, :rev => rev).count
|
||||||
|
@commits_pages = Redmine::Pagination::Paginator.new @commits_count, limit, params[:page]
|
||||||
|
end
|
||||||
|
rescue Exception => e
|
||||||
|
puts e
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# 选择对应的Commit
|
||||||
|
def commit_for_issue
|
||||||
|
history_commit_ids = params[:issue_for_commit_ids].split(",") unless params[:issue_for_commit_ids].nil?
|
||||||
|
@issue_commit_ids = (history_commit_ids.blank? ? params[:checkbox1] : params[:checkbox1] | history_commit_ids).uniq
|
||||||
|
end
|
||||||
|
|
||||||
|
def issue_commit_delete
|
||||||
|
commit_id = params[:commit_id].split(",")
|
||||||
|
issue_commit_ids = params[:issue_commit_ids]
|
||||||
|
# issue_id存在则为issue详情或者编辑的时候,否则为新建Issue
|
||||||
|
# 编辑和详情的时候需要在数据库中删除记录,新建的时候在内存中删除
|
||||||
|
if params[:issue_id]
|
||||||
|
commit_issue = CommitIssues.where(:commit_id => commit_id, :issue_id => params[:issue_id], :project_id => @project.id).first
|
||||||
|
commit_issue.delete if commit_issue
|
||||||
|
end
|
||||||
|
@issue_commit_ids = issue_commit_ids - commit_id
|
||||||
|
end
|
||||||
|
# over
|
||||||
|
|
||||||
def index
|
def index
|
||||||
# 顶部导航
|
# 顶部导航
|
||||||
@project_menu_type = 2
|
@project_menu_type = 2
|
||||||
|
@ -163,14 +214,14 @@ class IssuesController < ApplicationController
|
||||||
def show
|
def show
|
||||||
# 顶部导航
|
# 顶部导航
|
||||||
@project_menu_type = 2
|
@project_menu_type = 2
|
||||||
|
|
||||||
# 打开编辑内容
|
# 打开编辑内容
|
||||||
@is_edit = true unless params[:edit].nil?
|
@is_edit = true unless params[:edit].nil?
|
||||||
|
|
||||||
# 当前用户查看指派给他的缺陷消息,则设置消息为已读
|
# 当前用户查看指派给他的缺陷消息,则设置消息为已读
|
||||||
query = ForgeMessage.where("forge_message_type =? and user_id =? and forge_message_id =?", "Issue", User.current, @issue).first
|
query = ForgeMessage.where("forge_message_type =? and user_id =? and forge_message_id =?", "Issue", User.current, @issue).first
|
||||||
query.update_attribute(:viewed, true) unless query.nil?
|
query.update_attribute(:viewed, true) unless query.nil?
|
||||||
|
# issue 关联的commit
|
||||||
|
commit_issues = CommitIssues.where(:issue_id => @issue.id, :project_id => @issue.project_id)
|
||||||
|
@issue_commit_ids = commit_issues.map{|commit_issue| commit_issue.commit_id}
|
||||||
# issue 新建的at消息
|
# issue 新建的at消息
|
||||||
User.current.at_messages.unviewed('Issue', @issue.id).each {|x| x.viewed!}
|
User.current.at_messages.unviewed('Issue', @issue.id).each {|x| x.viewed!}
|
||||||
# 回复的at消息
|
# 回复的at消息
|
||||||
|
@ -238,6 +289,8 @@ class IssuesController < ApplicationController
|
||||||
@issue.fixed_version_id = nil if @issue.fixed_version_id == 0
|
@issue.fixed_version_id = nil if @issue.fixed_version_id == 0
|
||||||
@issue.assigned_to_id = nil if @issue.assigned_to_id == 0
|
@issue.assigned_to_id = nil if @issue.assigned_to_id == 0
|
||||||
if @issue.save
|
if @issue.save
|
||||||
|
# 关联commmit
|
||||||
|
update_issue_commit params[:commit_ids]
|
||||||
#params[:issue][:assigned_to_id] = nil if params[:issue][:assigned_to_id].to_i == 0
|
#params[:issue][:assigned_to_id] = nil if params[:issue][:assigned_to_id].to_i == 0
|
||||||
senduser = User.find(params[:issue][:assigned_to_id])
|
senduser = User.find(params[:issue][:assigned_to_id])
|
||||||
issue_id = @issue.id
|
issue_id = @issue.id
|
||||||
|
@ -276,6 +329,9 @@ class IssuesController < ApplicationController
|
||||||
def edit
|
def edit
|
||||||
# 修改实例变量的值
|
# 修改实例变量的值
|
||||||
return unless update_issue_from_params
|
return unless update_issue_from_params
|
||||||
|
# issue 关联的commit
|
||||||
|
commit_issues = CommitIssues.where(:issue_id => @issue.id, :project_id => @issue.project_id)
|
||||||
|
@issue_commit_ids = commit_issues.map{|commit_issue| commit_issue.commit_id}
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {render :layout => 'base_projects' }#added by young
|
format.html {render :layout => 'base_projects' }#added by young
|
||||||
|
@ -309,9 +365,9 @@ class IssuesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if @saved
|
if @saved
|
||||||
|
# 更新commit关联情况
|
||||||
|
update_issue_commit params[:commit_ids]
|
||||||
#修改界面增加跟踪者
|
#修改界面增加跟踪者
|
||||||
watcherlist = @issue.watcher_users
|
watcherlist = @issue.watcher_users
|
||||||
select_users = []
|
select_users = []
|
||||||
|
@ -356,6 +412,26 @@ class IssuesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 保存issue的时候相关的commit操作
|
||||||
|
# commit_ids => "9b9845ff,poor56el"
|
||||||
|
def update_issue_commit commit_ids
|
||||||
|
# 关联commmit
|
||||||
|
commit_ids = params[:commit_ids]
|
||||||
|
unless commit_ids.blank?
|
||||||
|
commit_ids = commit_ids.split(",").uniq
|
||||||
|
if params[:action] == "update"
|
||||||
|
exist_commit_ids = CommitIssues.where(:issue_id => @issue, :project_id => @issue.project_id)
|
||||||
|
unless exist_commit_ids.blank?
|
||||||
|
exist_commit_ids = exist_commit_ids.map{|commit| commit.commit_id}
|
||||||
|
commit_ids = commit_ids - exist_commit_ids
|
||||||
|
end
|
||||||
|
end
|
||||||
|
commit_ids.each do |commit_id|
|
||||||
|
CommitIssues.create(:commit_id => commit_id, :project_id => @issue.project_id, :issue_id => @issue.id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def update_user_issue_detail(issue, params)
|
def update_user_issue_detail(issue, params)
|
||||||
case params[:type]
|
case params[:type]
|
||||||
when "status"
|
when "status"
|
||||||
|
@ -794,7 +870,6 @@ class IssuesController < ApplicationController
|
||||||
|
|
||||||
# 更新issue状态时,journal表产生记录,返回@current_journal
|
# 更新issue状态时,journal表产生记录,返回@current_journal
|
||||||
@issue.init_journal(User.current)
|
@issue.init_journal(User.current)
|
||||||
|
|
||||||
issue_attributes = params[:issue]
|
issue_attributes = params[:issue]
|
||||||
if issue_attributes && params[:conflict_resolution]
|
if issue_attributes && params[:conflict_resolution]
|
||||||
case params[:conflict_resolution]
|
case params[:conflict_resolution]
|
||||||
|
@ -809,18 +884,18 @@ class IssuesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
senduser = User.find(params[:issue][:assigned_to_id])
|
if params[:action] == "update"
|
||||||
|
senduser = User.find(params[:issue][:assigned_to_id])
|
||||||
if senduser.id != User.current.id && @issue.assigned_to_id != params[:issue][:assigned_to_id].to_i
|
if senduser.id != User.current.id && @issue.assigned_to_id != params[:issue][:assigned_to_id].to_i
|
||||||
issue_id = @issue.id
|
issue_id = @issue.id
|
||||||
issue_title = params[:issue][:subject]
|
issue_title = params[:issue][:subject]
|
||||||
priority_id = params[:issue][:priority_id]
|
priority_id = params[:issue][:priority_id]
|
||||||
ps = ProjectsService.new
|
ps = ProjectsService.new
|
||||||
ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
|
ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@issue.safe_attributes = issue_attributes
|
@issue.safe_attributes = issue_attributes
|
||||||
|
|
||||||
@priorities = IssuePriority.active
|
@priorities = IssuePriority.active
|
||||||
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
|
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
|
||||||
true
|
true
|
||||||
|
|
|
@ -7,7 +7,7 @@ class StudentWorkController < ApplicationController
|
||||||
require "base64"
|
require "base64"
|
||||||
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:program_test_ex,
|
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:program_test_ex,
|
||||||
:set_score_rule,:forbidden_anonymous_comment,:delete_work,:new_student_work_project,:student_work_project,:cancel_relate_project,
|
:set_score_rule,:forbidden_anonymous_comment,:delete_work,:new_student_work_project,:student_work_project,:cancel_relate_project,
|
||||||
:search_course_students,:work_canrepeat,:add_group_member]
|
:search_course_students,:work_canrepeat,:add_group_member,:change_project]
|
||||||
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work,:revise_attachment]
|
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work,:revise_attachment]
|
||||||
before_filter :member_of_course, :only => [:new, :create, :show, :add_score, :praise_student_work]
|
before_filter :member_of_course, :only => [:new, :create, :show, :add_score, :praise_student_work]
|
||||||
before_filter :author_of_work, :only => [:edit, :update, :destroy]
|
before_filter :author_of_work, :only => [:edit, :update, :destroy]
|
||||||
|
@ -587,6 +587,14 @@ class StudentWorkController < ApplicationController
|
||||||
if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
|
if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
|
||||||
student_work.late_penalty = @homework.late_penalty
|
student_work.late_penalty = @homework.late_penalty
|
||||||
student_work.work_status = 2
|
student_work.work_status = 2
|
||||||
|
# 缺评扣分
|
||||||
|
if @homework.homework_detail_manual.no_anon_penalty == 0 && @homework.homework_detail_manual.comment_status == 3 && @homework.anonymous_comment == 0
|
||||||
|
work_ids = "(" + @homework.student_works.has_committed.map(&:id).join(",") + ")"
|
||||||
|
all_dis_eva = StudentWorksEvaluationDistribution.where("student_work_id IN #{work_ids}")
|
||||||
|
has_sw_count = all_dis_eva.select("distinct user_id").count
|
||||||
|
anon_count = all_dis_eva.count / has_sw_count
|
||||||
|
student_work.absence_penalty = @homework.homework_detail_manual.absence_penalty * anon_count
|
||||||
|
end
|
||||||
else
|
else
|
||||||
student_work.late_penalty = 0
|
student_work.late_penalty = 0
|
||||||
student_work.work_status = 1
|
student_work.work_status = 1
|
||||||
|
@ -1052,7 +1060,7 @@ class StudentWorkController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def forbidden_anonymous_comment
|
def forbidden_anonymous_comment
|
||||||
@homework.update_column('anonymous_comment', 1)
|
@homework.update_column('anonymous_comment', @homework.anonymous_comment == 0 ? 1 : 0)
|
||||||
homework_detail_manual = @homework.homework_detail_manual
|
homework_detail_manual = @homework.homework_detail_manual
|
||||||
homework_detail_programing = @homework.homework_detail_programing
|
homework_detail_programing = @homework.homework_detail_programing
|
||||||
if homework_detail_programing
|
if homework_detail_programing
|
||||||
|
@ -1084,6 +1092,7 @@ class StudentWorkController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
@homework = @work.homework_common
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_student_work_project
|
def new_student_work_project
|
||||||
|
@ -1130,6 +1139,26 @@ class StudentWorkController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 作品更换关联项目
|
||||||
|
def change_project
|
||||||
|
work = @homework.student_works.has_committed.where("user_id = #{User.current.id}").first
|
||||||
|
project = Project.find params[:projectName].to_i
|
||||||
|
if work && project
|
||||||
|
relate_user_ids = work.student_work_projects.map{|pro| pro.user_id}
|
||||||
|
member_ids = project.members.map{|mem| mem.user_id}
|
||||||
|
if (relate_user_ids & member_ids) == relate_user_ids
|
||||||
|
work.student_work_projects.update_all(:project_id => params[:projectName].to_i)
|
||||||
|
student_works = @homework.student_works.where("user_id in #{'(' + relate_user_ids.join(',') + ')'}")
|
||||||
|
student_works.update_all(:project_id => params[:projectName].to_i)
|
||||||
|
else
|
||||||
|
@remain_user_ids = relate_user_ids - (relate_user_ids & member_ids)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#查找课程的学生
|
#查找课程的学生
|
||||||
def search_course_students
|
def search_course_students
|
||||||
name = ""
|
name = ""
|
||||||
|
|
|
@ -1187,10 +1187,18 @@ class UsersController < ApplicationController
|
||||||
student_work = StudentWork.where(homework_common_id: homework.id, user_id: User.current.id).first
|
student_work = StudentWork.where(homework_common_id: homework.id, user_id: User.current.id).first
|
||||||
if student_work
|
if student_work
|
||||||
|
|
||||||
#提交作品时,计算是否迟交
|
# 提交作品时,计算是否迟交
|
||||||
if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
|
if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
|
||||||
student_work.late_penalty = homework.late_penalty
|
student_work.late_penalty = homework.late_penalty
|
||||||
student_work.work_status = 2
|
student_work.work_status = 2
|
||||||
|
# 缺评扣分
|
||||||
|
if homework.homework_detail_manual.no_anon_penalty == 0 && homework.homework_detail_manual.comment_status == 3 && homework.anonymous_comment == 0
|
||||||
|
work_ids = "(" + homework.student_works.has_committed.map(&:id).join(",") + ")"
|
||||||
|
all_dis_eva = StudentWorksEvaluationDistribution.where("student_work_id IN #{work_ids}")
|
||||||
|
has_sw_count = all_dis_eva.select("distinct user_id").count
|
||||||
|
anon_count = all_dis_eva.count / has_sw_count
|
||||||
|
student_work.absence_penalty = homework.homework_detail_manual.absence_penalty * anon_count
|
||||||
|
end
|
||||||
else
|
else
|
||||||
student_work.late_penalty = 0
|
student_work.late_penalty = 0
|
||||||
student_work.work_status = 1
|
student_work.work_status = 1
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
#coding=utf-8
|
#coding=utf-8
|
||||||
|
|
||||||
|
require 'base64'
|
||||||
class WechatsController < ActionController::Base
|
class WechatsController < ActionController::Base
|
||||||
wechat_responder
|
wechat_responder
|
||||||
|
|
||||||
|
@ -105,6 +107,7 @@ class WechatsController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
on :event, with: 'unsubscribe' do |request|
|
on :event, with: 'unsubscribe' do |request|
|
||||||
|
unBind(request)
|
||||||
request.reply.success # user can not receive this message
|
request.reply.success # user can not receive this message
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -272,12 +275,18 @@ class WechatsController < ActionController::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def unBind(request)
|
||||||
|
uw = user_binded?(request[:FromUserName])
|
||||||
|
uw.try(:subscribe!)
|
||||||
|
end
|
||||||
|
|
||||||
def sendBind(request)
|
def sendBind(request)
|
||||||
tmpurl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities'}&response_type=code&scope=snsapi_base&state=login&connect_redirect=1#wechat_redirect"
|
tmpurl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities'}&response_type=code&scope=snsapi_base&state=login&connect_redirect=1#wechat_redirect"
|
||||||
logger.info "tmpurl!!!!!!!!!!!!!!"
|
logger.info "tmpurl!!!!!!!!!!!!!!"
|
||||||
logger.info tmpurl
|
logger.info tmpurl
|
||||||
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '绑定登录', content: "欢迎使用Trustie创新实践服务平台!
|
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '绑定登录', content: "欢迎使用Trustie创新实践服务平台!
|
||||||
在这里您可以随时了解您的课程和项目动态,随时点赞和回复。
|
在这里您可以随时了解您的课程和项目动态,随时点赞和回复。交作业、代码提交等更多功能,请前往 www.trustie.net
|
||||||
|
|
||||||
我们将会与微信不断结合,为您提供更有价值的服务。
|
我们将会与微信不断结合,为您提供更有价值的服务。
|
||||||
|
|
||||||
您还未绑定确实的用户,请先绑定,谢谢!" } }
|
您还未绑定确实的用户,请先绑定,谢谢!" } }
|
||||||
|
@ -485,9 +494,33 @@ class WechatsController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# 用于权限跳转
|
||||||
|
def auth
|
||||||
|
state = params[:state]
|
||||||
|
url = "#{ROOT_URL}/wechat/auth_callback"
|
||||||
|
authorize_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{url}&response_type=code&scope=snsapi_base&state=#{state}&connect_redirect=1#wechat_redirect"
|
||||||
|
redirect_to authorize_url
|
||||||
|
end
|
||||||
|
|
||||||
|
def auth_callback
|
||||||
|
path = Base64.urlsafe_decode64(params[:state])
|
||||||
|
open_id = get_openid_from_code(params[:code])
|
||||||
|
unless open_id
|
||||||
|
render 'wechats/open_wechat', layout: nil and return
|
||||||
|
end
|
||||||
|
|
||||||
|
redirect_to "/wechat/user_activities##{path}"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
def get_openid_from_code(code)
|
def get_openid_from_code(code)
|
||||||
return 'oCnvgvz8R7QheXE-R9Kkr39j8Ndg' if code =='only-for-test'
|
if code =='only-for-test'
|
||||||
|
openid = 'o3ss_wHOOnHkz1khBJxH8RF4SfPY'
|
||||||
|
session[:wechat_openid] = openid
|
||||||
|
return openid
|
||||||
|
end
|
||||||
|
|
||||||
openid = session[:wechat_openid]
|
openid = session[:wechat_openid]
|
||||||
unless openid
|
unless openid
|
||||||
if code
|
if code
|
||||||
|
|
|
@ -77,12 +77,36 @@ module ApplicationHelper
|
||||||
user.nil? ? User.find(2) : user
|
user.nil? ? User.find(2) : user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 通过邮件查找用户,能查到返回用户,否则返回邮件地址
|
||||||
|
def user_by_mail mail
|
||||||
|
user = User.find_by_mail(mail)
|
||||||
|
user.nil? ? mail : user.try(:show_name)
|
||||||
|
end
|
||||||
|
|
||||||
|
def link_to_user_mail(mail, css_class)
|
||||||
|
user = User.find_by_mail(mail)
|
||||||
|
user = user.nil? ? mail : user
|
||||||
|
if user.is_a?(User)
|
||||||
|
name = user.show_name
|
||||||
|
link_to name, {:controller=> 'users', :action => 'show', id: user.id}, :class => css_class, :target => "_blank"
|
||||||
|
else
|
||||||
|
"<a class='#{css_class}'>#{h(user.to_s)}</a>".html_safe
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# 通过系统外部用户名查找用户,如果用户不存在则用邮箱替换
|
# 通过系统外部用户名查找用户,如果用户不存在则用邮箱替换
|
||||||
def get_user_by_login_and login
|
def get_user_by_login_and login
|
||||||
user = User.find_by_login(login)
|
user = User.find_by_login(login)
|
||||||
(user.nil? || login == "root") ? User.find(2) : user
|
(user.nil? || login == "root") ? User.find(2) : user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# 登录名来自外部系统
|
||||||
|
# 通过登录名查找用户,如果用户存在则显示用户姓名,否则显示登录名
|
||||||
|
def get_user_by_login login
|
||||||
|
user = User.find_by_login(login)
|
||||||
|
user.nil? ? login : user.show_name
|
||||||
|
end
|
||||||
|
|
||||||
# 重置user_path,目的是将id转换成用户名
|
# 重置user_path,目的是将id转换成用户名
|
||||||
def user_path(resource, parameters = {})
|
def user_path(resource, parameters = {})
|
||||||
if Fixnum === resource
|
if Fixnum === resource
|
||||||
|
@ -3741,7 +3765,9 @@ def get_hw_status homework_common
|
||||||
end
|
end
|
||||||
if Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
if Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
||||||
str += '<span class="green_homework_btn_cir ml5">作品提交中</span>'
|
str += '<span class="green_homework_btn_cir ml5">作品提交中</span>'
|
||||||
elsif Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d")
|
elsif Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && homework_common.anonymous_comment == 1 && User.current.allowed_to?(:as_teacher, homework_common.course)
|
||||||
|
str += '<span class="green_homework_btn_cir ml5" title="目前教师和教辅正在评阅">教师评阅中</span>'
|
||||||
|
else
|
||||||
str += '<span class="red_homework_btn_cir ml5">作品补交中</span>'
|
str += '<span class="red_homework_btn_cir ml5">作品补交中</span>'
|
||||||
end
|
end
|
||||||
elsif homework_common.homework_detail_manual.comment_status == 2
|
elsif homework_common.homework_detail_manual.comment_status == 2
|
||||||
|
|
|
@ -27,6 +27,21 @@ module RepositoriesHelper
|
||||||
REPO_IP_ADDRESS = Setting.host_repository
|
REPO_IP_ADDRESS = Setting.host_repository
|
||||||
REPO_GITLAB_ADDRESS = "git.trustie.net"
|
REPO_GITLAB_ADDRESS = "git.trustie.net"
|
||||||
|
|
||||||
|
# 获取某次提交的关联Issue
|
||||||
|
# REDO:一次关联查询
|
||||||
|
# type为true则为详情页面,全部显示
|
||||||
|
def get_commit_issues commit_id, project_id, type
|
||||||
|
commit_issues = CommitIssues.where(:commit_id => commit_id, :project_id => project_id)
|
||||||
|
unless commit_issues.blank?
|
||||||
|
if commit_issues.count > 2 && type != 1
|
||||||
|
result = commit_issues.map{|commit_issue| commit_issue.issue_id}.first(2) << "more"
|
||||||
|
else
|
||||||
|
result = commit_issues.map{|commit_issue| commit_issue.issue_id}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result unless result.blank?
|
||||||
|
end
|
||||||
|
|
||||||
# 因为gitlab的提交总数不是实时同步的,说以取总数用两种方法
|
# 因为gitlab的提交总数不是实时同步的,说以取总数用两种方法
|
||||||
def choise_commit_count git_count, pro_count
|
def choise_commit_count git_count, pro_count
|
||||||
git_count > pro_count ? git_count : pro_count
|
git_count > pro_count ? git_count : pro_count
|
||||||
|
|
|
@ -397,7 +397,7 @@ class Attachment < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def course
|
def course
|
||||||
container
|
Course === container ? container : nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def visible?(user=User.current)
|
def visible?(user=User.current)
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class CommitIssues < ActiveRecord::Base
|
||||||
|
attr_accessible :commit_id, :issue_id, :project_id
|
||||||
|
# 之所以没建立关联表,主要是应为commit_id是直接通过api获取的,不存在trustie端
|
||||||
|
has_many :issues
|
||||||
|
end
|
|
@ -56,6 +56,8 @@ class Issue < ActiveRecord::Base
|
||||||
has_one :praise_tread_cache, as: :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
|
||||||
|
# 该关联不能关联删除,因为commit记录没有存在Trustie数据库中
|
||||||
|
has_many :commit_issueses
|
||||||
|
|
||||||
has_many :at_messages, class_name: 'AtMessage', as: :at_message ,:dependent => :destroy
|
has_many :at_messages, class_name: 'AtMessage', as: :at_message ,:dependent => :destroy
|
||||||
|
|
||||||
|
|
|
@ -24,4 +24,9 @@ class UserWechat < ActiveRecord::Base
|
||||||
BlogComment.where(author_id: old_user).update_all(author_id: u.id)
|
BlogComment.where(author_id: old_user).update_all(author_id: u.id)
|
||||||
UserActivity.where(user_id: old_user).update_all(user_id: u.id)
|
UserActivity.where(user_id: old_user).update_all(user_id: u.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def unsubscribe!
|
||||||
|
self.delete
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -584,6 +584,8 @@ class CoursesService
|
||||||
@state = 2
|
@state = 2
|
||||||
elsif course[:is_delete] == 1
|
elsif course[:is_delete] == 1
|
||||||
@state = 11
|
@state = 11
|
||||||
|
elsif course[:invite_code_halt] == 1
|
||||||
|
@state = 14
|
||||||
else
|
else
|
||||||
if current_user.member_of_course?(course) #如果已经是成员
|
if current_user.member_of_course?(course) #如果已经是成员
|
||||||
@state = 3
|
@state = 3
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<% if @course %>
|
<% if @course %>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_news_post_reply', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||||
<% elsif @project %>
|
<% elsif @project %>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||||
<% else %>
|
<% else %>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'organizations/course_news_post_reply', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||||
<% end %>
|
<% end %>
|
||||||
sd_create_editor_from_data('<%= @user_activity_id%>',"","100%", "UserActivity");
|
sd_create_editor_from_data('<%= @user_activity_id%>',"","100%", "UserActivity");
|
||||||
|
|
|
@ -62,17 +62,17 @@
|
||||||
<% when 'HomeworkCommon' %>
|
<% when 'HomeworkCommon' %>
|
||||||
<%= render :partial => 'users/course_homework', :locals => {:activity => act, :user_activity_id => activity.id, :hw_status => 2} %>
|
<%= 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, :is_course => 1} %>
|
||||||
<% when 'Message' %>
|
<% when 'Message' %>
|
||||||
<%= render :partial => 'users/course_message', :locals => {:activity => act, :user_activity_id => activity.id,:is_course=>1,:is_board=>0} %>
|
<%= render :partial => 'users/course_message', :locals => {:activity => act, :user_activity_id => activity.id,:is_course=>1,:is_board=>0} %>
|
||||||
<% when 'Poll' %>
|
<% when 'Poll' %>
|
||||||
<%= render :partial => 'users/course_poll', :locals => {:activity => act, :user_activity_id => activity.id} %>
|
<%= render :partial => 'users/course_poll', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %>
|
||||||
<% when 'JournalsForMessage' %>
|
<% when 'JournalsForMessage' %>
|
||||||
<%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => activity.id} %>
|
<%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %>
|
||||||
<% when 'Attachment' %>
|
<% when 'Attachment' %>
|
||||||
<%= render :partial => 'users/course_attachment', :locals => {:activity => act, :user_activity_id => activity.id} %>
|
<%= render :partial => 'users/course_attachment', :locals => {:activity => act, :user_activity_id => activity.id} %>
|
||||||
<% when 'Course' %>
|
<% when 'Course' %>
|
||||||
<%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => activity.id} %>
|
<%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
<ul class="rankList">
|
<ul class="rankList">
|
||||||
<h3 style="font-size: 14px; font-weight: normal;">
|
<h3 style="font-size: 14px; font-weight: normal;">
|
||||||
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
|
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
|
||||||
<%= link_to "班级活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => 'fontGrey3' %>
|
<%= link_to "活跃度", course_member_path(course, :role => 2, :sort_type => 'act_score'), :class => 'fontGrey3' %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="fontGrey7"> 班级活跃度 </span>
|
<span class="fontGrey7"> 活跃度 </span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<a class="sy_cmore fr" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor: pointer; position:relative;">积分规则</a>
|
<a class="sy_cmore fr" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor: pointer; position:relative;">积分规则</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
<ul class="rankList">
|
<ul class="rankList">
|
||||||
<h4 style="font-size: 14px; font-weight: normal;">
|
<h4 style="font-size: 14px; font-weight: normal;">
|
||||||
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
|
<% if (User.current.logged? && course.open_student == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
|
||||||
<%= link_to "班级英雄榜", course_member_path(course, :role => 2), :class => 'fontGrey3' %>
|
<%= link_to "英雄榜", course_member_path(course, :role => 2), :class => 'fontGrey3' %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="fontGrey7">班级英雄榜</span>
|
<span class="fontGrey7">英雄榜</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
<a class="contributor_course" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor:pointer;">积分规则</a></h4>
|
<a class="contributor_course" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor:pointer;">积分规则</a></h4>
|
||||||
<div style="cursor:pointer;" class="numIntro undis">
|
<div style="cursor:pointer;" class="numIntro undis">
|
||||||
|
|
|
@ -1,23 +1,26 @@
|
||||||
<div class="st_list">
|
<div class="sy_class_fenban clear">
|
||||||
<div class="st_box">
|
<div class="mt5">
|
||||||
<a href="javascript:void(0)" class="fr fb mb5" >加入时间</a>
|
<div style="border-bottom: 1px solid #CCC">
|
||||||
<a href="javascript:void(0)" class="fr fb mb5 mr70" >角色</a>
|
<span href="javascript:void(0)" class="c_grey f14 fl fb mb5 ml65" >姓名</span>
|
||||||
<div class="cl"></div><!--st_box_top end-->
|
<span href="javascript:void(0)" class="c_grey f14 fr fb mb5 mr20">加入时间</span>
|
||||||
|
<span href="javascript:void(0)" class="c_grey f14 fr fb mb5 mr70" >角色</span>
|
||||||
|
<div class="cl"></div><!--st_box_top end-->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt10">
|
||||||
<% members.each do |member| %>
|
<% members.each do |member| %>
|
||||||
<div class="st_boxlist">
|
<div class="teacher_st_boxlist">
|
||||||
<%= link_to image_tag(url_to_avatar(member.user), :width => "32", :height => "32", :style => "display:block;"), user_path(member.user_id),:target => '_blank', :class => 'st_img' ,:alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(member.user), :width => "50", :height => "50", :style => "display:block;", :class =>'teacher_member_img'), user_path(member.user_id), :class => 'fl' ,:alt => "用户头像" %>
|
||||||
<span class="fl ml10 c_grey"><%= l(:label_username)%></span>
|
<div class="fl">
|
||||||
<%= link_to(member.user.show_name, user_path(member.user),:class => "ml10 c_blue02") %>
|
<%= link_to(member.user.show_name, user_path(member.user),:class => "ml10 mt5 mb10 link-blue db") %>
|
||||||
<span class="fr c_grey"><%= format_date(member.created_on)%></span>
|
<span class="c_grey ml10"><%= l(:label_username)%><%= member.user.login%></span>
|
||||||
<span class="fr c_grey mr30 w45"><%= zh_course_role(h member.roles.sort.collect(&:to_s).first)%></span>
|
</div>
|
||||||
|
<span class="fr c_grey mr15"><%= format_date(member.created_on)%></span>
|
||||||
|
<span class="fr c_grey mr55 w45" style="text-align: center"><%= zh_course_role(h member.roles.sort.collect(&:to_s).first)%></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
</div>
|
||||||
<ul class="wlist">
|
|
||||||
<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
|
||||||
</ul>
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -10,7 +10,6 @@
|
||||||
<li>
|
<li>
|
||||||
<label>班级邀请码:</label>
|
<label>班级邀请码:</label>
|
||||||
<input class=" sy_input_txt fl" name="invite_code" placeholder="请输入五位班级邀请码">
|
<input class=" sy_input_txt fl" name="invite_code" placeholder="请输入五位班级邀请码">
|
||||||
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -18,14 +17,13 @@
|
||||||
<input type="checkbox" name="role[]" value="9" id="join_course_role_9" class="ml5 mr5 "/><span class="mr10">教师</span>
|
<input type="checkbox" name="role[]" value="9" id="join_course_role_9" class="ml5 mr5 "/><span class="mr10">教师</span>
|
||||||
<input type="checkbox" name="role[]" value="7" id="join_course_role_7" class="ml5 mr5"/><span class="mr10">助教</span>
|
<input type="checkbox" name="role[]" value="7" id="join_course_role_7" class="ml5 mr5"/><span class="mr10">助教</span>
|
||||||
<input type="checkbox" name="role[]" value="10" id="join_course_role_10" class="ml5 mr5"/><span class="mr10">学生</span>
|
<input type="checkbox" name="role[]" value="10" id="join_course_role_10" class="ml5 mr5"/><span class="mr10">学生</span>
|
||||||
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<p id="none_checked_notice" class="c_red none f12" style="margin-left: 42px;">请至少选择一个身份</p>
|
||||||
|
<li class="mt10">
|
||||||
<label> </label>
|
<label> </label>
|
||||||
<a href="javascript:void(0);" class="sy_btn_blue fl" onclick="$('#new-watcher-form').submit();hideModal()">确 定</a>
|
<a href="javascript:void(0);" class="sy_btn_blue fl" onclick="submit_join_course();">确 定</a>
|
||||||
<a href="javascript:void(0);" class="sy_btn_grey fl ml20" onclick="hideModal()">取 消</a>
|
<a href="javascript:void(0);" class="sy_btn_grey fl ml20" onclick="hideModal()">取 消</a>
|
||||||
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -33,6 +31,16 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
|
function submit_join_course(){
|
||||||
|
if ($("input[name='role[]']:checked").length >= 1){
|
||||||
|
$("#none_checked_notice").hide();
|
||||||
|
$('#new-watcher-form').submit();
|
||||||
|
hideModal();
|
||||||
|
}else{
|
||||||
|
$("#none_checked_notice").show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$("#join_course_role_7").on('click', function(){
|
$("#join_course_role_7").on('click', function(){
|
||||||
if($("#join_course_role_7").is(":checked")) {
|
if($("#join_course_role_7").is(":checked")) {
|
||||||
|
|
|
@ -79,8 +79,8 @@
|
||||||
<% sum = hw_score + ex_score + act_score %>
|
<% sum = hw_score + ex_score + act_score %>
|
||||||
<td><%= (@page - 1) * @limit + i + 1 %></td>
|
<td><%= (@page - 1) * @limit + i + 1 %></td>
|
||||||
<td>
|
<td>
|
||||||
<%= link_to image_tag(url_to_avatar(user), :width => "30", :height => "30", :style => "display:block;"), user_path(member.user_id), :class => 'sy_class_users_st fl mt5 mr5' ,:alt => "用户头像" %>
|
<%= link_to image_tag(url_to_avatar(user), :width => "30", :height => "30", :style => "display:block;"), user_path(user), :class => 'sy_class_users_st fl mt5 mr5' ,:alt => "用户头像" %>
|
||||||
<span class="fl sy_class_users_st_name" title="<%= user.show_name %>"><%= user.show_name %></span>
|
<%= link_to user.show_name, user_path(user), :class => 'fl sy_class_users_st_name' ,:title => "#{user.show_name}" %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="sy_class_users_st_num" title="<%= user.user_extensions.student_id %>"><%= user.user_extensions.student_id %></span>
|
<span class="sy_class_users_st_num" title="<%= user.user_extensions.student_id %>"><%= user.user_extensions.student_id %></span>
|
||||||
|
|
|
@ -5,77 +5,82 @@
|
||||||
<% if @state == 0 %>
|
<% if @state == 0 %>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">加入成功</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">加入成功</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% elsif @state == 1 %>
|
<% elsif @state == 1 %>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">密码错误</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">密码错误</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% elsif @state == 2 %>
|
<% elsif @state == 2 %>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">班级已过期<br/>请联系班级管理员重启班级。(在配置班级处)</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">班级已过期<br/>请联系班级管理员重启班级。(在配置班级处)</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% elsif @state == 3 %>
|
<% elsif @state == 3 %>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">您已经加入了班级</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">您已经加入了班级</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% elsif @state == 4 %>
|
<% elsif @state == 4 %>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">您输入的邀请码错误</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">您输入的邀请码错误</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% elsif @state == 5 %>
|
<% elsif @state == 5 %>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">您还未登录</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">您还未登录</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% elsif @state == 6 %>
|
<% elsif @state == 6 %>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">申请成功,请等待审核</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">申请成功,请等待审核</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% elsif @state == 7%>
|
<% elsif @state == 7%>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">您已经发送过申请了,请耐心等待</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">您已经发送过申请了,请耐心等待</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% elsif @state == 8%>
|
<% elsif @state == 8%>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">您已经是该班级的教师了</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">您已经是该班级的教师了</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% elsif @state == 9%>
|
<% elsif @state == 9%>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">您已经是该班级的教辅了</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">您已经是该班级的教辅了</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% elsif @state == 10%>
|
<% elsif @state == 10%>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">您已经是该班级的管理员了</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">您已经是该班级的管理员了</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% elsif @state == 11%>
|
<% elsif @state == 11%>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">该班级已被删除</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">该班级已归档,请联系老师</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% elsif @state == 12 %>
|
<% elsif @state == 12 %>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">您已经发送过申请了,请耐心等待</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">您已经发送过申请了,请耐心等待</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% elsif @state == 13 %>
|
<% elsif @state == 13 %>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">申请成功,请等待审核</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">申请成功,请等待审核</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="refresh_current_course();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
||||||
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
|
<% elsif @state == 14 %>
|
||||||
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
|
'<div class="clear mt15"><p class="text_c f14">此二维码已停用,请与老师联系</p><div class="cl"></div>'+
|
||||||
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% else %>
|
<% else %>
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">未知错误,请稍后再试</p><div class="cl"></div>'+
|
'<div class="clear mt15"><p class="text_c f14">未知错误,请稍后再试</p><div class="cl"></div>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
<% if @role.to_i == 1 %>
|
<% if @role.to_i == 1 %>
|
||||||
<div class="courseRSide fl" id="homework_page_right">
|
<div class="sy_class_r sy_class_nobg fr ml10">
|
||||||
<div class="project_r_h">
|
<div class="sy_class_r_head mb10">
|
||||||
<h2 class="project_h2 fl"><%= @subPage_title%></h2>
|
<h3 class="fl"><%= @subPage_title %></h3>
|
||||||
<% if User.current.allowed_to?(:as_teacher,@course) %>
|
<% if User.current.allowed_to?(:as_teacher,@course) %>
|
||||||
<span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
|
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member'}, :class => 'link-blue fr mt5' %>
|
||||||
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member'}, :class => 'hw_more_li' %>
|
|
||||||
</span>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
|
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
$("#project_info_<%=@course.id %>").html("<%= escape_javascript(render :partial => 'layouts/course_base_info') %>");
|
||||||
|
hideModal();
|
|
@ -2,13 +2,13 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="newupload_td01"> </th>
|
<th class="newupload_td01"> </th>
|
||||||
<th class="pr">
|
<th class="pr tl">
|
||||||
<%= link_to "试卷标题", search_exercises_exercise_index_path(:course_id => course_id, :order => "exercise_name", :sort => @r_sort), :remote => true%>
|
<%= link_to "试卷标题", search_exercises_exercise_index_path(:course_id => course_id, :order => "exercise_name", :sort => @r_sort), :remote => true, :class => "ml5"%>
|
||||||
<% if order == "exercise_name" %>
|
<% if order == "exercise_name" %>
|
||||||
<%= link_to "", search_exercises_exercise_index_path(:course_id => course_id, :order => "exercise_name", :sort => @r_sort), :class => "#{@r_sort == 'desc' ? 'sortupbtn' : 'sortdownbtn'}", :style => "position: absolute; top: 8px; left: 172px;", :remote => true %>
|
<%= link_to "", search_exercises_exercise_index_path(:course_id => course_id, :order => "exercise_name", :sort => @r_sort), :class => "#{@r_sort == 'desc' ? 'sortupbtn' : 'sortdownbtn'}", :style => "position: absolute; top: 8px; left: 172px;", :remote => true %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</th>
|
</th>
|
||||||
<th class="newupload_td03" style="color: #7f7f7f;">来源</th>
|
<th class="newupload_td03 tl" style="color: #7f7f7f;"><span class="ml5">来源</span></th>
|
||||||
<th class="newupload_td04 pr">
|
<th class="newupload_td04 pr">
|
||||||
<%= link_to "创建时间", search_exercises_exercise_index_path(:course_id => course_id, :order => "created_at", :sort => @r_sort), :remote => true%>
|
<%= link_to "创建时间", search_exercises_exercise_index_path(:course_id => course_id, :order => "created_at", :sort => @r_sort), :remote => true%>
|
||||||
<% if order == "created_at" %>
|
<% if order == "created_at" %>
|
||||||
|
|
|
@ -1,6 +1,2 @@
|
||||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>');
|
var htmlvalue = "<%= escape_javascript(render :partial => 'student_work/alert_forbidden_anonymous', :locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
|
||||||
showModal('ajax-modal', '500px');
|
pop_box_new(htmlvalue, 400, 178);
|
||||||
$('#ajax-modal').siblings().remove();
|
|
||||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
|
||||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
|
||||||
$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9");
|
|
|
@ -2,5 +2,6 @@
|
||||||
<%#= watcher_link_issue(@issue, User.current) %>
|
<%#= watcher_link_issue(@issue, User.current) %>
|
||||||
<%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'talk_edit fr' if User.current.allowed_to?(:add_issues, @project) %>
|
<%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'talk_edit fr' if User.current.allowed_to?(:add_issues, @project) %>
|
||||||
<%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %>
|
<%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %>
|
||||||
<%= link_to l(:button_edit), 'javascript:void(0);', :onclick => 'issueEditShow();', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %>
|
<%#= link_to l(:button_edit), 'javascript:void(0);', :onclick => 'issueEditShow();', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %>
|
||||||
|
<%= link_to l(:button_edit), edit_issue_path(@issue), :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %>
|
||||||
<%#= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_journal_kind_reply"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %>
|
<%#= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_journal_kind_reply"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div id="issue_edit" style="display: none">
|
<div id="issue_edit">
|
||||||
<%= content_for(:header_tags) do %>
|
<%= content_for(:header_tags) do %>
|
||||||
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
|
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<!--<a href="javascript:void(0);" class="sy_btn_blue mr5 fr"> 保存并继续</a>-->
|
<!--<a href="javascript:void(0);" class="sy_btn_blue mr5 fr"> 保存并继续</a>-->
|
||||||
<!--<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="sy_btn_blue mr5 fr" id="issue_confirm"> 保存</a>-->
|
<!--<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="sy_btn_blue mr5 fr" id="issue_confirm"> 保存</a>-->
|
||||||
<input onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="sy_btn_blue fr mr5" onfocus="this.blur()" id="issue_confirm" style="width: 28px;color: #FFF" value="保存">
|
<input onclick="issue_create();" class="sy_btn_blue fr mr5" onfocus="this.blur()" id="issue_confirm" style="width: 28px;color: #FFF" value="保存">
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="fl pro_new_conbox_right ml10 mb10">
|
<ul class="fl pro_new_conbox_right ml10 mb10">
|
||||||
|
@ -74,28 +74,28 @@
|
||||||
<label class="fl ml5" for="issue_is_private" id="issue_is_private_tips"><%= l(:field_set_private_tips)%></label>
|
<label class="fl ml5" for="issue_is_private" id="issue_is_private_tips"><%= l(:field_set_private_tips)%></label>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li class=" clear" id="versions_assigned_id">
|
<li class="clear" id="versions_assigned_id">
|
||||||
<% if @issue.safe_attribute? 'assigned_to_id' %>
|
<% if @issue.safe_attribute? 'assigned_to_id' %>
|
||||||
<%= f.select :assigned_to_id, assigned_options_for_select(@issue.assignable_users, @issue.assigned_to),
|
<%= f.select :assigned_to_id, assigned_options_for_select(@issue.assignable_users, @issue.assigned_to),
|
||||||
{:required => @issue.required_attribute?('assigned_to_id'), :no_label => true},
|
{:required => @issue.required_attribute?('assigned_to_id'), :no_label => true},
|
||||||
{:onchange => "change_assigned_tip();",:class => "w150"} %>
|
{:onchange => "change_assigned_tip();",:class => "w150"} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li class=" clear" id="assigned_to_tips">
|
<li class="clear" id="assigned_to_tips">
|
||||||
<%= @issue.assigned_to.nil? ? "未指派" : "已指派" %>
|
<%= @issue.assigned_to.nil? ? "未指派" : "已指派" %>
|
||||||
</li>
|
</li>
|
||||||
<li class=" clear" >
|
<li class="clear" >
|
||||||
<%= 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},
|
||||||
{:onchange => "change_milestone_tip();", :class => "w150"} %>
|
{:onchange => "change_milestone_tip();", :class => "w150"} %>
|
||||||
</li>
|
</li>
|
||||||
<li class=" clear" id="milestone_option_tips">
|
<li class="clear" id="milestone_option_tips">
|
||||||
<%= @issue.fixed_version.nil? ? "未选择里程碑" : "已选择里程碑" %>
|
<%= @issue.fixed_version.nil? ? "未选择里程碑" : "已选择里程碑" %>
|
||||||
<% if params[:action] == "new" %>
|
<% if params[:action] == "new" %>
|
||||||
<%= link_to "", new_project_version_path(@project, :is_issue => true, :issue_project_id => @project.id), :class => "pic_add mt5 ml5 fr", :remote => true %>
|
<%= link_to "", new_project_version_path(@project, :is_issue => true, :issue_project_id => @project.id), :class => "pic_add mt5 ml5 fr", :remote => true %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li class=" clear" style="border:1px solid #c8c8c8;">
|
<li class="clear" style="border:1px solid #c8c8c8;">
|
||||||
<% if @issue.safe_attribute? 'start_date' %>
|
<% if @issue.safe_attribute? 'start_date' %>
|
||||||
<%= f.text_field :start_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
|
<%= f.text_field :start_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
|
||||||
:required => @issue.required_attribute?('start_date'), :onchange => "issue_start_date_change();",
|
:required => @issue.required_attribute?('start_date'), :onchange => "issue_start_date_change();",
|
||||||
|
@ -103,41 +103,86 @@
|
||||||
<%= calendar_for('issue_start_date', 'start_date') if @issue.leaf? %>
|
<%= calendar_for('issue_start_date', 'start_date') if @issue.leaf? %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li class=" clear" id="option_start_date_tips">
|
<li class="clear" id="option_start_date_tips">
|
||||||
<%= @issue.start_date.nil? ? "未选择开始日期" : "已选择开始日期" %>
|
<%= @issue.start_date.nil? ? "未选择开始日期" : "已选择开始日期" %>
|
||||||
</li>
|
</li>
|
||||||
<li class=" clear" style="border:1px solid #c8c8c8;">
|
<li class="clear" style="border:1px solid #c8c8c8;">
|
||||||
<label class="label02" ></label>
|
<label class="label02" ></label>
|
||||||
<% if @issue.safe_attribute? 'due_date' %>
|
<% if @issue.safe_attribute? 'due_date' %>
|
||||||
<%= f.text_field :due_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
|
<%= f.text_field :due_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
|
||||||
:required => @issue.required_attribute?('due_date'), :onchange => "issue_end_date_change();",
|
:required => @issue.required_attribute?('due_date'), :onchange => "issue_end_date_change();",
|
||||||
:class => "fl calendar_input",:style => "width: 170px;", :placeholder => "请选择结束日期" %>
|
:class => "fl calendar_input",:style => "width: 170px;", :placeholder => "请选择结束日期" %>
|
||||||
<%= calendar_for('issue_due_date', 'start_date') if @issue.leaf? %>
|
<%= calendar_for('issue_due_date', 'start_date') if @issue.leaf? %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li class=" clear " id="option_end_date_tips">
|
<li class="clear " id="option_end_date_tips">
|
||||||
<%= @issue.due_date.nil? ? "未选择结束日期" : "已选择结束日期" %>
|
<%= @issue.due_date.nil? ? "未选择结束日期" : "已选择结束日期" %>
|
||||||
</li>
|
</li>
|
||||||
<li class=" clear">
|
<li class="clear">
|
||||||
<% 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,
|
<%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true,
|
||||||
:required => @issue.required_attribute?('estimated_hours'), :placeholder => "请填写预计工时" %>
|
:required => @issue.required_attribute?('estimated_hours'), :placeholder => "请填写预计工时" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li class=" clear"><%= l(:field_estimated_hours) %></li>
|
<li class="clear"><%= l(:field_estimated_hours) %></li>
|
||||||
|
|
||||||
<li class=" clear">
|
<li class="clear">
|
||||||
<% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %>
|
<% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %>
|
||||||
<%= f.select :done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
|
<%= f.select :done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
|
||||||
{:required => @issue.required_attribute?('done_ratio'), :no_label => true},
|
{:required => @issue.required_attribute?('done_ratio'), :no_label => true},
|
||||||
:onchange => "PrecentChange(this.value)",
|
:onchange => "PrecentChange(this.value)",
|
||||||
:class => "w150" %>
|
:class => "w150" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li class=" clear">完成度</li>
|
|
||||||
</li>
|
</li>
|
||||||
|
<li class="clear">完成度</li>
|
||||||
|
<% if @project.gpid %>
|
||||||
|
<%#= hidden_field_tag @issue_commit_ids %>
|
||||||
|
<input value="" name="commit_ids" id="commit_ids" type="hidden">
|
||||||
|
<li class="clear"><span>关联Commit</span>
|
||||||
|
<a href="javascript:void(0)" onclick="get_issue_commit_ids('issue_commit_ids','<%= @project.id %>');">
|
||||||
|
<span class='btn-commit btn-blue mt-2 fr'>+</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<div id="issue_commit_ids">
|
||||||
|
<%= render :partial => "issues/issue_commit_ids", :locals => {:f => f} %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
<script>
|
<script>
|
||||||
|
function issue_create(){
|
||||||
|
var issue_commit_ids = $("#issue_commit_ids .commit_id_value");
|
||||||
|
var str = "";
|
||||||
|
for(var i=0; i < issue_commit_ids.length; i++){
|
||||||
|
str += $(issue_commit_ids[i]).html();
|
||||||
|
if(i != issue_commit_ids.length -1){
|
||||||
|
str += ",";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
issue_desc_editor.sync();
|
||||||
|
$('#commit_ids').val(str);
|
||||||
|
$('#issue-form').submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_issue_commit_ids(id, project_id){
|
||||||
|
var issue_commit_ids = $("#issue_commit_ids .commit_id_value");
|
||||||
|
var str = "";
|
||||||
|
for(var i=0; i < issue_commit_ids.length; i++){
|
||||||
|
str += $(issue_commit_ids[i]).html();
|
||||||
|
if(i != issue_commit_ids.length -1){
|
||||||
|
str += ",";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$.ajax({
|
||||||
|
url: '<%= url_for(:controller => 'issues', :action => 'issue_commits') %>',
|
||||||
|
type:'get',
|
||||||
|
data:{
|
||||||
|
project_id: project_id,
|
||||||
|
issue_commit_ids: str
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function change_assigned_tip() {
|
function change_assigned_tip() {
|
||||||
if( document.getElementById('issue_assigned_to_id').options[document.getElementById('issue_assigned_to_id').selectedIndex].value == 0 ){
|
if( document.getElementById('issue_assigned_to_id').options[document.getElementById('issue_assigned_to_id').selectedIndex].value == 0 ){
|
||||||
$('#assigned_to_tips').html("未指派");
|
$('#assigned_to_tips').html("未指派");
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<% if @issue_commit_ids %>
|
||||||
|
<% @issue_commit_ids.each do |commit_id| %>
|
||||||
|
<div class="btn btn-blue mb5">
|
||||||
|
<%= link_to commit_id[0,8], {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit_id}, :target => "_blank", :class => "commit_id_value" %>
|
||||||
|
<%= link_to "×", issue_commit_delete_issues_path(:commit_id => commit_id, :project_id => @project.id, :issue_commit_ids => @issue_commit_ids, :issue_id => @issue.try(:id)), :remote => true, :style => "color:#fff;" %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% else %>
|
||||||
|
<div class="c_grey">暂无</div>
|
||||||
|
<% end %>
|
|
@ -0,0 +1,42 @@
|
||||||
|
<div style="width:745px;">
|
||||||
|
<div class="muban_popup_top">
|
||||||
|
<h3 class="fl">关联Commit</h3>
|
||||||
|
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="muban_popup_con " >
|
||||||
|
<div class="newupload_conbox " >
|
||||||
|
<% if @commits.blank? %>
|
||||||
|
<%= render :partial => "projects/no_data" %>
|
||||||
|
<% else %>
|
||||||
|
<div class=" clear">
|
||||||
|
<div class="cl"></div>
|
||||||
|
<%= form_tag(url_for(:controller => 'issues', :action => 'issue_commits', :project_id => @project.id, :type => "search"),
|
||||||
|
:remote => true, :method => 'get', :id => 'issue_commit_form', :class => "fl") do %>
|
||||||
|
<ul class="clear lightheight28 fl mr100">
|
||||||
|
<li class="mb10 clear fl">
|
||||||
|
<span class=" fl"> 分支 : </span>
|
||||||
|
<%= select_tag :branch, options_for_select(["#{@default_branch}"]+ @branch_names, @rev),
|
||||||
|
:class => "fl newupload_select", :style => "width:180px;height:28px;",
|
||||||
|
:onchange => "$('#issue_commit_form').submit();" %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="hw_search_box fr mb10" >
|
||||||
|
<input type="text" name="search" placeholder="输入资源关键词进行搜索" class="hw_search-input" style="width:300px;">
|
||||||
|
<%= submit_tag '', :class => 'hw_btn_search', :onfocus => 'this.blur();', :style => 'border-style:none' %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div id="issue_commit_list">
|
||||||
|
<%= render :partial => "issues/issue_commits_list" %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function remote_function(id) {
|
||||||
|
$(id).submit();
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1,59 @@
|
||||||
|
<%= form_tag(url_for(:controller => 'issues', :action => 'commit_for_issue', :project_id => @project.id), :remote => true, :method => 'get', :id => 'commit_for_issue', :class => "fl") do %>
|
||||||
|
<table class="newupload_table " cellspacing="0" cellpadding="0">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="newupload_td01"> </th>
|
||||||
|
<th class="newupload_td04">修订号</th>
|
||||||
|
<th>描述</th>
|
||||||
|
<th class="newupload_td04">提交者</th>
|
||||||
|
<th class="newupload_td05">提交日期</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% @commits.each do |commit| %>
|
||||||
|
<tr>
|
||||||
|
<td class="newupload_td01"><input type="checkbox" value="<%= commit.short_id %>" name="checkbox1[]"> </td>
|
||||||
|
<td class="newupload_td04"><span class="newupload_table_name">
|
||||||
|
<%= link_to commit.id[0,8], {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank" %></span>
|
||||||
|
</td>
|
||||||
|
<td class="newupload_td02"><p><%= commit.title %></p></td>
|
||||||
|
<td class="newupload_td04"><span class="newupload_table_name"><%= link_to_user_mail(commit.author_email, "") %></span></td>
|
||||||
|
<td class="newupload_td05"><%= format_date(commit.created_at) %></td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
<input value="" name="issue_for_commit_ids" id="issue_for_commit_ids" type="hidden">
|
||||||
|
</table>
|
||||||
|
<div class="clear">
|
||||||
|
<div class="clear fl mt10 mb10">
|
||||||
|
<a href="javascript:void(0);" class="sy_btn_blue fl" onclick="search_and_branch_for_commit_ids();">确 定</a>
|
||||||
|
<a href="javascript:void(0);" class="sy_btn_grey fl ml10" onclick="hideModal()">取 消</a>
|
||||||
|
</div>
|
||||||
|
<div style="text-align:center;">
|
||||||
|
<div class="pages" style="width:auto; display:inline-block;">
|
||||||
|
<ul id="homework_pository_ref_pages">
|
||||||
|
<%= pagination_links_full @commits_pages, @commits_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function search_and_branch_for_commit_ids(){
|
||||||
|
var issue_commit_ids = $("#issue_commit_ids .commit_id_value");
|
||||||
|
var str = "";
|
||||||
|
for(var i=0; i < issue_commit_ids.length; i++){
|
||||||
|
str += $(issue_commit_ids[i]).html();
|
||||||
|
if(i != issue_commit_ids.length -1){
|
||||||
|
str += ",";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
alert(str);
|
||||||
|
$('#issue_for_commit_ids').val(str);
|
||||||
|
$('#commit_for_issue').submit();
|
||||||
|
hideModal();
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1 @@
|
||||||
|
$("#issue_commit_ids").html('<%= escape_javascript(render :partial => 'issues/issue_commit_ids') %>');
|
|
@ -1,6 +1,7 @@
|
||||||
<h3><%=h "#{@issue.tracker.name} ##{@issue.id}" %></h3>
|
<div id="issue_edit_show" class="mt10 pro_newissue_con">
|
||||||
|
<%= render :partial => 'issues/edit' %>
|
||||||
|
<% content_for :header_tags do %>
|
||||||
|
<%= robot_exclusion_tag %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= render :partial => 'edit' %>
|
</div>
|
||||||
<% content_for :header_tags do %>
|
|
||||||
<%= robot_exclusion_tag %>
|
|
||||||
<% end %>
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
$("#issue_commit_ids").html('<%= escape_javascript(render :partial => 'issues/issue_commit_ids') %>');
|
|
@ -0,0 +1,7 @@
|
||||||
|
<% if @type %>
|
||||||
|
$("#issue_commit_list").html('<%= escape_javascript(render :partial => 'issues/issue_commits_list') %>');
|
||||||
|
<% else %>
|
||||||
|
var htmlvalue = "<%= escape_javascript(render :partial => 'issues/issue_commits') %>";
|
||||||
|
pop_box_new(htmlvalue,760,600);
|
||||||
|
<% end %>
|
||||||
|
|
|
@ -5,16 +5,7 @@
|
||||||
<script>
|
<script>
|
||||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%", "<%= @issue.class.name %>");
|
sd_create_editor_from_data(<%= @issue.id%>, null, "100%", "<%= @issue.class.name %>");
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript">
|
|
||||||
$(function(){
|
|
||||||
$("#RSide").removeAttr("id");
|
|
||||||
$("#Container").css("width","1000px");
|
|
||||||
is_edit = <%= @is_edit.present? && @is_edit == true %>
|
|
||||||
if(is_edit) {
|
|
||||||
issueEditShow();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<div class="mt10 mb10" id =issue_show_total"">
|
<div class="mt10 mb10" id =issue_show_total"">
|
||||||
<div class="banner-big f16 fontGrey3">
|
<div class="banner-big f16 fontGrey3">
|
||||||
问题跟踪
|
问题跟踪
|
||||||
|
@ -46,9 +37,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="issue_edit_show" class="mt10 pro_newissue_con">
|
|
||||||
<%= render :partial => 'issues/edit'%>
|
|
||||||
</div>
|
|
||||||
<ul class="fr pro_new_conbox_right" id="project_issue_info_show">
|
<ul class="fr pro_new_conbox_right" id="project_issue_info_show">
|
||||||
<li class="clear">
|
<li class="clear">
|
||||||
<span class="pro_new_conbox_leftspan fl">当前状态</span>
|
<span class="pro_new_conbox_leftspan fl">当前状态</span>
|
||||||
|
@ -86,6 +74,11 @@
|
||||||
<span class="pro_new_conbox_rightspan fl ml10"><%= @issue.done_ratio %>%</span>
|
<span class="pro_new_conbox_rightspan fl ml10"><%= @issue.done_ratio %>%</span>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<li class="clear"><span class="pro_new_conbox_leftspan mb5">关联Commit</span>
|
||||||
|
<div id="issue_commit_ids">
|
||||||
|
<%= render :partial => "issues/issue_commit_ids" %>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -54,14 +54,23 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sy_class_id fl">
|
<div class="sy_class_id fl">
|
||||||
<p>邀 请 码<br />
|
<p style="margin: <%=is_teacher ? '8px auto' : '24px auto 0px' %>">邀 请 码<br />
|
||||||
<span class="sy_corange">
|
<span class="sy_corange">
|
||||||
<% if User.current.admin? || User.current.member_of_course?(@course) %>
|
<% if @course.invite_code_halt == 0 %>
|
||||||
<%=@course.generate_invite_code %>
|
<% if User.current.admin? || User.current.member_of_course?(@course) %>
|
||||||
|
<%=@course.generate_invite_code %>
|
||||||
|
<% else %>
|
||||||
|
<span class="f12">请询问老师</span>
|
||||||
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="f12">请询问老师</span>
|
已停用
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
|
<% if is_teacher && @course.invite_code_halt == 0 %>
|
||||||
|
<a href="javascript:void(0);" class="btn_grey_mid" style="margin-bottom: 12px;" onclick="alert_halt_code();">停 用</a>
|
||||||
|
<% elsif is_teacher && @course.invite_code_halt == 1 %>
|
||||||
|
<a href="<%=set_invite_code_halt_course_path(@course) %>" data-remote="true" class="btn_grey_mid" style="margin-bottom: 12px;">启 用</a>
|
||||||
|
<% end %>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="sy_class_info fl ml15">
|
<div class="sy_class_info fl ml15">
|
||||||
|
@ -102,10 +111,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% if is_teacher %>
|
<% if is_teacher %>
|
||||||
<div class="invite_code_tip_box fontGrey2">
|
<div class="invite_code_tip_box fontGrey2" id="invite_code_tip_box">
|
||||||
<em></em>
|
<em></em>
|
||||||
<span></span>
|
<span></span>
|
||||||
<p class="mt10 mb5">请将邀请码告诉学生和教辅</p>
|
<p class="mt10 mb5"><%= @course.invite_code_halt == 0 ? "请将邀请码告诉学生和教辅" : "邀请码已停用,学生和教辅" %></p>
|
||||||
<p class="mb10">他们可以主动加入班级</p>
|
<p class="mb10"><%= @course.invite_code_halt == 0 ? "他们可以主动加入班级" : "不可以主动加入班级了" %></p>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
|
@ -147,7 +147,7 @@
|
||||||
<%# 课程英雄榜 %>
|
<%# 课程英雄榜 %>
|
||||||
<%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
|
<%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
|
||||||
<div class="sy_class_leftbox" >
|
<div class="sy_class_leftbox" >
|
||||||
<h3 class="fontGrey7">班级推荐</h3>
|
<h3 class="fontGrey7">推荐</h3>
|
||||||
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
|
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
|
||||||
</div>
|
</div>
|
||||||
<%# 更新访问数,刷新的时候更新访问次数 %>
|
<%# 更新访问数,刷新的时候更新访问次数 %>
|
||||||
|
@ -279,10 +279,19 @@
|
||||||
|
|
||||||
function delete_confirm(){
|
function delete_confirm(){
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f14">您确认要退出该班级吗?</p><div class="cl"></div><a href="<%=join_path(:object_id => @course.id) %>" class="fr sy_btn_blue mr85 mt10" data-method="delete" data-remote="true">确 定</a>'+
|
'<div class="clear mt15"><p class="text_c f14">您确认要退出该班级吗?</p><div class="cl"></div>'+
|
||||||
|
'<a href="<%=join_path(:object_id => @course.id) %>" class="fr sy_btn_blue mr85 mt10" data-method="delete" data-remote="true">确 定</a>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取 消</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取 消</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function alert_halt_code(){
|
||||||
|
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
|
'<div class="clear mt15"><p class="text_c f14">邀请码停用后,用户不能主动加入该班级了</p><p class="text_c mt10 f14">您是否确认停用</p><div class="cl"></div>'+
|
||||||
|
'<a href="<%=set_invite_code_halt_course_path(@course) %>" class="fr sy_btn_blue mr135 mt10" data-remote="true">确 定</a>'+
|
||||||
|
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取 消</a></div></div>';
|
||||||
|
pop_box_new(htmlvalue, 400, 180);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</html>
|
</html>
|
|
@ -7,17 +7,26 @@
|
||||||
<% parents_rely = get_reply_parents parents_rely, comment %>
|
<% parents_rely = get_reply_parents parents_rely, comment %>
|
||||||
<% length = parents_rely.length %>
|
<% length = parents_rely.length %>
|
||||||
<div id="comment_reply_<%=comment.id %>">
|
<div id="comment_reply_<%=comment.id %>">
|
||||||
<% if length <= 2 %>
|
<% if length <= 5 %>
|
||||||
<%=render :partial => 'projects/project_issue_comments_reply', :locals => {:comment => comment.parent, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
<%=render :partial => 'projects/project_issue_comments_reply', :locals => {:comment => comment.parent, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="orig_cont clearfix">
|
<div class="orig_cont clearfix">
|
||||||
<div class="orig_cont clearfix">
|
<div class="orig_cont clearfix">
|
||||||
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[length - 1], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
<div class="orig_cont clearfix">
|
||||||
</div>
|
<div class="orig_cont clearfix">
|
||||||
<div class="orig_cont_hide_issue clearfix">
|
<div class="orig_cont clearfix">
|
||||||
<span class="orig_icon" >↓ </span>
|
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[length - 1], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
<span class="orig_icon" style="display:none;" > ↑</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
|
</div>
|
||||||
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => 'is_project_issue', :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %>
|
<div class="orig_cont_hide clearfix">
|
||||||
|
<span class="orig_icon" >↓ </span>
|
||||||
|
<span class="orig_icon" style="display:none;" > ↑</span><span class="">已经隐藏<%=(length - 5).to_s %>个楼层</span>
|
||||||
|
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => 'is_project_issue', :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[3], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[2], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[1], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
</div>
|
</div>
|
||||||
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[0], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[0], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,17 +7,26 @@
|
||||||
<% parents_rely = get_reply_parents_no_root parents_rely, comment %>
|
<% parents_rely = get_reply_parents_no_root parents_rely, comment %>
|
||||||
<% length = parents_rely.length %>
|
<% length = parents_rely.length %>
|
||||||
<div id="comment_reply_<%=comment.id %>">
|
<div id="comment_reply_<%=comment.id %>">
|
||||||
<% if length <= 2 %>
|
<% if length <= 5 %>
|
||||||
<%=render :partial => 'projects/journal_comment_reply', :locals => {:comment => comment.parent, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
<%=render :partial => 'projects/journal_comment_reply', :locals => {:comment => comment.parent, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="orig_cont clearfix">
|
<div class="orig_cont clearfix">
|
||||||
<div class="orig_cont clearfix">
|
<div class="orig_cont clearfix">
|
||||||
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
<div class="orig_cont clearfix">
|
||||||
</div>
|
<div class="orig_cont clearfix">
|
||||||
<div class="orig_cont_hide_issue clearfix">
|
<div class="orig_cont clearfix">
|
||||||
<span class="orig_icon" >↓ </span>
|
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
<span class="orig_icon" style="display:none;" > ↑</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
|
</div>
|
||||||
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => 'is_project_message', :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %>
|
<div class="orig_cont_hide clearfix">
|
||||||
|
<span class="orig_icon" >↓ </span>
|
||||||
|
<span class="orig_icon" style="display:none;" > ↑</span><span class="">已经隐藏<%=(length - 5).to_s %>个楼层</span>
|
||||||
|
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => 'is_project_message', :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[3], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[2], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[1], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
</div>
|
</div>
|
||||||
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[0], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[0], :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -14,9 +14,19 @@
|
||||||
<% commits.each do |commit| %>
|
<% commits.each do |commit| %>
|
||||||
<li class="clear">
|
<li class="clear">
|
||||||
<span class="fl c_grey ml15 "><%= time_tag(commit.created_at) %>前</span>
|
<span class="fl c_grey ml15 "><%= time_tag(commit.created_at) %>前</span>
|
||||||
<%= link_to get_user_by_mail(commit.author_email).show_name, user_path(get_user_by_mail(commit.author_email)), :target => "_blank", :class => "pullreques_pull_name fl ml10" %>
|
<%= link_to_user_mail(commit.author_email, "pullreques_pull_name fl ml10") %>
|
||||||
<p class="pullreques_pull_txt ml10 fl"><%= commit.title %></p>
|
<p class="pullreques_pull_txt ml10 fl"><%= commit.title %></p>
|
||||||
<%= link_to truncate(commit.short_id, :length => 20), {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank", :class => "fr mr15 c_grey" %>
|
<%= link_to truncate(commit.short_id, :length => 20), {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank", :class => "fr mr15 c_grey" %>
|
||||||
|
<% get_commit_issues(commit.short_id, @project.id, 0).each do |issue_id| %>
|
||||||
|
<div class="btn-commit-issue btn-blue mb5 mr5 fr">
|
||||||
|
<% if issue_id == "more" %>
|
||||||
|
<%= link_to "更多", {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => commit.id}, :target => "_blank", :class => "commit_id_value mr5" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to "##{issue_id}", issue_path(issue_id), :target => "_blank", :class => "commit_id_value mr5" %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -8,12 +8,18 @@
|
||||||
<div class="c_grey02 mb10">
|
<div class="c_grey02 mb10">
|
||||||
<p><%= @commit_details.message %></p>
|
<p><%= @commit_details.message %></p>
|
||||||
</div>
|
</div>
|
||||||
<!--<div class=" clear mb10">-->
|
<div class=" clear mb10">
|
||||||
<!--<p class="fb">关联Issue:</p>-->
|
<p class="fb c_grey">关联Issue:</p>
|
||||||
<!--<a href="javascript:void(0);" class="btn-small fl mr10">#123</a>-->
|
<% get_commit_issues(@commit_details.short_id, @project.id, 1).each do |issue_id| %>
|
||||||
<!--<a href="javascript:void(0);" class="btn-small fl mr10">#123</a>-->
|
<div class="btn-commit-issue btn-blue mb5 mr5">
|
||||||
<!--<a href="javascript:void(0);" class="btn-small fl mr10">#123</a>-->
|
<% if issue_id == "more" %>
|
||||||
<!--</div>-->
|
<%= link_to "更多", {:controller => 'repositories', :action => 'commit_diff', :id => @project.id, :changeset => @commit_details.id}, :target => "_blank", :class => "commit_id_value mr5" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to "##{issue_id}", issue_path(issue_id), :target => "_blank", :class => "commit_id_value mr5" %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
<li class="commit js-toggle-container">
|
<li class="commit js-toggle-container">
|
||||||
<%= render :partial => 'commit_details', :locals => {:changeset => @commit_details} %>
|
<%= render :partial => 'commit_details', :locals => {:changeset => @commit_details} %>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
<div id="popbox02">
|
<div id="muban_popup_box" style="width:400px;">
|
||||||
<div class="ni_con">
|
<div class="muban_popup_top">
|
||||||
<h2>禁用匿评</h2>
|
<h3 class="fl">
|
||||||
<p>
|
提示
|
||||||
禁用匿评后学生将不能对作品进行互评,且匿评不能再开启,是否确定禁用匿评?
|
</h3>
|
||||||
</p>
|
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
|
||||||
<div class="ni_btn">
|
<div class="cl"></div>
|
||||||
<a href="javascript:" class="tijiao" onclick="clickOK('<%= forbidden_anonymous_comment_student_work_path(:homework=>@homework, :user_activity_id => user_activity_id, :hw_status => hw_status)%>');" style="margin-bottom: 20px;" >
|
</div>
|
||||||
确 定
|
<div class="muban_popup_con ml30 mr30 mt20 mb10 clear" >
|
||||||
</a>
|
<p class="mb10 f14 text_c">评分比例将恢复默认值,您可以在评分设置中进行修改</p>
|
||||||
<a href="javascript:" class="tijiao" onclick="clickCanel();" style="margin-bottom: 20px;">
|
<% if @homework.anonymous_comment == 0%>
|
||||||
取 消
|
<p class="mb10 f14 text_c">是否确定禁用匿评</p>
|
||||||
</a>
|
<% else %>
|
||||||
</div>
|
<p class="mb10 f14 text_c">是否确定启用匿评</p>
|
||||||
|
<% end %>
|
||||||
|
<a href="javascript:void(0);" class="fl sy_btn_blue" style="margin-left: 114px;" onclick="clickOK('<%= forbidden_anonymous_comment_student_work_path(:homework=>@homework, :user_activity_id => user_activity_id, :hw_status => hw_status)%>');">确定</a>
|
||||||
|
<a href="javascript:void(0);" class="fl sy_btn_grey ml5" onclick="hideModal();">取消</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -0,0 +1,64 @@
|
||||||
|
<div id="muban_popup_box" style="width:400px;">
|
||||||
|
<div class="muban_popup_top">
|
||||||
|
<h3 class="fl">更换项目</h3>
|
||||||
|
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="muban_popup_con clear ml30 mr30 mt10">
|
||||||
|
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'change_project',:homework => @homework.id},:method => "post", :remote => true) do |f|%>
|
||||||
|
<input type="text" name="project" placeholder="输入项目名称进行搜索" class="searchResourcePopup mb10" />
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p id="no_search_result" class="c_red f14" style="width:320px;display: none">您当前尚未创建任何项目,请先创建项目再关联。</p>
|
||||||
|
<ul id="search_project_list" class="maxHeight200"></ul>
|
||||||
|
<p id="notes" class="c_red"></p>
|
||||||
|
<a href="javascript:void(0);" class="sy_btn_blue fr" onclick="clickOK();">确定</a>
|
||||||
|
<a href="javascript:void(0);" class="sy_btn_grey fr mr5" onclick="clickCanel();">取消</a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var lastSearchCondition = '';
|
||||||
|
var count = 0;
|
||||||
|
function search_pros(e){
|
||||||
|
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
lastSearchCondition = $(e.target).val().trim();
|
||||||
|
$.ajax({
|
||||||
|
url: '<%= url_for(:controller => 'student_work', :action => 'search_user_projects') %>'+'?name='+ e.target.value,
|
||||||
|
type:'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function throttle(method,context,e){
|
||||||
|
clearTimeout(method.tId);
|
||||||
|
method.tId=setTimeout(function(){
|
||||||
|
method.call(context,e);
|
||||||
|
},500);
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询项目
|
||||||
|
$("input[name='project']").on('input', function (e) {
|
||||||
|
throttle(search_pros,window,e);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
$.ajax({
|
||||||
|
url: '<%= url_for(:controller => 'student_work', :action => 'search_user_projects') %>'+'?first=1',
|
||||||
|
type:'get'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function clickOK() {
|
||||||
|
var radio = $("input[name='projectName']:checked");
|
||||||
|
if(radio.length < 1) {
|
||||||
|
$("#notes").html("请先选择一个项目");
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
$("#muban_popup_box").find('form').submit();
|
||||||
|
hideModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -5,16 +5,15 @@
|
||||||
<div class="syllabus_class_w fontGrey3" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(st)%>')">
|
<div class="syllabus_class_w fontGrey3" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(st)%>')">
|
||||||
<%= link_to(image_tag(url_to_avatar(st.user),:width =>"40",:height => "40", :style => "display:block;"),user_activities_path(st.user), :class => "fl") %>
|
<%= link_to(image_tag(url_to_avatar(st.user),:width =>"40",:height => "40", :style => "display:block;"),user_activities_path(st.user), :class => "fl") %>
|
||||||
<% if !is_expand %>
|
<% if !is_expand %>
|
||||||
<span class="fl student_work_<%= st.id%>" style="width:120px;">
|
<span class="fl" style="width:120px;">
|
||||||
<span class="fl hidden ml5" style="max-width:75px;"><%= st.user.show_name %></span>
|
<%= link_to st.user.show_name + "(组长)", user_path(st.user), :class => "fl hidden ml5 linkGrey", :style => "max-width:75px;" %>
|
||||||
<span class="fl">(组长)</span>
|
|
||||||
</span>
|
</span>
|
||||||
<span class="fl hidden student_work_<%= st.id%>" style="width:105px; text-align: center">
|
<span class="fl hidden student_work_<%= st.id%>" style="width:105px; text-align: center">
|
||||||
<%= st.user.user_extensions.student_id.nil? || st.user.user_extensions.student_id == "" ? "--" : st.user.user_extensions.student_id%>
|
<%= st.user.user_extensions.student_id.nil? || st.user.user_extensions.student_id == "" ? "--" : st.user.user_extensions.student_id%>
|
||||||
</span>
|
</span>
|
||||||
<% else %>
|
<% else %>
|
||||||
<span class="fl student_work_<%= st.id%>" style="width:120px;">
|
<span class="fl" style="width:120px;">
|
||||||
<span class="fl hidden ml5" style="max-width:75px;"><%= st.user.show_name %></span>
|
<%= link_to st.user.show_name, user_path(st.user), :class => "fl hidden ml5 linkGrey", :style => "max-width:75px;" %>
|
||||||
</span>
|
</span>
|
||||||
<span class="fl student_work_<%= st.id%> hidden" style="width:105px; text-align: center">
|
<span class="fl student_work_<%= st.id%> hidden" style="width:105px; text-align: center">
|
||||||
<%= st.user.user_extensions.student_id.nil? || st.user.user_extensions.student_id == "" ? "--" : st.user.user_extensions.student_id%>
|
<%= st.user.user_extensions.student_id.nil? || st.user.user_extensions.student_id == "" ? "--" : st.user.user_extensions.student_id%>
|
||||||
|
|
|
@ -13,15 +13,15 @@
|
||||||
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %>
|
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %>
|
||||||
</td>
|
</td>
|
||||||
<% if @homework.homework_type != 3 %>
|
<% if @homework.homework_type != 3 %>
|
||||||
<td class="<%= @homework.homework_type == 1 ? (@homework.anonymous_comment == 1 ? 'hworkStName130' : 'hworkStName100') : (@homework.anonymous_comment == 1 ? 'hworkStName110' : 'hworkStName') %> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
<td class="<%= @homework.homework_type == 1 ? (@homework.anonymous_comment == 1 ? 'hworkStName130' : 'hworkStName100') : (@homework.anonymous_comment == 1 ? 'hworkStName110' : 'hworkStName') %> pr10 float-none" title="<%= student_work.user.show_name%>" style="cursor:pointer;">
|
||||||
<%= student_work.user.show_name%>
|
<%= link_to student_work.user.show_name ,user_path(student_work.user) %>
|
||||||
</td>
|
</td>
|
||||||
<td class="<%= @homework.homework_type == 1 ? (@homework.anonymous_comment == 1 ? 'hworkStName130' : 'hworkStID90') : (@homework.anonymous_comment == 1 ? 'hworkStID100' : 'hworkStID') %> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
<td class="<%= @homework.homework_type == 1 ? (@homework.anonymous_comment == 1 ? 'hworkStName130' : 'hworkStID90') : (@homework.anonymous_comment == 1 ? 'hworkStID100' : 'hworkStID') %> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||||
</td>
|
</td>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> width130" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
<td class="hworkName float-none pr10 width130" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||||
<div>
|
<div>
|
||||||
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "StudentName break_word"%>
|
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "StudentName break_word"%>
|
||||||
</div>
|
</div>
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% elsif @homework.homework_detail_group.base_on_project == 0 %>
|
<% elsif @homework.homework_detail_group.base_on_project == 0 %>
|
||||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> <%=@homework.anonymous_comment == 1 ? 'width280' : 'width210' %>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
<td class="hworkName float-none pr10 <%=@homework.anonymous_comment == 1 ? 'width280' : 'width210' %>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||||
<div>
|
<div>
|
||||||
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
<div class="homepagePostDes">
|
<div class="homepagePostDes">
|
||||||
<div class="homepagePostTo break_word mt-4">
|
<div class="homepagePostTo break_word mt-4">
|
||||||
<%= link_to homework.user.show_name, user_activities_path(homework.user_id), :class => "newsBlue mr15"%>
|
<%= link_to homework.user.show_name, user_activities_path(homework.user_id), :class => "newsBlue mr15"%>
|
||||||
TO
|
|
||||||
<%= link_to homework.course.name, course_path(homework.course_id), :class => "newsBlue"%>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle hidden fl m_w505">
|
<div class="homepagePostTitle hidden fl m_w505">
|
||||||
<% index = get_hw_index(homework, is_teacher) %>
|
<% index = get_hw_index(homework, is_teacher) %>
|
||||||
|
|
|
@ -121,13 +121,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
});
|
});
|
||||||
function show_upload(){
|
function show_upload(){
|
||||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
|
var htmlvalue = "<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>";
|
||||||
showModal('ajax-modal', '452px');
|
pop_box_new(htmlvalue, 500, 230);
|
||||||
$('#ajax-modal').siblings().remove();
|
|
||||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
|
||||||
$('#ajax-modal').parent().css("top","40%").css("left","46%");
|
|
||||||
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
|
||||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
|
||||||
}
|
}
|
||||||
function regex_des() {
|
function regex_des() {
|
||||||
if ($.trim($("#attachment_des").val()) == "") {
|
if ($.trim($("#attachment_des").val()) == "") {
|
||||||
|
|
|
@ -1,16 +1,21 @@
|
||||||
<div id="popbox02" style="">
|
<div id="muban_popup_box" style="width:400px;">
|
||||||
<span class="f16 fontBlue">关联项目</span>
|
<div class="muban_popup_top">
|
||||||
<a href="javascript:void(0);" class="popClose" onclick="clickCanel();"></a>
|
<h3 class="fl">关联项目</h3>
|
||||||
<%=form_tag url_for(:controller=>'student_work',:action=>'student_work_project',:homework=>@homework.id,:user_activity_id=>@user_activity_id,:hw_status =>@hw_status),:id =>'student_work_relate_project',:class=>'resourcesSearchBox',:remote => true do %>
|
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
|
||||||
<input type="text" name="project" placeholder="输入项目名称进行搜索" class="searchResourcePopup mb10" />
|
<div class="cl"></div>
|
||||||
<div class="cl"></div>
|
</div>
|
||||||
<p id="no_search_result" class="c_red" style="width:220px;display: none">您当前尚未创建任何项目,请先创建项目再关联。</p>
|
<div class="muban_popup_con clear ml30 mr30 mt10">
|
||||||
<ul id="search_project_list" class="maxHeight100"></ul>
|
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'student_work_project',:homework => @homework.id,:user_activity_id=>@user_activity_id,:hw_status =>@hw_status},:method => "post", :remote => true) do |f|%>
|
||||||
<p id="notes" class="c_red"></p>
|
<input type="text" name="project" placeholder="输入项目名称进行搜索" class="searchResourcePopup mb10" />
|
||||||
<div class="courseSendSubmit mt10"><a href="javascript:void(0);" class="sendSourceText" onclick="clickOK();">确定</a></div>
|
<div class="cl"></div>
|
||||||
<div class="courseSendCancel mt10"><a href="javascript:void(0);" class="sendSourceText" onclick="clickCanel();">取消</a></div>
|
<p id="no_search_result" class="c_red f14" style="width:320px;display: none">您当前尚未创建任何项目,请先创建项目再关联。</p>
|
||||||
<div class="cl"></div>
|
<ul id="search_project_list" class="maxHeight200"></ul>
|
||||||
<% end %>
|
<p id="notes" class="c_red"></p>
|
||||||
|
<a href="javascript:void(0);" class="sy_btn_blue fr" onclick="clickOK();">确定</a>
|
||||||
|
<a href="javascript:void(0);" class="sy_btn_grey fr mr5" onclick="clickCanel();">取消</a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var lastSearchCondition = '';
|
var lastSearchCondition = '';
|
||||||
|
@ -52,7 +57,7 @@
|
||||||
$("#notes").html("请先选择一个项目");
|
$("#notes").html("请先选择一个项目");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
$("#student_work_relate_project").submit();
|
$("#muban_popup_box").find('form').submit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
|
@ -3,18 +3,22 @@
|
||||||
<% allow_visit = project.status != 9 && (project.is_public || User.current.member_of?(project) || User.current.admin? || User.current.allowed_to?(:as_teacher, @homework.course)) %>
|
<% allow_visit = project.status != 9 && (project.is_public || User.current.member_of?(project) || User.current.admin? || User.current.allowed_to?(:as_teacher, @homework.course)) %>
|
||||||
<div class="syllabus_courses_list" style="cursor: default">
|
<div class="syllabus_courses_list" style="cursor: default">
|
||||||
<div class="sy_courses_open">
|
<div class="sy_courses_open">
|
||||||
|
<% projectUser = User.where("id=?",project.user_id).first %>
|
||||||
|
<% is_change = project.status == 9 && projectUser == User.current && @homework.student_works.has_committed.where("user_id = #{User.current.id}").count == 1 %>
|
||||||
<h3>
|
<h3>
|
||||||
<% if allow_visit %>
|
<% if allow_visit %>
|
||||||
<%= link_to "#{project.name}", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
<%= link_to "#{project.name}", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||||
<% elsif project.status != 9 %>
|
<% elsif project.status != 9 %>
|
||||||
<a href="javascript:void(0)" class="new_project_title fl" title="私有项目不可访问"><%=project.name %></a>
|
<a href="javascript:void(0)" class="new_project_title fl" title="私有项目不可访问"><%=project.name %></a>
|
||||||
<% else %>
|
<% else %>
|
||||||
<a href="javascript:void(0)" class="new_project_title fl" title="项目已删除"><%=project.name %></a>
|
<a href="javascript:void(0)" onclick="alert_notice_box();" class="new_project_title fl <%= is_change ? 'mw380' : '' %>" title="项目已删除"><%=project.name %></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
</h3>
|
</h3>
|
||||||
<span class="<%= project.is_public? ? 'syllabus_class_open' : 'syllabus_class_private' %> fl ml10 mt3 syllabus_class_property"><%= project.is_public? ? '公开' : '私有' %></span>
|
<span class="<%= project.is_public? ? 'syllabus_class_open' : 'syllabus_class_private' %> fl ml10 mt3 syllabus_class_property"><%= project.is_public? ? '公开' : '私有' %></span>
|
||||||
<% projectUser = User.where("id=?",project.user_id).first %>
|
<% if is_change %>
|
||||||
<%=link_to "<span class='fr grayTxt'>创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %>
|
<a href="javascript:void(0)" onclick="alert_change_project();" class="btn_grey_mid mt-5 ml10 fr">更换项目</a>
|
||||||
|
<% end %>
|
||||||
|
<%=link_to "<span class='fr grayTxt hidden mw150'>创建者:#{projectUser.show_name}</span>".html_safe, user_path(projectUser), :title => "#{projectUser.show_name}" %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
@ -31,3 +35,15 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div><!--syllabus_courses_box end-->
|
</div><!--syllabus_courses_box end-->
|
||||||
|
<script>
|
||||||
|
function alert_notice_box(){
|
||||||
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
|
'<div class="clear mt15"><p class="text_c f14">项目已删除,链接无效</p><div class="cl"></div>'+
|
||||||
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
||||||
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
|
}
|
||||||
|
function alert_change_project(){
|
||||||
|
var htmlvalue = "<%= escape_javascript(render :partial => 'student_work/change_project') %>";
|
||||||
|
pop_box_new(htmlvalue, 400, 285);
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -1,31 +1,33 @@
|
||||||
<% revise_attachment = work.attachments.where("attachtype = 7").first %>
|
<% revise_attachment = work.attachments.where("attachtype = 7").first %>
|
||||||
<% if @homework.end_time < Date.today %>
|
<% if @homework.end_time < Date.today %>
|
||||||
<% if revise_attachment && @is_teacher %>
|
<% if revise_attachment && work.user != User.current %>
|
||||||
<div class="resubAtt mb15">
|
<div class="resubAtt mb15">
|
||||||
<span class="resubTitle">追加修订附件</span>
|
<span class="resubTitle">作业修订附件</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb10" id="revise_attachment_div_<%=revise_attachment.id %>">
|
<div class="mb10" id="revise_attachment_div_<%=revise_attachment.id %>">
|
||||||
<span class="tit_fb"> 追加附件:</span>
|
<span class="tit_fb"> 追加附件:</span>
|
||||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %>
|
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %>
|
||||||
<span class="tit_fb">追加时间:</span><%=format_time revise_attachment.created_on.to_s %> (<%=revise_attachment_status @homework,revise_attachment %>)<br />
|
|
||||||
<% unless revise_attachment.description == "" %>
|
<% unless revise_attachment.description == "" %>
|
||||||
<span class="tit_fb break_word">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
|
<span class="tit_fb break_word">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
<div class="_notice_box ml5 text_c">注意:此处的附件是在作业截止日期过后提交的</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if work.user == User.current && !User.current.allowed_to?(:as_teacher, @homework.course) %>
|
<% if work.user == User.current && !User.current.allowed_to?(:as_teacher, @homework.course) %>
|
||||||
<div class="resubAtt mb15">
|
<div class="resubAtt mb15">
|
||||||
<span class="resubTitle">追加修订附件</span>
|
<span class="resubTitle">作业修订附件</span>
|
||||||
</div>
|
</div>
|
||||||
<% if revise_attachment %>
|
<% if revise_attachment %>
|
||||||
<div class="mb10" id="revise_attachment_div_<%=revise_attachment.id %>">
|
<div class="mb10" id="revise_attachment_div_<%=revise_attachment.id %>">
|
||||||
<span class="tit_fb"> 追加附件:</span>
|
<span class="tit_fb"> 追加附件:</span>
|
||||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %>
|
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %>
|
||||||
<span class="tit_fb">追加时间:</span><%=format_time revise_attachment.created_on.to_s %><br />
|
|
||||||
<% unless revise_attachment.description == "" %>
|
<% unless revise_attachment.description == "" %>
|
||||||
<span class="tit_fb break_word">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
|
<span class="tit_fb break_word">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="_notice_box ml5 text_c">注意:此处的附件是在作业截止日期过后提交的</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -125,13 +125,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
});
|
});
|
||||||
function show_upload(){
|
function show_upload(){
|
||||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
|
var htmlvalue = "<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>";
|
||||||
showModal('ajax-modal', '452px');
|
pop_box_new(htmlvalue, 500, 230);
|
||||||
$('#ajax-modal').siblings().remove();
|
|
||||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
|
||||||
$('#ajax-modal').parent().css("top","40%").css("left","46%");
|
|
||||||
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
|
||||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
|
||||||
}
|
}
|
||||||
function regex_des() {
|
function regex_des() {
|
||||||
if ($.trim($("#attachment_des").val()) == "") {
|
if ($.trim($("#attachment_des").val()) == "") {
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<%=link_to "提交作品", new_student_work_url_without_domain(@homework.id),:class => 'blueCir ml5 f12' %>
|
<%=link_to "提交作品", new_student_work_url_without_domain(@homework.id),:class => 'blueCir ml5 f12' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
|
<% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
|
||||||
<span class="f12 c_red">已提交且不可再修改,因为截止日期已过</span>
|
<span class="f12 c_red">截止日期已过,已提交且不可修改</span>
|
||||||
<% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
|
<% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
|
||||||
<% if @homework.homework_type == 3 %>
|
<% if @homework.homework_type == 3 %>
|
||||||
<span class="f12 c_red">组长已提交,组长还可修改</span>
|
<span class="f12 c_red">组长已提交,组长还可修改</span>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<ul class="ping_box_ul <%= is_last ? '' : 'ping_line'%> fl">
|
<ul class="ping_box_ul <%= is_last ? '' : 'ping_line'%> fl">
|
||||||
<% show_real_name = @is_teacher || score.user == User.current || score.reviewer_role != 3 %>
|
<% show_real_name = @is_teacher || score.user == User.current || score.reviewer_role != 3 %>
|
||||||
<%= link_to image_tag(url_to_avatar(show_real_name ? score.user : ""), :width => "34", :height => "34"), show_real_name ? user_path(score.user) : "javascript:void(0)",:class => "ping_pic fl" %>
|
<%= link_to image_tag(url_to_avatar(show_real_name ? score.user : ""), :width => "34", :height => "34"), show_real_name ? user_path(score.user) : "javascript:void(0)",:class => "ping_pic fl" %>
|
||||||
<% show_real_score = @homework.score_open == 1 || @is_teacher || score.student_work.user == User.current %>
|
<% show_real_score = @homework.score_open == 1 || @is_teacher || score.student_work.user == User.current || score.user == User.current %>
|
||||||
<div class="pingBoxTit">
|
<div class="pingBoxTit">
|
||||||
<%= link_to show_real_name ? score.user.show_name : "匿名", show_real_name ? user_path(score.user) : "javascript:void(0)", :title => show_real_name ? score.user.show_name : "匿评用户", :class => "linkBlue fl" %>
|
<%= link_to show_real_name ? score.user.show_name : "匿名", show_real_name ? user_path(score.user) : "javascript:void(0)", :title => show_real_name ? score.user.show_name : "匿评用户", :class => "linkBlue fl" %>
|
||||||
<span class="ml5 fl">
|
<span class="ml5 fl">
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
<!--<div class="resourceUploadPopup">-->
|
<div id="muban_popup_box" style="width:500px;">
|
||||||
<span class="uploadDialogText">上传附件</span>
|
<div class="muban_popup_top">
|
||||||
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
|
<h3 class="fl">
|
||||||
<div class="uploadBoxContainer">
|
上传附件
|
||||||
|
</h3>
|
||||||
|
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="muban_popup_con ml50 mt20 mb10 uploadBoxContainer">
|
||||||
<%= form_tag(revise_attachment_student_work_path(work.id), :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
|
<%= form_tag(revise_attachment_student_work_path(work.id), :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
|
||||||
<div>
|
<div>
|
||||||
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
||||||
|
@ -43,15 +48,11 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<p id="hint_message"></p>
|
<p id="hint_message"></p>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div style="margin-top: 10px" >
|
<div style="margin-top: 10px">
|
||||||
<div class="courseSendSubmit">
|
<a href="javascript:void(0);" id="upload_files_cancle_btn" class="fl sy_btn_grey mr10" onclick="closeModal();">取消</a>
|
||||||
<a href="javascript:void(0);" id="upload_files_submit_btn" class="sendSourceText" onclick="submit_revise_files();">确定</a>
|
<a href="javascript:void(0);" id="upload_files_submit_btn" class="fl sy_btn_blue" onclick="submit_revise_files();">确定</a>
|
||||||
<%#= submit_tag '确定',:onclick=>'submit_revise_files();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %>
|
|
||||||
</div>
|
|
||||||
<div class="courseSendCancel">
|
|
||||||
<a href="javascript:void(0);" id="upload_files_cancle_btn" class="sendSourceText" onclick="closeModal();">取消</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
</div>
|
|
@ -5,7 +5,9 @@
|
||||||
<%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw360', :download => true -%>
|
<%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw360', :download => true -%>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author && status != 2 %>
|
<% if attachment.id && User.current == attachment.author && (attachment.attachtype == 7 || @homework.end_time >= Date.today) %>
|
||||||
|
<%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) %>
|
||||||
|
<% end %>
|
||||||
<span class="postAttSize">(<%= number_to_human_size attachment.filesize %>)</span>
|
<span class="postAttSize">(<%= number_to_human_size attachment.filesize %>)</span>
|
||||||
<span class="author">
|
<span class="author">
|
||||||
<%= format_time(attachment.created_on) %>
|
<%= format_time(attachment.created_on) %>
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<% if @remain_user_ids %>
|
||||||
|
<% str = "" %>
|
||||||
|
<% @remain_user_ids.each do |user_id| %>
|
||||||
|
<% user = User.find user_id %>
|
||||||
|
<% if str == "" %>
|
||||||
|
<% str += user.show_name.to_s + "(" + user.login.to_s + ")" %>
|
||||||
|
<% else %>
|
||||||
|
<% str += "、" + user.show_name.to_s + "(" + user.login.to_s + ")" %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
var htmlvalue = '<div id="muban_popup_box" style="width:350px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
|
'<div class="clear mt15"><p class="text_c f14">以下组员还不是项目成员,请先前往项目添加成员</p><p class="text_c f14"><%=str %></p><div class="cl"></div>'+
|
||||||
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 144px;" onclick="hideModal();">确 定</a></div></div>';
|
||||||
|
pop_box_new(htmlvalue, 350, 140);
|
||||||
|
<% else %>
|
||||||
|
window.location.href = "<%=student_work_index_url(:homework => @homework.id, :tab => 3) %>";
|
||||||
|
<% end %>
|
|
@ -4,3 +4,11 @@ sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
|
||||||
<% else %>
|
<% else %>
|
||||||
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 %>
|
||||||
|
<% if @homework.anonymous_comment == 0 %>
|
||||||
|
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
|
'<div class="muban_popup_con ml30 mr30 mt20 mb10 clear"><p class="mb10 f14 text_c">将于7天后自动启动该作业的匿评</p><p class="mb10 f14 text_c">您可以在匿评设置中进行修改</p>' +
|
||||||
|
'<a href="javascript:void(0);" class="btn btn-blue mt10" style="margin-left: 142px;" onclick="hideModal();">知道啦</a></div></div>';
|
||||||
|
pop_box_new(htmlvalue, 400, 178);
|
||||||
|
<% else %>
|
||||||
|
hideModal();
|
||||||
|
<% end %>
|
|
@ -186,8 +186,10 @@
|
||||||
|
|
||||||
<% if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
<% if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||||
<div class="undis" id="student_work_con3">
|
<div class="undis" id="student_work_con3">
|
||||||
<% project_ids = @homework.student_work_projects.blank? ? "(-1)" : "(" + @homework.student_work_projects.map{|pro| pro.project_id}.join(",") + ")" %>
|
<% student_work_ids = @homework.student_works.has_committed.blank? ? "(-1)" : "(" + @homework.student_works.has_committed.map{|st| st.id}.join(",") + ")" %>
|
||||||
<% projects = Project.where("id in #{project_ids}") %>
|
<% student_work_projects = @homework.student_work_projects.where("student_work_id in #{student_work_ids} or student_work_id is null") %>
|
||||||
|
<% project_ids = student_work_projects.blank? ? "(-1)" : "(" + student_work_projects.map{|pro| pro.project_id}.join(",") + ")" %>
|
||||||
|
<% projects = Project.where("id in #{project_ids}").order("updated_on desc") %>
|
||||||
<%= render :partial => "student_work/relate_projects", :locals => {:projects => projects}%>
|
<%= render :partial => "student_work/relate_projects", :locals => {:projects => projects}%>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,5 +1,2 @@
|
||||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/relate_project') %>');
|
var htmlvalue = "<%= escape_javascript(render :partial => 'student_work/relate_project') %>";
|
||||||
showModal('ajax-modal', '320px');
|
pop_box_new(htmlvalue, 400, 285);
|
||||||
$('#ajax-modal').siblings().remove();
|
|
||||||
$('#ajax-modal').parent().css("top","").css("left","");
|
|
||||||
$('#ajax-modal').parent().addClass("groupPopUp");
|
|
|
@ -3,7 +3,7 @@
|
||||||
<% else %>
|
<% else %>
|
||||||
$("#search_project_list").html("");
|
$("#search_project_list").html("");
|
||||||
<% @project_ids.each do |project|%>
|
<% @project_ids.each do |project|%>
|
||||||
link = "<li><label><input type='radio' class='courseSendCheckbox' name='projectName' value='<%=project.id%>'/><span class='sendCourseName'> <%=project.name %> </span></label></li>";
|
link = "<li><input type='radio' class='courseSendCheckbox fl' name='projectName' value='<%=project.id%>'/><a href='<%=project_path(project) %>' target='_blank' class='hidden fl' style='padding-top: 8px; max-width: 300px;'> <%=project.name %> </a><div class='cl'></div></li>";
|
||||||
$("#search_project_list").append(link );
|
$("#search_project_list").append(link);
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
|
@ -12,7 +12,7 @@
|
||||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
TO
|
TO
|
||||||
<%= link_to activity.course.name.to_s+" | 班级资源", course_files_path(activity.course), :class => "newsBlue" %>
|
<%= link_to "班级资源", course_files_path(activity.course), :class => "newsBlue ml15" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle break_word" >
|
<div class="homepagePostTitle break_word" >
|
||||||
<%= link_to activity.filename, course_files_path(activity.course), :class => "postGrey" %>
|
<%= link_to activity.filename, course_files_path(activity.course), :class => "postGrey" %>
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
<%= link_to activity.try(:teacher).try(:realname), user_path(activity.teacher), :class => "newsBlue mr15" %>
|
<%= link_to activity.try(:teacher).try(:realname), user_path(activity.teacher), :class => "newsBlue mr15" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
TO
|
TO
|
||||||
<%= link_to activity.name.to_s+" | 班级", course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue" %>
|
<% str = defined?(is_course) && is_course == 1 ? "班级" : "#{activity.name.to_s} | 班级" %>
|
||||||
|
<%= link_to str, course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle break_word" >
|
<div class="homepagePostTitle break_word" >
|
||||||
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
|
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||||
|
|
|
@ -9,10 +9,10 @@
|
||||||
<div class="homepagePostTo break_word">
|
<div class="homepagePostTo break_word">
|
||||||
<%= link_to activity.user.show_name, user_path(activity.user,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
<%= link_to activity.user.show_name, user_path(activity.user,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||||
TO <!--+"(课程名称)" -->
|
TO <!--+"(课程名称)" -->
|
||||||
<% if hw_status == 3 || hw_status == 5 %>
|
<% if hw_status == 3 || hw_status == 2 %>
|
||||||
<%= link_to activity.course.name, course_path(activity.course_id), :class => "newsBlue"%>
|
<%= link_to "班级作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to activity.course.name.to_s+" | 班级作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue"%>
|
<%= link_to activity.course.name.to_s+" | 班级作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle hidden fl m_w505"> <!--+"(作业名称)"-->
|
<div class="homepagePostTitle hidden fl m_w505"> <!--+"(作业名称)"-->
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
<%= link_to activity.user.show_name, user_path(activity.user), :class => "newsBlue mr15" %>
|
<%= link_to activity.user.show_name, user_path(activity.user), :class => "newsBlue mr15" %>
|
||||||
TO
|
TO
|
||||||
<% course=Course.find(activity.jour_id) %>
|
<% course=Course.find(activity.jour_id) %>
|
||||||
<%= link_to course.name.to_s+" | 班级留言", course_feedback_path(course), :class => "newsBlue" %>
|
<% str = defined?(is_course) && is_course == 1 ? "班级留言" : "#{course.name.to_s} | 班级留言" %>
|
||||||
|
<%= link_to str, course_feedback_path(course), :class => "newsBlue ml15" %>
|
||||||
</div>
|
</div>
|
||||||
<!--<div class="homepagePostTitle break_word list_style upload_img">
|
<!--<div class="homepagePostTitle break_word list_style upload_img">
|
||||||
<%# if activity.parent %>
|
<%# if activity.parent %>
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
<div class="homepagePostTo break_word">
|
<div class="homepagePostTo break_word">
|
||||||
<%= link_to activity.author.show_name, user_path(activity.author, :host=>Setting.host_user), :class => "newsBlue mr15" %>
|
<%= link_to activity.author.show_name, user_path(activity.author, :host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||||
TO
|
TO
|
||||||
<%= link_to activity.course.name.to_s+" | #{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue mr5"%>
|
<% str = is_course == 1 ? "#{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}" : activity.course.name.to_s+" | #{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}" %>
|
||||||
|
<%= link_to str, course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15"%>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle hidden m_w530 fl">
|
<div class="homepagePostTitle hidden m_w530 fl">
|
||||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
<div class="homepagePostTo break_word">
|
<div class="homepagePostTo break_word">
|
||||||
<%= link_to activity.author.show_name, user_path(activity.author), :class => "newsBlue mr15" %>
|
<%= link_to activity.author.show_name, user_path(activity.author), :class => "newsBlue mr15" %>
|
||||||
TO <!--+"(课程名称)"-->
|
TO <!--+"(课程名称)"-->
|
||||||
<%= link_to activity.course.name.to_s+" | 班级通知", course_news_index_path(activity.course), :class => "newsBlue" %>
|
<% str = defined?(is_course) && is_course == 1 ? "班级通知" : "#{activity.course.name.to_s} | 班级通知" %>
|
||||||
|
<%= link_to str, course_news_index_path(activity.course), :class => "newsBlue ml15" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
||||||
<%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %>
|
<%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %>
|
||||||
|
|
|
@ -17,7 +17,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
TO
|
TO
|
||||||
<% course = Course.find(activity.polls_group_id) %>
|
<% course = Course.find(activity.polls_group_id) %>
|
||||||
<%= link_to course.name.to_s+" | 问卷", poll_index_path(:polls_type => "Course", :polls_group_id => activity.polls_group_id), :class => "newsBlue" %>
|
<% str = defined?(is_course) && is_course == 1 ? "班级问卷" : "#{course.name.to_s} | 班级问卷" %>
|
||||||
|
<%= link_to str, poll_index_path(:polls_type => "Course", :polls_group_id => activity.polls_group_id), :class => "newsBlue ml15" %>
|
||||||
<!--<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a>-->
|
<!--<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a>-->
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle break_word" >
|
<div class="homepagePostTitle break_word" >
|
||||||
|
|
|
@ -111,6 +111,11 @@
|
||||||
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id),:class => "wpostOptionLink",
|
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id),:class => "wpostOptionLink",
|
||||||
:title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品", :remote => true)%>
|
:title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品", :remote => true)%>
|
||||||
</li>
|
</li>
|
||||||
|
<% elsif activity.anonymous_comment == 1 %>
|
||||||
|
<li>
|
||||||
|
<%= link_to("启用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id),:class => "wpostOptionLink",
|
||||||
|
:title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品", :remote => true)%>
|
||||||
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %>
|
<% if (activity.anonymous_comment == 1 && activity.is_open == 0) || (activity.anonymous_comment == 0 && comment_status == 3 && activity.is_open == 0) %>
|
||||||
<li>
|
<li>
|
||||||
|
|
|
@ -7,20 +7,26 @@
|
||||||
<% parents_rely = get_reply_parents_no_root parents_rely, comment %>
|
<% parents_rely = get_reply_parents_no_root parents_rely, comment %>
|
||||||
<% length = parents_rely.length %>
|
<% length = parents_rely.length %>
|
||||||
<div id="comment_reply_<%=comment.id %>">
|
<div id="comment_reply_<%=comment.id %>">
|
||||||
<% if length <= 2 %>
|
<% if length <= 5 %>
|
||||||
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="orig_cont clearfix">
|
<div class="orig_cont clearfix">
|
||||||
<div class="orig_cont clearfix">
|
<div class="orig_cont clearfix">
|
||||||
<!--<div>-->
|
<div class="orig_cont clearfix">
|
||||||
<!--<%#=render :partial => 'users/journal_comment_reply', :locals => {:comment => parents_rely[length - 1]} %>-->
|
<div class="orig_cont clearfix">
|
||||||
<!--</div>-->
|
<div class="orig_cont clearfix">
|
||||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="orig_cont_hide clearfix">
|
<div class="orig_cont_hide clearfix">
|
||||||
<span class="orig_icon" >↓ </span>
|
<span class="orig_icon" >↓ </span>
|
||||||
<span class="orig_icon" style="display:none;" > ↑</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
|
<span class="orig_icon" style="display:none;" > ↑</span><span class="">已经隐藏<%=(length - 5).to_s %>个楼层</span>
|
||||||
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => user_activity_id, :parent_id => comment.id),:remote=>true, :class => 'linkBlue2' %>
|
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => user_activity_id, :parent_id => comment.id),:remote=>true, :class => 'linkBlue2' %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[3], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[2], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
</div>
|
</div>
|
||||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,20 +7,26 @@
|
||||||
<% parents_rely = get_reply_parents parents_rely, comment %>
|
<% parents_rely = get_reply_parents parents_rely, comment %>
|
||||||
<% length = parents_rely.length %>
|
<% length = parents_rely.length %>
|
||||||
<div id="comment_reply_<%=comment.id %>">
|
<div id="comment_reply_<%=comment.id %>">
|
||||||
<% if length <= 2 %>
|
<% if length <= 5 %>
|
||||||
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="orig_cont clearfix">
|
<div class="orig_cont clearfix">
|
||||||
<div class="orig_cont clearfix">
|
<div class="orig_cont clearfix">
|
||||||
<!--<div>-->
|
<div class="orig_cont clearfix">
|
||||||
<!--<%#=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>-->
|
<div class="orig_cont clearfix">
|
||||||
<!--</div>-->
|
<div class="orig_cont clearfix">
|
||||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
</div>
|
</div>
|
||||||
<div class="orig_cont_hide clearfix">
|
<div class="orig_cont_hide clearfix">
|
||||||
<span class="orig_icon" >↓ </span>
|
<span class="orig_icon" >↓ </span>
|
||||||
<span class="orig_icon" style="display:none;" > ↑</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
|
<span class="orig_icon" style="display:none;" > ↑</span><span class="">已经隐藏<%=(length - 5).to_s %>个楼层</span>
|
||||||
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => user_activity_id, :parent_id => comment.id), :remote=>true, :class => 'linkBlue2' %>
|
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => user_activity_id, :parent_id => comment.id),:remote=>true, :class => 'linkBlue2' %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[3], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[2], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
|
</div>
|
||||||
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[1], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
</div>
|
</div>
|
||||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0], :type => type, :user_activity_id => user_activity_id, :parent_id => comment.id} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -48,8 +48,8 @@
|
||||||
}
|
}
|
||||||
if (inputs.length == outputs.length) {
|
if (inputs.length == outputs.length) {
|
||||||
for (var i=0; i<inputs.length; i++) {
|
for (var i=0; i<inputs.length; i++) {
|
||||||
autoTextarea2(inputs[i], outputs[i]);
|
autoTextarea2(inputs[i], outputs[i], 0, 140);
|
||||||
autoTextarea2(outputs[i], inputs[i]);
|
autoTextarea2(outputs[i], inputs[i], 0, 140);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$(inputs[inputs.length - 1]).focus();
|
$(inputs[inputs.length - 1]).focus();
|
||||||
|
@ -61,7 +61,16 @@
|
||||||
<% if !edit_mode %>
|
<% if !edit_mode %>
|
||||||
var text = document.getElementById("textarea_input_test");
|
var text = document.getElementById("textarea_input_test");
|
||||||
var text2 = document.getElementById("textarea_output_test");
|
var text2 = document.getElementById("textarea_output_test");
|
||||||
autoTextarea2(text,text2);
|
autoTextarea2(text,text2, 0, 140);
|
||||||
autoTextarea2(text2,text);
|
autoTextarea2(text2,text, 0, 140);
|
||||||
|
<% else %>
|
||||||
|
var inputs = document.getElementsByName("program[input][]");
|
||||||
|
var outputs = document.getElementsByName("program[output][]");
|
||||||
|
if (inputs.length == outputs.length) {
|
||||||
|
for (var i=0; i<inputs.length; i++) {
|
||||||
|
autoTextarea2(inputs[i], outputs[i], 0, 140);
|
||||||
|
autoTextarea2(outputs[i], inputs[i], 0, 140);
|
||||||
|
}
|
||||||
|
}
|
||||||
<% end %>
|
<% end %>
|
||||||
</script>
|
</script>
|
|
@ -57,7 +57,7 @@ module RedmineApp
|
||||||
#disable [deprecated] I18n.enforce_available_locales will default to true in the future.
|
#disable [deprecated] I18n.enforce_available_locales will default to true in the future.
|
||||||
# If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false
|
# If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false
|
||||||
# to avoid this message.
|
# to avoid this message.
|
||||||
#I18n.config.enforce_available_locales = false
|
I18n.config.enforce_available_locales = false
|
||||||
|
|
||||||
# Configure sensitive parameters which will be filtered from the log file.
|
# Configure sensitive parameters which will be filtered from the log file.
|
||||||
config.filter_parameters += [:password]
|
config.filter_parameters += [:password]
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
if Rails.env.development?
|
||||||
|
Rack::MiniProfiler.config.position = 'right'
|
||||||
|
Rack::MiniProfiler.config.start_hidden = true
|
||||||
|
end
|
|
@ -335,6 +335,7 @@ RedmineApp::Application.routes.draw do
|
||||||
collection do
|
collection do
|
||||||
post 'add_score_reply'
|
post 'add_score_reply'
|
||||||
post 'student_work_project'
|
post 'student_work_project'
|
||||||
|
post 'change_project'
|
||||||
get 'new_student_work_project'
|
get 'new_student_work_project'
|
||||||
get 'search_user_projects'
|
get 'search_user_projects'
|
||||||
get 'search_course_students'
|
get 'search_course_students'
|
||||||
|
@ -955,6 +956,9 @@ RedmineApp::Application.routes.draw do
|
||||||
collection do
|
collection do
|
||||||
match 'bulk_edit', :via => [:get, :post]
|
match 'bulk_edit', :via => [:get, :post]
|
||||||
post 'bulk_update'
|
post 'bulk_update'
|
||||||
|
get 'issue_commits'
|
||||||
|
get 'commit_for_issue'
|
||||||
|
get 'issue_commit_delete'
|
||||||
end
|
end
|
||||||
member do
|
member do
|
||||||
post 'add_journal'
|
post 'add_journal'
|
||||||
|
@ -1256,6 +1260,7 @@ RedmineApp::Application.routes.draw do
|
||||||
post 'add_members'
|
post 'add_members'
|
||||||
get 'delete_member'
|
get 'delete_member'
|
||||||
get 'archive_course'
|
get 'archive_course'
|
||||||
|
get 'set_invite_code_halt'
|
||||||
end
|
end
|
||||||
collection do
|
collection do
|
||||||
match 'join_private_courses', :via => [:get, :post]
|
match 'join_private_courses', :via => [:get, :post]
|
||||||
|
@ -1417,6 +1422,8 @@ RedmineApp::Application.routes.draw do
|
||||||
post :bind
|
post :bind
|
||||||
post :get_bind
|
post :get_bind
|
||||||
post :is_bind
|
post :is_bind
|
||||||
|
get :auth
|
||||||
|
get :auth_callback
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
class CreateCommitIssues < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :commit_issues do |t|
|
||||||
|
t.string :commit_id
|
||||||
|
t.integer :issue_id
|
||||||
|
t.integer :project_id
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,19 @@
|
||||||
|
class UpdateStudentWorkScore < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
homework = HomeworkCommon.where("id = 4198").first
|
||||||
|
unless homework.nil?
|
||||||
|
homework.student_works.each do |st|
|
||||||
|
if st.late_penalty != 0 && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") > Time.parse(st.commit_time.to_s).strftime("%Y-%m-%d")
|
||||||
|
if st.work_status == 2
|
||||||
|
st.work_status = 1
|
||||||
|
end
|
||||||
|
st.late_penalty = 0
|
||||||
|
st.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddColumnToCourse < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :courses, :invite_code_halt, :integer, :limit => 1, :default => 0
|
||||||
|
end
|
||||||
|
end
|
18
db/schema.rb
18
db/schema.rb
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20161201083030) do
|
ActiveRecord::Schema.define(:version => 20161208015939) do
|
||||||
|
|
||||||
create_table "activities", :force => true do |t|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
@ -629,6 +629,7 @@ ActiveRecord::Schema.define(:version => 20161201083030) do
|
||||||
t.string "invite_code"
|
t.string "invite_code"
|
||||||
t.string "qrcode"
|
t.string "qrcode"
|
||||||
t.integer "qrcode_expiretime", :default => 0
|
t.integer "qrcode_expiretime", :default => 0
|
||||||
|
t.integer "invite_code_halt", :limit => 1, :default => 0
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true
|
add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true
|
||||||
|
@ -866,6 +867,7 @@ ActiveRecord::Schema.define(:version => 20161201083030) do
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
t.string "secret_key"
|
t.string "secret_key"
|
||||||
t.integer "status"
|
t.integer "status"
|
||||||
|
t.integer "operate_user_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type"
|
add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type"
|
||||||
|
@ -941,6 +943,7 @@ ActiveRecord::Schema.define(:version => 20161201083030) do
|
||||||
t.integer "quotes", :default => 0
|
t.integer "quotes", :default => 0
|
||||||
t.integer "is_open", :default => 0
|
t.integer "is_open", :default => 0
|
||||||
t.datetime "simi_time"
|
t.datetime "simi_time"
|
||||||
|
t.integer "score_open", :default => 1
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id"
|
add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id"
|
||||||
|
@ -1541,6 +1544,12 @@ ActiveRecord::Schema.define(:version => 20161201083030) do
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "professional_levels", :force => true do |t|
|
||||||
|
t.string "level"
|
||||||
|
t.datetime "created_at", :null => false
|
||||||
|
t.datetime "updated_at", :null => false
|
||||||
|
end
|
||||||
|
|
||||||
create_table "project_infos", :force => true do |t|
|
create_table "project_infos", :force => true do |t|
|
||||||
t.integer "project_id"
|
t.integer "project_id"
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
|
@ -1631,8 +1640,11 @@ ActiveRecord::Schema.define(:version => 20161201083030) do
|
||||||
t.integer "pull_request_id"
|
t.integer "pull_request_id"
|
||||||
t.integer "gpid"
|
t.integer "gpid"
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.datetime "created_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
|
t.integer "status", :default => 0
|
||||||
|
t.integer "project_id"
|
||||||
|
t.string "title"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "quality_analyses", :force => true do |t|
|
create_table "quality_analyses", :force => true do |t|
|
||||||
|
|
|
@ -52,6 +52,7 @@ class Gitlab::Client
|
||||||
# @option options [String] :ref_name The branch or tag name of a project repository.
|
# @option options [String] :ref_name The branch or tag name of a project repository.
|
||||||
# @option options [Integer] :page The page number.
|
# @option options [Integer] :page The page number.
|
||||||
# @option options [Integer] :per_page The number of results per page.
|
# @option options [Integer] :per_page The number of results per page.
|
||||||
|
# @option options [String] :search The obj of results's search value.
|
||||||
# @return [Array<Gitlab::ObjectifiedHash>]
|
# @return [Array<Gitlab::ObjectifiedHash>]
|
||||||
def commits(project, options={})
|
def commits(project, options={})
|
||||||
get("/projects/#{project}/repository/commits", :query => options)
|
get("/projects/#{project}/repository/commits", :query => options)
|
||||||
|
|
|
@ -41,19 +41,19 @@ namespace :homework_publishtime do
|
||||||
puts "--------------------------------homework_publish end"
|
puts "--------------------------------homework_publish end"
|
||||||
end
|
end
|
||||||
|
|
||||||
task :end => :environment do
|
# task :end => :environment do
|
||||||
puts "--------------------------------homework_publish_end start"
|
# puts "--------------------------------homework_publish_end start"
|
||||||
Rails.logger.info("log--------------------------------homework_publish_end start")
|
# Rails.logger.info("log--------------------------------homework_publish_end start")
|
||||||
homework_commons = HomeworkCommon.where("end_time = '#{Date.today}'")
|
# homework_commons = HomeworkCommon.where("end_time = '#{Date.today}'")
|
||||||
homework_commons.each do |homework|
|
# homework_commons.each do |homework|
|
||||||
if homework.anonymous_comment == 1
|
# if homework.anonymous_comment == 1
|
||||||
homework_detail_manual = homework.homework_detail_manual
|
# homework_detail_manual = homework.homework_detail_manual
|
||||||
if homework_detail_manual.comment_status == 1
|
# if homework_detail_manual.comment_status == 1
|
||||||
homework_detail_manual.update_column('comment_status', 3)
|
# homework_detail_manual.update_column('comment_status', 3)
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
Rails.logger.info("log--------------------------------homework_publish_end end")
|
# Rails.logger.info("log--------------------------------homework_publish_end end")
|
||||||
puts "--------------------------------homework_publish_end end"
|
# puts "--------------------------------homework_publish_end end"
|
||||||
end
|
# end
|
||||||
end
|
end
|
|
@ -55,7 +55,6 @@
|
||||||
<script src="/javascripts/wechat/others/routes.js"></script>
|
<script src="/javascripts/wechat/others/routes.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
|
@ -27,6 +27,18 @@
|
||||||
<div class="c-grey4 f13 mt5"><span class="mr10">{{issue.project_name}} - 项目问题</span><span>{{issue.created_on}}</span></div>
|
<div class="c-grey4 f13 mt5"><span class="mr10">{{issue.project_name}} - 项目问题</span><span>{{issue.created_on}}</span></div>
|
||||||
|
|
||||||
<div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="issue.description|safeHtml" img-preview></div>
|
<div class="f13 c-black mt5 text-control post-all-content" ng-bind-html="issue.description|safeHtml" img-preview></div>
|
||||||
|
|
||||||
|
|
||||||
|
<ul class="weixin-files clear f14 mb10">
|
||||||
|
<ol ng-repeat="attachment in issue.attachments"><img src="images/wechat/w-icons-file.png" width="18" style="vertical-align:top; margin-top:2px;" class="mr5" /><a class="c-blue " ng-href="{{attachment.download_url}}">{{attachment.filename}}</a><span class="c-grey ml5 ">({{attachment.attafile_size}})</span></ol>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class=" clear f14 mb10">
|
||||||
|
<div ng-repeat="attachment in previewImgUrls track by $index">
|
||||||
|
<img ng-click="previewImg($index)" ng-src="{{attachment}}" width="50" class="mr5 weixin-files-img fl" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<span class="c-grey f12 mr15">状 态:{{issue.issue_status}}</span>
|
<span class="c-grey f12 mr15">状 态:{{issue.issue_status}}</span>
|
||||||
<span class="c-grey f12">优先级:{{issue.issue_priority}}</span><br/>
|
<span class="c-grey f12">优先级:{{issue.issue_priority}}</span><br/>
|
||||||
<span class="c-grey f12 mr15">指派给:{{issue.issue_assigned_to}}</span>
|
<span class="c-grey f12 mr15">指派给:{{issue.issue_assigned_to}}</span>
|
||||||
|
@ -114,7 +126,7 @@
|
||||||
<div class="post-reply-row border-bottom-none">
|
<div class="post-reply-row border-bottom-none">
|
||||||
<div class="post-input-container">
|
<div class="post-input-container">
|
||||||
<div class="copy-input-container"><textarea class="copy-input"></textarea></div>
|
<div class="copy-input-container"><textarea class="copy-input"></textarea></div>
|
||||||
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="issue.comment" placeholder="输入回复内容~" /></textarea>
|
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-change="onPostChange(issue.comment, '{{issue.comment}}')" ng-model="issue.comment" placeholder="输入回复内容~" /></textarea>
|
||||||
<button ng-click="addReply(issue,0)" ng-disabled="issue.disabled" ng-hide="issue.disabled" class="post-reply-submit fr border-radius">提交</button>
|
<button ng-click="addReply(issue,0)" ng-disabled="issue.disabled" ng-hide="issue.disabled" class="post-reply-submit fr border-radius">提交</button>
|
||||||
<button ng-disabled="issue.disabled" ng-hide="!issue.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
|
<button ng-disabled="issue.disabled" ng-hide="!issue.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
@ -125,3 +137,14 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="post-container wechat-at" ng-show="showAtDialog">
|
||||||
|
<div loading-spinner></div>
|
||||||
|
<div class="class-detail-name"><span class="course-name-width hidden inline-block">选择您要@的人</span>
|
||||||
|
<button ng-click="cancelAt()" class="cancel-btn-new fr border-radius">取消</button>
|
||||||
|
</div>
|
||||||
|
<ul class="weixin-users-all">
|
||||||
|
<li ng-repeat="person in at_persons track by $index" ng-click="selectAtPerson($index)"><p class="fl ">{{person.name}}</p><p class="fl ">({{person.login}})</p></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
|
@ -1488,6 +1488,8 @@ function pop_up_box(value,tWidth,tTop,tLeft){
|
||||||
}
|
}
|
||||||
|
|
||||||
// 公共弹框样式
|
// 公共弹框样式
|
||||||
|
// 建议左右栏的:Width:460,Height:190
|
||||||
|
// 建议宽屏对应值:Width:760,Height:500
|
||||||
function pop_box_new(value, Width, Height){
|
function pop_box_new(value, Width, Height){
|
||||||
w = ($(window).width() - Width)/2;
|
w = ($(window).width() - Width)/2;
|
||||||
h = ($(window).height() - Height)/2;
|
h = ($(window).height() - Height)/2;
|
||||||
|
@ -1715,7 +1717,7 @@ function expand_course_list(id, target, btnid, count) {
|
||||||
//点击删除时的确认弹框
|
//点击删除时的确认弹框
|
||||||
function delete_confirm_box(url, str){
|
function delete_confirm_box(url, str){
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
'<div class="clear mt15"><p class="text_c f16">' + str + '</p><div class="cl"></div><a href="'+ url +'" class="fr sy_btn_blue mr10 mt10" data-remote="true">确定</a>'+
|
'<div class="clear mt15"><p class="text_c f16">' + str + '</p><div class="cl"></div><a href="'+ url +'" class="fr sy_btn_blue mt10" style="margin-right: 92px;" data-remote="true">确定</a>'+
|
||||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取消</a></div></div>';
|
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取消</a></div></div>';
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1446,7 +1446,7 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) {
|
||||||
} : function (name) {
|
} : function (name) {
|
||||||
return getComputedStyle(elem, null)[name];
|
return getComputedStyle(elem, null)[name];
|
||||||
},
|
},
|
||||||
minHeight = parseFloat(getFirstStyle('height'))
|
minHeight = parseFloat(getFirstStyle('height'));
|
||||||
|
|
||||||
elem.style.resize = 'none';
|
elem.style.resize = 'none';
|
||||||
elem2.style.resize = 'none';
|
elem2.style.resize = 'none';
|
||||||
|
@ -1474,8 +1474,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) {
|
||||||
style2.overflowY = 'auto';
|
style2.overflowY = 'auto';
|
||||||
} else {
|
} else {
|
||||||
height = elem.scrollHeight - padding;
|
height = elem.scrollHeight - padding;
|
||||||
style.overflowY = 'hidden';
|
|
||||||
style2.overflowY = 'hidden';
|
|
||||||
};
|
};
|
||||||
style.height = height + extra + 'px';
|
style.height = height + extra + 'px';
|
||||||
style2.height = height + extra + 'px';
|
style2.height = height + extra + 'px';
|
||||||
|
@ -1491,8 +1489,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) {
|
||||||
style2.overflowY = 'auto';
|
style2.overflowY = 'auto';
|
||||||
} else {
|
} else {
|
||||||
height = elem2.scrollHeight - padding;
|
height = elem2.scrollHeight - padding;
|
||||||
style.overflowY = 'hidden';
|
|
||||||
style2.overflowY = 'hidden';
|
|
||||||
};
|
};
|
||||||
style.height = height + extra + 'px';
|
style.height = height + extra + 'px';
|
||||||
style2.height = height + extra + 'px';
|
style2.height = height + extra + 'px';
|
||||||
|
|
|
@ -477,7 +477,7 @@ $(function(){
|
||||||
//注意\n\
|
//注意\n\
|
||||||
//1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
//1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
||||||
//2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
//2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
||||||
//3:该程序每次运行输出的结果最多显示100个字符(多余的不显示),每行末尾的所有空格用□表示\n\
|
//3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\
|
||||||
import java.io.*;\n\
|
import java.io.*;\n\
|
||||||
import java.util.*;\n\
|
import java.util.*;\n\
|
||||||
\n\
|
\n\
|
||||||
|
@ -501,7 +501,7 @@ class Main\n\
|
||||||
//注意\n\
|
//注意\n\
|
||||||
//1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
//1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
||||||
//2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
//2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
||||||
//3:该程序每次运行输出的结果最多显示100个字符(多余的不显示),每行末尾的所有空格用□表示\n\
|
//3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\
|
||||||
#include <stdio.h>\n\
|
#include <stdio.h>\n\
|
||||||
int main()\n\
|
int main()\n\
|
||||||
{\n\
|
{\n\
|
||||||
|
@ -521,7 +521,7 @@ int main()\n\
|
||||||
//注意\n\
|
//注意\n\
|
||||||
//1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
//1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
||||||
//2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
//2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
||||||
//3:该程序每次运行输出的结果最多显示100个字符(多余的不显示),每行末尾的所有空格用□表示\n\
|
//3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\
|
||||||
#include <iostream>\n\
|
#include <iostream>\n\
|
||||||
using namespace std;\n\
|
using namespace std;\n\
|
||||||
\n\
|
\n\
|
||||||
|
@ -543,7 +543,7 @@ int main()\n\
|
||||||
#注意\n\
|
#注意\n\
|
||||||
#1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
#1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
||||||
#2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
#2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
||||||
#3:该程序每次运行输出的结果最多显示100个字符(多余的不显示),空格用□表示\n\
|
#3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),空格用□表示\n\
|
||||||
import sys \n\
|
import sys \n\
|
||||||
\n\
|
\n\
|
||||||
#获取参数方式,使用raw_input\n\
|
#获取参数方式,使用raw_input\n\
|
||||||
|
|
|
@ -632,7 +632,7 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) {
|
||||||
} : function (name) {
|
} : function (name) {
|
||||||
return getComputedStyle(elem, null)[name];
|
return getComputedStyle(elem, null)[name];
|
||||||
},
|
},
|
||||||
minHeight = parseFloat(getFirstStyle('height'))
|
minHeight = parseFloat(getFirstStyle('height'));
|
||||||
|
|
||||||
elem.style.resize = 'none';
|
elem.style.resize = 'none';
|
||||||
elem2.style.resize = 'none';
|
elem2.style.resize = 'none';
|
||||||
|
@ -660,8 +660,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) {
|
||||||
style2.overflowY = 'auto';
|
style2.overflowY = 'auto';
|
||||||
} else {
|
} else {
|
||||||
height = elem.scrollHeight - padding;
|
height = elem.scrollHeight - padding;
|
||||||
style.overflowY = 'hidden';
|
|
||||||
style2.overflowY = 'hidden';
|
|
||||||
};
|
};
|
||||||
style.height = height + extra + 'px';
|
style.height = height + extra + 'px';
|
||||||
style2.height = height + extra + 'px';
|
style2.height = height + extra + 'px';
|
||||||
|
@ -677,8 +675,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) {
|
||||||
style2.overflowY = 'auto';
|
style2.overflowY = 'auto';
|
||||||
} else {
|
} else {
|
||||||
height = elem2.scrollHeight - padding;
|
height = elem2.scrollHeight - padding;
|
||||||
style.overflowY = 'hidden';
|
|
||||||
style2.overflowY = 'hidden';
|
|
||||||
};
|
};
|
||||||
style.height = height + extra + 'px';
|
style.height = height + extra + 'px';
|
||||||
style2.height = height + extra + 'px';
|
style2.height = height + extra + 'px';
|
||||||
|
|
|
@ -10,6 +10,7 @@ app.constant('config', {
|
||||||
app.run(['$rootScope', 'auth', '$location', '$routeParams', function($rootScope, auth, $location, $routeParams){
|
app.run(['$rootScope', 'auth', '$location', '$routeParams', function($rootScope, auth, $location, $routeParams){
|
||||||
|
|
||||||
if(g_redirect_path && g_redirect_path.length>1){
|
if(g_redirect_path && g_redirect_path.length>1){
|
||||||
|
console.log(g_redirect_path);
|
||||||
$location.path(g_redirect_path);
|
$location.path(g_redirect_path);
|
||||||
g_redirect_path = null;
|
g_redirect_path = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,58 @@
|
||||||
app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'common', function($scope, $http, $routeParams, auth, common){
|
app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'common',
|
||||||
|
function($scope, $http, $routeParams, auth, common){
|
||||||
|
|
||||||
|
var vm = $scope;
|
||||||
|
vm.previewImgUrls = [];
|
||||||
|
vm.showAtDialog = false;
|
||||||
|
|
||||||
|
var parseAtPersons = function (comment) {
|
||||||
|
var selectedPersons = [];
|
||||||
|
var ss = comment.match(/@(.+?)\s+/g);
|
||||||
|
|
||||||
|
for(var i in ss){
|
||||||
|
var personName = ss[i].substr(1, ss[i].length-2);
|
||||||
|
console.log(personName);
|
||||||
|
|
||||||
|
for(var j in vm.at_persons){
|
||||||
|
var person = vm.at_persons[j];
|
||||||
|
if(person.name == personName){
|
||||||
|
selectedPersons.push(person);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(var i in selectedPersons){
|
||||||
|
var person = selectedPersons[i];
|
||||||
|
comment = comment.replace('@'+person.name+' ',
|
||||||
|
'<span class="atwho-inserted"><span class="at" data-user-id="'+person.id
|
||||||
|
+'"><a href="/users/'+person.id+'">@'+person.name+'('+person.login+')'+' </a></span></span>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return comment;
|
||||||
|
};
|
||||||
|
|
||||||
|
vm.onPostChange = function (newValue, oldValue) {
|
||||||
|
if(newValue.length > oldValue.length && newValue.match(/@$/)=='@'){
|
||||||
|
console.log('@ fire');
|
||||||
|
vm.showAtDialog = true;
|
||||||
|
if(!vm.at_persons){
|
||||||
|
$http.get('/at/'+$routeParams.id+'.json?type=Issue').then(function (response) {
|
||||||
|
vm.at_persons = response.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(vm.issue.comment);
|
||||||
|
};
|
||||||
|
|
||||||
|
vm.selectAtPerson = function (index) {
|
||||||
|
var person = vm.at_persons[index];
|
||||||
|
vm.showAtDialog = false;
|
||||||
|
vm.issue.comment += person.name + ' ';
|
||||||
|
};
|
||||||
|
|
||||||
|
vm.cancelAt = function(){
|
||||||
|
vm.showAtDialog = false;
|
||||||
|
}
|
||||||
|
|
||||||
common.init({
|
common.init({
|
||||||
id: $routeParams.id,
|
id: $routeParams.id,
|
||||||
|
@ -18,11 +72,28 @@ app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'c
|
||||||
replytype = data.type;
|
replytype = data.type;
|
||||||
page = data.page;
|
page = data.page;
|
||||||
|
|
||||||
|
|
||||||
|
var parseImgAttachment = function(attachments){
|
||||||
|
var urls = [];
|
||||||
|
if(!attachments){
|
||||||
|
return urls;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(var i = attachments.length-1; i>=0; i--){
|
||||||
|
if(attachments[i].filename.match('.jpg$')=='.jpg' || attachments[i].filename.match('.png$')=='.png'){
|
||||||
|
urls.push(attachments[i].download_url);
|
||||||
|
attachments.splice(i, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return urls;
|
||||||
|
};
|
||||||
|
|
||||||
if (replytype == 0){
|
if (replytype == 0){
|
||||||
if (page == 0){
|
if (page == 0){
|
||||||
$scope.issue = data.data;
|
$scope.issue = data.data;
|
||||||
$scope.page = 0;
|
$scope.page = 0;
|
||||||
$scope.is_public = data.is_public;
|
$scope.is_public = data.is_public;
|
||||||
|
$scope.previewImgUrls = parseImgAttachment($scope.issue.attachments);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$scope.issue.all_children = $scope.issue.all_children.concat(data.data.all_children);
|
$scope.issue.all_children = $scope.issue.all_children.concat(data.data.all_children);
|
||||||
|
@ -42,6 +113,17 @@ app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'c
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
replyCallback: function(){
|
replyCallback: function(){
|
||||||
|
},
|
||||||
|
beforeReplay: function(data){
|
||||||
|
return parseAtPersons(data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$scope.previewImg = function(index){
|
||||||
|
console.log(index);
|
||||||
|
wx.previewImage({
|
||||||
|
current: $scope.previewImgUrls[index], // 当前显示图片的http链接
|
||||||
|
urls: $scope.previewImgUrls // 需要预览的图片http链接列表
|
||||||
|
});
|
||||||
|
}
|
||||||
}]);
|
}]);
|
|
@ -94,24 +94,17 @@ app.factory('rms', function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$location', function($http, auth, $routeParams,rms,config,wx,$location){
|
app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$location', function($http, auth, $routeParams,rms,config,wx,$location){
|
||||||
var addCommonReply = function(id, type, data,args,reply_type, cb){
|
var addCommonReply = function(id, type, data,args,reply_type, beforeReply, cb){
|
||||||
//先判断有没有绑定
|
|
||||||
// $http.post(
|
|
||||||
// '/wechat/is_bind',
|
|
||||||
// {} ///不用传code了,都由服务器来处理
|
|
||||||
// ).then(function(response){
|
|
||||||
// console.log(response.data);
|
|
||||||
// if(response.data.status != 0){
|
|
||||||
// $location.path("/login_tip");
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
if(!data.comment || data.comment.length<=0){
|
if(!data.comment || data.comment.length<=0){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var temp = data.comment.replace(/\n/g,'<br/>');
|
var temp = data.comment.replace(/\n/g,'<br/>');
|
||||||
|
|
||||||
|
if(typeof beforeReply==='function'){
|
||||||
|
temp = beforeReply(temp);
|
||||||
|
}
|
||||||
|
|
||||||
var userInfo = {
|
var userInfo = {
|
||||||
type: type,
|
type: type,
|
||||||
content: temp,
|
content: temp,
|
||||||
|
@ -121,6 +114,8 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
||||||
//回复按钮禁用
|
//回复按钮禁用
|
||||||
data.disabled = true;
|
data.disabled = true;
|
||||||
|
|
||||||
|
console.log(userInfo);
|
||||||
|
|
||||||
$http({
|
$http({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: apiUrl+ "new_comment/"+id,
|
url: apiUrl+ "new_comment/"+id,
|
||||||
|
@ -308,7 +303,8 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
|
||||||
loadData(args.id,0,0);
|
loadData(args.id,0,0);
|
||||||
args.scope.addReply = function(data,reply_type){
|
args.scope.addReply = function(data,reply_type){
|
||||||
console.log(data.comment);
|
console.log(data.comment);
|
||||||
addCommonReply(data.act_id, args.replyType, data,args,reply_type, function(subscribe){
|
|
||||||
|
addCommonReply(data.act_id, args.replyType, data,args, reply_type, args.beforeReplay, function(subscribe){
|
||||||
// args.scope.formData = {comment: ''};
|
// args.scope.formData = {comment: ''};
|
||||||
if(subscribe == 0){
|
if(subscribe == 0){
|
||||||
$location.path("/login_tip");
|
$location.path("/login_tip");
|
||||||
|
|
|
@ -175,6 +175,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
|
||||||
.mr100 {margin-right:100px !important;}
|
.mr100 {margin-right:100px !important;}
|
||||||
.mr118 {margin-right:118px !important;}
|
.mr118 {margin-right:118px !important;}
|
||||||
.mr130 {margin-right:130px;}
|
.mr130 {margin-right:130px;}
|
||||||
|
.mr135 {margin-right:135px;}
|
||||||
.mr150 {margin-right:150px;}
|
.mr150 {margin-right:150px;}
|
||||||
.mw15{margin:0 15px;}
|
.mw15{margin:0 15px;}
|
||||||
.mr90 {margin-right:90px;}
|
.mr90 {margin-right:90px;}
|
||||||
|
@ -316,6 +317,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
|
||||||
.H60 {height:60px !important;}
|
.H60 {height:60px !important;}
|
||||||
.H150{ height:150px;}
|
.H150{ height:150px;}
|
||||||
.p10 {padding-left:10px; padding-right:10px;}
|
.p10 {padding-left:10px; padding-right:10px;}
|
||||||
|
.mw150 {max-width: 150px !important;}
|
||||||
.mw220 {max-width: 220px !important;}
|
.mw220 {max-width: 220px !important;}
|
||||||
.mw280 {max-width:280px !important;}
|
.mw280 {max-width:280px !important;}
|
||||||
.mw360 {max-width: 360px !important;}
|
.mw360 {max-width: 360px !important;}
|
||||||
|
@ -324,6 +326,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
|
||||||
.mh18 {max-height: 18px;}
|
.mh18 {max-height: 18px;}
|
||||||
.max_h54 {max-height:54px; }
|
.max_h54 {max-height:54px; }
|
||||||
.maxHeight100 {max-height:100px; overflow-x:hidden; overflow-y:auto;}
|
.maxHeight100 {max-height:100px; overflow-x:hidden; overflow-y:auto;}
|
||||||
|
.maxHeight200 {max-height:200px; overflow-x:hidden; overflow-y:auto;}
|
||||||
|
|
||||||
.W50{ width:50px;}
|
.W50{ width:50px;}
|
||||||
.W120{ width:110px;}
|
.W120{ width:110px;}
|
||||||
|
@ -674,6 +677,21 @@ a.sy_btn_grey_mini{
|
||||||
border-radius:3px;
|
border-radius:3px;
|
||||||
}
|
}
|
||||||
a:hover.sy_btn_grey_mini{ background: #c3c3c3;}
|
a:hover.sy_btn_grey_mini{ background: #c3c3c3;}
|
||||||
|
a.btn_grey_mid{
|
||||||
|
display:inline-block;
|
||||||
|
color: #565656;
|
||||||
|
background: #eaeaea;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 12px;
|
||||||
|
padding:0 10px;
|
||||||
|
height: 26px;
|
||||||
|
line-height: 26px;
|
||||||
|
-webkit-border-radius:3px;
|
||||||
|
-moz-border-radius:3px;
|
||||||
|
-o-border-radius:3px;
|
||||||
|
border-radius:3px;
|
||||||
|
}
|
||||||
|
a:hover.btn_grey_mid{ background: #c8c8c8;}
|
||||||
a.sy_btn_green{
|
a.sy_btn_green{
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|
|
@ -604,3 +604,5 @@ a:hover.ex_icon_edit{ background:url(/images/course/icons.png) -21px -276px no-
|
||||||
.archive_course_notice {width:220px; position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-265px; top:-15px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
|
.archive_course_notice {width:220px; position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-265px; top:-15px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
|
||||||
.archive_course_notice em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
|
.archive_course_notice em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
|
||||||
.archive_course_notice span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;}
|
.archive_course_notice span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;}
|
||||||
|
|
||||||
|
.teacher_member_img{width:50px; height:50px; border: 1px solid #fff;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;}
|
|
@ -20,6 +20,8 @@ input.radio-width90{ width: 90px; }
|
||||||
.muban_icons_blue{font-size: 12px;padding: 0 5px;border-radius: 3px;line-height: 14px;color: #3b94d6;border: 1px solid #3b94d6;}
|
.muban_icons_blue{font-size: 12px;padding: 0 5px;border-radius: 3px;line-height: 14px;color: #3b94d6;border: 1px solid #3b94d6;}
|
||||||
/*模板buttons 20161013byLB*/
|
/*模板buttons 20161013byLB*/
|
||||||
.btn{display: inline-block;border:none; padding:0 10px;color: #333;background: #e1e1e1; text-align:center;font-size: 12px; height: 30px;line-height: 30px;-webkit-border-radius: 3px;-moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; }
|
.btn{display: inline-block;border:none; padding:0 10px;color: #333;background: #e1e1e1; text-align:center;font-size: 12px; height: 30px;line-height: 30px;-webkit-border-radius: 3px;-moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; }
|
||||||
|
.btn-commit-issue{display: inline-block;border:none; padding:0 5px;color: #333;background: #e1e1e1; text-align:center;font-size: 12px; height: 20px;line-height: 20px;-webkit-border-radius: 3px;-moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; margin-top: 6px;}
|
||||||
|
.btn-commit{display: inline-block;border:none; padding:0 10px;color: #333;background: #e1e1e1; text-align:center;font-size: 12px; height: 20px;-webkit-border-radius: 3px;-moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; }
|
||||||
.btn:hover{background: #c3c3c3; color: #333;}
|
.btn:hover{background: #c3c3c3; color: #333;}
|
||||||
.btn-grey{background: #d9d9d9; color: #656565;}
|
.btn-grey{background: #d9d9d9; color: #656565;}
|
||||||
.btn-grey:hover{background: #717171; color: #fff;}
|
.btn-grey:hover{background: #717171; color: #fff;}
|
||||||
|
|
|
@ -788,6 +788,7 @@ a:hover.issues_list_title{color:#3b94d6;}
|
||||||
.hw_search_box{ position:relative; }
|
.hw_search_box{ position:relative; }
|
||||||
.hw_search_box input.hw_search-input{ width:293px; height:28px; border:none; border:1px solid #e7e7e7; background:#fff; padding-left:5px;padding-right: 25px;}
|
.hw_search_box input.hw_search-input{ width:293px; height:28px; border:none; border:1px solid #e7e7e7; background:#fff; padding-left:5px;padding-right: 25px;}
|
||||||
.hw_search_box a.hw_btn_search{display:block; width:20px; height:20px; background:url(/images/hw/icons_hw.png) 0 -57px no-repeat; position:absolute; right:5px; top:5px; cursor:pointer;}
|
.hw_search_box a.hw_btn_search{display:block; width:20px; height:20px; background:url(/images/hw/icons_hw.png) 0 -57px no-repeat; position:absolute; right:5px; top:5px; cursor:pointer;}
|
||||||
|
.hw_search_box input.hw_btn_search{display:block; width:20px; height:20px; background:url(/images/hw/icons_hw.png) 0 -57px no-repeat; position:absolute; right:5px; top:5px; cursor:pointer;}
|
||||||
.hw_search_box a:hover.hw_btn_search{background:url(/images/hw/icons_hw.png) -40px -57px no-repeat;}
|
.hw_search_box a:hover.hw_btn_search{background:url(/images/hw/icons_hw.png) -40px -57px no-repeat;}
|
||||||
.hw_files_icon{display:block; width:17px; height:14px; background:url(../images/hw/icons_hw.png) 0 -135px no-repeat;}
|
.hw_files_icon{display:block; width:17px; height:14px; background:url(../images/hw/icons_hw.png) 0 -135px no-repeat;}
|
||||||
/* 编辑删除 与课程相同 */
|
/* 编辑删除 与课程相同 */
|
||||||
|
@ -1001,8 +1002,8 @@ a.pullreques_reply_name{ font-weight: bold; color: #333;}
|
||||||
.pullreques_reply_txt{ width: 900px;color: #666;}
|
.pullreques_reply_txt{ width: 900px;color: #666;}
|
||||||
.pullreques_pull_top { width: 100%; height: 40px; line-height: 40px; background: #f4f4f4; border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;}
|
.pullreques_pull_top { width: 100%; height: 40px; line-height: 40px; background: #f4f4f4; border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;}
|
||||||
a.pullreques_pull_name{display: block; margin-left: 5px;max-width:80px; color:#3b94d6 !important; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
|
a.pullreques_pull_name{display: block; margin-left: 5px;max-width:80px; color:#3b94d6 !important; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
|
||||||
.pullreques_pull_list li{ height: 30px; line-height: 30px; }
|
.pullreques_pull_list li{ height: 35px; line-height: 35px; }
|
||||||
.pullreques_pull_txt{display: block; margin-left: 10px;max-width:740px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
|
.pullreques_pull_txt{display: block; margin-left: 10px;max-width:640px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
|
||||||
.pullreques_change_list li{height: 40px; line-height: 40px;border-bottom:1px solid #e1e1e1; }
|
.pullreques_change_list li{height: 40px; line-height: 40px;border-bottom:1px solid #e1e1e1; }
|
||||||
.pullreques_change_list li:last-child{ border-bottom: none;}
|
.pullreques_change_list li:last-child{ border-bottom: none;}
|
||||||
.pullreques_icons_add{background: url(/images/new_project/icons_issue.png) 0 -374px no-repeat; display: inline-block; width: 19px; height: 16px;}
|
.pullreques_icons_add{background: url(/images/new_project/icons_issue.png) 0 -374px no-repeat; display: inline-block; width: 19px; height: 16px;}
|
||||||
|
@ -1057,7 +1058,7 @@ table.text-file{}
|
||||||
.old:hover{ background:#fffaf1; }
|
.old:hover{ background:#fffaf1; }
|
||||||
.new{ background: #eaffea;}
|
.new{ background: #eaffea;}
|
||||||
.new:hover{ background:#fffaf1; }
|
.new:hover{ background:#fffaf1; }
|
||||||
|
.commit_id_value{color: white !important;}
|
||||||
/* 我的缺陷列表*/
|
/* 我的缺陷列表*/
|
||||||
.myissues_con{ width:968px; padding:15px; border:1px solid #ddd; background-color:#fff; color:#444; margin: 0 auto; }
|
.myissues_con{ width:968px; padding:15px; border:1px solid #ddd; background-color:#fff; color:#444; margin: 0 auto; }
|
||||||
.myissues_head{ width: 100%; height: 40px; line-height: 40px; background: #f4f4f4; }
|
.myissues_head{ width: 100%; height: 40px; line-height: 40px; background: #f4f4f4; }
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue