首页、课程、项目、组织动态增加更新时间

This commit is contained in:
cxt 2016-01-12 15:53:15 +08:00
parent e5f8c4c4a8
commit b48a2848b0
35 changed files with 240 additions and 106 deletions

View File

@ -54,16 +54,9 @@ class CommentsController < ApplicationController
# end
# # <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add end
#flash[:notice] = l(:label_comment_added)
course_activity = CourseActivity.where("course_act_type='News' and course_act_id =#{@news.id}").first
if course_activity
course_activity.updated_at = Time.now
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
update_course_activity(@news.class,@news.id)
update_user_activity(@news.class,@news.id)
update_org_activity(@news.class,@news.id)
end
if params[:user_activity_id]

View File

@ -405,9 +405,9 @@ class IssuesController < ApplicationController
jour.journalized = @issue
jour.save_attachments(params[:attachments])
jour.save
user_activity = UserActivity.where("act_type='Issue' and act_id =#{@issue.id}").first
user_activity.updated_at = jour.created_on
user_activity.save
update_user_activity(@issue.class,@issue.id)
update_forge_activity(@issue.class,@issue.id)
@user_activity_id = params[:user_activity_id]
if params[:issue_id]
@issue_id = params[:issue_id]
@ -455,9 +455,9 @@ class IssuesController < ApplicationController
@issue = Issue.find params[:id]
jour.journalized = @issue
jour.save
user_activity = UserActivity.where("act_type='Issue' and act_id =#{@issue.id}").first
user_activity.updated_at = jour.created_on
user_activity.save
update_user_activity(@issue.class,@issue.id)
update_forge_activity(@issue.class,@issue.id)
respond_to do |format|
format.js
end

View File

@ -176,26 +176,11 @@ class MessagesController < ApplicationController
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
# @reply.reply_id = params[:id]
@topic.children << @reply
course_activity = CourseActivity.where("course_act_type='Message' and course_act_id =#{@topic.id}").first
if course_activity
course_activity.updated_at = Time.now
course_activity.save
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
update_course_activity(@topic.class,@topic.id)
update_user_activity(@topic.class,@topic.id)
update_forge_activity(@topic.class,@topic.id)
update_org_activity(@topic.class,@topic.id)
#@topic.update_attribute(:updated_on, Time.now)
if !@reply.new_record?
if params[:asset_id]

View File

@ -259,16 +259,10 @@ class StudentWorkController < ApplicationController
stu_project.save
end
end
course_activity = CourseActivity.where("course_act_type='HomeworkCommon' and course_act_id =#{@homework.id}").first
if course_activity
course_activity.updated_at = Time.now
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
update_course_activity(@homework.class,@homework.id)
update_user_activity(@homework.class,@homework.id)
update_org_activity(@homework.class,@homework.id)
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

View File

@ -57,21 +57,11 @@ class WordsController < ApplicationController
@jfm = add_reply_adapter options
@save_succ = true if @jfm.errors.empty?
if @save_succ
course_activity = CourseActivity.where("course_act_type='JournalsForMessage' and course_act_id =#{parent_id}").first
if course_activity
course_activity.updated_at = Time.now
course_activity.save
end
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
update_course_activity('JournalsForMessage',parent_id)
update_user_activity('JournalsForMessage',parent_id)
update_forge_activity('JournalsForMessage',parent_id)
update_org_activity('JournalsForMessage',parent_id)
update_principal_activity('JournalsForMessage',parent_id)
end
respond_to do |format|
# format.html {
@ -278,16 +268,9 @@ class WordsController < ApplicationController
update_kindeditor_assets_owner ids,feedback[:id],OwnerTypeHelper::JOURNALSFORMESSAGE
end
course_activity = CourseActivity.where("course_act_type='HomeworkCommon' and course_act_id =#{@homework_common.id}").first
if course_activity
course_activity.updated_at = Time.now
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
update_course_activity(@homework_common.class,@homework_common.id)
update_user_activity(@homework_common.class,@homework_common.id)
update_org_activity(@homework_common.class,@homework_common.id)
respond_to do |format|
format.js{
@user_activity_id = params[:user_activity_id]

View File

@ -2788,4 +2788,45 @@ int main(int argc, char** argv){
# # commits_total_count(project.gpid)
# project.changesets.count
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

View File

@ -70,7 +70,7 @@ class Course < ActiveRecord::Base
validates_length_of :description, :maximum => 10000
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
before_destroy :delete_all_members,:delete_course_ealasticsearch_index
@ -428,6 +428,12 @@ class Course < ActiveRecord::Base
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
# Course.__elasticsearch__.client.indices.delete index: Course.index_name rescue nil

View File

@ -26,6 +26,7 @@ class HomeworkCommon < ActiveRecord::Base
:author => :author,
:url => Proc.new {|o| {:controller => 'student_work', :action => 'index', :homework => o.id}}
after_create :act_as_activity, :send_mail, :act_as_course_message
after_update :update_activity
after_save :act_as_course_activity
after_destroy :delete_kindeditor_assets
@ -60,7 +61,12 @@ class HomeworkCommon < ActiveRecord::Base
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
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::HOMEWORKCOMMON

View File

@ -84,7 +84,7 @@ class Issue < ActiveRecord::Base
# fq
after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :act_as_forge_message, :act_as_at_message
after_update :be_user_score
after_update :be_user_score,:update_activity
after_destroy :down_user_score
# after_create :be_user_score
# end
@ -126,7 +126,13 @@ class Issue < ActiveRecord::Base
after_save :after_create_from_copy
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
def act_as_activity
self.acts << Activity.new(:user_id => self.author_id)

View File

@ -70,12 +70,21 @@ class JournalsForMessage < ActiveRecord::Base
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 :reset_counters!
after_update :update_ativity
after_destroy :reset_counters!
after_save :be_user_score
after_destroy :down_user_score
# 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
if user.anonymous?
return false

View File

@ -36,6 +36,8 @@ class Message < ActiveRecord::Base
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 :user_acts, :class_name => 'UserActivity',:as =>:user_act ,:dependent => :destroy
# end
# 课程/项目 消息
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
after_create :add_author_as_watcher, :reset_counters!
after_update :update_messages_board
after_update :update_messages_board, :update_activity
after_destroy :reset_counters!,:down_user_score,:delete_kindeditor_assets
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
@ -180,6 +182,13 @@ class Message < ActiveRecord::Base
def get_notify_is_read()
return @notify_is_read
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

View File

@ -56,7 +56,7 @@ class News < ActiveRecord::Base
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
after_update :update_activity
after_destroy :delete_kindeditor_assets
scope :visible, lambda {|*args|
@ -68,6 +68,14 @@ class News < ActiveRecord::Base
}
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)
!user.nil? && user.allowed_to?(:view_news, project)
end

View File

@ -8,6 +8,16 @@ class OrgDocumentComment < ActiveRecord::Base
acts_as_attachable
has_many :org_acts, :class_name => 'OrgActivity',:as =>:org_act ,:dependent => :destroy
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
if(self.parent().nil?)

View File

@ -14,7 +14,7 @@ class Poll < ActiveRecord::Base
# 课程消息
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_update :update_activity
acts_as_event :title => Proc.new {|o| "#{l(:label_course_poll)}: #{o.polls_name}" },
:description => :polls_description,
:datetime => :published_at,
@ -32,6 +32,13 @@ class Poll < ActiveRecord::Base
self.acts << Activity.new(:user_id => self.user_id)
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
if self.polls_type == "Course"

View File

@ -20,7 +20,7 @@
</span>
</div>
<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%>
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
<% end %>

View File

@ -19,7 +19,7 @@
</span>
</div>
<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%>
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
<% end %>

View File

@ -17,9 +17,13 @@
<div class="homepagePostTitle break_word" >
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
</div>
<div class="homepagePostDate">
<div class="homepagePostDate fl">
创建时间:<%= format_time(activity.created_at) %>
</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">
<ul>
<li class="homepagePostSettingIcon">

View File

@ -28,9 +28,13 @@
<span class="locked_btn_cir ml10 fl" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<% end%>
<div class="cl"></div>
<div class="homepagePostDate">
<div class="homepagePostDate fl">
发帖时间:<%= format_time(activity.created_on) %>
</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 id="intro_content_<%= user_activity_id%>">
<% if activity.parent_id.nil? %>

View File

@ -20,9 +20,13 @@
<span class="sticky_btn_cir ml10">置顶</span>
<% end%>
<div class="cl"></div>
<div class="homepagePostDate">
<div class="homepagePostDate fl">
发布时间:<%= format_time(activity.created_on) %>
</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 id="intro_content_<%= user_activity_id%>">
<%= activity.description.html_safe %>

View File

@ -27,9 +27,13 @@
<%= link_to poll_name, poll_path(activity.id), :class => "postGrey"%>
<% end %>
</div>
<div class="homepagePostDate">
<div class="homepagePostDate fl">
发布时间:<%= format_time(activity.published_at) %>
</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 id="intro_content_<%= user_activity_id%>">
<%= activity.polls_description.html_safe %>

View File

@ -29,10 +29,14 @@
<% end %>
<% end %>
</div>
<div class="homepagePostDeadline">
时间:
<div class="homepagePostDeadline fl">
发布时间:
<%=format_time(activity.created_on) %>
</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 class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">

View File

@ -24,9 +24,13 @@
%>
<% end %>
</div>
<div class="homepagePostDate">
时间:<%= format_time(activity.created_on) %>
<div class="homepagePostDate fl">
发布时间:<%= format_time(activity.created_on) %>
</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 id="intro_content_<%= user_activity_id%>">
<% if activity.parent_id.nil? %>

View File

@ -19,9 +19,13 @@
<div class="homepagePostTitle break_word" >
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
</div>
<div class="homepagePostDate">
<div class="homepagePostDate fl">
创建时间:<%= format_time(project.created_on) %>
</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">
<ul>
<li class="homepagePostSettingIcon">

View File

@ -24,9 +24,13 @@
%>
<% end %>
</div>
<div class="homepagePostDate">
时间:<%= format_time(activity.created_on) %>
<div class="homepagePostDate fl">
发帖时间:<%= format_time(activity.created_on) %>
</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 id="intro_content_<%= user_activity_id%>">
<% if activity.parent_id.nil? %>

View File

@ -12,8 +12,13 @@
<span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span>
</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">
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %></div>
<div class="homepagePostDate fl">
发布时间:<%= 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? %>
<div class="homepagePostIntro" style="width:640px;">
<%= document.content.html_safe %>

View File

@ -19,9 +19,13 @@
<span class="sticky_btn_cir ml10">置顶</span>
<% end%>
<div class="cl"></div>
<div class="homepagePostDate">
<div class="homepagePostDate fl">
发布时间:<%= format_time(activity.created_on) %>
</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 id="intro_content_<%= user_activity_id %>">
<%= activity.description.html_safe %>

View File

@ -17,9 +17,13 @@
<div class="homepagePostTitle break_word" >
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
</div>
<div class="homepagePostDate">
<div class="homepagePostDate fl">
创建时间:<%= format_time(activity.created_at) %>
</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">
<ul>
<li class="homepagePostSettingIcon">

View File

@ -20,9 +20,13 @@
<%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
<% end %>
</div>
<div class="homepagePostDate">
<div class="homepagePostDate fl">
留言时间:<%= format_time(activity.created_on) %>
</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 class="cl"></div>
</div>

View File

@ -28,9 +28,13 @@
<span class="locked_btn_cir ml10 fl" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<% end%>
<div class="cl"></div>
<div class="homepagePostDate">
<div class="homepagePostDate fl">
发帖时间:<%= format_time(activity.created_on) %>
</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 id="intro_content_<%= user_activity_id%>">
<% if activity.parent_id.nil? %>

View File

@ -20,9 +20,13 @@
<span class="sticky_btn_cir ml10">置顶</span>
<% end%>
<div class="cl"></div>
<div class="homepagePostDate">
<div class="homepagePostDate fl">
发布时间:<%= format_time(activity.created_on) %>
</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 id="intro_content_<%= user_activity_id%>">
<%= activity.description.html_safe %>

View File

@ -27,9 +27,13 @@
<%= link_to poll_name, poll_path(activity.id), :class => "postGrey"%>
<% end %>
</div>
<div class="homepagePostDate">
<div class="homepagePostDate fl">
发布时间:<%= format_time(activity.published_at) %>
</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 id="intro_content_<%= user_activity_id%>">
<%= activity.polls_description.html_safe %>
@ -57,4 +61,4 @@
<% end %>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>
</script>

View File

@ -19,9 +19,13 @@
<div class="homepagePostTitle break_word" >
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
</div>
<div class="homepagePostDate">
<div class="homepagePostDate fl">
创建时间:<%= format_time(project.created_on) %>
</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">
<ul>
<li class="homepagePostSettingIcon">

View File

@ -41,10 +41,14 @@
<% end %>
<% end %>
</div>
<div class="homepagePostDeadline">
时间:
<div class="homepagePostDeadline fl">
发布时间:
<%=format_time(activity.created_on) %>
</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 class="homepagePostIntro break_word upload_img list_style maxh360 table_maxWidth" id="activity_description_<%= user_activity_id%>">
<div id="intro_content_<%= user_activity_id%>">

View File

@ -29,9 +29,13 @@
<% end%>
<div class="cl"></div>
</div>
<div class="homepagePostDate">
<div class="homepagePostDate fl">
发帖时间:<%= format_time(activity.created_on) %>
</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 id="intro_content_<%= user_activity_id%>">
<% if activity.parent_id.nil? %>
@ -153,4 +157,4 @@
</div>
<script type="text/javascript">
$(description_show_hide(<%=user_activity_id %>));
</script>
</script>

View File

@ -23,9 +23,13 @@
<%= link_to activity.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %>
<% end %>
</div>
<div class="homepagePostDate">
<div class="homepagePostDate fl">
留言时间:<%= format_time(activity.created_on) %>
</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 class="cl"></div>
</div>