diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index b1aae9b26..d14bccc4e 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -507,7 +507,8 @@ class ApplicationController < ActionController::Base
# render_404
# end
- def self.model_object(model)
+ def self.
+ model_object(model)
self.model_object = model
end
diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb
index dcab1b360..dcd549d76 100644
--- a/app/controllers/blog_comments_controller.rb
+++ b/app/controllers/blog_comments_controller.rb
@@ -144,7 +144,7 @@ class BlogCommentsController < ApplicationController
if params[:parent_id]
@blogComment.content = params[:blog_comment][:content]
parent = BlogComment.find params[:parent_id]
- @blogComment.reply_id = params[:reply_id]
+ @blogComment.reply_id = params[:id]
parent.children << @blogComment
else
@quote = params[:quote][:quote] || ""
diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb
index ceb63d7b0..099e9404a 100644
--- a/app/controllers/boards_controller.rb
+++ b/app/controllers/boards_controller.rb
@@ -161,6 +161,7 @@ class BoardsController < ApplicationController
if @project
render :action => 'show', :layout => 'base_projects'
elsif @course
+ @left_nav_type = 2
@params=params
render :action => 'show', :layout => 'base_courses'
end
@@ -185,6 +186,7 @@ class BoardsController < ApplicationController
@board = @project.boards.build
@board.safe_attributes = params[:board]
if @project.project_type == 1
+ @left_nav_type = 2
render :layout => 'base_courses'
end
end
@@ -206,6 +208,7 @@ class BoardsController < ApplicationController
def edit
if @project.project_type == 1
+ @left_nav_type = 2
render :layout => 'base_courses'
end
end
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb
index 5966b310f..9226b904c 100644
--- a/app/controllers/comments_controller.rb
+++ b/app/controllers/comments_controller.rb
@@ -19,8 +19,8 @@ class CommentsController < ApplicationController
default_search_scope :news
include ApplicationHelper
model_object News
- before_filter :find_model_object
- before_filter :find_project_from_association
+ before_filter :find_model_object, :except => [:reply, :quote]
+ before_filter :find_project_from_association, :except => [:reply, :quote]
before_filter :authorize
def create
@@ -73,7 +73,46 @@ class CommentsController < ApplicationController
def destroy
@news.comments.find(params[:comment_id]).destroy
- redirect_to news_url(@news)
+ if params[:user_activity_id]
+ @user_activity_id = params[:user_activity_id]
+ respond_to do |format|
+ format.js
+ return
+ end
+ else
+ redirect_to news_url(@news)
+ end
+ end
+
+ def quote
+ @comment = Comment.find(params[:id])
+ respond_to do | format|
+ format.js
+ end
+ end
+
+ def reply
+ comment = Comment.find(params[:id])
+ @news = News.find comment.commented_id
+ new_comment = @news.comments.build(:author_id => User.current.id, :reply_id => params[:id], :comments => params[:content], :parent_id => comment.id)
+ @user_activity_id = params[:user_activity_id]
+ if new_comment.save
+ update_course_activity(@news.class,@news.id)
+ update_user_activity(@news.class,@news.id)
+ update_org_activity(@news.class,@news.id)
+ if @user_activity_id
+ respond_to do |format|
+ format.js
+ return
+ end
+ else
+ respond_to do |format|
+ format.html {
+ redirect_to news_path(@news)
+ }
+ end
+ end
+ end
end
private
@@ -87,5 +126,4 @@ class CommentsController < ApplicationController
@news
end
-
end
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index 28366b109..a38cc8d34 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -301,7 +301,6 @@ class CoursesController < ApplicationController
def member
## 有角色参数的才是课程,没有的就是项目
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
-
@render_file = 'new_member_list'
@score_sort_by = "desc"
@sort_type = params[:sort_type] ? params[:sort_type] : "score"
@@ -414,6 +413,9 @@ class CoursesController < ApplicationController
end
def settings
+ #添加成员消息状态
+ join_course_messages = CourseMessage.where("user_id =? and course_message_type =? and course_id =? and status = ? and viewed =?", User.current.id, 'JoinCourse', @course.id, 1, 0)
+ join_course_messages.update_all(:viewed => true)
if User.current.allowed_to?(:as_teacher,@course)
@select_tab = params[:tab]
@issue_custom_fields = IssueCustomField.sorted.all
@@ -889,25 +891,28 @@ class CoursesController < ApplicationController
if params[:type].present?
case params[:type]
when "homework"
- @course_activities = course_activities.where("course_act_type = 'HomeworkCommon'").order('updated_at desc').limit(10).offset(@page * 10)
+ @course_activities = course_activities.where("course_act_type = 'HomeworkCommon'").order('updated_at desc')
when "news"
- @course_activities = course_activities.where("course_act_type = 'News'").order('updated_at desc').limit(10).offset(@page * 10)
+ @course_activities = course_activities.where("course_act_type = 'News'").order('updated_at desc')
when "message"
- @course_activities = course_activities.where("course_act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
+ @course_activities = course_activities.where("course_act_type = 'Message'").order('updated_at desc')
when "poll"
- @course_activities = course_activities.where("course_act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10)
+ @course_activities = course_activities.where("course_act_type = 'Poll'").order('updated_at desc')
when "attachment"
- @course_activities = course_activities.where("course_act_type = 'Attachment'").order('updated_at desc').limit(10).offset(@page * 10)
+ @course_activities = course_activities.where("course_act_type = 'Attachment'").order('updated_at desc')
when "journalsForMessage"
- @course_activities = course_activities.where("course_act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10)
+ @course_activities = course_activities.where("course_act_type = 'JournalsForMessage'").order('updated_at desc')
else
- @course_activities = course_activities.order('updated_at desc').limit(10).offset(@page * 10)
+ @course_activities = course_activities.order('updated_at desc')
end
else
- @course_activities = course_activities.order('updated_at desc').limit(10).offset(@page * 10)
+ @course_activities = course_activities.order('updated_at desc')
end
+ @course_activities_count = @course_activities.count
+ @course_activities = @course_activities.limit(10).offset(@page * 10)
@type = params[:type]
+ @left_nav_type = 1
respond_to do |format|
format.js
format.html{render :layout => 'base_courses'}
@@ -939,6 +944,7 @@ class CoursesController < ApplicationController
end
@jour = paginateHelper @jours,10
@state = false
+ @left_nav_type = 6
respond_to do |format|
format.html{render :layout => 'base_courses'}
format.api
@@ -1122,6 +1128,14 @@ class CoursesController < ApplicationController
end
end
+ #统计
+ def statistics_course
+ @left_nav_type = 9
+ respond_to do |format|
+ format.html {render :layout => 'base_courses'}
+ end
+ end
+
private
def update_quotes attachment
if attachment.copy_from
diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb
index c3964c567..e3caaf9fb 100644
--- a/app/controllers/exercise_controller.rb
+++ b/app/controllers/exercise_controller.rb
@@ -29,6 +29,7 @@ class ExerciseController < ApplicationController
exercises = @course.exercises.where("exercise_status <> 1").order("created_at asc")
end
@exercises = paginateHelper exercises,20 #分页
+ @left_nav_type = 8
respond_to do |format|
format.html
end
@@ -72,6 +73,7 @@ class ExerciseController < ApplicationController
end
# @percent = get_percent(@exercise,User.current)
@exercise_questions = @exercise.exercise_questions
+ @left_nav_type = 8
respond_to do |format|
format.html {render :layout => 'base_courses'}
end
@@ -118,6 +120,7 @@ class ExerciseController < ApplicationController
end
def edit
+ @left_nav_type = 8
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
@@ -159,6 +162,7 @@ class ExerciseController < ApplicationController
@exercise = Exercise.find(params[:id])
exercise_questions = @exercise.exercise_questions
@exercise_questions = paginateHelper exercise_questions, 5
+ @left_nav_type = 8
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
@@ -379,6 +383,7 @@ class ExerciseController < ApplicationController
else
@exercise_users_list = []
end
+ @left_nav_type = 8
respond_to do |format|
format.html
format.xls {
@@ -566,6 +571,7 @@ class ExerciseController < ApplicationController
eu = get_exercise_user(@exercise.id, @user.id)
eu.update_attributes(:score => score)
@exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", @user.id, @exercise.id).first
+ @left_nav_type = 8
respond_to do |format|
format.html {render :layout => 'base_courses'}
end
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index f06725d01..ed2b2ebfa 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -366,6 +366,7 @@ class FilesController < ApplicationController
@tag_list = attachment_tag_list @all_attachments
+ @left_nav_type = 5
render :layout => 'base_courses'
elsif params[:org_subfield_id]
if params[:sort]
@@ -445,6 +446,7 @@ class FilesController < ApplicationController
@versions = @project.versions.sort
@course_tag = @project.project_type
if @project.project_type == 1
+ @left_nav_type = 5
render :layout => 'base_courses'
end
end
@@ -812,6 +814,7 @@ class FilesController < ApplicationController
@attachtype = params[:type].to_i
@contenttype = params[:contentType].to_s
# render layout: 'base_courses'
+ @left_nav_type = 5
respond_to do |format|
format.js
format.html {
diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb
index 6724f42bb..2020915f8 100644
--- a/app/controllers/homework_common_controller.rb
+++ b/app/controllers/homework_common_controller.rb
@@ -39,6 +39,7 @@ class HomeworkCommonController < ApplicationController
end
end
+ @left_nav_type = 3
respond_to do |format|
format.js
format.html
@@ -60,6 +61,7 @@ class HomeworkCommonController < ApplicationController
@is_in_course = params[:is_in_course].to_i
@course_activity = params[:course_activity].to_i
if @is_in_course == 1 || @course_activity == 1
+ @left_nav_type = 3
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 049842e37..921d7d12b 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -432,15 +432,14 @@ class IssuesController < ApplicationController
def add_journal
if User.current.logged?
- @jour = Journal.new
- @jour.user_id = User.current.id
- @jour.notes = params[:notes]
- @jour.journalized = @issue
- @jour.save_attachments(params[:attachments])
- @jour.save
+ jour = Journal.new
+ jour.user_id = User.current.id
+ jour.notes = params[:notes]
+ jour.journalized = @issue
+ jour.save_attachments(params[:attachments])
+ jour.save
update_user_activity(@issue.class,@issue.id)
update_forge_activity(@issue.class,@issue.id)
- @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
@user_activity_id = params[:user_activity_id]
if params[:issue_id]
@@ -474,7 +473,6 @@ class IssuesController < ApplicationController
def reply
@issue = Issue.find(params[:id])
@jour = Journal.find(params[:journal_id])
- @tempContent = "
#{ll(Setting.default_language, :text_user_wrote, @jour.user.realname.blank? ? @jour.user.login: @jour.user.realname)}
#{@jour.notes.html_safe}
".html_safe
respond_to do |format|
format.js
end
@@ -483,17 +481,17 @@ class IssuesController < ApplicationController
#给issue添加journ。回复内容包含 对某个被回复的journ的内容
def add_reply
if User.current.logged?
- jour = Journal.new
- jour.user_id = User.current.id
- jour.notes = params[:quote]+params[:notes]
+ jour = Journal.find(params[:journal_id])
@issue = Issue.find params[:id]
- jour.journalized = @issue
- jour.save
- update_user_activity(@issue.class,@issue.id)
- update_forge_activity(@issue.class,@issue.id)
+ new_jour = @issue.journals.build(:user_id => User.current.id, :reply_id => params[:journal_id], :notes => params[:content], :parent_id => jour.id)
+ @user_activity_id = params[:user_activity_id]
+ if new_jour.save
+ update_user_activity(@issue.class,@issue.id)
+ update_forge_activity(@issue.class,@issue.id)
- respond_to do |format|
- format.html{redirect_to issue_url(@issue)}
+ respond_to do |format|
+ format.js
+ end
end
end
end
@@ -502,8 +500,9 @@ class IssuesController < ApplicationController
def delete_journal
@issue = Issue.find(params[:id])
Journal.destroy(params[:journal_id])
- respond_to do |format|
- format.html{redirect_to issue_url(@issue)}
+ @user_activity_id = params[:user_activity_id]
+ respond_to do |format|
+ format.js
end
end
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index f5ad89832..3e41e2c91 100644
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -56,6 +56,7 @@ class MessagesController < ApplicationController
all
@replies = paginateHelper messages_replies,10
@reply = Message.new(:subject => "RE: #{@message.subject}")
+ @left_nav_type = 2
render :action => "show", :layout => "base_courses"#by young
elsif @project
@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
@@ -124,6 +125,7 @@ class MessagesController < ApplicationController
end
else
+ @left_nav_type = 2
respond_to do |format|
format.html {
layout_file = @project ? 'base_projects' : 'base_courses'
@@ -140,15 +142,15 @@ class MessagesController < ApplicationController
def reply
if params[:parent_id]
parent = Message.find params[:parent_id]
+ @topic = params[:activity_id].nil? ? parent : Message.find(params[:activity_id].to_i)
@reply = Message.new
@reply.author = User.current
@reply.board = parent.board
@reply.content = params[:content]
- @reply.subject = "RE: #{parent.subject}"
- @reply.reply_id = params[:reply_id]
+ @reply.subject = "RE: #{@topic.subject}"
+ @reply.reply_id = params[:id]
# @reply.reply_id = params[:id]
parent.children << @reply
- @topic = params[:activity_id].nil? ? parent : Message.find(params[:activity_id].to_i)
@user_activity_id = params[:user_activity_id] if params[:user_activity_id]
@is_course = params[:is_course] if params[:is_course]
@is_board = params[:is_board] if params[:is_board]
@@ -241,6 +243,7 @@ class MessagesController < ApplicationController
if @project
layout_file = 'base_projects'
elsif @course
+ @left_nav_type = 2
layout_file = 'base_courses'
elsif @org_subfield
@organization = @org_subfield.organization
diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb
index 76b229dbf..190c3852b 100644
--- a/app/controllers/news_controller.rb
+++ b/app/controllers/news_controller.rb
@@ -56,7 +56,7 @@ class NewsController < ApplicationController
:order => "#{News.table_name}.created_on DESC",
:offset => @page * 10,
:limit => 10)
-
+ @left_nav_type = 4
respond_to do |format|
format.html {
@news = News.new # for adding news inline
@@ -136,6 +136,7 @@ class NewsController < ApplicationController
@newss = paginateHelper @newss,@limit
#@newss = paginateHelper scope_order,10
+ @left_nav_type = 4
respond_to do |format|
format.html {
@news = News.new
@@ -176,6 +177,7 @@ class NewsController < ApplicationController
if @news.course_id
@course = Course.find(@news.course_id)
if @course
+ @left_nav_type = 4
render :layout => 'base_courses'
end
elsif @news.org_subfield_id
@@ -279,6 +281,7 @@ class NewsController < ApplicationController
@organization = @org_subfield.organization
end
if @course
+ @left_nav_type = 4
render :layout => "base_courses"
elsif @org_subfield
render :layout => 'base_org'
diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb
index 924be596e..a8a294d4d 100644
--- a/app/controllers/org_document_comments_controller.rb
+++ b/app/controllers/org_document_comments_controller.rb
@@ -1,6 +1,6 @@
class OrgDocumentCommentsController < ApplicationController
before_filter :find_organization, :only => [:new, :create, :show, :index]
- before_filter :authorize_allowed, :only => [:create, :add_reply]
+ before_filter :authorize_allowed, :only => [:create, :add_reply, :add_reply_in_doc]
helper :attachments,:organizations
layout 'base_org'
diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
index e4cf31f55..ad04e68fa 100644
--- a/app/controllers/poll_controller.rb
+++ b/app/controllers/poll_controller.rb
@@ -15,6 +15,7 @@ class PollController < ApplicationController
polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id} and polls_status = 2")
end
@polls = paginateHelper polls,20 #分页
+ @left_nav_type = 7
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
@@ -25,7 +26,7 @@ class PollController < ApplicationController
def show
@poll = Poll.find params[:id]
- if @poll.polls_status != 2 && (!User.current.allowed_to?(:as_teacher,@course) || User.current.admin?)
+ if @poll.polls_status != 2 && !(User.current.allowed_to?(:as_teacher,@course) || User.current.admin?)
render_403
return
end
@@ -44,6 +45,7 @@ class PollController < ApplicationController
@percent = get_percent(@poll,User.current)
poll_questions = @poll.poll_questions
@poll_questions = paginateHelper poll_questions,5 #分页
+ @left_nav_type = 7
respond_to do |format|
format.html {render :layout => 'base_courses'}
end
@@ -78,6 +80,7 @@ class PollController < ApplicationController
def edit
respond_to do |format|
+ @left_nav_type = 7
format.html{render :layout => 'base_courses'}
end
end
@@ -112,6 +115,7 @@ class PollController < ApplicationController
@poll = Poll.find(params[:id])
poll_questions = @poll.poll_questions
@poll_questions = paginateHelper poll_questions, 5
+ @left_nav_type = 7
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
@@ -393,6 +397,7 @@ class PollController < ApplicationController
#显示某个学生某份问卷的填写结果
def poll_result
@poll_questions = paginateHelper @poll.poll_questions,5
+ @left_nav_type = 7
respond_to do |format|
format.html{render :layout => 'base_courses'}
end
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index cb86f1165..d8c174bc3 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -300,15 +300,13 @@ class ProjectsController < ApplicationController
return
end
- logger.debug "111111111"*100
- # over
@author = params[:user_id].blank? ? nil : User.active.find(params[:user_id])
@page = params[:page] ? params[:page].to_i + 1 : 0
# 根据私密性,取出符合条件的所有数据
if User.current.member_of?(@project) || User.current.admin?
case params[:type]
when nil
- @events_pages = ForgeActivity.where("project_id = ? and forge_act_type in ('Issue', 'Message','News', 'Project', 'Attachment')", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10)
+ @events_pages = ForgeActivity.where("project_id = ? and forge_act_type in ('Issue', 'Message','News', 'Project', 'Attachment','Commit')", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10)
when 'issue'
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Issue'", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10)
when 'news'
@@ -321,8 +319,8 @@ class ProjectsController < ApplicationController
else
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public = ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc").page(params['page'|| 1]).per(10);
end
- logger.debug "2"*100
- # g = Gitlab.client
+
+ # 版本库统计图
unless @project.gpid.nil? || @project.project_score.changeset_num == 0
# rep_statics_commit = @project.rep_statics.order("commits_num desc")
rep_statics_commit = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by commits_num desc limit 10")
@@ -335,20 +333,14 @@ class ProjectsController < ApplicationController
@a_commits_del = rep_statics_code.map {|s| s.del.to_i }
@a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i }
g = Gitlab.client
- logger.debug "3"*100
begin
gid = @project.gpid
- logger.debug "31"*100
- g_branch = g.project(gid)
- logger.debug "4"*100
- g_branch = g_branch.default_branch.to_s
- logger.debug "5"*100
+ g_project = g.project(gid)
+ g_branch = g_project.default_branch.to_s
rescue =>e
- logger.error("get gitlab project failed: " + e)
+ logger.error("get default branch failed: " + e)
end
- logger.debug "6"*100
@rev = g_branch.nil? ? "master" : g_branch
- logger.debug "7"*100
end
# 根据对应的请求,返回对应的数据
respond_to do |format|
diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb
index 6b50c1788..80c5a2468 100644
--- a/app/controllers/quality_analysis_controller.rb
+++ b/app/controllers/quality_analysis_controller.rb
@@ -165,7 +165,7 @@ class QualityAnalysisController < ApplicationController
logger.info("result: delete job ###################==>#{d_job}")
qa.delete
respond_to do |format|
- format.html{redirect_to project_quality_analysis_path(:project_id => @project.id)}
+ format.html{redirect_to :controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).identifier}
end
rescue Exception => e
puts e
@@ -199,9 +199,6 @@ class QualityAnalysisController < ApplicationController
# update成功则返回 ‘200’
jenkins_job = @client.job.update("#{job_name}", @doc.to_xml)
- get_current_build_status = @client.job.get_current_build_status("Hjqreturn-1280")
- logger.error("Failed to update job: ==> #{jenkins_job}") unless jenkins_job == '200'
-
# 数据更新到Trustie数据
if jenkins_job == '200'
logger.info("quality_ananlysis will be updated: ==> #{jenkins_job}")
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index 6b41e39fc..65b4a15d6 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -48,7 +48,7 @@ class RepositoriesController < ApplicationController
include RepositoriesHelper
helper :project_score
#@root_path = RepositoriesHelper::ROOT_PATH
- require 'net/ssh'
+ # require 'net/ssh'
rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed
def new
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index 45b54cf0a..1b93bdeba 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -381,14 +381,24 @@ class StudentWorkController < ApplicationController
@is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评
@show_all = false
- course_group = CourseGroup.find_by_id(@group) if @group
- if course_group
- group_students = course_group.users
- if group_students.empty?
- student_in_group = '(0)'
+ if @group
+ if @group == "0"
+ none_group_students = @course.members.select{ |member| member.course_group_id == 0 }
+ if none_group_students.empty?
+ student_in_group = '(0)'
+ else
+ student_in_group = '(' + none_group_students.map{ |member| member.user_id }.join(',') + ')'
+ end
else
- student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')'
+ course_group = CourseGroup.find_by_id(@group)
+ group_students = course_group.users
+ if group_students.empty?
+ student_in_group = '(0)'
+ else
+ student_in_group = '(' + group_students.map{ |user| user.id }.join(',') + ')'
+ end
end
+
#开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表
if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.has_committed.where(:user_id => User.current.id).empty?)
if @order == 'lastname'
@@ -526,6 +536,7 @@ class StudentWorkController < ApplicationController
@is_focus = params[:is_focus] ? params[:is_focus].to_i : 0
# 消息传过来的ID
@message_student_work_id = params[:student_work_id]
+ @left_nav_type = 3
respond_to do |format|
format.js
format.html
@@ -918,6 +929,7 @@ class StudentWorkController < ApplicationController
ORDER BY absence #{order}")
end
@order = order == "desc" ? "asc" : "desc"
+ @left_nav_type = 3
respond_to do |format|
format.html
end
diff --git a/app/controllers/syllabuses_controller.rb b/app/controllers/syllabuses_controller.rb
index 291e6ca30..9c69f5259 100644
--- a/app/controllers/syllabuses_controller.rb
+++ b/app/controllers/syllabuses_controller.rb
@@ -13,7 +13,6 @@ class SyllabusesController < ApplicationController
end
def show
- #@courses = @syllabus.courses
respond_to do |format|
format.js
format.html{render :layout => 'base_syllabus'}
@@ -109,11 +108,7 @@ class SyllabusesController < ApplicationController
sort_name = "updated_on"
sort_type = @c_sort == 1 ? "asc" : "desc"
- if User.current == @syllabus.user || User.current.admin?
- @courses = @syllabus.courses.where("is_delete = 0").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS #{sort_name}").order("#{sort_name} #{sort_type}")
- else
- @courses = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS #{sort_name}").order("#{sort_name} #{sort_type}")
- end
+ @courses = @syllabus.courses.where("is_delete = ?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS #{sort_name}").order("#{sort_name} #{sort_type}")
#根据 作业+资源数排序
if @order.to_i == 2
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 5a88e90d3..5e968e854 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -94,6 +94,12 @@ class UsersController < ApplicationController
@comment = Message.find params[:comment].to_i
when 'BlogComment'
@comment = BlogComment.find params[:comment].to_i
+ when 'OrgDocumentComment'
+ @comment = OrgDocumentComment.find params[:comment].to_i
+ when 'Comment'
+ @comment = Comment.find params[:comment].to_i
+ when 'Journal'
+ @comment = Journal.find params[:comment].to_i
end
end
@@ -133,6 +139,16 @@ class UsersController < ApplicationController
@user_activity_id = params[:user_activity_id]
@activity_id = params[:activity_id]
@type = 'OrgDocumentComment'
+ when 'News'
+ @reply = Comment.find params[:reply_id]
+ @user_activity_id = params[:user_activity_id]
+ @activity_id = params[:activity_id]
+ @type = 'News'
+ when 'Issue'
+ @reply = Journal.find params[:reply_id]
+ @user_activity_id = params[:user_activity_id]
+ @activity_id = params[:activity_id]
+ @type = 'Issue'
end
respond_to do |format|
format.js
@@ -709,9 +725,9 @@ class UsersController < ApplicationController
@user = User.current
@select_course = params[:select_course] ? 1 : 0
#@user_homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc")
- visible_course = Course.where("is_public = 1 && is_delete = 0")
- visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
- @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc")
+ courses = @user.courses.where("is_delete = 1")
+ course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
+ @homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and course_id not in #{course_ids}").order("#{@order} #{@b_sort}")
@type = params[:type]
@limit = 15
@is_remote = true
@@ -933,6 +949,7 @@ class UsersController < ApplicationController
@student_work = StudentWork.new
end
@course = @homework.course
+ @left_nav_type = 3
respond_to do |format|
format.js
format.html {render :layout => 'base_courses'}
@@ -1549,7 +1566,11 @@ class UsersController < ApplicationController
when "current_user"
@user_activities = UserActivity.where("user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))").order('updated_at desc').limit(10).offset(@page * 10)
else
- blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
+ if @user == User.current
+ blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
+ else
+ blog_ids = "("+@user.blog.id.to_s+")"
+ end
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
@@ -1559,8 +1580,12 @@ class UsersController < ApplicationController
# @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10)
# blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
# 减少数据库交互
- watched_user_ids = User.watched_by(@user.id).count == 0 ? " " : ("," + User.watched_by(@user.id).map{|u| u.id.to_s }.join(','))
- user_ids = "(" + @user.id.to_s + watched_user_ids + ")"
+ if @user == User.current
+ watched_user_ids = User.watched_by(@user.id).count == 0 ? " " : ("," + User.watched_by(@user.id).map{|u| u.id.to_s }.join(','))
+ user_ids = "(" + @user.id.to_s + watched_user_ids + ")"
+ else
+ user_ids = "(" + @user.id.to_s + ")"
+ end
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}")
blog_ids = watched_user_blog_ids.empty? ? "(-1)" : "(" + watched_user_blog_ids.map { |blog| blog.id}.join(",") + ")"
@@ -3312,19 +3337,22 @@ class UsersController < ApplicationController
when 'News'
obj = News.where('id = ?', params[:id].to_i).first
@journals = obj.comments.reorder("created_on desc")
+ @type = 'News'
+ @user_activity_id = params[:div_id].to_i if params[:div_id]
when 'Syllabus'
obj = Syllabus.where('id = ?', params[:id].to_i).first
- @journals = obj.comments.reorder("created_on desc")
+ @journals = obj.journals_for_messages.reorder("created_on desc")
when 'JournalsForMessage'
obj = JournalsForMessage.where('id = ?', params[:id].to_i).first
journals = []
@journals = get_all_children(journals, obj)
@type = 'JournalsForMessage'
@user_activity_id = params[:div_id].to_i if params[:div_id]
- @allow_delete = params[:allow_delete]
when 'Issue'
obj = Issue.where('id = ?', params[:id].to_i).first
@journals = obj.journals.reorder("created_on desc")
+ @type = 'Issue'
+ @user_activity_id = params[:div_id].to_i if params[:div_id]
when 'BlogComment'
obj = BlogComment.where('id = ?', params[:id].to_i).first
@user_activity_id = params[:div_id].to_i if params[:div_id]
@@ -3334,6 +3362,7 @@ class UsersController < ApplicationController
@journals = get_all_children(comments, obj)
when 'HomeworkCommon'
obj = HomeworkCommon.where('id = ?', params[:id].to_i).first
+ @type = 'HomeworkCommon'
@journals = obj.journals_for_messages.reorder("created_on desc")
@is_in_course = params[:is_in_course].to_i if params[:is_in_course]
@course_activity = params[:course_activity].to_i if params[:course_activity]
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 603084cd1..7aae73e94 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -38,6 +38,24 @@ module ApplicationHelper
# super
# end
+ # 通过系统外部邮箱查找用户,如果用户不存在则用邮箱替换
+ def get_user_by_mail mail
+ user = User.find_by_mail(mail)
+ user.nil? ? User.find(2) : user
+ end
+
+ # 历史数据(老版本库数据)处理完则可以修改该放放
+ def get_rep_identifier_by_project project
+ identifier = Repository.where(:project_id => project.id, :type => "Repository::Gitlab").first.try(:identifier)
+ result = identifier.nil? ? Repository.where(:project_id => project.id).first.try(:identifier) : identifier
+ result
+ end
+
+ # 获取用户单位
+ # 优先获取高校信息,如果改信息不存在则获取occupation
+ def get_occupation_from_user user
+ School.where("id=?",user.user_extensions.school_id).first.try(:name).nil? ? user.user_extensions.try(:occupation) : School.where("id=?",user.user_extensions.school_id).first.try(:name)
+ end
def update_visiti_count container
container.update_column(:visits, container.visits + 1)
diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb
index d1f4bfe97..96e0d7683 100644
--- a/app/helpers/courses_helper.rb
+++ b/app/helpers/courses_helper.rb
@@ -35,7 +35,7 @@ module CoursesHelper
and (c.is_excellent =1 or c.excellent_option =1) and c.is_public = 1 and c.id != #{current_course.id} order by cs.updated_at desc;"
default_ids = Course.find_by_sql(sql).flatten.map { |c| c.id }
excellent_ids << default_ids.flatten
- arr_result = excellent_ids.flatten.uniq.first(5)
+ arr_result = excellent_ids.flatten.uniq.first(3)
excellent_courses = Course.find(arr_result)
return excellent_courses
end
@@ -78,18 +78,18 @@ module CoursesHelper
#生成课程老师成员链接
def course_teacher_link teacher_num
if User.current.member_of_course?(@course) || User.current.admin?
- link_to "#{teacher_num}", course_member_path(@course, :role => 1), :class => 'info_foot_num c_blue', :id => 'teacher_number'
+ link_to "#{teacher_num}", course_member_path(@course, :role => 1), :class => 'sy_cblue', :id => 'teacher_number'
else
- content_tag 'span',teacher_num, :class => 'info_foot_num c_blue'
+ content_tag 'span',teacher_num, :class => 'sy_cblue'
end
end
#生成课程学生列表连接
def course_student_link student_num
if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) || User.current.admin?
- link_to "#{student_num}", course_member_path(@course, :role => 2), :class => 'info_foot_num c_blue', :id => "student_number"
+ link_to "#{student_num}", course_member_path(@course, :role => 2), :class => 'sy_cblue', :id => "student_number"
else
- content_tag 'span',student_num, :class => 'info_foot_num c_blue'
+ content_tag 'span',student_num, :class => 'sy_cblue'
end
end
@@ -591,6 +591,26 @@ module CoursesHelper
Course.tagged_with(tag_name).order('updated_at desc')
end
+ # 获取动态列表名称
+ def get_acts_list_type type
+ case type
+ when "homework"
+ ">" + l(:label_homework_acts)
+ when "news"
+ ">" + l(:label_news_acts)
+ when "attachment"
+ ">" + l(:label_attachment_acts)
+ when "message"
+ ">" + l(:label_message_acts)
+ when "journalsForMessage"
+ ">" + l(:label_journalsForMessage_acts)
+ when "poll"
+ ">" + l(:label_poll_acts)
+ else
+ ">" + l(:label_all_cats)
+ end
+ end
+
#分班下拉框
def course_group_option course
type = []
@@ -772,12 +792,12 @@ module CoursesHelper
url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id)
method = joined ? 'delete' : 'post'
if joined
- link = link_to(text, url, :remote => true, :method => method, :class => "Blue-btn", :style => "margin_left: 0px;", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out))
+ link = link_to(text, url, :remote => true, :method => method, :class => "sy_btn_grey fl", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out))
else
- link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "Blue-btn", :style => "margin_left: 0px;")
+ link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "sy_btn_grey fl")
end
else
- link = "#{l(:label_course_join_student)}"
+ link = "#{l(:label_course_join_student)}"
end
link.html_safe
end
@@ -872,7 +892,7 @@ module CoursesHelper
desc.html_safe
end
- # 学生按作业总分排序,取前8个
+ # 学生按作业总分排序,取前3个
def hero_homework_score(course, score_sort_by)
sql_select = "SELECT members.*,(
SELECT SUM(work_score)
@@ -884,14 +904,14 @@ module CoursesHelper
FROM members
JOIN students_for_courses
ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id
- WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 9"
+ WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 3"
homework_scores = Member.find_by_sql(sql_select)
end
def contributor_course_scor(course_id)
ccs = CourseContributorScore.find_by_sql("SELECT * FROM `course_contributor_scores` where course_id = #{course_id} order by
(message_num*2 + message_reply_num + news_reply_num + news_num +
- resource_num*5 + journal_num + homework_journal_num ) desc limit 9;")
+ resource_num*5 + journal_num + homework_journal_num ) desc limit 3;")
end
end
diff --git a/app/helpers/student_work_helper.rb b/app/helpers/student_work_helper.rb
index 42a3a6538..4f0a2ca6d 100644
--- a/app/helpers/student_work_helper.rb
+++ b/app/helpers/student_work_helper.rb
@@ -101,6 +101,10 @@ module StudentWorkHelper
if course.course_groups && !course.course_groups.empty?
base = []
base << l(:label_chose_group)
+ base << -1
+ result << base
+ base = []
+ base << l(:label_no_group)
base << 0
result << base
course.course_groups.each do |group|
diff --git a/app/models/changeset.rb b/app/models/changeset.rb
index f72342257..149f4b163 100644
--- a/app/models/changeset.rb
+++ b/app/models/changeset.rb
@@ -22,9 +22,7 @@ class Changeset < ActiveRecord::Base
#after_save :be_user_score # user_score
has_many :filechanges, :class_name => 'Change', :dependent => :delete_all
- # fq
- has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
- # end
+ has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy
#Added by nie
has_one :project_status, :dependent => :destroy
@@ -59,7 +57,6 @@ class Changeset < ActiveRecord::Base
validates :committed_on, presence: true
validates :commit_date, presence: true
validates :scmid, uniqueness: {scope: :repository_id, allow_nil: true}
-
scope :visible, lambda {|*args|
includes(:repository => :project).where(Project.allowed_to_condition(args.shift || User.current, :view_changesets, *args))
}
@@ -68,7 +65,7 @@ class Changeset < ActiveRecord::Base
# after_update :be_user_score
after_destroy :down_user_score
# before_create :before_create_cs
- after_create :act_as_forge_activity
+ # after_create :act_as_forge_activity
def revision=(r)
@@ -118,7 +115,7 @@ class Changeset < ActiveRecord::Base
# 项目中提交动态,类型Changeset
# type:0 为老版本即Trsutie数据 1为gitlab中获取的动态
def act_as_forge_activity
- self.acts << ForgeActivity.new(:user_id => self.user_id, :project_id => self.project_id, :type => true)
+ self.forge_acts << ForgeActivity.new(:user_id => self.user_id, :project_id => self.project_id, :type => true)
end
def scan_for_issues
diff --git a/app/models/comment.rb b/app/models/comment.rb
index 80b52a8f4..633c9a825 100644
--- a/app/models/comment.rb
+++ b/app/models/comment.rb
@@ -33,10 +33,11 @@ class Comment < ActiveRecord::Base
:title=>Proc.new {|o| "RE: #{o.commented.title}" },
:url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.commented.id} }
+ acts_as_tree :counter_cache => :comments_count, :order => "#{Comment.table_name}.created_on ASC"
belongs_to :commented, :polymorphic => true, :counter_cache => true,:touch => true
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
validates_presence_of :commented, :author, :comments
- safe_attributes 'comments'
+ safe_attributes 'comments','parent_id','reply_id','comments_count'
after_create :send_mail, :act_as_system_message, :act_as_student_score
after_destroy :down_course_score
diff --git a/app/models/commit.rb b/app/models/commit.rb
new file mode 100644
index 000000000..a6633206a
--- /dev/null
+++ b/app/models/commit.rb
@@ -0,0 +1,13 @@
+class Commit < ActiveRecord::Base
+ attr_accessible :comments, :committed_on, :committer, :project_id, :repository_id, :version
+ validates :repository_id, presence: true
+ validates :version, presence: true, uniqueness: {scope: :repository_id}
+ validates :committed_on, presence: true
+ has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy
+ after_create :act_as_forge_activity
+
+ # 项目中提交动态
+ def act_as_forge_activity
+ self.forge_acts << ForgeActivity.new(:user_id => 2, :project_id => self.project_id)
+ end
+end
diff --git a/app/models/forge_activity.rb b/app/models/forge_activity.rb
index 47ebf4d0f..5fe953f66 100644
--- a/app/models/forge_activity.rb
+++ b/app/models/forge_activity.rb
@@ -25,8 +25,11 @@ class ForgeActivity < ActiveRecord::Base
# 在个人动态里面增加当前动态
# 版本库提交动态不显示在用户动态中
+ # Commit为版本库提交类型,因为是从gitlab获取,不能实时更新
def add_user_activity
- if self.forge_act_type != "Changeset"
+ if self.forge_act_type == "Commit"
+ self.update_column(:updated_at, self.forge_act.committed_on)
+ else
user_activity = UserActivity.where("act_type = '#{self.forge_act_type.to_s}' and act_id = '#{self.forge_act_id}'").first
if user_activity
user_activity.save
@@ -50,7 +53,9 @@ class ForgeActivity < ActiveRecord::Base
# 项目提交动态不显示在组织动态中
def add_org_activity
- if self.forge_act_type != "Changeset"
+ if self.forge_act_type == "Commit"
+ self.update_column(:updated_at, self.forge_act.committed_on)
+ else
org_activity = OrgActivity.where("org_act_type = '#{self.forge_act_type.to_s}' and org_act_id = #{self.forge_act_id}").first
if org_activity
org_activity.updated_at = self.updated_at
diff --git a/app/models/journal.rb b/app/models/journal.rb
index 0f88fcb7f..d2cc9e539 100644
--- a/app/models/journal.rb
+++ b/app/models/journal.rb
@@ -37,6 +37,7 @@ class Journal < ActiveRecord::Base
has_many :at_messages, as: :at_message, dependent: :destroy
acts_as_attachable
attr_accessor :indice
+ acts_as_tree :counter_cache => :comments_count, :order => "#{Journal.table_name}.created_on ASC"
acts_as_event :title =>Proc.new {|o| status = ((s = o.new_status) ? " (#{s})" : nil); "#{o.issue.tracker} ##{o.issue.project_index}#{status}: #{o.issue.subject}" },
:description =>:notes,
diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb
index ab4b65f5c..d864b6462 100644
--- a/app/services/courses_service.rb
+++ b/app/services/courses_service.rb
@@ -162,7 +162,7 @@ class CoursesService
raise '403'
end
end
- @comments = @news.comments
+ @comments = @news.comments.reorder("created_on desc")
@comments.reverse! if current_user.wants_comments_in_reverse_order?
{:news => @news,:comments => @comments}
diff --git a/app/views/admin/users.html.erb b/app/views/admin/users.html.erb
index 2a757fdee..9215782bb 100644
--- a/app/views/admin/users.html.erb
+++ b/app/views/admin/users.html.erb
@@ -56,8 +56,7 @@
<%= checked_image user.admin? %> |
<%= format_time(user.created_on) %> |
<%= format_time(user.last_login_on) unless user.last_login_on.nil? %> |
- <% occupation = user.user_extensions.identity == 0 ? School.where("id=?",user.user_extensions.school_id).first.try(:name) : user.user_extensions.occupation %>
- <%= truncate( occupation, :length => 12 ) %> |
+ <%= truncate(get_occupation_from_user(user), :length => 12 ) %> |
<%= change_status_link(user) %> |
<%= delete_link user_path(user, :back_url => admin_users_path(params)) unless User.current == user %> |
diff --git a/app/views/blog_comments/_edit.html.erb b/app/views/blog_comments/_edit.html.erb
index 048402635..b9d10527d 100644
--- a/app/views/blog_comments/_edit.html.erb
+++ b/app/views/blog_comments/_edit.html.erb
@@ -39,6 +39,8 @@
%>
+
+
@@ -56,4 +58,11 @@
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/app/views/blog_comments/_new.html.erb b/app/views/blog_comments/_new.html.erb
index e336c7d01..de7be84c1 100644
--- a/app/views/blog_comments/_new.html.erb
+++ b/app/views/blog_comments/_new.html.erb
@@ -36,6 +36,8 @@
:maxlength => 5000 }%>
+
+
-
\ No newline at end of file
+
diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb
index bde98d456..f5c7c9094 100644
--- a/app/views/blog_comments/show.html.erb
+++ b/app/views/blog_comments/show.html.erb
@@ -135,13 +135,8 @@
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
-
- <%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
- <%= time_from_now(comment.created_on) %>
-
- <% if !comment.parent.nil? && !comment.parent.parent.nil? %>
- <%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
- <% end %>
+ <%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
+
<% if !comment.content_detail.blank? %>