Merge branch 'develop' into hjq_new_course
This commit is contained in:
commit
dd1ce752ab
|
@ -54,16 +54,9 @@ class CommentsController < ApplicationController
|
||||||
# end
|
# end
|
||||||
# # <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add end
|
# # <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add end
|
||||||
#flash[:notice] = l(:label_comment_added)
|
#flash[:notice] = l(:label_comment_added)
|
||||||
course_activity = CourseActivity.where("course_act_type='News' and course_act_id =#{@news.id}").first
|
update_course_activity(@news.class,@news.id)
|
||||||
if course_activity
|
update_user_activity(@news.class,@news.id)
|
||||||
course_activity.updated_at = Time.now
|
update_org_activity(@news.class,@news.id)
|
||||||
course_activity.save
|
|
||||||
end
|
|
||||||
user_activity = UserActivity.where("act_type='News' and act_id =#{@news.id}").first
|
|
||||||
if user_activity
|
|
||||||
user_activity.updated_at = Time.now
|
|
||||||
user_activity.save
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if params[:user_activity_id]
|
if params[:user_activity_id]
|
||||||
|
|
|
@ -405,9 +405,9 @@ class IssuesController < ApplicationController
|
||||||
jour.journalized = @issue
|
jour.journalized = @issue
|
||||||
jour.save_attachments(params[:attachments])
|
jour.save_attachments(params[:attachments])
|
||||||
jour.save
|
jour.save
|
||||||
user_activity = UserActivity.where("act_type='Issue' and act_id =#{@issue.id}").first
|
update_user_activity(@issue.class,@issue.id)
|
||||||
user_activity.updated_at = jour.created_on
|
update_forge_activity(@issue.class,@issue.id)
|
||||||
user_activity.save
|
|
||||||
@user_activity_id = params[:user_activity_id]
|
@user_activity_id = params[:user_activity_id]
|
||||||
if params[:issue_id]
|
if params[:issue_id]
|
||||||
@issue_id = params[:issue_id]
|
@issue_id = params[:issue_id]
|
||||||
|
@ -455,9 +455,9 @@ class IssuesController < ApplicationController
|
||||||
@issue = Issue.find params[:id]
|
@issue = Issue.find params[:id]
|
||||||
jour.journalized = @issue
|
jour.journalized = @issue
|
||||||
jour.save
|
jour.save
|
||||||
user_activity = UserActivity.where("act_type='Issue' and act_id =#{@issue.id}").first
|
update_user_activity(@issue.class,@issue.id)
|
||||||
user_activity.updated_at = jour.created_on
|
update_forge_activity(@issue.class,@issue.id)
|
||||||
user_activity.save
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
|
|
@ -176,26 +176,11 @@ class MessagesController < ApplicationController
|
||||||
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
|
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
|
||||||
# @reply.reply_id = params[:id]
|
# @reply.reply_id = params[:id]
|
||||||
@topic.children << @reply
|
@topic.children << @reply
|
||||||
course_activity = CourseActivity.where("course_act_type='Message' and course_act_id =#{@topic.id}").first
|
update_course_activity(@topic.class,@topic.id)
|
||||||
if course_activity
|
update_user_activity(@topic.class,@topic.id)
|
||||||
course_activity.updated_at = Time.now
|
update_forge_activity(@topic.class,@topic.id)
|
||||||
course_activity.save
|
update_org_activity(@topic.class,@topic.id)
|
||||||
end
|
|
||||||
forge_activity = ForgeActivity.where("forge_act_type='Message' and forge_act_id=#{@topic.id}").first
|
|
||||||
if forge_activity
|
|
||||||
forge_activity.updated_at = Time.now
|
|
||||||
forge_activity.save
|
|
||||||
end
|
|
||||||
user_activity = UserActivity.where("act_type='Message' and act_id =#{@topic.id}").first
|
|
||||||
if user_activity
|
|
||||||
user_activity.updated_at = Time.now
|
|
||||||
user_activity.save
|
|
||||||
end
|
|
||||||
org_activity = OrgActivity.where("org_act_type='Message' and org_act_id =#{@topic.id}").first
|
|
||||||
if org_activity
|
|
||||||
org_activity.updated_at = Time.now
|
|
||||||
org_activity.save
|
|
||||||
end
|
|
||||||
#@topic.update_attribute(:updated_on, Time.now)
|
#@topic.update_attribute(:updated_on, Time.now)
|
||||||
if !@reply.new_record?
|
if !@reply.new_record?
|
||||||
if params[:asset_id]
|
if params[:asset_id]
|
||||||
|
|
|
@ -259,16 +259,10 @@ class StudentWorkController < ApplicationController
|
||||||
stu_project.save
|
stu_project.save
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
course_activity = CourseActivity.where("course_act_type='HomeworkCommon' and course_act_id =#{@homework.id}").first
|
update_course_activity(@homework.class,@homework.id)
|
||||||
if course_activity
|
update_user_activity(@homework.class,@homework.id)
|
||||||
course_activity.updated_at = Time.now
|
update_org_activity(@homework.class,@homework.id)
|
||||||
course_activity.save
|
|
||||||
end
|
|
||||||
user_activity = UserActivity.where("act_type='HomeworkCommon' and act_id =#{@homework.id}").first
|
|
||||||
if user_activity
|
|
||||||
user_activity.updated_at = Time.now
|
|
||||||
user_activity.save
|
|
||||||
end
|
|
||||||
course_message = CourseMessage.new(:user_id =>User.current.id,:content=>"new",:course_message_id=>student_work.id,:course_id => @course.id,:course_message_type=>"StudentWork", :status => 9) #作品提交记录
|
course_message = CourseMessage.new(:user_id =>User.current.id,:content=>"new",:course_message_id=>student_work.id,:course_id => @course.id,:course_message_type=>"StudentWork", :status => 9) #作品提交记录
|
||||||
course_message.save
|
course_message.save
|
||||||
|
|
||||||
|
|
|
@ -57,21 +57,11 @@ class WordsController < ApplicationController
|
||||||
@jfm = add_reply_adapter options
|
@jfm = add_reply_adapter options
|
||||||
@save_succ = true if @jfm.errors.empty?
|
@save_succ = true if @jfm.errors.empty?
|
||||||
if @save_succ
|
if @save_succ
|
||||||
course_activity = CourseActivity.where("course_act_type='JournalsForMessage' and course_act_id =#{parent_id}").first
|
update_course_activity('JournalsForMessage',parent_id)
|
||||||
if course_activity
|
update_user_activity('JournalsForMessage',parent_id)
|
||||||
course_activity.updated_at = Time.now
|
update_forge_activity('JournalsForMessage',parent_id)
|
||||||
course_activity.save
|
update_org_activity('JournalsForMessage',parent_id)
|
||||||
end
|
update_principal_activity('JournalsForMessage',parent_id)
|
||||||
principal_activity = PrincipalActivity.where("principal_act_type='JournalsForMessage' and principal_act_id =#{parent_id}").first
|
|
||||||
if principal_activity
|
|
||||||
principal_activity.updated_at = Time.now
|
|
||||||
principal_activity.save
|
|
||||||
end
|
|
||||||
user_activity = UserActivity.where("act_type='JournalsForMessage' and act_id =#{parent_id}").first
|
|
||||||
if user_activity
|
|
||||||
user_activity.updated_at = Time.now
|
|
||||||
user_activity.save
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
# format.html {
|
# format.html {
|
||||||
|
@ -278,16 +268,9 @@ class WordsController < ApplicationController
|
||||||
update_kindeditor_assets_owner ids,feedback[:id],OwnerTypeHelper::JOURNALSFORMESSAGE
|
update_kindeditor_assets_owner ids,feedback[:id],OwnerTypeHelper::JOURNALSFORMESSAGE
|
||||||
end
|
end
|
||||||
|
|
||||||
course_activity = CourseActivity.where("course_act_type='HomeworkCommon' and course_act_id =#{@homework_common.id}").first
|
update_course_activity(@homework_common.class,@homework_common.id)
|
||||||
if course_activity
|
update_user_activity(@homework_common.class,@homework_common.id)
|
||||||
course_activity.updated_at = Time.now
|
update_org_activity(@homework_common.class,@homework_common.id)
|
||||||
course_activity.save
|
|
||||||
end
|
|
||||||
user_activity = UserActivity.where("act_type='HomeworkCommon' and act_id =#{@homework_common.id}").first
|
|
||||||
if user_activity
|
|
||||||
user_activity.updated_at = Time.now
|
|
||||||
user_activity.save
|
|
||||||
end
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js{
|
format.js{
|
||||||
@user_activity_id = params[:user_activity_id]
|
@user_activity_id = params[:user_activity_id]
|
||||||
|
|
|
@ -2793,4 +2793,45 @@ int main(int argc, char** argv){
|
||||||
project.gpid.nil? ? 0 : g.project(project.gpid).commit_count
|
project.gpid.nil? ? 0 : g.project(project.gpid).commit_count
|
||||||
# project.changesets.count
|
# project.changesets.count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#课程动态的更新
|
||||||
|
def update_course_activity type, id
|
||||||
|
course_activity = CourseActivity.where("course_act_type=? and course_act_id =?", type.to_s, id).first
|
||||||
|
if course_activity
|
||||||
|
course_activity.updated_at = Time.now
|
||||||
|
course_activity.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
#首页动态更新
|
||||||
|
def update_user_activity type, id
|
||||||
|
user_activity = UserActivity.where("act_type=? and act_id =?", type.to_s, id).first
|
||||||
|
if user_activity
|
||||||
|
user_activity.updated_at = Time.now
|
||||||
|
user_activity.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
#项目动态更新
|
||||||
|
def update_forge_activity type, id
|
||||||
|
forge_activity = ForgeActivity.where("forge_act_type=? and forge_act_id=?", type.to_s, id).first
|
||||||
|
if forge_activity
|
||||||
|
forge_activity.updated_at = Time.now
|
||||||
|
forge_activity.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
#组织动态更新
|
||||||
|
def update_org_activity type , id
|
||||||
|
org_activity = OrgActivity.where("org_act_type=? and org_act_id =?", type.to_s, id).first
|
||||||
|
if org_activity
|
||||||
|
org_activity.updated_at = Time.now
|
||||||
|
org_activity.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
#个人动态更新
|
||||||
|
def update_principal_activity type, id
|
||||||
|
principal_activity = PrincipalActivity.where("principal_act_type=? and principal_act_id =?", type.to_s, id).first
|
||||||
|
if principal_activity
|
||||||
|
principal_activity.updated_at = Time.now
|
||||||
|
principal_activity.save
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -507,8 +507,10 @@ module CoursesHelper
|
||||||
#课程实践年份下拉框
|
#课程实践年份下拉框
|
||||||
def course_time_option year
|
def course_time_option year
|
||||||
type = []
|
type = []
|
||||||
|
month = Time.now.month
|
||||||
now_year = year.nil? ? Time.now.year : (Time.now.year <= year ? Time.now.year : year)
|
now_year = year.nil? ? Time.now.year : (Time.now.year <= year ? Time.now.year : year)
|
||||||
for i in (now_year..now_year + 10)
|
year = month < 3 ? now_year - 1 : now_year
|
||||||
|
for i in (year..year + 10)
|
||||||
option = []
|
option = []
|
||||||
option << i
|
option << i
|
||||||
option << i
|
option << i
|
||||||
|
|
|
@ -17,6 +17,7 @@ class BlogComment < ActiveRecord::Base
|
||||||
safe_attributes 'title', 'content',"sticky", "locked"
|
safe_attributes 'title', 'content',"sticky", "locked"
|
||||||
|
|
||||||
after_save :add_user_activity
|
after_save :add_user_activity
|
||||||
|
after_update :update_activity
|
||||||
before_destroy :destroy_user_activity
|
before_destroy :destroy_user_activity
|
||||||
|
|
||||||
scope :like, lambda {|arg|
|
scope :like, lambda {|arg|
|
||||||
|
@ -28,6 +29,15 @@ class BlogComment < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#动态更新
|
||||||
|
def update_activity
|
||||||
|
user_activity = UserActivity.where("act_type='BlogComment' and act_id =?",self.id).first
|
||||||
|
if user_activity
|
||||||
|
user_activity.updated_at = Time.now
|
||||||
|
user_activity.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#在个人动态里面增加当前动态
|
#在个人动态里面增加当前动态
|
||||||
def add_user_activity
|
def add_user_activity
|
||||||
if self.parent_id.nil? #只有发博文才插入动态
|
if self.parent_id.nil? #只有发博文才插入动态
|
||||||
|
|
|
@ -70,7 +70,7 @@ class Course < ActiveRecord::Base
|
||||||
validates_length_of :description, :maximum => 10000
|
validates_length_of :description, :maximum => 10000
|
||||||
before_save :self_validate
|
before_save :self_validate
|
||||||
# 公开课程变成私有课程,所有资源都变成私有
|
# 公开课程变成私有课程,所有资源都变成私有
|
||||||
after_update :update_files_public,:update_course_ealasticsearch_index
|
after_update :update_files_public,:update_course_ealasticsearch_index,:update_activity
|
||||||
after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index
|
after_create :create_board_sync, :act_as_course_activity, :act_as_course_message,:create_course_ealasticsearch_index
|
||||||
before_destroy :delete_all_members,:delete_course_ealasticsearch_index
|
before_destroy :delete_all_members,:delete_course_ealasticsearch_index
|
||||||
|
|
||||||
|
@ -428,6 +428,12 @@ class Course < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
#动态的更新
|
||||||
|
def update_activity
|
||||||
|
update_course_activity(self.class, self.id)
|
||||||
|
update_user_activity(self.class, self.id)
|
||||||
|
update_org_activity(self.class, self.id)
|
||||||
|
end
|
||||||
|
|
||||||
# Delete the previous articles index in Elasticsearch
|
# Delete the previous articles index in Elasticsearch
|
||||||
# Course.__elasticsearch__.client.indices.delete index: Course.index_name rescue nil
|
# Course.__elasticsearch__.client.indices.delete index: Course.index_name rescue nil
|
||||||
|
|
|
@ -26,6 +26,7 @@ class HomeworkCommon < ActiveRecord::Base
|
||||||
:author => :author,
|
:author => :author,
|
||||||
:url => Proc.new {|o| {:controller => 'student_work', :action => 'index', :homework => o.id}}
|
:url => Proc.new {|o| {:controller => 'student_work', :action => 'index', :homework => o.id}}
|
||||||
after_create :act_as_activity, :send_mail, :act_as_course_message
|
after_create :act_as_activity, :send_mail, :act_as_course_message
|
||||||
|
after_update :update_activity
|
||||||
after_save :act_as_course_activity
|
after_save :act_as_course_activity
|
||||||
after_destroy :delete_kindeditor_assets
|
after_destroy :delete_kindeditor_assets
|
||||||
|
|
||||||
|
@ -60,7 +61,12 @@ class HomeworkCommon < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
#动态的更新
|
||||||
|
def update_activity
|
||||||
|
update_course_activity(self.class, self.id)
|
||||||
|
update_user_activity(self.class, self.id)
|
||||||
|
update_org_activity(self.class, self.id)
|
||||||
|
end
|
||||||
#删除对应的图片
|
#删除对应的图片
|
||||||
def delete_kindeditor_assets
|
def delete_kindeditor_assets
|
||||||
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::HOMEWORKCOMMON
|
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::HOMEWORKCOMMON
|
||||||
|
|
|
@ -84,7 +84,7 @@ class Issue < ActiveRecord::Base
|
||||||
|
|
||||||
# fq
|
# fq
|
||||||
after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :act_as_forge_message, :act_as_at_message, :add_issues_count
|
after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :act_as_forge_message, :act_as_at_message, :add_issues_count
|
||||||
after_update :be_user_score
|
after_update :be_user_score,:update_activity
|
||||||
after_destroy :down_user_score, :decrease_issues_count
|
after_destroy :down_user_score, :decrease_issues_count
|
||||||
# after_create :be_user_score
|
# after_create :be_user_score
|
||||||
# end
|
# end
|
||||||
|
@ -126,6 +126,12 @@ class Issue < ActiveRecord::Base
|
||||||
after_save :after_create_from_copy
|
after_save :after_create_from_copy
|
||||||
after_destroy :update_parent_attributes
|
after_destroy :update_parent_attributes
|
||||||
|
|
||||||
|
#动态的更新
|
||||||
|
def update_activity
|
||||||
|
update_user_activity(self.class, self.id)
|
||||||
|
update_forge_activity(self.class, self.id)
|
||||||
|
update_org_activity(self.class, self.id)
|
||||||
|
end
|
||||||
|
|
||||||
# fq
|
# fq
|
||||||
def act_as_activity
|
def act_as_activity
|
||||||
|
|
|
@ -70,12 +70,21 @@ class JournalsForMessage < ActiveRecord::Base
|
||||||
validates :notes, presence: true, if: :is_homework_jour?
|
validates :notes, presence: true, if: :is_homework_jour?
|
||||||
after_create :act_as_activity, :act_as_course_activity, :act_as_course_message, :act_as_at_message, :act_as_user_feedback_message, :act_as_principal_activity, :act_as_student_score
|
after_create :act_as_activity, :act_as_course_activity, :act_as_course_message, :act_as_at_message, :act_as_user_feedback_message, :act_as_principal_activity, :act_as_student_score
|
||||||
after_create :reset_counters!
|
after_create :reset_counters!
|
||||||
|
after_update :update_ativity
|
||||||
after_destroy :reset_counters!
|
after_destroy :reset_counters!
|
||||||
after_save :be_user_score
|
after_save :be_user_score
|
||||||
after_destroy :down_user_score
|
after_destroy :down_user_score
|
||||||
|
|
||||||
# default_scope { where('m_parent_id IS NULL') }
|
# default_scope { where('m_parent_id IS NULL') }
|
||||||
|
|
||||||
|
#动态的更新
|
||||||
|
def update_activity
|
||||||
|
update_course_activity(self.class, self.id)
|
||||||
|
update_user_activity(self.class, self.id)
|
||||||
|
update_forge_activity(self.class, self.id)
|
||||||
|
update_org_activity(self.class, self.id)
|
||||||
|
update_principal_activity(self.class, self.id)
|
||||||
|
end
|
||||||
def self.create_by_user? user
|
def self.create_by_user? user
|
||||||
if user.anonymous?
|
if user.anonymous?
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -36,6 +36,8 @@ class Message < ActiveRecord::Base
|
||||||
has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy
|
has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy
|
||||||
# 课程动态
|
# 课程动态
|
||||||
has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy
|
has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy
|
||||||
|
has_many :user_acts, :class_name => 'UserActivity',:as =>:user_act ,:dependent => :destroy
|
||||||
|
|
||||||
# end
|
# end
|
||||||
# 课程/项目 消息
|
# 课程/项目 消息
|
||||||
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
|
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
|
||||||
|
@ -75,7 +77,7 @@ class Message < ActiveRecord::Base
|
||||||
validate :cannot_reply_to_locked_topic, :on => :create
|
validate :cannot_reply_to_locked_topic, :on => :create
|
||||||
|
|
||||||
after_create :add_author_as_watcher, :reset_counters!, :add_boards_count
|
after_create :add_author_as_watcher, :reset_counters!, :add_boards_count
|
||||||
after_update :update_messages_board
|
after_update :update_messages_board, :update_activity
|
||||||
after_destroy :reset_counters!,:down_user_score,:delete_kindeditor_assets, :decrease_boards_count
|
after_destroy :reset_counters!,:down_user_score,:delete_kindeditor_assets, :decrease_boards_count
|
||||||
|
|
||||||
after_create :act_as_activity,:act_as_course_activity,:be_user_score,:act_as_forge_activity, :act_as_system_message, :send_mail, :act_as_student_score, :act_as_at_message
|
after_create :act_as_activity,:act_as_course_activity,:be_user_score,:act_as_forge_activity, :act_as_system_message, :send_mail, :act_as_student_score, :act_as_at_message
|
||||||
|
@ -194,6 +196,13 @@ class Message < ActiveRecord::Base
|
||||||
def get_notify_is_read()
|
def get_notify_is_read()
|
||||||
return @notify_is_read
|
return @notify_is_read
|
||||||
end
|
end
|
||||||
|
#动态的更新
|
||||||
|
def update_activity
|
||||||
|
update_course_activity(self.class, self.id)
|
||||||
|
update_user_activity(self.class, self.id)
|
||||||
|
update_forge_activity(self.class, self.id)
|
||||||
|
update_org_activity(self.class, self.id)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ class News < ActiveRecord::Base
|
||||||
acts_as_watchable
|
acts_as_watchable
|
||||||
|
|
||||||
after_create :act_as_activity,:act_as_forge_activity, :act_as_course_activity,:act_as_system_message, :add_author_as_watcher, :send_mail, :add_news_count
|
after_create :act_as_activity,:act_as_forge_activity, :act_as_course_activity,:act_as_system_message, :add_author_as_watcher, :send_mail, :add_news_count
|
||||||
|
after_update :update_activity
|
||||||
after_destroy :delete_kindeditor_assets, :decrease_news_count
|
after_destroy :delete_kindeditor_assets, :decrease_news_count
|
||||||
|
|
||||||
scope :visible, lambda {|*args|
|
scope :visible, lambda {|*args|
|
||||||
|
@ -68,6 +68,14 @@ class News < ActiveRecord::Base
|
||||||
}
|
}
|
||||||
safe_attributes 'title', 'summary', 'description', 'sticky'
|
safe_attributes 'title', 'summary', 'description', 'sticky'
|
||||||
|
|
||||||
|
#动态的更新
|
||||||
|
def update_activity
|
||||||
|
update_course_activity(self.class, self.id)
|
||||||
|
update_user_activity(self.class, self.id)
|
||||||
|
update_org_activity(self.class, self.id)
|
||||||
|
update_forge_activity(self.class, self.id)
|
||||||
|
end
|
||||||
|
|
||||||
def visible?(user=User.current)
|
def visible?(user=User.current)
|
||||||
!user.nil? && user.allowed_to?(:view_news, project)
|
!user.nil? && user.allowed_to?(:view_news, project)
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,6 +8,16 @@ class OrgDocumentComment < ActiveRecord::Base
|
||||||
acts_as_attachable
|
acts_as_attachable
|
||||||
has_many :org_acts, :class_name => 'OrgActivity',:as =>:org_act ,:dependent => :destroy
|
has_many :org_acts, :class_name => 'OrgActivity',:as =>:org_act ,:dependent => :destroy
|
||||||
after_create :document_save_as_org_activity
|
after_create :document_save_as_org_activity
|
||||||
|
after_update :update_activity
|
||||||
|
|
||||||
|
#动态的更新
|
||||||
|
def update_activity
|
||||||
|
org_activity = OrgActivity.where("org_act_type='OrgDocumentComment' and org_act_id =?", id).first
|
||||||
|
if org_activity
|
||||||
|
org_activity.updated_at = Time.now
|
||||||
|
org_activity.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def document_save_as_org_activity
|
def document_save_as_org_activity
|
||||||
if(self.parent().nil?)
|
if(self.parent().nil?)
|
||||||
|
|
|
@ -14,7 +14,7 @@ class Poll < ActiveRecord::Base
|
||||||
# 课程消息
|
# 课程消息
|
||||||
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
|
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
|
||||||
after_save :act_as_course_message, :act_as_activity, :act_as_course_activity
|
after_save :act_as_course_message, :act_as_activity, :act_as_course_activity
|
||||||
|
after_update :update_activity
|
||||||
acts_as_event :title => Proc.new {|o| "#{l(:label_course_poll)}: #{o.polls_name}" },
|
acts_as_event :title => Proc.new {|o| "#{l(:label_course_poll)}: #{o.polls_name}" },
|
||||||
:description => :polls_description,
|
:description => :polls_description,
|
||||||
:datetime => :published_at,
|
:datetime => :published_at,
|
||||||
|
@ -32,6 +32,13 @@ class Poll < ActiveRecord::Base
|
||||||
self.acts << Activity.new(:user_id => self.user_id)
|
self.acts << Activity.new(:user_id => self.user_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#动态的更新
|
||||||
|
def update_activity
|
||||||
|
update_course_activity(self.class, self.id)
|
||||||
|
update_user_activity(self.class, self.id)
|
||||||
|
update_org_activity(self.class, self.id)
|
||||||
|
end
|
||||||
|
|
||||||
#课程动态公共表记录
|
#课程动态公共表记录
|
||||||
def act_as_course_activity
|
def act_as_course_activity
|
||||||
if self.polls_type == "Course"
|
if self.polls_type == "Course"
|
||||||
|
|
|
@ -409,7 +409,7 @@ class User < Principal
|
||||||
|
|
||||||
def get_at_show_name
|
def get_at_show_name
|
||||||
name = show_name
|
name = show_name
|
||||||
name = "#{name} #{self.login}" if name != self.login
|
(name != self.login) ? "#{name} #{self.login}" : name
|
||||||
end
|
end
|
||||||
|
|
||||||
#added by nie
|
#added by nie
|
||||||
|
|
|
@ -65,9 +65,13 @@
|
||||||
<span class="locked_btn_cir ml10 fl" title="已锁定"> </span>
|
<span class="locked_btn_cir ml10 fl" title="已锁定"> </span>
|
||||||
<% end%>
|
<% end%>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
发帖时间:<%= format_time(activity.created_on) %>
|
发帖时间:<%= format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(UserActivity.where("act_type='#{activity.class}' and act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||||
<div id="intro_content_<%= user_activity_id%>">
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
<% if activity.parent_id.nil? %>
|
<% if activity.parent_id.nil? %>
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt5">
|
<div class="mt5">
|
||||||
<span class="fontGrey2 mr15 fl">上传时间:<%= format_date(file.created_on)%></span>
|
<span class="fontGrey2 mr15 fl">上传时间:<%= format_time(file.created_on)%></span>
|
||||||
<% if file.tag_list.length > 0%>
|
<% if file.tag_list.length > 0%>
|
||||||
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
|
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt5">
|
<div class="mt5">
|
||||||
<span class="fontGrey2 mr15 fl">上传时间:<%= format_date(file.created_on)%></span>
|
<span class="fontGrey2 mr15 fl">上传时间:<%= format_time(file.created_on)%></span>
|
||||||
<% if file.tag_list.length > 0%>
|
<% if file.tag_list.length > 0%>
|
||||||
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
|
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -24,14 +24,5 @@
|
||||||
<%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %>
|
<%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if issues.count == 10%>
|
<% if issues.count == 10%>
|
||||||
<div id="show_more_issues" class="loadMore mt10 f_grey">展开更多<%=link_to "", project_issues_path({:project_id => project.id}.merge(params)),:id => "more_issues_link",:remote => "true",:class => "none" %></div>
|
<%= link_to "点击展开更多",project_issues_path({:project_id => project.id}.merge(params)),:id => "show_more_issues",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||||
<%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
|
||||||
<% end%>
|
<% end%>
|
||||||
<!--<ul class="wlist">-->
|
|
||||||
<!--<%#= pagination_links_full issue_pages, issue_count, :per_page_links => false, :remote => true, :flag => true %>-->
|
|
||||||
<!--</ul>-->
|
|
||||||
<script type="text/javascript">
|
|
||||||
$("#show_more_issues").mouseover(function(){
|
|
||||||
$("#more_issues_link").click();
|
|
||||||
});
|
|
||||||
</script>
|
|
|
@ -17,9 +17,13 @@
|
||||||
<div class="homepagePostTitle break_word" >
|
<div class="homepagePostTitle break_word" >
|
||||||
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
|
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
创建时间:<%= format_time(activity.created_at) %>
|
创建时间:<%= format_time(activity.created_at) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="homepagePostSettingIcon">
|
<li class="homepagePostSettingIcon">
|
||||||
|
|
|
@ -28,9 +28,13 @@
|
||||||
<span class="locked_btn_cir ml10 fl" title="已锁定"> </span>
|
<span class="locked_btn_cir ml10 fl" title="已锁定"> </span>
|
||||||
<% end%>
|
<% end%>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
发帖时间:<%= format_time(activity.created_on) %>
|
发帖时间:<%= format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||||
<div id="intro_content_<%= user_activity_id%>">
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
<% if activity.parent_id.nil? %>
|
<% if activity.parent_id.nil? %>
|
||||||
|
|
|
@ -20,9 +20,13 @@
|
||||||
<span class="sticky_btn_cir ml10">置顶</span>
|
<span class="sticky_btn_cir ml10">置顶</span>
|
||||||
<% end%>
|
<% end%>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
发布时间:<%= format_time(activity.created_on) %>
|
发布时间:<%= format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||||
<div id="intro_content_<%= user_activity_id%>">
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
<%= activity.description.html_safe %>
|
<%= activity.description.html_safe %>
|
||||||
|
|
|
@ -27,9 +27,13 @@
|
||||||
<%= link_to poll_name, poll_path(activity.id), :class => "postGrey"%>
|
<%= link_to poll_name, poll_path(activity.id), :class => "postGrey"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
发布时间:<%= format_time(activity.published_at) %>
|
发布时间:<%= format_time(activity.published_at) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||||
<div id="intro_content_<%= user_activity_id%>">
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
<%= activity.polls_description.html_safe %>
|
<%= activity.polls_description.html_safe %>
|
||||||
|
|
|
@ -29,10 +29,14 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDeadline">
|
<div class="homepagePostDeadline fl">
|
||||||
时间:
|
发布时间:
|
||||||
<%=format_time(activity.created_on) %>
|
<%=format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||||
<div id="intro_content_<%= user_activity_id%>">
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
|
|
|
@ -24,9 +24,13 @@
|
||||||
%>
|
%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
时间:<%= format_time(activity.created_on) %>
|
发布时间:<%= format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(OrgActivity.where("org_act_type='#{activity.class}' and org_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||||
<div id="intro_content_<%= user_activity_id%>">
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
<% if activity.parent_id.nil? %>
|
<% if activity.parent_id.nil? %>
|
||||||
|
|
|
@ -19,9 +19,13 @@
|
||||||
<div class="homepagePostTitle break_word" >
|
<div class="homepagePostTitle break_word" >
|
||||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
|
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
创建时间:<%= format_time(project.created_on) %>
|
创建时间:<%= format_time(project.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="homepagePostSettingIcon">
|
<li class="homepagePostSettingIcon">
|
||||||
|
|
|
@ -24,9 +24,13 @@
|
||||||
%>
|
%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
时间:<%= format_time(activity.created_on) %>
|
发帖时间:<%= format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||||
<div id="intro_content_<%= user_activity_id%>">
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
<% if activity.parent_id.nil? %>
|
<% if activity.parent_id.nil? %>
|
||||||
|
|
|
@ -12,8 +12,13 @@
|
||||||
<span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span>
|
<span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %></div>
|
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(OrgActivity.where("org_act_type='#{document.class}' and org_act_id =#{document.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<% unless document.content.blank? %>
|
<% unless document.content.blank? %>
|
||||||
<div class="homepagePostIntro" style="width:640px;">
|
<div class="homepagePostIntro" style="width:640px;">
|
||||||
<%= document.content.html_safe %>
|
<%= document.content.html_safe %>
|
||||||
|
|
|
@ -19,9 +19,13 @@
|
||||||
<span class="sticky_btn_cir ml10">置顶</span>
|
<span class="sticky_btn_cir ml10">置顶</span>
|
||||||
<% end%>
|
<% end%>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
发布时间:<%= format_time(activity.created_on) %>
|
发布时间:<%= format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id %>">
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id %>">
|
||||||
<div id="intro_content_<%= user_activity_id %>">
|
<div id="intro_content_<%= user_activity_id %>">
|
||||||
<%= activity.description.html_safe %>
|
<%= activity.description.html_safe %>
|
||||||
|
|
|
@ -17,9 +17,13 @@
|
||||||
<div class="homepagePostTitle break_word" >
|
<div class="homepagePostTitle break_word" >
|
||||||
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
|
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
创建时间:<%= format_time(activity.created_at) %>
|
创建时间:<%= format_time(activity.created_at) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="homepagePostSettingIcon">
|
<li class="homepagePostSettingIcon">
|
||||||
|
|
|
@ -20,9 +20,13 @@
|
||||||
<%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
|
<%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
留言时间:<%= format_time(activity.created_on) %>
|
留言时间:<%= format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -28,9 +28,13 @@
|
||||||
<span class="locked_btn_cir ml10 fl" title="已锁定"> </span>
|
<span class="locked_btn_cir ml10 fl" title="已锁定"> </span>
|
||||||
<% end%>
|
<% end%>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
发帖时间:<%= format_time(activity.created_on) %>
|
发帖时间:<%= format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||||
<div id="intro_content_<%= user_activity_id%>">
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
<% if activity.parent_id.nil? %>
|
<% if activity.parent_id.nil? %>
|
||||||
|
|
|
@ -20,9 +20,13 @@
|
||||||
<span class="sticky_btn_cir ml10">置顶</span>
|
<span class="sticky_btn_cir ml10">置顶</span>
|
||||||
<% end%>
|
<% end%>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
发布时间:<%= format_time(activity.created_on) %>
|
发布时间:<%= format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||||
<div id="intro_content_<%= user_activity_id%>">
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
<%= activity.description.html_safe %>
|
<%= activity.description.html_safe %>
|
||||||
|
|
|
@ -27,9 +27,13 @@
|
||||||
<%= link_to poll_name, poll_path(activity.id), :class => "postGrey"%>
|
<%= link_to poll_name, poll_path(activity.id), :class => "postGrey"%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
发布时间:<%= format_time(activity.published_at) %>
|
发布时间:<%= format_time(activity.published_at) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||||
<div id="intro_content_<%= user_activity_id%>">
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
<%= activity.polls_description.html_safe %>
|
<%= activity.polls_description.html_safe %>
|
||||||
|
@ -57,4 +61,4 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(description_show_hide(<%=user_activity_id %>));
|
$(description_show_hide(<%=user_activity_id %>));
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -19,9 +19,13 @@
|
||||||
<div class="homepagePostTitle break_word" >
|
<div class="homepagePostTitle break_word" >
|
||||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
|
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
创建时间:<%= format_time(project.created_on) %>
|
创建时间:<%= format_time(project.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="homepagePostSettingIcon">
|
<li class="homepagePostSettingIcon">
|
||||||
|
|
|
@ -41,10 +41,14 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDeadline">
|
<div class="homepagePostDeadline fl">
|
||||||
时间:
|
发布时间:
|
||||||
<%=format_time(activity.created_on) %>
|
<%=format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||||
<div id="intro_content_<%= user_activity_id%>">
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
|
|
|
@ -29,9 +29,13 @@
|
||||||
<% end%>
|
<% end%>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
发帖时间:<%= format_time(activity.created_on) %>
|
发帖时间:<%= format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||||
<div id="intro_content_<%= user_activity_id%>">
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
<% if activity.parent_id.nil? %>
|
<% if activity.parent_id.nil? %>
|
||||||
|
@ -153,4 +157,4 @@
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(description_show_hide(<%=user_activity_id %>));
|
$(description_show_hide(<%=user_activity_id %>));
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -26,9 +26,13 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
发布时间:<%= format_time(activity.created_on) %>
|
发布时间:<%= format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(UserActivity.where("act_type='#{activity.class}' and act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||||
<div id="intro_content_<%= user_activity_id%>">
|
<div id="intro_content_<%= user_activity_id%>">
|
||||||
<%= activity.content.html_safe %>
|
<%= activity.content.html_safe %>
|
||||||
|
|
|
@ -42,9 +42,9 @@
|
||||||
<% if homework_commons.count == 10%>
|
<% if homework_commons.count == 10%>
|
||||||
<% if is_in_course == 1%>
|
<% if is_in_course == 1%>
|
||||||
<!-- 在课程内 -->
|
<!-- 在课程内 -->
|
||||||
<%= link_to "加载更多",homework_common_index_path(:course => course_id,:page => page,:is_in_course => is_in_course),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%>
|
<%= link_to "点击展开更多",homework_common_index_path(:course => course_id,:page => page,:is_in_course => is_in_course),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%>
|
||||||
<% else%>
|
<% else%>
|
||||||
<!-- 在个人主页 -->
|
<!-- 在个人主页 -->
|
||||||
<%= link_to "加载更多",user_homeworks_user_path(User.current.id,:page => page,:is_in_course => is_in_course),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%>
|
<%= link_to "点击展开更多",user_homeworks_user_path(User.current.id,:page => page,:is_in_course => is_in_course),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%>
|
||||||
<% end%>
|
<% end%>
|
||||||
<% end%>
|
<% end%>
|
|
@ -23,9 +23,13 @@
|
||||||
<%= link_to activity.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %>
|
<%= link_to activity.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate fl">
|
||||||
留言时间:<%= format_time(activity.created_on) %>
|
留言时间:<%= format_time(activity.created_on) %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="homepagePostDate fl ml15">
|
||||||
|
更新时间:<%= format_time(PrincipalActivity.where("principal_act_type='#{activity.class}' and principal_act_id =#{activity.id}").first.updated_at) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -158,7 +158,7 @@ h4{ font-size:14px; color:#3b3b3b;}
|
||||||
.w583{ width:583px;}
|
.w583{ width:583px;}
|
||||||
.w350{ width:350px;}
|
.w350{ width:350px;}
|
||||||
.w610{ width:610px;}
|
.w610{ width:610px;}
|
||||||
.w60{ width:600px !important;}
|
.w600{ width:600px !important;}
|
||||||
.w606{ width:606px }
|
.w606{ width:606px }
|
||||||
.h20{height: 20px;}
|
.h20{height: 20px;}
|
||||||
.h22{ height:22px;}
|
.h22{ height:22px;}
|
||||||
|
@ -397,7 +397,7 @@ li.menuArrow:hover {background:url(../images/item.png) -20px -70px no-repeat;}
|
||||||
a.topnav_login_box:hover {color:#a1ebff;}
|
a.topnav_login_box:hover {color:#a1ebff;}
|
||||||
.navRow1 {margin:0; padding:0;}
|
.navRow1 {margin:0; padding:0;}
|
||||||
.navRow2 {margin:0; padding:0;}
|
.navRow2 {margin:0; padding:0;}
|
||||||
.topnav_login_list{ border:1px solid #269ac9; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-7px; position:absolute; z-index:9999; line-height:2;}
|
.topnav_login_list{ border:1px solid #eaeaea; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-7px; position:absolute; z-index:9999; line-height:2;}
|
||||||
.topnav_login_list a{color:#15bccf;}
|
.topnav_login_list a{color:#15bccf;}
|
||||||
.topnav_login_list li{ }
|
.topnav_login_list li{ }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue