Merge branch 'develop' into dai_ao

Conflicts:
	app/controllers/pull_requests_controller.rb
	app/views/users/_user_message_course.html.erb
	app/views/users/_user_message_forge.html.erb
This commit is contained in:
daiao 2016-12-02 13:26:41 +08:00
commit 77f252b538
73 changed files with 832 additions and 686 deletions

View File

@ -175,8 +175,10 @@ class AdminController < ApplicationController
def courses def courses
@name = params[:name].to_s.strip.downcase @name = params[:name].to_s.strip.downcase
if @name && @name != "" if @name && @name != ""
@courses = Course.select{ |course| course.teacher && ((course.teacher.show_name).include?(@name) || course.name.include?(@name))} all_user_ids = Course.all.map{|course| course.tea_id}
@courses = @courses.sort{|x, y| y.created_at <=> x.created_at} user_str_ids = search_user_by_name all_user_ids, @name
user_ids = user_str_ids.empty? ? "(-1)" : "(" + user_str_ids.join(",") + ")"
@courses = Course.where("tea_id in #{user_ids} or name like '%#{@name}%'").reorder("created_at desc")
else else
@courses = Course.order('created_at desc') @courses = Course.order('created_at desc')
end end

View File

@ -14,17 +14,17 @@ class MemosController < ApplicationController
# layout 'base_memos' # layout 'base_memos'
def quote def quote
@subject = @memo.subject # @subject = @memo.subject
@subject = "RE: #{@subject}" unless @subject.starts_with?('RE:') # @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
#
@content = "#{ll(Setting.default_language, :text_user_wrote, @memo.author)} <br/> &nbsp; " # @content = "#{ll(Setting.default_language, :text_user_wrote, @memo.author)} <br/> &nbsp; "
@content << @memo.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "</blockquote>\n\n<br/>" # @content << @memo.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "</blockquote>\n\n<br/>"
@content = "<blockquote style='word-break: break-all;word-wrap: break-word;'>" << @content # @content = "<blockquote style='word-break: break-all;word-wrap: break-word;'>" << @content
#@content = "> #{ll(Setting.default_language, :text_user_wrote, @memo.author)}\n> " # #@content = "> #{ll(Setting.default_language, :text_user_wrote, @memo.author)}\n> "
#@content << @memo.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" # #@content << @memo.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
#@content_html = textilizable(@content) # #@content_html = textilizable(@content)
@temp = Memo.new # @temp = Memo.new
@temp.content = @content # @temp.content = @content
end end
def new def new
@ -47,6 +47,8 @@ class MemosController < ApplicationController
@quote = params[:quote] @quote = params[:quote]
end end
#unless params[:quote].nil? #unless params[:quote].nil?
# @quote = params[:quote][:quote] # @quote = params[:quote][:quote]
#end #end
@ -55,6 +57,10 @@ class MemosController < ApplicationController
@memo.forum_id = params[:forum_id] @memo.forum_id = params[:forum_id]
@memo.author_id = User.current.id @memo.author_id = User.current.id
if params[:memo][:parent_id]
@memo.root_id = (Memo.find params[:memo][:parent_id]).root_id.nil? ? params[:memo][:parent_id].to_i : (Memo.find params[:memo][:parent_id]).root_id
end
@memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads])) @memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads]))
@memo.content = @quote + @memo.content @memo.content = @quote + @memo.content
respond_to do |format| respond_to do |format|
@ -111,32 +117,37 @@ class MemosController < ApplicationController
@memo = @memo.root # 取出楼主防止输入帖子id让回复作为主贴显示 @memo = @memo.root # 取出楼主防止输入帖子id让回复作为主贴显示
@memo.update_column(:viewed_count, (@memo.viewed_count.to_i + 1)) @memo.update_column(:viewed_count, (@memo.viewed_count.to_i + 1))
page = params[:page] # page = params[:page]
if params[:r] && page.nil? # if params[:r] && page.nil?
offset = @memo.children.where("#{Memo.table_name}.id < ?", params[:r].to_i).count # offset = @memo.children.where("#{Memo.table_name}.id < ?", params[:r].to_i).count
page = 1 + offset / pre_count # page = 1 + offset / pre_count
else # else
# end
end
@reply_count = @memo.children.count # @reply_count = @memo.children.count
@reply_pages = Paginator.new @reply_count, pre_count, page # @reply_pages = Paginator.new @reply_count, pre_count, page
@replies = @memo.children. # @replies = @memo.children.
includes(:author, :attachments). # includes(:author, :attachments).
reorder("#{Memo.table_name}.created_at DESC"). # reorder("#{Memo.table_name}.created_at DESC").
limit(@reply_pages.per_page). # limit(@reply_pages.per_page).
offset(@reply_pages.offset). # offset(@reply_pages.offset).
all # all
@replies = Memo.where("root_id = #{@memo.id}").reorder("created_at desc")
@reply_count = @replies.count
@replies = get_no_children_comments_all @replies
@limit_count = @replies.count
@page = params[:page] ? params[:page].to_i + 1 : 0
@limit = 10
@replies = @replies[@page * @limit..@page * @limit + 9]
@memo_new = Memo.new @memo_new = Memo.new
@my_topic_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is null").count @my_topic_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is null").count
@my_replies_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is not null").count @my_replies_count = Memo.where("forum_id = #{@memo.forum_id} and author_id = #{User.current.id} and parent_id is not null").count
# @memo = Memo.find_by_id(params[:id])
# @forum = Forum.find(params[:forum_id])
# @replies = @memo.replies
# @mome_new = Memo.new
respond_to do |format| respond_to do |format|
format.js
format.html {render :layout=> 'base_forums'}#:layout=> 'base_forums', format.html {render :layout=> 'base_forums'}#:layout=> 'base_forums',
format.json { render json: @memo } format.json { render json: @memo }
format.xml { render xml: @memo } format.xml { render xml: @memo }

View File

@ -1,15 +1,19 @@
# encoding: utf-8
# 如果你对改模块任何功能不清楚,请不要随便改 # 如果你对改模块任何功能不清楚,请不要随便改
# @Hjqreturn # @Hjqreturn
class PullRequestsController < ApplicationController class PullRequestsController < ApplicationController
before_filter :authorize_logged before_filter :authorize_logged
before_filter :find_project_and_repository before_filter :find_project_and_repository
before_filter :connect_gitlab, :only => [:index, :show, :create, :accept_pull_request, :pull_request_commits, :pull_request_changes, :new, before_filter :connect_gitlab, :only => [:index, :show, :create, :accept_pull_request, :pull_request_commits, :pull_request_changes, :new, :update_pull_request, :pull_request_comments, :create_pull_request_comment, :compare_pull_request]
:update_pull_request, :pull_request_comments, :create_pull_request_comment, :compare_pull_request] before_filter :member_allowed, :only => [:new, :create]
before_filter :manager_allowed, :only => [:accept_pull_request]
layout "base_projects" layout "base_projects"
include PullRequestsHelper include PullRequestsHelper
include ApplicationHelper include ApplicationHelper
require 'ostruct'
# 返回json格式 # 返回json格式
def index def index
# project_menu_type 为了控制base顶部导航 # project_menu_type 为了控制base顶部导航
@ -92,7 +96,7 @@ class PullRequestsController < ApplicationController
if compare_pull_request(source_branch, target_project_id, target_branch) if compare_pull_request(source_branch, target_project_id, target_branch)
# 如果传送了目标项目ID即向fork源项目发送请求 # 如果传送了目标项目ID即向fork源项目发送请求
# if params[:forked_project_id] && params[:source_project] == "forked_project_name" # if params[:forked_project_id] && params[:source_project] == "forked_project_name"
if !params[:target_project_id].blank? if !params[:target_project_id].blank? && params[:target_project_id].to_i != @project.id
target_project_id = params[:forked_project_id].to_i target_project_id = params[:forked_project_id].to_i
request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch, :target_project_id => target_project_id) request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch, :target_project_id => target_project_id)
@fork_project_name = Project.find(params[:target_project_id]).try(:name) @fork_project_name = Project.find(params[:target_project_id]).try(:name)
@ -132,8 +136,14 @@ class PullRequestsController < ApplicationController
format.js{redirect_to new_project_pull_request_path(:show_tip => tip)} format.js{redirect_to new_project_pull_request_path(:show_tip => tip)}
end end
end end
rescue Gitlab::Error::Forbidden => e
@message = l(:label_pull_request_forbidden)
rescue Gitlab::Error::Conflict => e rescue Gitlab::Error::Conflict => e
@message = e.message @message = l(:label_pull_request_conflic)
rescue Gitlab::Error::NotFound => e
@message = l(:label_pull_request_notfound)
rescue Exception => e
puts e
end end
end end
@ -319,23 +329,38 @@ class PullRequestsController < ApplicationController
# id (required) - The ID of a project # id (required) - The ID of a project
# merge_request_id (required) - The ID of MR # merge_request_id (required) - The ID of MR
def pull_request_changes def pull_request_changes
begin
@type = params[:type] @type = params[:type]
@changes = @g.merge_request_changes(@project.gpid, params[:id]).try(:changes) @changes = @g.merge_request_changes(@project.gpid, params[:id]).try(:changes)
@changes_count = @changes.count
@changes_count = @changes.count
@limit = 10 @limit = 10
@is_remote = true @is_remote = true
@count = @changes_count @count = @changes_count
@pages = Paginator.new @count, @limit, params['page'] || 1 @pages = Paginator.new @count, @limit, params['page'] || 1
@offset ||= @pages.offset @offset ||= @pages.offset
@changes = paginateHelper @changes, 10 @changes = paginateHelper @changes, 10
rescue Exception => e
@message = e.message
end
end end
private private
# post 相关操作权限控制
# 项目管理员可操作
def manager_allowed
unless is_project_manager?(User.current.id, @project.id)
return render_403
end
end
# 项目成员可操作
def member_allowed
unless User.current.member_of?(@project)
return render_403
end
end
def send_message user_id, project_id, pull_request_id, status def send_message user_id, project_id, pull_request_id, status
ForgeMessage.create(:user_id => user_id, :project_id => project_id, ForgeMessage.create(:user_id => user_id, :project_id => project_id,
:forge_message_id => pull_request_id, :forge_message_type => "PullRequest", :viewed => true, :status => status) :forge_message_id => pull_request_id, :forge_message_type => "PullRequest", :viewed => true, :status => status)

View File

@ -49,6 +49,7 @@ class RepositoriesController < ApplicationController
helper :repositories helper :repositories
include RepositoriesHelper include RepositoriesHelper
helper :project_score helper :project_score
require 'ostruct'
#@root_path = RepositoriesHelper::ROOT_PATH #@root_path = RepositoriesHelper::ROOT_PATH
# require 'net/ssh' # require 'net/ssh'
@ -580,8 +581,12 @@ update
def commit_diff def commit_diff
# 顶部导航 # 顶部导航
@project_menu_type = 5 @project_menu_type = 5
@commit_diff = @g.commit_diff(@project.gpid, params[:changeset]) @commit_diff = @g.commit_diff(@project.gpid, params[:changeset])
diff = ActiveSupport::JSON.decode(@commit_diff.to_json).first
diff = OpenStruct.new(diff)
@diff_file = Trustie::Gitlab::Diff::File.new(diff)
@commit_details = @g.commit(@project.gpid, params[:changeset]) @commit_details = @g.commit(@project.gpid, params[:changeset])
render :layout => 'base_projects' render :layout => 'base_projects'
end end

View File

@ -164,6 +164,8 @@ class UsersController < ApplicationController
@comment = Comment.find params[:comment].to_i @comment = Comment.find params[:comment].to_i
when 'Journal','is_project_issue' when 'Journal','is_project_issue'
@comment = Journal.find params[:comment].to_i @comment = Journal.find params[:comment].to_i
when 'Memo'
@comment = Memo.find params[:comment].to_i
end end
@user_activity_id = params[:user_activity_id] @user_activity_id = params[:user_activity_id]
@parent_id = params[:parent_id] if params[:parent_id] @parent_id = params[:parent_id] if params[:parent_id]
@ -308,6 +310,15 @@ class UsersController < ApplicationController
@root.update_column('updated_at', Time.now) @root.update_column('updated_at', Time.now)
@count = @root.journals_for_messages.count @count = @root.journals_for_messages.count
@comments = @root.journals_for_messages.reorder("created_on desc").limit(3) @comments = @root.journals_for_messages.reorder("created_on desc").limit(3)
when 'Memo'
@root = reply.root
comment = Memo.new
comment.author = User.current
comment.forum = reply.forum
comment.content = params[:reply_message]
comment.subject = "#{@root.subject}"
comment.root_id = reply.root_id
reply.children << comment
end end
update_course_activity(@root.class.to_s,@root.id) update_course_activity(@root.class.to_s,@root.id)
update_user_activity(@root.class.to_s,@root.id) update_user_activity(@root.class.to_s,@root.id)

View File

@ -3422,6 +3422,8 @@ def get_reply_by_type type, reply_id
reply = Journal.find reply_id reply = Journal.find reply_id
when 'Syllabus' when 'Syllabus'
reply = JournalsForMessage.find reply_id reply = JournalsForMessage.find reply_id
when 'Memo'
reply = Memo.find reply_id
end end
reply reply
end end

View File

@ -19,6 +19,11 @@ module PullRequestsHelper
PullRequest.where(:pull_request_id => pull_request_id).first PullRequest.where(:pull_request_id => pull_request_id).first
end end
# 通过gitlab项目id获取Trustie项目的用户名
def find_gitlab_project gitlab_project_id
Project.find_by_gpid(gitlab_project_id).owner.try(:show_name)
end
def get_state state def get_state state
case state case state
when "open","reopened" when "open","reopened"

View File

@ -40,7 +40,7 @@ class Comment < ActiveRecord::Base
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id' belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
validates_presence_of :commented, :author, :comments validates_presence_of :commented, :author, :comments
safe_attributes 'comments','parent_id','reply_id','comments_count' safe_attributes 'comments','parent_id','reply_id','comments_count'
after_create :send_mail, :act_as_system_message, :act_as_student_score after_create :act_as_system_message, :act_as_student_score #:send_mail,
after_destroy :down_course_score after_destroy :down_course_score
def act_as_system_message def act_as_system_message
@ -55,11 +55,11 @@ class Comment < ActiveRecord::Base
# end # end
end end
else # 项目相关 else # 项目相关
if self.author_id != self.commented.author_id # if self.author_id != self.commented.author_id
self.forge_messages << ForgeMessage.new(:user_id => self.commented.author_id, :project_id => self.commented.project.id, :viewed => false) # self.forge_messages << ForgeMessage.new(:user_id => self.commented.author_id, :project_id => self.commented.project.id, :viewed => false)
#content = strip_html self.comments.html_safe, 200 # #content = strip_html self.comments.html_safe, 200
#ws.comment_template self.commented.author_id, "blog_comment", self.id, "#{l(:label_news_comment_template)}", self.author.try(:realname), format_time(self.created_on), content # #ws.comment_template self.commented.author_id, "blog_comment", self.id, "#{l(:label_news_comment_template)}", self.author.try(:realname), format_time(self.created_on), content
end # end
end end
end end

View File

@ -1,7 +1,7 @@
# Added by young # Added by young
class JournalsForMessageObserver < ActiveRecord::Observer class JournalsForMessageObserver < ActiveRecord::Observer
def after_create(journals_for_message) def after_create(journals_for_message)
Mailer.run.journals_for_message_add(User.current, journals_for_message) # Mailer.run.journals_for_message_add(User.current, journals_for_message)
end end
end end

View File

@ -109,40 +109,40 @@ class Mailer < ActionMailer::Base
# 邀请未注册用户加入项目 # 邀请未注册用户加入项目
# 功能: 在加入项目的同时自动注册用户 # 功能: 在加入项目的同时自动注册用户
def send_invite_in_project(email, project, invitor, first_name, last_name, gender) def send_invite_in_project(email, project, invitor, first_name, last_name, gender)
@email = email # @email = email
@subject = "#{invitor.name} #{l(:label_invite_project)} #{project.name} " # @subject = "#{invitor.name} #{l(:label_invite_project)} #{project.name} "
@password = newpass(6) # @password = newpass(6)
#
login = email # login = email
login = login.sub(/%40/,'@') # login = login.sub(/%40/,'@')
us = UsersService.new # us = UsersService.new
# 自动激活用户 # # 自动激活用户
user = us.register_auto(login, email, @password, first_name, last_name, gender) # user = us.register_auto(login, email, @password, first_name, last_name, gender)
InviteList.create(:user_id => user.id, :project_id => project.id, :mail =>email) # InviteList.create(:user_id => user.id, :project_id => project.id, :mail =>email)
User.current = user unless User.current.nil? # User.current = user unless User.current.nil?
@user = user # @user = user
@token = Token.get_token_from_user(user, 'autologin') # @token = Token.get_token_from_user(user, 'autologin')
@project_url = url_for(:controller => 'projects', :action => 'member', :id => project.id, :mail => true, :token => @token.value) # @project_url = url_for(:controller => 'projects', :action => 'member', :id => project.id, :mail => true, :token => @token.value)
mail :to => email, :subject => @subject # mail :to => email, :subject => @subject
end end
# 邀请已注册的用户加入项目 # 邀请已注册的用户加入项目
def request_member_to_project(email, project, invitor) def request_member_to_project(email, project, invitor)
@subject = "#{invitor.name} #{l(:label_invite_project)}: #{project.name} " # @subject = "#{invitor.name} #{l(:label_invite_project)}: #{project.name} "
user = User.find_by_mail(email.to_s) # user = User.find_by_mail(email.to_s)
@invitor_name = "#{invitor.name}" # @invitor_name = "#{invitor.name}"
@project_name = "#{project.name}" # @project_name = "#{project.name}"
@user = user # @user = user
@project = project # @project = project
if InviteList.where("project_id= ? and user_id =? and mail =?", project.id, @user.id, email).first.nil? # if InviteList.where("project_id= ? and user_id =? and mail =?", project.id, @user.id, email).first.nil?
InviteList.create(:user_id => user.id, :project_id => project.id, :mail => email) # InviteList.create(:user_id => user.id, :project_id => project.id, :mail => email)
end
@token = Token.get_token_from_user(user, 'autologin')
@project_url = url_for(:controller => 'projects', :action => 'member', :id => project.id, :user_id => user.id, :mail => true, :token => @token.value)
# 发送消息邀请
send_message_request_member(user,project)
# end # end
mail :to => email, :subject => @subject # @token = Token.get_token_from_user(user, 'autologin')
# @project_url = url_for(:controller => 'projects', :action => 'member', :id => project.id, :user_id => user.id, :mail => true, :token => @token.value)
# # 发送消息邀请
# send_message_request_member(user,project)
# # end
# mail :to => email, :subject => @subject
end end
# 邀请信息消息 注forge_message_id 为邀请人ID(特殊情况) # 邀请信息消息 注forge_message_id 为邀请人ID(特殊情况)
@ -293,23 +293,23 @@ class Mailer < ActionMailer::Base
# 公共讨论区发帖、回帖添加邮件发送信息 # 公共讨论区发帖、回帖添加邮件发送信息
def forum_message_added(memo) def forum_message_added(memo)
@memo = memo # @memo = memo
redmine_headers 'Memo' => memo.id # redmine_headers 'Memo' => memo.id
@forum = memo.forum # @forum = memo.forum
@author = memo.author # @author = memo.author
@forum_url = url_for(:controller => 'forums', :action => 'show', :id => @forum.id) # @forum_url = url_for(:controller => 'forums', :action => 'show', :id => @forum.id)
@issue_author_url = url_for(user_activities_url(@author)) # @issue_author_url = url_for(user_activities_url(@author))
recipients ||= [] # recipients ||= []
#将帖子创建者邮箱地址加入数组 # #将帖子创建者邮箱地址加入数组
recipients << @forum.creator.mail # recipients << @forum.creator.mail
#回复人邮箱地址加入数组 # #回复人邮箱地址加入数组
recipients << @author.mail # recipients << @author.mail
# cc = wiki_content.page.wiki.watcher_recipients - recipients # # cc = wiki_content.page.wiki.watcher_recipients - recipients
#
@memo_url = url_for(forum_memo_url(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id))) # @memo_url = url_for(forum_memo_url(@forum, (@memo.parent_id.nil? ? @memo : @memo.parent_id)))
mail :to => recipients, # mail :to => recipients,
:subject => "[ #{l(:label_message_plural)} : #{memo.subject} #{l(:label_memo_create_succ)}]", # :subject => "[ #{l(:label_message_plural)} : #{memo.subject} #{l(:label_memo_create_succ)}]",
:filter => true # :filter => true
end end
# Builds a Mail::Message object used to email recipients of the added journals for message. # Builds a Mail::Message object used to email recipients of the added journals for message.
@ -318,64 +318,64 @@ class Mailer < ActionMailer::Base
# 直接留言后 reply_id,m_parent_id 为空相对应的at_user取值为nil # 直接留言后 reply_id,m_parent_id 为空相对应的at_user取值为nil
def journals_for_message_add(user, journals_for_message) def journals_for_message_add(user, journals_for_message)
@user = journals_for_message.user # 留言人 # @user = journals_for_message.user # 留言人
@mail = journals_for_message.jour if journals_for_message.at_user.nil? # 留言 # @mail = journals_for_message.jour if journals_for_message.at_user.nil? # 留言
@mail = journals_for_message.at_user if journals_for_message.at_user # @mail = journals_for_message.at_user if journals_for_message.at_user
@message = journals_for_message.notes # @message = journals_for_message.notes
@title = "#@user #{t(:label_leave_your_message, :locale => 'zh')}" # @title = "#@user #{t(:label_leave_your_message, :locale => 'zh')}"
@issue_author_url = url_for(user_activities_url(@user)) # @issue_author_url = url_for(user_activities_url(@user))
@url = case journals_for_message.jour.class.to_s.to_sym # 判断留言的对象所属类型 # @url = case journals_for_message.jour.class.to_s.to_sym # 判断留言的对象所属类型
# when :Bid # # when :Bid
# course_for_bid_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}") # # course_for_bid_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Project # when :Project
return -1 if journals_for_message.jour.project_type == Project::ProjectType_project # return -1 if journals_for_message.jour.project_type == Project::ProjectType_project
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}") # project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Course # when :Course
course_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}") # course_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Contest # when :Contest
show_contest_contest_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}") # show_contest_contest_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :User # when :User
user_newfeedback_user_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}") # user_newfeedback_user_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
else # else
Rails.logger.error "[Builds a Mail::Message ERROR] journalsForMessage's jour is unkown type, journalsForMessage.id = #{journals_for_message.id}" # Rails.logger.error "[Builds a Mail::Message ERROR] journalsForMessage's jour is unkown type, journalsForMessage.id = #{journals_for_message.id}"
return -1 # return -1
end # end
#
# 验证用户的收取邮件的方式 # # 验证用户的收取邮件的方式
recipients ||= [] # recipients ||= []
recipients1 ||= [] # recipients1 ||= []
recipients1 = @mail.mail # recipients1 = @mail.mail
recipients = journals_for_message.jour.author.mail # recipients = journals_for_message.jour.author.mail
#
# modify by nwb # # modify by nwb
#如果是直接留言并且留言对象是课程 # #如果是直接留言并且留言对象是课程
if !journals_for_message.at_user && journals_for_message.jour.class.to_s.to_sym == :Course # if !journals_for_message.at_user && journals_for_message.jour.class.to_s.to_sym == :Course
course = journals_for_message.jour # course = journals_for_message.jour
@author = journals_for_message.user # @author = journals_for_message.user
#课程的教师 # #课程的教师
@members = course_all_member journals_for_message.jour # @members = course_all_member journals_for_message.jour
#收件人邮箱 # #收件人邮箱
@recipients ||= [] # @recipients ||= []
@members.each do |teacher| # @members.each do |teacher|
@recipients << teacher.user.mail # @recipients << teacher.user.mail
end # end
mail :to => @recipients, # mail :to => @recipients,
:subject => "#{l(:label_your_course)}#{journals_for_message.jour.name}#{l(:label_have_message)} ", # :subject => "#{l(:label_your_course)}#{journals_for_message.jour.name}#{l(:label_have_message)} ",
:filter => true # :filter => true
# elsif journals_for_message.jour.class.to_s.to_sym == :Bid # # elsif journals_for_message.jour.class.to_s.to_sym == :Bid
# # if !journals_for_message.jour.author.notify_about? journals_for_message
# # return -1
# # end
# #
# # mail :to => recipients, :subject => @title,:filter => true
# elsif journals_for_message.jour.class.to_s.to_sym == :Contest
# if !journals_for_message.jour.author.notify_about? journals_for_message # if !journals_for_message.jour.author.notify_about? journals_for_message
# return -1 # return -1
# end # end
#
# mail :to => recipients, :subject => @title,:filter => true # mail :to => recipients, :subject => @title,:filter => true
elsif journals_for_message.jour.class.to_s.to_sym == :Contest # else
if !journals_for_message.jour.author.notify_about? journals_for_message # mail :to => recipients1, :subject => @title,:filter => true
return -1 # end
end
mail :to => recipients, :subject => @title,:filter => true
else
mail :to => recipients1, :subject => @title,:filter => true
end
end end
@ -485,16 +485,16 @@ class Mailer < ActionMailer::Base
# 用户申请加入项目邮件通知 # 用户申请加入项目邮件通知
def applied_project(applied) def applied_project(applied)
@project =applied.project # @project =applied.project
redmine_headers 'Project' => @project, # redmine_headers 'Project' => @project,
'User' => applied.user # 'User' => applied.user
@user = applied.user # @user = applied.user
recipients = @project.manager_recipients # recipients = @project.manager_recipients
s = l(:text_applied_project, :id => "##{@user.show_name}", :project => @project.name) # s = l(:text_applied_project, :id => "##{@user.show_name}", :project => @project.name)
@token = Token.get_token_from_user(@user, 'autologin') # @token = Token.get_token_from_user(@user, 'autologin')
@applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members') # @applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members')
mail :to => recipients, # mail :to => recipients,
:subject => s # :subject => s
end end
def reminder(user, issues, days) def reminder(user, issues, days)
@ -555,14 +555,14 @@ class Mailer < ActionMailer::Base
# document_added(document) => Mail::Message object # document_added(document) => Mail::Message object
# Mailer.document_added(document).deliver => sends an email to the document's project recipients # Mailer.document_added(document).deliver => sends an email to the document's project recipients
def document_added(document) def document_added(document)
redmine_headers 'Project' => document.project.identifier # redmine_headers 'Project' => document.project.identifier
@author = User.current # @author = User.current
@document = document # @document = document
@issue_author_url = url_for(user_activities_url(@author)) # @issue_author_url = url_for(user_activities_url(@author))
@document_url = url_for(:controller => 'documents', :action => 'show', :id => document) # @document_url = url_for(:controller => 'documents', :action => 'show', :id => document)
mail :to => document.recipients, # mail :to => document.recipients,
:subject => "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}", # :subject => "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}",
:filter => true # :filter => true
end end
# Builds a Mail::Message object used to email recipients of a project when an attachements are added. # Builds a Mail::Message object used to email recipients of a project when an attachements are added.
@ -571,54 +571,54 @@ class Mailer < ActionMailer::Base
# attachments_added(attachments) => Mail::Message object # attachments_added(attachments) => Mail::Message object
# Mailer.attachments_added(attachments).deliver => sends an email to the project's recipients # Mailer.attachments_added(attachments).deliver => sends an email to the project's recipients
def attachments_added(attachments) def attachments_added(attachments)
container = attachments.first.container # container = attachments.first.container
added_to = '' # added_to = ''
added_to_url = '' # added_to_url = ''
@author = attachments.first.author # @author = attachments.first.author
@issue_author_url = url_for(user_activities_url(@author)) # @issue_author_url = url_for(user_activities_url(@author))
case container.class.name # case container.class.name
when 'Project' # when 'Project'
added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container) # added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container)
added_to = "#{l(:label_project)}: #{container}" # added_to = "#{l(:label_project)}: #{container}"
recipients = container.notified_users.select { |user| user.allowed_to?(:view_files, container) }.collect { |u| u.mail } # recipients = container.notified_users.select { |user| user.allowed_to?(:view_files, container) }.collect { |u| u.mail }
when 'Course' # when 'Course'
added_to_url = url_for(:controller => 'files', :action => 'index', :course_id => container) # added_to_url = url_for(:controller => 'files', :action => 'index', :course_id => container)
added_to = "#{l(:label_course)}: #{container.name}" # added_to = "#{l(:label_course)}: #{container.name}"
recipients = container.notified_users.select { |user| user.allowed_to?(:view_files, container) }.collect { |u| u.mail } # recipients = container.notified_users.select { |user| user.allowed_to?(:view_files, container) }.collect { |u| u.mail }
when 'Version' # when 'Version'
added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container.project) # added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container.project)
added_to = "#{l(:label_version)}: #{container.name}" # added_to = "#{l(:label_version)}: #{container.name}"
recipients = container.project.notified_users.select { |user| user.allowed_to?(:view_files, container.project) }.collect { |u| u.mail } # recipients = container.project.notified_users.select { |user| user.allowed_to?(:view_files, container.project) }.collect { |u| u.mail }
when 'Document' # when 'Document'
added_to_url = url_for(:controller => 'documents', :action => 'show', :id => container.id) # added_to_url = url_for(:controller => 'documents', :action => 'show', :id => container.id)
added_to = "#{l(:label_document)}: #{container.title}" # added_to = "#{l(:label_document)}: #{container.title}"
recipients = container.recipients # recipients = container.recipients
end # end
if container.class.name == 'Course' # if container.class.name == 'Course'
redmine_headers 'Course' => container.id # redmine_headers 'Course' => container.id
@attachments = attachments # @attachments = attachments
@added_to = added_to # @added_to = added_to
@added_to_url = added_to_url # @added_to_url = added_to_url
mail :to => recipients, # mail :to => recipients,
:subject => "[#{container.name}] #{l(:label_attachment_new)}", # :subject => "[#{container.name}] #{l(:label_attachment_new)}",
:filter => true # :filter => true
elsif container.class.name == 'Project' # elsif container.class.name == 'Project'
redmine_headers 'Project' => container.id # redmine_headers 'Project' => container.id
@attachments = attachments # @attachments = attachments
@added_to = added_to # @added_to = added_to
@added_to_url = added_to_url # @added_to_url = added_to_url
mail :to => recipients, # mail :to => recipients,
:subject => "[#{container.name}] #{l(:label_attachment_new)}", # :subject => "[#{container.name}] #{l(:label_attachment_new)}",
:filter => true # :filter => true
else # else
redmine_headers 'Project' => container.project.identifier # redmine_headers 'Project' => container.project.identifier
@attachments = attachments # @attachments = attachments
@added_to = added_to # @added_to = added_to
@added_to_url = added_to_url # @added_to_url = added_to_url
mail :to => recipients, # mail :to => recipients,
:subject => "[#{container.project.name}] #{l(:label_attachment_new)}", # :subject => "[#{container.project.name}] #{l(:label_attachment_new)}",
:filter => true # :filter => true
end # end
end end
# Builds a Mail::Message object used to email recipients of a course when an homework are posted. # Builds a Mail::Message object used to email recipients of a course when an homework are posted.
@ -650,15 +650,15 @@ class Mailer < ActionMailer::Base
def news_added(news) def news_added(news)
if news.project if news.project
redmine_headers 'Project' => news.project.identifier # redmine_headers 'Project' => news.project.identifier
@author = news.author # @author = news.author
@issue_author_url = url_for(user_activities_url(@author)) # @issue_author_url = url_for(user_activities_url(@author))
message_id news # message_id news
@news = news # @news = news
@news_url = url_for(:controller => 'news', :action => 'show', :id => news) # @news_url = url_for(:controller => 'news', :action => 'show', :id => news)
mail :to => news.recipients, # mail :to => news.recipients,
:subject => "[#{news.project.name}] #{l(:label_news)}: #{news.title}", # :subject => "[#{news.project.name}] #{l(:label_news)}: #{news.title}",
:filter => true # :filter => true
elsif news.course elsif news.course
redmine_headers 'Course' => news.course.id redmine_headers 'Course' => news.course.id
@author = news.author @author = news.author
@ -681,17 +681,17 @@ class Mailer < ActionMailer::Base
def news_comment_added(comment) def news_comment_added(comment)
news = comment.commented news = comment.commented
if news.project if news.project
redmine_headers 'Project' => news.project.identifier # redmine_headers 'Project' => news.project.identifier
@author = comment.author # @author = comment.author
@issue_author_url = url_for(user_activities_url(@author)) # @issue_author_url = url_for(user_activities_url(@author))
message_id comment # message_id comment
@news = news # @news = news
@comment = comment # @comment = comment
@news_url = url_for(:controller => 'news', :action => 'show', :id => news) # @news_url = url_for(:controller => 'news', :action => 'show', :id => news)
mail :to => news.recipients, # mail :to => news.recipients,
:cc => news.watcher_recipients, # :cc => news.watcher_recipients,
:subject => "Re: [#{news.project.name}] #{l(:label_news)}: #{news.title}", # :subject => "Re: [#{news.project.name}] #{l(:label_news)}: #{news.title}",
:filter => true # :filter => true
elsif news.course elsif news.course
redmine_headers 'Course' => news.course.id redmine_headers 'Course' => news.course.id
@author = comment.author @author = comment.author
@ -714,37 +714,37 @@ class Mailer < ActionMailer::Base
# message_posted(message) => Mail::Message object # message_posted(message) => Mail::Message object
# Mailer.message_posted(message).deliver => sends an email to the recipients # Mailer.message_posted(message).deliver => sends an email to the recipients
def message_posted(message) def message_posted(message)
if message.project # if message.project
redmine_headers 'Project' => message.project.identifier, # redmine_headers 'Project' => message.project.identifier,
'Topic-Id' => (message.parent_id || message.id) # 'Topic-Id' => (message.parent_id || message.id)
@author = message.author # @author = message.author
@issue_author_url = url_for(user_activities_url(@author)) # @issue_author_url = url_for(user_activities_url(@author))
message_id message # message_id message
references message.parent unless message.parent.nil? # references message.parent unless message.parent.nil?
recipients = message.recipients # recipients = message.recipients
cc = ((message.root.watcher_recipients + message.board.watcher_recipients).uniq - recipients) # cc = ((message.root.watcher_recipients + message.board.watcher_recipients).uniq - recipients)
@message = message # @message = message
@message_url = url_for(message.event_url) # @message_url = url_for(message.event_url)
mail :to => recipients, # mail :to => recipients,
:cc => cc, # :cc => cc,
:subject => "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}", # :subject => "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}",
:filter => true # :filter => true
elsif message.course # elsif message.course
redmine_headers 'Course' => message.course.id, # redmine_headers 'Course' => message.course.id,
'Topic-Id' => (message.parent_id || message.id) # 'Topic-Id' => (message.parent_id || message.id)
@author = message.author # @author = message.author
@issue_author_url = url_for(user_activities_url(@author)) # @issue_author_url = url_for(user_activities_url(@author))
message_id message # message_id message
references message.parent unless message.parent.nil? # references message.parent unless message.parent.nil?
recipients = message.course.notified_users.select { |user| user.allowed_to?(:view_files, message.course) }.collect { |u| u.mail } # recipients = message.course.notified_users.select { |user| user.allowed_to?(:view_files, message.course) }.collect { |u| u.mail }
cc = ((message.root.watcher_recipients + message.board.watcher_recipients).uniq - recipients) # cc = ((message.root.watcher_recipients + message.board.watcher_recipients).uniq - recipients)
@message = message # @message = message
@message_url = url_for(message.event_url) # @message_url = url_for(message.event_url)
mail :to => recipients, # mail :to => recipients,
:cc => cc, # :cc => cc,
:subject => "[#{message.board.course.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}", # :subject => "[#{message.board.course.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}",
:filter => true # :filter => true
end # end
end end
# Builds a Mail::Message object used to email the recipients of a project of the specified wiki content was added. # Builds a Mail::Message object used to email the recipients of a project of the specified wiki content was added.
@ -753,20 +753,20 @@ class Mailer < ActionMailer::Base
# wiki_content_added(wiki_content) => Mail::Message object # wiki_content_added(wiki_content) => Mail::Message object
# Mailer.wiki_content_added(wiki_content).deliver => sends an email to the project's recipients # Mailer.wiki_content_added(wiki_content).deliver => sends an email to the project's recipients
def wiki_content_added(wiki_content) def wiki_content_added(wiki_content)
redmine_headers 'Project' => wiki_content.project.identifier, # redmine_headers 'Project' => wiki_content.project.identifier,
'Wiki-Page-Id' => wiki_content.page.id # 'Wiki-Page-Id' => wiki_content.page.id
@author = wiki_content.author # @author = wiki_content.author
message_id wiki_content # message_id wiki_content
recipients = wiki_content.recipients # recipients = wiki_content.recipients
cc = wiki_content.page.wiki.watcher_recipients - recipients # cc = wiki_content.page.wiki.watcher_recipients - recipients
@wiki_content = wiki_content # @wiki_content = wiki_content
@wiki_content_url = url_for(:controller => 'wiki', :action => 'show', # @wiki_content_url = url_for(:controller => 'wiki', :action => 'show',
:project_id => wiki_content.project, # :project_id => wiki_content.project,
:id => wiki_content.page.title) # :id => wiki_content.page.title)
mail :to => recipients, # mail :to => recipients,
:cc => cc, # :cc => cc,
:subject => "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :id => wiki_content.page.pretty_title)}", # :subject => "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :id => wiki_content.page.pretty_title)}",
:filter => true # :filter => true
end end
# Builds a Mail::Message object used to email the recipients of a project of the specified wiki content was updated. # Builds a Mail::Message object used to email the recipients of a project of the specified wiki content was updated.
@ -775,23 +775,23 @@ class Mailer < ActionMailer::Base
# wiki_content_updated(wiki_content) => Mail::Message object # wiki_content_updated(wiki_content) => Mail::Message object
# Mailer.wiki_content_updated(wiki_content).deliver => sends an email to the project's recipients # Mailer.wiki_content_updated(wiki_content).deliver => sends an email to the project's recipients
def wiki_content_updated(wiki_content) def wiki_content_updated(wiki_content)
redmine_headers 'Project' => wiki_content.project.identifier, # redmine_headers 'Project' => wiki_content.project.identifier,
'Wiki-Page-Id' => wiki_content.page.id # 'Wiki-Page-Id' => wiki_content.page.id
@author = wiki_content.author # @author = wiki_content.author
message_id wiki_content # message_id wiki_content
recipients = wiki_content.recipients # recipients = wiki_content.recipients
cc = wiki_content.page.wiki.watcher_recipients + wiki_content.page.watcher_recipients - recipients # cc = wiki_content.page.wiki.watcher_recipients + wiki_content.page.watcher_recipients - recipients
@wiki_content = wiki_content # @wiki_content = wiki_content
@wiki_content_url = url_for(:controller => 'wiki', :action => 'show', # @wiki_content_url = url_for(:controller => 'wiki', :action => 'show',
:project_id => wiki_content.project, # :project_id => wiki_content.project,
:id => wiki_content.page.title) # :id => wiki_content.page.title)
@wiki_diff_url = url_for(:controller => 'wiki', :action => 'diff', # @wiki_diff_url = url_for(:controller => 'wiki', :action => 'diff',
:project_id => wiki_content.project, :id => wiki_content.page.title, # :project_id => wiki_content.project, :id => wiki_content.page.title,
:version => wiki_content.version) # :version => wiki_content.version)
mail :to => recipients, # mail :to => recipients,
:cc => cc, # :cc => cc,
:subject => "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_updated, :id => wiki_content.page.pretty_title)}", # :subject => "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_updated, :id => wiki_content.page.pretty_title)}",
:filter => true # :filter => true
end end
# Builds a Mail::Message object used to email the specified user their account information. # Builds a Mail::Message object used to email the specified user their account information.

View File

@ -79,9 +79,10 @@ class Memo < ActiveRecord::Base
"lock", "lock",
"sticky", "sticky",
"parent_id", "parent_id",
"replies_count" "replies_count",
"root_id"
after_create :add_author_as_watcher, :reset_counters!, :send_mail, :send_message,:create_memo_ealasticsearch_index after_create :add_author_as_watcher, :reset_counters!, :send_message,:create_memo_ealasticsearch_index
after_update :update_memo_ealasticsearch_index after_update :update_memo_ealasticsearch_index
after_destroy :reset_counters!,:delete_kindeditor_assets,:delete_memo_ealasticsearch_index#,:down_user_score -- 公共区发帖暂不计入得分, after_destroy :reset_counters!,:delete_kindeditor_assets,:delete_memo_ealasticsearch_index#,:down_user_score -- 公共区发帖暂不计入得分,
# after_create :send_notification # after_create :send_notification
@ -126,6 +127,18 @@ class Memo < ActiveRecord::Base
Mailer.run.forum_message_added(self) if Setting.notified_events.include?('forum_message_added') Mailer.run.forum_message_added(self) if Setting.notified_events.include?('forum_message_added')
end end
def creator_user
self.author
end
def created_time
self.created_on
end
def content_detail
self.content
end
# 公共贴吧消息记录 # 公共贴吧消息记录
# 原则贴吧创始人发帖人wanglingchun特殊用户 # 原则贴吧创始人发帖人wanglingchun特殊用户
def send_message def send_message

View File

@ -65,7 +65,7 @@ class News < ActiveRecord::Base
:author_key => :author_id :author_key => :author_id
acts_as_watchable acts_as_watchable
after_create :act_as_forge_activity, :act_as_course_activity, :add_author_as_watcher, :send_mail, :add_news_count, :act_as_student_score, :act_as_system_message,:delay_news_wechat_send,:delay_news_send after_create :act_as_course_activity, :add_author_as_watcher, :send_mail, :add_news_count, :act_as_student_score,:delay_news_wechat_send, :delay_news_send
after_update :update_activity after_update :update_activity
after_destroy :delete_kindeditor_assets, :decrease_news_count, :delete_org_activities, :down_course_score after_destroy :delete_kindeditor_assets, :decrease_news_count, :delete_org_activities, :down_course_score

View File

@ -82,7 +82,7 @@ class User < Principal
#每日一报、一事一报、不报 #每日一报、一事一报、不报
MAIL_NOTIFICATION_OPTIONS = [ MAIL_NOTIFICATION_OPTIONS = [
#['week', :label_user_mail_option_week], #['week', :label_user_mail_option_week],
['day', :label_user_mail_option_day], # ['day', :label_user_mail_option_day],
['all', :label_user_mail_option_all], ['all', :label_user_mail_option_all],
['none', :label_user_mail_option_none] ['none', :label_user_mail_option_none]
] ]

View File

@ -19,7 +19,7 @@
<div class="orig_reply mb10 mt-10"> <div class="orig_reply mb10 mt-10">
<div class="reply"> <div class="reply">
<span class="reply-right"> <span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>"> <span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span> </span>
<span style="position: relative" class="fr mr20"> <span style="position: relative" class="fr mr20">

View File

@ -1,4 +1,5 @@
<% unless contributor_course_scor(course.id).count == 0 %> <% count = contributor_course_scor(course.id).select{|ccs| ccs.con_score != 0 && !ccs.con_score.nil?}.count %>
<% unless count == 0 %>
<div> <div>
<ul class="rankList"> <ul class="rankList">
<h3 style="font-size: 14px; font-weight: normal;"> <h3 style="font-size: 14px; font-weight: normal;">

View File

@ -25,7 +25,7 @@
<div class="ping_disfoot f14"> <div class="ping_disfoot f14">
<% ids = 'project_respond_form_'+ journal.id.to_s%> <% ids = 'project_respond_form_'+ journal.id.to_s%>
<span id="reply_praise_count_<%=journal.id %>"> <span class="reply_praise_count_<%=journal.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%>
</span> </span>
<% if reply_allow %> <% if reply_allow %>

View File

@ -1,5 +1,9 @@
hideModal(); hideModal();
$("#member_li_<%=params[:member_id] %>").html(""); var all_indexes = $("#member_li_<%=params[:member_id] %>").nextAll().find("td:first-child");
for(var i = 0; i < all_indexes.length; i++){
$(all_indexes[i]).html(parseInt($(all_indexes[i]).html()) - 1);
}
$("#member_li_<%=params[:member_id] %>").remove();
$("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>"); $("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>");
$("#group_children_list").html("<%= escape_javascript( render :partial => 'layouts/group_children_list', :locals => {:course => @course})%>"); $("#group_children_list").html("<%= escape_javascript( render :partial => 'layouts/group_children_list', :locals => {:course => @course})%>");
$("#student_number").html("<%= studentCount(@course) %>"); $("#student_number").html("<%= studentCount(@course) %>");

View File

@ -1,20 +1,8 @@
<div class="sy_class_r sy_class_nobg fr ml10"> <div class="sy_class_r sy_class_nobg fr ml10">
<div class="sy_class_r_head mb10"> <div class="sy_class_r_head mb10">
<h3>学生列表(<%=@group.name %></h3> <h3 class="fl">学生列表(<%=@group.name %></h3>
<div class="hw_more_box"> <%= link_to "导出成绩", export_course_member_excel_course_path(@course,:group_id => @group.id ,:format => 'xls'), :class => 'link-blue fr mt5'%>
<ul> <div class="cl"></div>
<li class="hw_more_icons">
<ul class="hw_more_txt">
<li><%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:group_id => @group.id ,:format => 'xls'), :class => 'hw_more_li'%></li>
<% if @canShowCode %>
<li>
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'hw_more_li' %>
</li>
<% end %>
</ul>
</li>
</ul>
</div>
</div> </div>
<div class="sy_class_fenban clear"> <div class="sy_class_fenban clear">

View File

@ -17,7 +17,7 @@
<% if User.current.allowed_to?(:as_teacher,@course) %> <% if User.current.allowed_to?(:as_teacher,@course) %>
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'link-blue ml10 fr mt5' %> <%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'link-blue ml10 fr mt5' %>
<% end %> <% end %>
<%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'), :class => 'link-blue fr mt5'%> <%= link_to "导出成绩", export_course_member_excel_course_path(@course,:format => 'xls'), :class => 'link-blue fr mt5'%>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<%= render :partial => 'course_student', :locals => {:members => @members} %> <%= render :partial => 'course_student', :locals => {:members => @members} %>

View File

@ -18,7 +18,8 @@
</div> </div>
<div class="postDetailReply fr"> <div class="postDetailReply fr">
<a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a> <a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a>
<%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %> <% replies_count = Memo.where("root_id = #{topic.id}").count %>
<%= link_to (replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %>
<a href="javascript:void(0);" class="linkGrey2 disablePostLikeIcon ml10" style="cursor: default" title="点赞人数" > <%= get_praise_num(topic)%></a> <a href="javascript:void(0);" class="linkGrey2 disablePostLikeIcon ml10" style="cursor: default" title="点赞人数" > <%= get_praise_num(topic)%></a>
</div> </div>

View File

@ -24,7 +24,7 @@
<div class="orig_reply mb10 mt-10"> <div class="orig_reply mb10 mt-10">
<div class="reply"> <div class="reply">
<span class="reply-right"> <span class="reply-right">
<span id="reply_praise_count_<%= comment.id %>"> <span class="reply_praise_count_<%= comment.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %> <%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %>
</span> </span>
<span style="position: relative" class="fr mr20"> <span style="position: relative" class="fr mr20">

View File

@ -147,7 +147,7 @@
<% end %> <% end %>
<% elsif ma.class == OrgMessage %> <% elsif ma.class == OrgMessage %>
<% if ma.message_type == 'ApplySubdomain' && ma.organization %> <% if ma.message_type == 'ApplySubdomain' && ma.organization %>
<li><a href="<%=agree_apply_subdomain_organizations_path( :organization_id => ma.organization_id, :org_domain => ma.content, :user_id => ma.sender_id, :act_id => ma.id ) %>" target="_blank" title="<%=ma.organization.name %> 申请子域名:<%= (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count == 0 || (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count > 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准"%>"><span class="shadowbox_news_user"><%=ma.organization.name %> </span>申请子域名:<%= (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count == 0 || (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count > 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准"%></a></li> <li><a href="<%=organization_path(ma.organization_id) %>" target="_blank" title="<%=ma.organization.name %> 申请子域名:<%= ma.content%>"><span class="shadowbox_news_user"><%=ma.organization.name %> </span>申请子域名:<%= ma.content%></a></li>
<% elsif ma.message_type == 'AgreeApplySubdomain' %> <% elsif ma.message_type == 'AgreeApplySubdomain' %>
<li><a href="javascript:void(0)" target="_blank" title="系统提示 管理员同意了您的子域名申请:<%= ma.content%>"><span class="shadowbox_news_user">系统提示 </span>管理员同意了您的子域名申请:<%= ma.content%></a></li> <li><a href="javascript:void(0)" target="_blank" title="系统提示 管理员同意了您的子域名申请:<%= ma.content%>"><span class="shadowbox_news_user">系统提示 </span>管理员同意了您的子域名申请:<%= ma.content%></a></li>
<% end %> <% end %>

View File

@ -7,13 +7,10 @@
<meta name="keywords" content="issue,bug,tracker" /> <meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
<%= favicon %> <%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', 'nyan', :media => 'all' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application', 'jquery.colorbox-min') %> <%= javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application', 'jquery.colorbox-min') %>
<%= import_ke(enable_at: false, prettify: true, init_activity: false) %>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>

View File

@ -0,0 +1,77 @@
<% @replies.each do |reply| %>
<script type="text/javascript">
$(function(){
$("#activity_description_<%= reply.id %> p,#activity_description_<%= reply.id %> span,#activity_description_<%= reply.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
postContent = postContent.replace(/<script>*/g, "<script>");
postContent = postContent.replace(/<html>*/g, "<html>");
$(this).html(postContent);
});
autoUrl('activity_description_<%= reply.id %>');
description_show_hide(<%= reply.id %>);
});
$(".homepagePostReplyDes").mouseover(function(){
$(this).find("a[id*='delete_memo_reply']").show();
}).mouseout(function(){
$(this).find("a[id*='delete_memo_reply']").hide();
});
</script>
<div class="homepagePostReplyContainer" >
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
<div class="homepagePostReplyPublisher">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply, :type => 'Memo', :user_activity_id => @memo.id}%>
</div>
<div class="homepagePostReplyContent break_word" style="margin-bottom:15px;" id="activity_description_<%= reply.id %>">
<p><%= reply.content.gsub(/script/, "script&nbsp").html_safe %></p>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span class="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_reply)) %>
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
forum_memo_path(@memo.forum, reply),
:method => :delete,
:id => "delete_reply_#{reply.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if @memo.author.id == User.current.id || User.current.admin? %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= reply.id%>"></p>
</div>
<div class="cl"></div>
</div>
<% end %>
<% if @limit_count > @page * @limit + 10 %>
<div id="more_memo_replies">
<div class="detail_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开更多回复', forum_memo_path(@memo.forum_id, @memo, :page => @page),:remote=>true %>
</div>
</div>
<% end %>

View File

@ -0,0 +1,31 @@
<div class="ReplyToMessageContainer borderBottomNone" id="reply_to_message_<%= reply.id%>">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>">
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
</div>
<div class="ReplyToMessageInputContainer mb10">
<% if User.current.logged? %>
<div nhname='new_message_<%= reply.id%>'>
<%= form_for('memo',:url=>forum_memos_path,:method => "post") do |f|%>
<%= f.hidden_field :subject, :required => true, value: reply.subject %>
<%= f.hidden_field :forum_id, :required => true, value: reply.forum_id %>
<%= f.hidden_field :parent_id, :required => true, value: reply.id %>
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
<div nhname='toolbar_container_<%= reply.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="memo[content]"></textarea>
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= reply.id%>'></p>
<% end%>
</div>
<% else %>
<%= render :partial => "users/show_unlogged" %>
<% end %>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<script>
$(function(){
sd_create_editor_from_data(<%= reply.id%>,null,"100%", "<%=reply.class.to_s%>");
});
</script>

View File

@ -1,5 +1,5 @@
//ckeditor.setData("<%= raw escape_javascript(@content) %>"); if($("#reply_message_<%= @memo.id%>").length > 0) {
$('#message_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>"); $("#reply_message_<%= @memo.id%>").replaceWith("<%= escape_javascript(render :partial => 'memos/reply_message', :locals => {:reply => @memo}) %>");
$('#quote').val("<%= raw escape_javascript(@content) %>"); }else if($("#reply_to_message_<%= @memo.id%>").length >0) {
showAndScrollTo("new_memo", "cke_editor01"); $("#reply_to_message_<%= @memo.id%>").replaceWith("<p id='reply_message_<%= @memo.id%>'></p>");
$("img").removeAttr("align"); }

View File

@ -4,22 +4,6 @@
<% end %> <% end %>
<script> <script>
function expand_reply(container,btnid){
var target = $(container).children();
var btn = $(btnid);
if(btn.data('init')=='0'){
btn.data('init',1);
btn.html('收起回复');
target.show();
}else{
btn.data('init',0);
btn.html('展开更多');
target.hide();
target.eq(0).show();
target.eq(1).show();
target.eq(2).show();
}
}
$(function() { $(function() {
sd_create_editor_from_data(<%= @memo.id%>,null,"100%", "<%=@memo.class.to_s%>"); sd_create_editor_from_data(<%= @memo.id%>,null,"100%", "<%=@memo.class.to_s%>");
}); });
@ -82,46 +66,8 @@
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %></div> <div class="homepagePostReplyBannerCount">回复(<%=@reply_count %></div>
<div class="homepagePostReplyBannerTime"></div> <div class="homepagePostReplyBannerTime"></div>
</div> </div>
<div class="" id="reply_div_<%= @memo.id %>"> <div class="" id="reply_div_<%= @memo.id %>">
<% @replies.each_with_index do |reply,i| %> <%= render :partial => 'memos/memo_all_replies' %>
<div class="homepagePostReplyContainer" >
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.show_name%></a><%= format_date(reply.created_at) %></div>
<div class="homepagePostReplyContent break_word" style="margin-bottom:25px;" id="activity_description_<%= reply.id %>"><p><%= reply.content.gsub(/script/, "script&nbsp").html_safe %></p>
<% if @memo.author.id == User.current.id || User.current.admin? %>
<%= link_to "删除", forum_memo_path(@memo.forum, reply), :class => "fr undis", :method => "delete", :confirm => l(:text_are_you_sure), :id => "delete_memo_reply_#{reply.id}" %>
<% end %>
</div>
</div>
<script type="text/javascript">
$(function(){
$("#activity_description_<%= reply.id %> p,#activity_description_<%= reply.id %> span,#activity_description_<%= reply.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
postContent = postContent.gsub(/<script>*/, "<script>");
postContent = postContent.gsub(/<html>*/, "<html>");
$(this).html(postContent);
});
autoUrl('activity_description_<%= reply.id %>');
description_show_hide(<%= reply.id %>);
});
$(".homepagePostReplyDes").mouseover(function(){
$(this).find("a[id*='delete_memo_reply']").show();
}).mouseout(function(){
$(this).find("a[id*='delete_memo_reply']").hide();
});
</script>
<div class="cl"></div>
</div>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostReplyContainer borderBottomNone minHeight48"> <div class="homepagePostReplyContainer borderBottomNone minHeight48">

View File

@ -0,0 +1 @@
$("#more_memo_replies").replaceWith("<%= escape_javascript(render :partial => 'memos/memo_all_replies')%>");

View File

@ -18,7 +18,7 @@
<div class="orig_reply mb10 mt-10"> <div class="orig_reply mb10 mt-10">
<div class="reply"> <div class="reply">
<span class="reply-right"> <span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>"> <span class="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %> <%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span> </span>
<span style="position: relative" class="fr mr20"> <span style="position: relative" class="fr mr20">

View File

@ -18,7 +18,7 @@
<div class="orig_reply mb10 mt-10"> <div class="orig_reply mb10 mt-10">
<div class="reply"> <div class="reply">
<span class="reply-right"> <span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>"> <span class="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %> <%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span> </span>
<span style="position: relative" class="fr mr20"> <span style="position: relative" class="fr mr20">

View File

@ -18,7 +18,7 @@
<div class="orig_reply mb10 mt-10"> <div class="orig_reply mb10 mt-10">
<div class="reply"> <div class="reply">
<span class="reply-right"> <span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>"> <span class="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %> <%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span> </span>
<span style="position: relative" class="fr mr20"> <span style="position: relative" class="fr mr20">

View File

@ -19,7 +19,7 @@
<div class="orig_reply mb10 mt-10"> <div class="orig_reply mb10 mt-10">
<div class="reply"> <div class="reply">
<span class="reply-right"> <span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>"> <span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span> </span>
<span style="position: relative" class="fr mr20"> <span style="position: relative" class="fr mr20">

View File

@ -20,7 +20,7 @@
<div class="orig_reply mb10 mt-10"> <div class="orig_reply mb10 mt-10">
<div class="reply"> <div class="reply">
<span class="reply-right"> <span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>"> <span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span> </span>
<span style="position: relative" class="fr mr20"> <span style="position: relative" class="fr mr20">

View File

@ -356,7 +356,7 @@
<div class="orig_reply mb10 mt-10"> <div class="orig_reply mb10 mt-10">
<div class="reply"> <div class="reply">
<span class="reply-right"> <span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>"> <span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span> </span>
<span style="position: relative" class="fr mr20"> <span style="position: relative" class="fr mr20">

View File

@ -112,7 +112,7 @@
<%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(reply.created_on) %> <%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>"> <span class="reply_praise_count_<%=reply.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
</span> </span>
</div> </div>

View File

@ -81,7 +81,7 @@
<%= link_to comment.try(:author).try(:realname), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %> <%= link_to comment.try(:author).try(:realname), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(comment.created_on) %> <%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>"> <span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span> </span>
</div> </div>

View File

@ -92,7 +92,7 @@
<%= link_to reply.try(:user).try(:realname), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:user).try(:realname), user_url_in_org(reply.user_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(reply.created_on) %> <%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>"> <span class="reply_praise_count_<%=reply.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
</span> </span>
</div> </div>

View File

@ -91,7 +91,7 @@
<%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %> <%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
<% end %> <% end %>
<%= format_time(reply.created_on) %> <%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>"> <span class="reply_praise_count_<%=reply.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
</span> </span>
</div> </div>

View File

@ -2,7 +2,7 @@
<% if @type.to_s == 'activity' %> <% if @type.to_s == 'activity' %>
$('#praise_count_<%=@user_activity_id %>').html('<%= j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>'); $('#praise_count_<%=@user_activity_id %>').html('<%= j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>');
<% else @type.to_s == 'reply' %> <% else @type.to_s == 'reply' %>
$('#reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); $('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>');
<% end %> <% end %>
<% else %> <% else %>
$('#praise_tread').html('<%= j( $('#praise_tread').html('<%= j(

View File

@ -1,13 +1,13 @@
<% if @obj_type == 'Memo'%> <% if @activity %>
$('#praise_tread_<%= @obj.id %>').html('<%= j(
render :partial => "/memos/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal}
)%>');
<% elsif @activity %>
<% if @type.to_s == 'activity' %> <% if @type.to_s == 'activity' %>
$('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>'); $('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>');
<% else @type.to_s == 'reply' %> <% else @type.to_s == 'reply' %>
$('#reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); $('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>');
<% end %> <% end %>
<% elsif @obj_type == 'Memo'%>
$('#praise_tread_<%= @obj.id %>').html('<%= j(
render :partial => "/memos/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal}
)%>');
<% else %> <% else %>
$('#praise_tread_<%= @obj.id %>').html('<%= j( $('#praise_tread_<%= @obj.id %>').html('<%= j(
render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal} render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal}

View File

@ -1,7 +1,7 @@
<div class="orig_user fl"> <div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
</div> </div>
<div class="orig_right fl"> <div class="orig_right fl" style="width: 93%;" onmouseout="$(this).find('.reply-right').hide();" onmouseover="$(this).find('.reply-right').show();">
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %> <%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %>
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span> <span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="orig_content "> <div class="orig_content ">
@ -16,10 +16,10 @@
<%= comment.content_detail.html_safe %> <%= comment.content_detail.html_safe %>
<% end %> <% end %>
</div> </div>
<div class="orig_reply mt-10"> <div class="orig_reply mt-10 pr" style="height: 18px;">
<div class="reply"> <div class="reply">
<span class="reply-right"> <div class="reply-right none" style="position: absolute; right: 0px;">
<span id="reply_praise_count_<%=comment.id %>"> <span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span> </span>
<span style="position: relative" class="fr mr20"> <span style="position: relative" class="fr mr20">
@ -31,7 +31,7 @@
:title => l(:button_reply)) %> :title => l(:button_reply)) %>
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup03" style="display: none"> ︿</span> <span id="reply_iconup_<%=comment.id %>" class="reply_iconup03" style="display: none"> ︿</span>
</span> </span>
</span> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>

View File

@ -16,7 +16,7 @@
</div> </div>
<div class="ping_disfoot f14"> <div class="ping_disfoot f14">
<% ids = 'project_respond_form_'+ journal.id.to_s%> <% ids = 'project_respond_form_'+ journal.id.to_s%>
<span id="reply_praise_count_<%=journal.id %>"> <span class="reply_praise_count_<%=journal.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>journal, :user_activity_id=>journal.id,:type=>"reply"}%>
</span> </span>
<% if journal.user == User.current|| User.current.admin? %> <% if journal.user == User.current|| User.current.admin? %>

View File

@ -1,7 +1,7 @@
<div class="orig_user fl"> <div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
</div> </div>
<div class="orig_right fl"> <div class="orig_right fl" style="width: 93%;" onmouseout="$(this).find('.reply-right').hide();" onmouseover="$(this).find('.reply-right').show();">
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %> <%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %>
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span> <span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="orig_content "> <div class="orig_content ">
@ -16,13 +16,13 @@
<%= comment.content_detail.html_safe %> <%= comment.content_detail.html_safe %>
<% end %> <% end %>
</div> </div>
<div class="orig_reply mt-10"> <div class="orig_reply mt-10 pr" style="height: 18px;">
<div class="reply"> <div class="reply">
<span class="reply-right"> <div class="reply-right none" style="position: absolute; right: 0px;">
<span id="reply_praise_count_<%=comment.id %>"> <span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span> </span>
<span style="position: relative" class="fr mr20"> <span class="fr mr20">
<%= link_to( <%= link_to(
l(:button_reply), l(:button_reply),
{:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => 'Issue', :user_activity_id => user_activity_id, :parent_id => parent_id, :is_project => true}, {:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => 'Issue', :user_activity_id => user_activity_id, :parent_id => parent_id, :is_project => true},
@ -31,7 +31,7 @@
:title => l(:button_reply)) %> :title => l(:button_reply)) %>
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup03" style="display: none"> ︿</span> <span id="reply_iconup_<%=comment.id %>" class="reply_iconup03" style="display: none"> ︿</span>
</span> </span>
</span> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>

View File

@ -29,7 +29,7 @@
<div class="orig_reply mb10 mt-10"> <div class="orig_reply mb10 mt-10">
<div class="reply"> <div class="reply">
<span class="reply-right"> <span class="reply-right">
<span id="reply_praise_count_<%= comment.id %>"> <span class="reply_praise_count_<%= comment.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %> <%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %>
</span> </span>

View File

@ -20,7 +20,7 @@
<div class="orig_reply mb10 mt-10"> <div class="orig_reply mb10 mt-10">
<div class="reply"> <div class="reply">
<span class="reply-right"> <span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>"> <span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span> </span>

View File

@ -29,7 +29,7 @@
<div class="orig_reply mb10 mt-10"> <div class="orig_reply mb10 mt-10">
<div class="reply"> <div class="reply">
<span class="reply-right"> <span class="reply-right">
<span id="reply_praise_count_<%= comment.id %>"> <span class="reply_praise_count_<%= comment.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %> <%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %>
</span> </span>
<span style="position: relative" class="fr mr20"> <span style="position: relative" class="fr mr20">

View File

@ -1,51 +1,31 @@
<% if !@changes.blank? && @type == "3" %> <% if !@changes.blank? && @type == "3" %>
<div class="pullreques_change_box"> <div class="pullreques_change_box">
<div class="pullreques_pull_top clear"> <div class="pullreques_pull_top clear">
<p class="fl c_grey ml15">改动了<span class="fontBlue"> <%= @changes_count %></span> 个文件</p> <p class="fl c_grey ml15">改动了<span class="fontBlue"> <%= @changes_count %></span> 个文件</p>
</div> </div>
<ul class="pullreques_change_list"> <ul class="pullreques_change_list">
<% @changes.each do |change| %> <% @changes.each do |change| %>
<li><span class="fl ml15 mt12 <%= get_type_of_file(change) %>"></span><p class="pullreques_pull_txt ml5 fl"><%= change['new_path'] %></p></li> <li><span class="fl ml15 mt12 <%= get_type_of_file(change) %>"></span><p class="pullreques_pull_txt ml5 fl"><%= change['new_path'] %></p></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
<% @changes.each do |change| %> <% @changes.each do |change| %>
<div class="showing-changes-row fontGrey2"> <div class="showing-changes-row fontGrey2">
<a class="linkGrey3" id="changed-files"> <a class="linkGrey3" id="changed-files">
<img src="/images/vlicon/file.png" width="18" height="20" style="vertical-align:middle;" class="mr5" /><%= change['new_path'] %> <img src="/images/vlicon/file.png" width="18" height="20" style="vertical-align:middle;" class="mr5" /><%= change['new_path'] %>
</a> </a>
</div> </div>
<div class="autoscroll"> <div class="autoscroll">
<table class="filecontent syntaxhl" style="width:100%;" > <%= render :partial => 'repositories/change_diff', :locals => {:change => change} %>
<tbody> </div>
<% line_num = diff_line_num(change['diff']) %> <% end %>
<% diff_content = diff_content(change['diff']) %>
<% syntax_highlight_lines('new_path', Redmine::CodesetUtil.to_utf8_by_setting(diff_content)).each do |line| %> <div style="text-align:center;">
<tr> <div class="pages" style="width:auto; display:inline-block;">
<th class="line-num" id="L<%= line_num %>" style="vertical-align: top;"> <ul id="homework_pository_ref_pages">
<a href="#L<%= line_num %>" style="padding-top: 0px;"><%= line_num %></a> <%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</th> </ul>
<% if line[0,1] == "-" %> <div class="cl"></div>
<td class="line-code diff_out"><pre style="white-space:pre;"><%= line.html_safe %></pre></td> </div>
<% elsif line[0,1] == "+" %> </div>
<td class="line-code diff_in"><pre style="white-space:pre;"><%= line.html_safe %></pre></td> <% end %>
<% else%>
<td class="line-code"><pre style="white-space:pre;"><%= line.html_safe %></pre></td>
<% end %>
</tr>
<% line_num += 1 %>
<% end %>
</tbody>
</table>
</div>
<% end %>
<div style="text-align:center;">
<div class="pages" style="width:auto; display:inline-block;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @pages, @count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</ul>
<div class="cl"></div>
</div>
</div>
<% end %>

View File

@ -14,10 +14,8 @@
<div class="c_grey clear mt5"> <div class="c_grey clear mt5">
<p class="fl">由 <%= link_to get_user_by_login_and(request.author.try(:username)).try(:show_name), user_path(get_user_by_login_and(request.author.try(:username))), :class => "linkBlue2" %> 创建于<%= time_tag(request.created_at) %>前</p> <p class="fl">由 <%= link_to get_user_by_login_and(request.author.try(:username)).try(:show_name), user_path(get_user_by_login_and(request.author.try(:username))), :class => "linkBlue2" %> 创建于<%= time_tag(request.created_at) %>前</p>
<span class="fl ml10"><%= time_tag(request.updated_at) %>前更新</span> <span class="fl ml10"><%= time_tag(request.updated_at) %>前更新</span>
<p class="fr"><%= @project.name+"/"+request.source_branch %><span class="c_grey02 ml10 mr10">合并到</span><%= request.target_branch %></p> <p class="fr"><%= find_gitlab_project(request.source_project_id)+"/"+request.source_branch %><span class="c_grey02 ml10 mr10">合并到</span><%= find_gitlab_project(request.target_project_id)+"/"+request.target_branch %></p>
</div> </div>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -1 +1,2 @@
$("#merge_record_3").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_changes") %>'); $("#merge_record_3").html('<%= escape_javascript( render :partial => "pull_requests/pull_request_changes") %>');

View File

@ -0,0 +1,50 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<table class="filecontent syntaxhl">
<tbody>
<% diff = ActiveSupport::JSON.decode(change.to_json) %>
<% diff = OpenStruct.new(diff) %>
<% @diff_file = Trustie::Gitlab::Diff::File.new(diff) %>
<% @diff_file.diff_lines.each_with_index do |line, index| %>
<% type = line.type %>
<% last_line = line.new_pos.to_s %>
<% line_old = line.old_pos.to_s %>
<% if type.nil? || type == "match" %>
<tr class="line_holder" >
<td class="old_line">
<a><%= type == "match" ? "..." : line_old.center(4) %></a>
</td>
<td class="new_line" >
<a><%= type == "match" ? "..." : last_line.center(4) %></a>
</td>
<td class="line_content noteable_line <%= 'c_grey' if type == "match" %>" >
<pre style="width:auto;overflow: auto; "><%= Redmine::CodesetUtil.replace_invalid_utf8(line.text).html_safe %></pre>
</td>
</tr>
<% else %>
<% old_line = type == 'new' ? ' '*4: line_old %>
<% new_line = type == 'old' ? ' '*4: last_line %>
<tr class="<%= type == 'old' ? 'line_holder old' : 'line_holder new' %>" >
<td class="old_line">
<a><%= old_line.to_s.center(4) %></a>
</td>
<td class="new_line" data-linenumber="2">
<a><%= new_line.to_s.center(4) %></a>
</td>
<td class="<%= type == 'old' ? 'line_content noteable_line old' : 'line_content new noteable_line' %> " >
<pre style="width:auto;overflow: auto; "><%= Redmine::CodesetUtil.replace_invalid_utf8(line.text).html_safe %></pre>
</td>
</tr>
<% end %>
<% end %>
<tr>
<td class=" old_line " data-linenumber="5">
...
</td>
<td class="new_line " data-linenumber="5">
...
</td>
<td class="line_content "></td>
</tr>
</tbody>
</table>

View File

@ -9,42 +9,14 @@
</li> </li>
</div> </div>
<div class="showing-changes-project f14"><%= @commit_details.message %></div> <div class="showing-changes-project f14"><%= @commit_details.message %></div>
<!--<div class="showing-changes-row fontGrey2">Showing <a href="javascript:void()" class="linkGrey3" id="changed-files">3 changed files</a> with <span class="c_green">3 additions</span> and <span class="c_red">3 deletions</span>--> <% @commit_diff.each do |commit_diff| %>
<!--<ol class="mt10" id="changed-files-detail">-->
<!--<li><a href="javascript:void()" class="linkGrey3" id="changed-files">app/views/organizations/_org_course_homework.html.erb</a> </li>-->
<!--<li><a href="javascript:void()" class="linkGrey3" id="changed-files">app/views/users/_course_homework.html.erb</a> </li>-->
<!--<li><a href="javascript:void()" class="linkGrey3" id="changed-files">app/views/users/_user_homework_detail.html.erb</a> </li>-->
<!--</ol>-->
<!--</div>-->
<% @commit_diff.each do |cd| %>
<div class="showing-changes-row fontGrey2"> <div class="showing-changes-row fontGrey2">
<a href="javascript:void(0);" class="linkGrey3" id="changed-files"> <a href="javascript:void(0);" class="linkGrey3" id="changed-files">
<img src="/images/vlicon/file.png" width="18" height="20" style="vertical-align:middle;" class="mr5" /><%= cd.new_path %> <img src="/images/vlicon/file.png" width="18" height="20" style="vertical-align:middle;" class="mr5" /><%= commit_diff.new_path %>
</a> </a>
</div> </div>
<div class="autoscroll"> <div class="autoscroll">
<table class="filecontent syntaxhl" style="width:100%;" > <%= render :partial => 'repositories/change_diff', :locals => {:change => commit_diff} %>
<tbody>
<% line_num = diff_line_num(cd.diff) %>
<% diff_content = diff_content(cd.diff) %>
<% syntax_highlight_lines(cd.new_path, Redmine::CodesetUtil.to_utf8_by_setting(diff_content)).each do |line| %>
<tr>
<th class="line-num" id="L<%= line_num %>" style="vertical-align: top;">
<a href="#L<%= line_num %>" style="padding-top: 0px;"><%= line_num %></a>
</th>
<% if line[0,1] == "-" %>
<td class="line-code diff_out"><pre style="width:auto;white-space: nowrap; "><%= line.html_safe %></pre></td>
<% elsif line[0,1] == "+" %>
<td class="line-code diff_in"><pre style="width:auto;white-space: nowrap; "><%= line.html_safe %></pre></td>
<% else%>
<td class="line-code"><pre style="width:auto;white-space: nowrap; "><%= line.html_safe %></pre></td>
<% end %>
</tr>
<% line_num += 1 %>
<% end %>
</tbody>
</table>
</div> </div>
<% end %> <% end %>
</div> </div>

View File

@ -27,7 +27,21 @@
<div class="flex-cell student_work_<%= st.id%>"> <div class="flex-cell student_work_<%= st.id%>">
<div class="<%= score_color st.student_score%> student_score_info pr"> <div class="<%= score_color st.student_score%> student_score_info pr">
<% if st.student_score.nil? %> <% if st.student_score.nil? %>
<span title="该作品未被匿评">未参与</span> <% pro = @homework.student_work_projects.where("user_id = #{st.user_id}").first
if pro.nil? || pro.student_work_id == "" || pro.student_work_id.nil?
work = st
else
work = StudentWork.find pro.student_work_id
end %>
<% if @homework.homework_detail_manual.comment_status < 2 %>
<span title="尚未开启匿评">未参与</span>
<% elsif @homework.homework_detail_manual.comment_status == 2 && work.student_works_evaluation_distributions.count != 0 %>
<span title="匿评期间,尚未获得他人匿评">待匿评</span>
<% elsif @homework.homework_detail_manual.comment_status == 3 && work.student_works_evaluation_distributions.count != 0 %>
<span title="匿评已截止,未获得他人匿评">未评分</span>
<% else %>
<span title="匿评开启后提交的作品,不参加匿评">迟交</span>
<% end %>
<% else %> <% else %>
<%= format("%.1f", st.student_score) %> <%= format("%.1f", st.student_score) %>
<% end %> <% end %>

View File

@ -69,7 +69,19 @@
<% if @homework.anonymous_comment == 0%> <% if @homework.anonymous_comment == 0%>
<td class="hworkList70 <%= score_color student_work.student_score%> student_score_info pr"> <td class="hworkList70 <%= score_color student_work.student_score%> student_score_info pr">
<% if student_work.student_score.nil? %> <% if student_work.student_score.nil? %>
<span title="该作品未被匿评">未参与</span> <% if student_work.work_status != 0 %>
<% if @homework.homework_detail_manual.comment_status < 2 %>
<span title="尚未开启匿评">未参与</span>
<% elsif @homework.homework_detail_manual.comment_status >= 2 && student_work.student_works_evaluation_distributions.count == 0 %>
<span title="匿评开启后提交的作品,不参加匿评">迟交</span>
<% elsif @homework.homework_detail_manual.comment_status == 2 && student_work.student_works_evaluation_distributions.count != 0 %>
<span title="匿评期间,尚未获得他人匿评">待匿评</span>
<% elsif @homework.homework_detail_manual.comment_status == 3 && student_work.student_works_evaluation_distributions.count != 0 %>
<span title="匿评已截止,未获得他人匿评">未评分</span>
<% end %>
<% else %>
<span title="">--</span>
<% end %>
<% else %> <% else %>
<%=format("%.1f",student_work.student_score) %> <%=format("%.1f",student_work.student_score) %>
<% end %> <% end %>

View File

@ -23,7 +23,7 @@
<p class="list-info fr grayTxt"> <p class="list-info fr grayTxt">
<%= link_to project.members.count, allow_visit ? member_project_path(project) : 'javascript:void(0)', :class => "c_blue" %><span class="mr5">成员&nbsp;&nbsp;|</span> <%= link_to project.members.count, allow_visit ? member_project_path(project) : 'javascript:void(0)', :class => "c_blue" %><span class="mr5">成员&nbsp;&nbsp;|</span>
<%= link_to project.project_score.issue_num, allow_visit ? project_issues_path(project) : 'javascript:void(0)', :class => "c_blue" %><span class="mr5">问题&nbsp;&nbsp;|</span> <%= link_to project.project_score.issue_num, allow_visit ? project_issues_path(project) : 'javascript:void(0)', :class => "c_blue" %><span class="mr5">问题&nbsp;&nbsp;|</span>
<%= link_to project.project_score.attach_num, allow_visit ? file_project_path(project) : 'javascript:void(0)', :class => "c_blue" %><span>资源</span> <%= link_to project.project_score.changeset_num, visible_repository?(project) ? ({:controller => 'repositories', :action => 'show', :id => project, :repository_id => gitlab_repository(project).try(:identifier)}) : 'javascript:void(0)', :class => "c_blue" %><span>提交</span>
</p> </p>
</div> </div>
</div> </div>

View File

@ -51,37 +51,37 @@
// }); // });
<%# end%> <%# end%>
function set_score_rule_submit() { // function set_score_rule_submit() {
if($("#late_penalty_num").val() == ""){ // if($("#late_penalty_num").val() == ""){
$("#late_penalty_num").val("0"); // $("#late_penalty_num").val("0");
} // }
if($("#absence_penalty_num").val() == ""){ // if($("#absence_penalty_num").val() == ""){
$("#absence_penalty_num").val("0"); // $("#absence_penalty_num").val("0");
} // }
$('#muban_popup_box').find('form').submit(); // $('#muban_popup_box').find('form').submit();
hideModal(); // hideModal();
} // }
//设置评分规则 // //设置评分规则
function set_score_rule(){ // function set_score_rule(){
<% if @homework.homework_type == 2 %> <!--<%# if @homework.homework_type == 2 %>-->
<% if @homework.anonymous_comment == 0 %> <!--<%# if @homework.anonymous_comment == 0 %>-->
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>"; // var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
pop_box_new(htmlvalue, 570, 355); // pop_box_new(htmlvalue, 570, 355);
<% else %> <!--<%# else %>-->
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>"; // var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
pop_box_new(htmlvalue, 500, 285); // pop_box_new(htmlvalue, 500, 285);
<% end %> <!--<%# end %>-->
<% else %> <!--<%# else %>-->
<% if @homework.anonymous_comment == 0 %> <!--<%# if @homework.anonymous_comment == 0 %>-->
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>"; // var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
pop_box_new(htmlvalue, 500, 325); // pop_box_new(htmlvalue, 500, 325);
<% else %> <!--<%# else %>-->
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>"; // var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
pop_box_new(htmlvalue, 500, 225); // pop_box_new(htmlvalue, 500, 225);
<% end %> <!--<%# end %>-->
<% end %> <!--<%# end %>-->
} // }
</script> </script>
<div class="homepageRight mt0 ml10"> <div class="homepageRight mt0 ml10">
@ -118,10 +118,10 @@
<!--div class="hworkInfor"><a href="javascript:void(0);" class="linkBlue">作业信息</a></div--> <!--div class="hworkInfor"><a href="javascript:void(0);" class="linkBlue">作业信息</a></div-->
<% if @is_teacher%> <% if @is_teacher%>
<div class="fr mt5"> <div class="fr mt5">
<ul class="resourcesSelect"> <ul class="">
<li class="resourcesSelected"> <li class="pr export_icon_li">
<a href="javascript:void(0);" class="resourcesIcon"></a> <a href="javascript:void(0);" class="export_icon linkBlue2">导出</a>
<ul class="hworkMenu"> <ul class="hworkMenu" style="top: 30px; left: -100px;">
<li> <li>
<%= link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => "export_student_work"%> <%= link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => "export_student_work"%>
</li> </li>
@ -141,9 +141,6 @@
<%= link_to("导出匿评情况", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey')%> <%= link_to("导出匿评情况", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey')%>
</li> </li>
<% end %> <% end %>
<li>
<a href="javascript:void(0);" class="hworkSetting resourcesGrey" onclick="set_score_rule();">评分设置</a>
</li>
</ul> </ul>
</li> </li>
</ul> </ul>

View File

@ -1,7 +1,7 @@
<div class="orig_user fl"> <div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user), :alt => "用户头像" %>
</div> </div>
<div class="orig_right fl"> <div class="orig_right fl" onmouseout="$(this).find('.reply-right').hide();" onmouseover="$(this).find('.reply-right').show();">
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user), :class => "content-username" %> <%= link_to comment.creator_user.show_name, user_path(comment.creator_user), :class => "content-username" %>
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span> <span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="orig_content"> <div class="orig_content">
@ -16,16 +16,16 @@
<%= comment.content_detail.html_safe %> <%= comment.content_detail.html_safe %>
<% end %> <% end %>
</div> </div>
<div class="orig_reply mt-10"> <div class="orig_reply mt-10 pr" style="height: 18px;">
<div class="reply"> <div class="reply">
<span class="reply-right"> <div class="reply-right none" style="position: absolute; right: 0px;">
<span id="reply_praise_count_<%=comment.id %>"> <span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span> </span>
<% if type == 'Message' %> <% if type == 'Message' %>
<% topic = comment.root %> <% topic = comment.root %>
<% if !topic.locked? && authorize_for('messages', 'reply') %> <% if !topic.locked? && authorize_for('messages', 'reply') %>
<span style="position: relative" class="fr mr20"> <span class="fr mr20">
<%= link_to( <%= link_to(
l(:button_reply), l(:button_reply),
{:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id}, {:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id},
@ -36,7 +36,7 @@
</span> </span>
<% end %> <% end %>
<% else %> <% else %>
<span style="position: relative" class="fr mr20"> <span class="fr mr20">
<%= link_to( <%= link_to(
l(:button_reply), l(:button_reply),
{:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id}, {:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :parent_id => parent_id},
@ -46,7 +46,7 @@
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup03" style="display: none"> ︿</span> <span id="reply_iconup_<%=comment.id %>" class="reply_iconup03" style="display: none"> ︿</span>
</span> </span>
<% end %> <% end %>
</span> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>

View File

@ -20,7 +20,7 @@
<div class="orig_reply mb10 mt-10"> <div class="orig_reply mb10 mt-10">
<div class="reply"> <div class="reply">
<span class="reply-right"> <span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>"> <span class="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span> </span>
<% if type == 'Message' %> <% if type == 'Message' %>

View File

@ -29,7 +29,7 @@
<div class="orig_reply mb10 mt-10"> <div class="orig_reply mb10 mt-10">
<div class="reply"> <div class="reply">
<span class="reply-right"> <span class="reply-right">
<span id="reply_praise_count_<%= comment.id %>"> <span class="reply_praise_count_<%= comment.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %> <%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %>
</span> </span>
<% if type == 'HomeworkCommon' %> <% if type == 'HomeworkCommon' %>

View File

@ -7,7 +7,7 @@
</a> </a>
</li> </li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<%=link_to ma.course_message.author.show_name, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> <%=link_to ma.course_message.author.try(:show_name), user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了通知:</span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了通知:</span>
</li> </li>
<li class="homepageNewsContent fl"> <li class="homepageNewsContent fl">
@ -275,7 +275,7 @@
</a> </a>
</li> </li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<%= link_to ma.course_message.user.show_name, <%= link_to ma.course_message.user.try(:show_name),
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? 'homepageNewsTypeNotRead fl':'homepageNewsType fl' %>"><%= ma.apply_result == 1 ? '同意' : '拒绝'%>引用作业:</span> <span class="<%= ma.viewed == 0 ? 'homepageNewsTypeNotRead fl':'homepageNewsType fl' %>"><%= ma.apply_result == 1 ? '同意' : '拒绝'%>引用作业:</span>
</li> </li>
@ -304,7 +304,7 @@
</a> </a>
</li> </li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<%=link_to ma.course_message.user.show_name, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> <%=link_to ma.course_message.user.try(:show_name), user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了问卷:</span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了问卷:</span>
</li> </li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
@ -327,7 +327,7 @@
</a> </a>
</li> </li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<%=link_to User.find(ma.course_message.author_id).show_name, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> <%=link_to ma.course_message.author.try(:show_name), user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">
<%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %></span></li> <%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %></span></li>
<% if ma.course_message.parent_id.nil? %> <% if ma.course_message.parent_id.nil? %>
@ -423,7 +423,7 @@
</a> </a>
</li> </li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<%= link_to ma.course_message.user.show_name, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> <%= link_to ma.course_message.user.try(:show_name), user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">在班级中留言了:</span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">在班级中留言了:</span>
</li> </li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
@ -447,7 +447,7 @@
</a> </a>
</li> </li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<%= link_to ma.course_message.user.show_name, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> <%= link_to ma.course_message.user.try(:show_name), user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
<% if ma.course_message.m_parent_id.nil? %> <% if ma.course_message.m_parent_id.nil? %>
回复了您的<span class="fontBlue2" title="作业:<%=ma.course_message.jour.name %>">作业</span> 回复了您的<span class="fontBlue2" title="作业:<%=ma.course_message.jour.name %>">作业</span>

View File

@ -162,7 +162,7 @@
<% if ma.forge_message_type == "Message" %> <% if ma.forge_message_type == "Message" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author), :target => '_blank' %></a></li> <li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author), :target => '_blank' %></a></li>
<li class="homepageNewsPubType fl"><%=link_to User.find(ma.forge_message.author_id).show_name, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> <li class="homepageNewsPubType fl"><%=link_to ma.forge_message.author.try(:show_name), user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %></span></li> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %></span></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey"> <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.forge_message.subject, board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %> <%= link_to ma.forge_message.subject, board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
@ -181,7 +181,7 @@
</a> </a>
</li> </li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">
<%=link_to User.find(ma.forge_message.author_id).show_name, user_path(ma.forge_message.author), <%=link_to ma.forge_message.author.try(:show_name), user_path(ma.forge_message.author),
:class => "newsBlue homepageNewsPublisher", :target => '_blank' %> :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了新闻:</span> <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了新闻:</span>
</li> </li>

View File

@ -43,6 +43,8 @@ $("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(re
window.location.href = "<%=org_document_comment_path(:id => @root.id, :organization_id => @root.organization.id) %>"; window.location.href = "<%=org_document_comment_path(:id => @root.id, :organization_id => @root.organization.id) %>";
<% end %> <% end %>
<% elsif @type == 'Syllabus' %> <% elsif @type == 'Syllabus' %>
$("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'syllabuses/syllabus_post_reply', :locals => {:activity => @root, :user_activity_id => @user_activity_id}) %>"); $("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'syllabuses/syllabus_post_reply', :locals => {:activity => @root, :user_activity_id => @user_activity_id}) %>");
<% elsif @type == 'Memo' %>
window.location.href = "<%=forum_memo_path(@root.forum_id, @root) %>";
<% end %> <% end %>
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity"); sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");

View File

@ -5,7 +5,7 @@
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'projects/journal_comment_reply', :locals => {:comment => @comment.parent, :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>"); $('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'projects/journal_comment_reply', :locals => {:comment => @comment.parent, :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>");
<% elsif params[:type] == 'is_project_issue' %> <% elsif params[:type] == 'is_project_issue' %>
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'projects/project_issue_comments_reply', :locals => {:comment => @comment.parent, :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>"); $('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'projects/project_issue_comments_reply', :locals => {:comment => @comment.parent, :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>");
<% elsif (@comment.class.to_s == 'Message' || @comment.class.to_s == 'BlogComment' || @comment.class.to_s == 'OrgDocumentComment') %> <% elsif (@comment.class.to_s == 'Message' || @comment.class.to_s == 'BlogComment' || @comment.class.to_s == 'OrgDocumentComment' || @comment.class.to_s == 'Memo') %>
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent, :type => params[:type], :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>"); $('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent, :type => params[:type], :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>");
<% else %> <% else %>
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/comment_reply', :locals => {:comment => @comment.parent, :type => params[:type], :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>"); $('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/comment_reply', :locals => {:comment => @comment.parent, :type => params[:type], :user_activity_id => @user_activity_id, :parent_id => @parent_id})%>");

View File

@ -36,7 +36,7 @@
<%= format_time reply.created_on %> <%= format_time reply.created_on %>
</span> </span>
<div class="ping_disfoot" style="display: none; margin-left: 4px;" id='<%=ids_r%>' > <div class="ping_disfoot" style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
<span id="reply_praise_count_<%=reply.id %>"> <span class="reply_praise_count_<%=reply.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
</span> </span>
<% if reply_allow %> <% if reply_allow %>

View File

@ -507,3 +507,7 @@ zh:
label_done_ratio_endding: 已完成 label_done_ratio_endding: 已完成
label_done_ratio_doing: 未完成 label_done_ratio_doing: 未完成
label_pull_request_conflic: 您创建的Pull Request尚未被管理员接受或者关闭不能重新创建
label_pull_request_forbidden: 您没有权限进行该操作
label_pull_request_notfound: 您操作的页面不存在或者已被删除

View File

@ -1,41 +0,0 @@
default: &default
# corpid: "corpid"
# corpsecret: "corpsecret"
# agentid: 1
#production
appid: "wx8e1ab05163a28e37"
secret: "beb4d3bc4b32b3557811680835357841"
token: "123456"
access_token: "1234567"
encrypt_mode: false # if true must fill encoding_aes_key
#production
encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw"
jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket"
#template
binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc"
journal_notice: "uC1zAw4F2q6HTA3Pcj8VUO6wKKKiYFwnPJB4iXxpdoM"
homework_message_notice: "tCf7teCVqc2vl2LZ_hppIdWmpg8yLcrI8XifxYePjps"
class_notice: "MQ_mFupbXP-9jWbeHT3C5xqNBvPo8EIlNv4ULakSpJA"
create_class_notice: "2GtJJGzzNlNy2i0UrsjEDlvfSVIUXQfSo47stpcQAVw"
create_project_notice: "jYu0iimbDpgWYZaTLXioZe2lvqoWTdKnUPyphTJ1mxs"
project_review_notice: "kdb-8UlMjTc3z51Qcf8g2vY4i_nE4OGKZAucdQma_2E"
join_project_notice: "TtXvy0XMIQyCgpnXHhoB8t-x0QIfy-78gAJXsGf9afg"
project_issue_notice: "HP8JejOnkzmvFopTarc0l1Tp4bU9qnxzdH27x3186lI"
at_notice: "U3kqzgriCaqkPI9qX0NDQOInJ5hiwHCz6wgTsPysSx4"
rebind_notice: "OYsiECfqUlHKlzF_X-pz_xsGh_vAAUunX0jYRdHlyFU"
auto_openid_url_1: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities"
auto_openid_url_2: "&response_type=code&scope=snsapi_base&state="
auto_openid_url_3: "&connect_redirect=1#wechat_redirect"
production:
<<: *default
development:
<<: *default
test:
<<: *default

View File

@ -0,0 +1,26 @@
class AddRootIdToMemos < ActiveRecord::Migration
def change
add_column :memos, :root_id, :integer
add_index :memos, :root_id
def get_base_parent comment
comm = comment
while comm.parent
comm = comm.parent
end
comm
end
count = Memo.all.count / 30 + 2
transaction do
for i in 1 ... count do i
Memo.page(i).per(30).each do |memo|
unless memo.parent.nil?
parent = get_base_parent memo
memo.update_column('root_id', parent.id)
end
end
end
end
end
end

View File

@ -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 => 20161125024643) do ActiveRecord::Schema.define(:version => 20161128072528) 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
@ -325,16 +325,14 @@ ActiveRecord::Schema.define(:version => 20161125024643) do
add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids" add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids"
create_table "changesets", :force => true do |t| create_table "changesets", :force => true do |t|
t.integer "repository_id", :null => false t.integer "repository_id", :null => false
t.string "revision", :null => false t.string "revision", :null => false
t.string "committer" t.string "committer"
t.datetime "committed_on", :null => false t.datetime "committed_on", :null => false
t.text "comments" t.text "comments"
t.date "commit_date" t.date "commit_date"
t.string "scmid" t.string "scmid"
t.integer "user_id" t.integer "user_id"
t.integer "project_id"
t.integer "type", :default => 0
end end
add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on" add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on"
@ -518,6 +516,20 @@ ActiveRecord::Schema.define(:version => 20161125024643) do
t.integer "container_id", :default => 0 t.integer "container_id", :default => 0
end end
create_table "course_class_post", :id => false, :force => true do |t|
t.integer "班级id", :default => 0, :null => false
t.string "班级名"
t.integer "帖子id", :default => 0, :null => false
t.integer "主贴id"
t.string "帖子标题", :default => "", :null => false
t.text "帖子内容"
t.integer "帖子用户id"
t.integer "帖子回复数", :default => 0, :null => false
t.integer "最后回帖id"
t.datetime "发帖时间", :null => false
t.datetime "帖子更新时间", :null => false
end
create_table "course_contributor_scores", :force => true do |t| create_table "course_contributor_scores", :force => true do |t|
t.integer "course_id" t.integer "course_id"
t.integer "user_id" t.integer "user_id"
@ -996,10 +1008,6 @@ ActiveRecord::Schema.define(:version => 20161125024643) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "innodb_monitor", :id => false, :force => true do |t|
t.integer "a"
end
create_table "invite_lists", :force => true do |t| create_table "invite_lists", :force => true do |t|
t.integer "project_id" t.integer "project_id"
t.integer "user_id" t.integer "user_id"
@ -1211,8 +1219,11 @@ ActiveRecord::Schema.define(:version => 20161125024643) do
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 "viewed_count", :default => 0 t.integer "viewed_count", :default => 0
t.integer "root_id"
end end
add_index "memos", ["root_id"], :name => "index_memos_on_root_id"
create_table "message_alls", :force => true do |t| create_table "message_alls", :force => true do |t|
t.integer "user_id" t.integer "user_id"
t.integer "message_id" t.integer "message_id"

View File

@ -197,10 +197,10 @@ END_DESC
desc "send a email for day" desc "send a email for day"
task :day => :environment do task :day => :environment do
users = User.where(mail_notification: 'day') # users = User.where(mail_notification: 'day')
users.each do |user| # users.each do |user|
Mailer.run.send_for_user_activities(user, Date.today, 1) # Mailer.run.send_for_user_activities(user, Date.today, 1)
end # end
end end
end end
end end

View File

@ -7,21 +7,21 @@ module Trustie
FINISH = "#!idiff-finish!#" FINISH = "#!idiff-finish!#"
def processing(diff_arr) def processing(diff_arr)
indexes = _indexes_of_changed_lines diff_arr # indexes = _indexes_of_changed_lines diff_arr
#
indexes.each do |index| # indexes.each do |index|
first_line = diff_arr[index+1] # first_line = diff_arr[index+1]
second_line = diff_arr[index+2] # second_line = diff_arr[index+2]
#
# Skip inline diff if empty line was replaced with content # # Skip inline diff if empty line was replaced with content
next if first_line == "-\n" # next if first_line == "-\n"
#
first_token = find_first_token(first_line, second_line) # first_token = find_first_token(first_line, second_line)
apply_first_token(diff_arr, index, first_token) # apply_first_token(diff_arr, index, first_token)
#
last_token = find_last_token(first_line, second_line, first_token) # last_token = find_last_token(first_line, second_line, first_token)
apply_last_token(diff_arr, index, last_token) # apply_last_token(diff_arr, index, last_token)
end # end
diff_arr diff_arr
end end

View File

@ -3,39 +3,38 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>页面不见了</title> <title>页面不见了</title>
<link type="text/css" rel="stylesheet" href="/stylesheets/css/common.css" />
<link type="text/css" rel="stylesheet" href="/stylesheets/css/public.css" />
<script src="/javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js"></script>
<style> <style>
body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff;} body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;} div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;}
div,img,tr,td{ border:0;} div,img,tr,td{ border:0;}
table,tr,td{border:0 cellspacing:0; cellpadding:0;}
ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; }
a:hover{ }
.content{ width:550px; height:200px; margin:0 auto; padding:10px 0;}
.left{color:#15bccf; font-size:100px; font-weight:bold; font-style:oblique; width:200px; height:120px; padding-right:30px; float:left;}
.right{ width:240px; height:120px; float:left;color:#15bccf; font-size: 18px; font-weight:bold; padding-left:30px; margin-top:40px; border-left:1px dashed #CCC; }
.link{ margin-top:8px;}
.link a{ display:block; width:80px; height:30px; font-size:14px; font-weight:bold; color:#fff; text-align:center; background:#15bccf; float:left; margin-right:10px;}
.link a:hover{ background:#ff8417;}
</style> </style>
<script type="text/javascript">
$(function(){
if(window.history.length == 1)
{
$("#history_back").css("color","#CCC");
$("#history_back").css("cursor","default");
}
});
</script>
</head> </head>
<body> <body>
<div class="content"> <div class="muban_conbox_max">
<div class="left">404</div> <div class="pages_new_404">
<div class="right"> <img src="/images/404/pic_404.jpg" >
<p><span style="font-size:24px;">ERROR PAGE</span><br /> <p class="pages_new_404_txt mt40">
页面不见了!建议您</p> 非常抱歉,您访问的页面不存在或已删除。
<div class="link"> <a href="javascript:history.back()" id="history_back" class="linkBlue2 mr10">返回上页>></a>
<!---<a href="http://forge.trustie.net/" target="_blank">返回首页</a>----> <a href="http://shang.qq.com/wpa/qunwpa?idkey=064e805dac955b8aea158c4b0dd3f033b8841bcee175fd619613f0e4ac4d8151" target="_blank" class="linkBlue2">QQ反馈>></a>
<a href="#" target="_blank">后退一步</a> </p>
<a href="http://user.trustie.net/users/5/user_newfeedback" target="_blank">给我留言</a>
</div>
</div> </div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -9,7 +9,7 @@
<style type="text/css"> <style type="text/css">
body { body {
font-family: Trebuchet MS, Georgia, "Times New Roman", serif; font-family: "微软雅黑","宋体";
background: #fff; background: #fff;
margin: 10px; margin: 10px;
} }
@ -35,25 +35,6 @@
$("#history_back").css("color","#CCC"); $("#history_back").css("color","#CCC");
$("#history_back").css("cursor","default"); $("#history_back").css("cursor","default");
} }
$("#subject").keydown(function(){
var curLength=$("#subject").val().length;
if(curLength>50){
var num=$("#subject").val().substr(0,50);
$("#subject").val(num);
}
else{
$("#textCount").text(50-$("#subject").val().length)
}
}).keyup(function(){
var curLength=$("#subject").val().length;
if(curLength>50){
var num=$("#subject").val().substr(0,50);
$("#subject").val(num);
}
else{
$("#textCount").text(50-$("#subject").val().length)
}
});
}); });
</script> </script>
</head> </head>

View File

@ -480,17 +480,22 @@ a.yellowBtn{ display:inline-block;color:#0d90c3; height:22px;}
/* commonBtn */ /* commonBtn */
.grey_btn{ background:#d9d9d9; color:#656565; font-weight:normal; text-align:center;padding:2px 10px;} .grey_btn{background:#d9d9d9; color:#656565; font-weight:normal; text-align:center;padding:2px 10px;}
a.grey_btn{ background:#d9d9d9; color:#656565; font-weight:normal; text-align:center;padding:2px 10px;} a.grey_btn{background:#d9d9d9; color:#656565; font-weight:normal; text-align:center;padding:2px 10px;}
a:hover.grey_btn{ background:#717171; color:#fff;} a:hover.grey_btn{background:#717171; color:#fff;}
.grey_n_btn{ background:#d9d9d9; color:#656565; font-weight:normal;padding:2px 10px; text-align:center;} a.big_grey_btn{background:#e1e1e1; color:#333; font-weight:normal; padding:0px 15px; text-align:center; font-size: 12px; height: 30px; line-height: 30px;}
a:hover.big_grey_btn{background:#c3c3c3;}
.grey_n_btn{background:#d9d9d9; color:#656565; font-weight:normal;padding:2px 10px; text-align:center;}
a.grey_n_btn{background:#d9d9d9; color:#656565;font-weight:normal; padding:2px 10px; text-align:center;} a.grey_n_btn{background:#d9d9d9; color:#656565;font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.grey_n_btn{ background:#717171; color:#fff;} a:hover.grey_n_btn{ background:#717171; color:#fff;}
.green_btn{ background:#28be6c; color:#fff; font-weight:normal;padding:2px 10px; text-align:center;} .green_btn{background:#28be6c; color:#fff; font-weight:normal;padding:2px 10px; text-align:center;}
a.green_btn{background:#28be6c;color:#fff; font-weight:normal; padding:2px 10px; text-align:center;} a.green_btn{background:#28be6c;color:#fff; font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.green_btn{ background:#14ad5a;} a:hover.green_btn{ background:#14ad5a;}
.blue_btn{ background:#64bdd9; color:#fff; font-weight:normal;padding:2px 10px; text-align:center;} .blue_btn{background:#64bdd9; color:#fff; font-weight:normal; padding:2px 10px; text-align:center;}
a.blue_btn{background:#3b94d6;color:#fff; font-weight:normal; padding:2px 10px; text-align:center;} a.blue_btn{background:#3b94d6; color:#fff; font-weight:normal; padding:2px 10px; text-align:center;}
a:hover.blue_btn{background:#2788d0;}
a.big_blue_btn{background:#3b94d6; color:#fff; font-weight:normal;padding:0px 15px; text-align:center; font-size: 12px; height: 30px; line-height: 30px;}
a:hover.big_blue_btn{background:#2788d0;}
.red_btn{ background:red; color:#fff; font-size:14px; font-weight:normal;padding:2px 8px; text-align:center;} .red_btn{ background:red; color:#fff; font-size:14px; font-weight:normal;padding:2px 8px; text-align:center;}
a.red_btn{background:red; color:#fff;font-size:14px; font-weight:normal; padding:2px 8px; text-align:center;cursor: pointer;} a.red_btn{background:red; color:#fff;font-size:14px; font-weight:normal; padding:2px 8px; text-align:center;cursor: pointer;}
a.orange_btn_homework{background:#d63502;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center;} a.orange_btn_homework{background:#d63502;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; text-align:center;}
@ -825,3 +830,7 @@ a:hover.btn_newpro_grey,a:active.btn_newpro_grey{ background: #eaeaea;}
} }
.ke-block ol li{list-style-type: decimal;margin-left: 40px;} .ke-block ol li{list-style-type: decimal;margin-left: 40px;}
.ke-block ul li{list-style-type: disc;margin-left: 40px;} .ke-block ul li{list-style-type: disc;margin-left: 40px;}
a.export_icon{background: url(/images/item.png) -58px -30px no-repeat; width: 45px; float: left; line-height: 41px; font-size: 14px; margin-top: -5px;}
a.export_icon:hover {background: url(/images/item.png) -58px -60px no-repeat;}
.export_icon_li:hover ul {display:block;}

View File

@ -1043,3 +1043,14 @@ table.quality_list tbody td, table.quality_list tbody tr td {
font-size: 11px; font-size: 11px;
padding: 4px 10px 4px 3px; padding: 4px 10px 4px 3px;
} }
/* 文本变更样式 */
.autoscroll {overflow-x: auto; margin-bottom: 0.2em;}
table.filecontent { border: 1px solid #e2e2e2; border-collapse: collapse; width: 100%;background-color: #fafafa;}
table.text-file{}
.old_line,.new_line,.diff_line {margin: 0px; padding: 0px;border: none; background: #f7f8fa;color: rgba(0,0,0,0.3); padding: 0px 5px; border-right: 1px solid #dce0e6;text-align: right; min-width: 35px; max-width: 50px; width: 35px; -webkit-user-select: none;}
.old_line a,.new_line a,.diff_line a { float: left;width: 35px; font-weight: normal; color: rgba(0,0,0,0.3);}
.line_content{padding: 0px 5px;}
.old{ background:#ffecec; }
.old:hover{ background:#fffaf1; }
.new{ background: #eaffea;}
.new:hover{ background:#fffaf1; }