组织发送动态的显示
This commit is contained in:
parent
a9412b959e
commit
9e7c595e55
|
@ -79,16 +79,39 @@ class OrganizationsController < ApplicationController
|
|||
if @organization.show_mode == 1 && params[:org_subfield_id].nil? && params[:list] .nil?
|
||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||
@subfield_content = @organization.org_subfields.order("priority")
|
||||
@organization = Organization.find(params[:id])
|
||||
# 统计访问量
|
||||
@organization.update_column(:visits, @organization.visits.to_i + 1)
|
||||
|
||||
# @org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
# @org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0
|
||||
# @org_acts = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{@org_subfield.id})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
|
||||
shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id)
|
||||
shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id)
|
||||
project_ids = (@organization.projects.map(&:id)-shield_project_ids) << 0
|
||||
course_ids = (@organization.courses.map(&:id)-shield_course_ids) << 0
|
||||
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
|
||||
@project_acts = get_project_activities_org @organization, project_ids
|
||||
@course_acts = get_course_activities_org @organization, course_ids
|
||||
#@org_acts = OrgActivity.where("container_id =? and container_type =?",@organization.id, 'Organization').order('updated_at desc')
|
||||
#@project_acts = OrgActivity.where("(container_id =? and container_type =?) " +
|
||||
# "or (container_type ='Project' and org_act_type in ('Issue','Message') and container_id in (#{project_ids.join(',')})) ",
|
||||
# @organization.id, 'Organization').order('updated_at desc').limit(8)
|
||||
|
||||
#@course_acts = OrgActivity.where("(container_id =? and container_type =?) " +
|
||||
# "or (container_type ='Course' and org_act_type in #{course_types} and container_id in (#{course_ids.join(',')}))",
|
||||
# @organization.id, 'Organization').order('updated_at desc').limit(8)
|
||||
|
||||
|
||||
|
||||
# 项目两种动态
|
||||
@project_acts = get_project_activities_org @organization
|
||||
@project_issue_acts = get_project_issue_activities_org @organization
|
||||
@project_message_acts = get_project_message_activities_org @organization
|
||||
# 磕碜动态
|
||||
#@project_acts = get_project_activities_org @organization
|
||||
|
||||
# 课程动态
|
||||
#@project_acts_issues = get_project_activities_org @organization
|
||||
@course_acts = get_course_activities_org @organization
|
||||
@course_acts_homework = get_course_homework_activities_org @organization
|
||||
@course_acts_message = get_course_message_activities_org @organization
|
||||
@course_acts_news = get_course_news_activities_org @organization
|
||||
#@course_acts = get_course_activities_org @organization
|
||||
|
||||
render :layout => 'base_org_newstyle'
|
||||
else
|
||||
render_403
|
||||
|
@ -97,7 +120,7 @@ class OrganizationsController < ApplicationController
|
|||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||
@organization = Organization.find(params[:id])
|
||||
# 统计访问量
|
||||
@organization.update_attribute(:visits, @organization.visits.to_i + 1)
|
||||
@organization.update_column(:visits, @organization.visits.to_i + 1)
|
||||
if params[:org_subfield_id]
|
||||
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0
|
||||
|
@ -162,10 +185,9 @@ class OrganizationsController < ApplicationController
|
|||
end
|
||||
|
||||
# 获取整过项目的动态
|
||||
def get_project_activities_org org
|
||||
project_ids = org.projects.map{|project| project.id}.join(",")
|
||||
def get_project_activities_org org, project_ids
|
||||
unless project_ids.blank?
|
||||
project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{project_ids}) and container_type = 'project'
|
||||
project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{project_ids.join(',')}) and container_type = 'project'
|
||||
and org_act_type in ('Message', 'Issue') order by updated_at desc limit 8;")
|
||||
else
|
||||
project_acts = nil
|
||||
|
@ -174,10 +196,9 @@ class OrganizationsController < ApplicationController
|
|||
end
|
||||
|
||||
# 获取整过课程的动态
|
||||
def get_course_activities_org org
|
||||
course_ids = org.courses.map{|course| course.id}.join(",")
|
||||
def get_course_activities_org org, course_ids
|
||||
unless course_ids.blank?
|
||||
project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{course_ids}) and container_type = 'course'
|
||||
project_acts = OrgActivity.find_by_sql("SELECT * FROM org_activities where container_id in (#{course_ids.join(',')}) and container_type = 'course'
|
||||
and org_act_type in ('HomeworkCommon', 'Poll', 'Message', 'News', 'Course') order by updated_at desc limit 8;")
|
||||
else
|
||||
project_acts = nil
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
<% if field.status == 0 %>
|
||||
<div class="content ">
|
||||
<div class="box-top" id="course_<%= field.id %>"><h2 class="box-title">课程动态</h2></div>
|
||||
<% if @course_acts.nil? %>
|
||||
<% if @course_acts.blank? %>
|
||||
<p class="nocontent">暂无内容,敬请期待!</p>
|
||||
<div class="cl"></div>
|
||||
<%= link_to "More", organization_path(@organization, :list =>1), :class => "more-btn-center mt30" , :target => "_blank" %>
|
||||
|
@ -134,7 +134,7 @@
|
|||
<% else %>
|
||||
<div class="content">
|
||||
<div class="box-top" id="course_<%= field.id %>"><h2 class="box-title">课程动态</h2></div>
|
||||
<% if @course_acts.nil? %>
|
||||
<% if @course_acts.blank? %>
|
||||
<p class="nocontent">暂无内容,敬请期待!</p>
|
||||
<div class="cl"></div>
|
||||
<%= link_to "More", organization_path(@organization, :list =>1), :class => "more-btn-center mt30" , :target => "_blank" %>
|
||||
|
@ -158,7 +158,7 @@
|
|||
<% if field.status == 0 %>
|
||||
<div class="content ">
|
||||
<div class="box-top" id="project_<%= field.id %>"><h2 class="box-title">项目动态</h2><p class="box-title-p"></p></div>
|
||||
<% if @project_acts.nil? %>
|
||||
<% if @project_acts.blank? %>
|
||||
<p class="nocontent">暂无内容,敬请期待!</p>
|
||||
<div class="cl"></div>
|
||||
<%= link_to "More", organization_path(@organization, :list =>1), :class => "more-btn-center mt30" , :target => "_blank" %>
|
||||
|
@ -180,7 +180,7 @@
|
|||
<% else %>
|
||||
<div class="content">
|
||||
<div class="box-top" style="display:<%= field.hide == 0?'block':'none' %>;" id="project_<%= field.id %>"><h2 class="box-title">项目动态</h2><p class="box-title-p"></p></div>
|
||||
<% if @project_acts.nil? %>
|
||||
<% if @project_acts.blank? %>
|
||||
<p class="nocontent">暂无内容,敬请期待!</p>
|
||||
<div class="cl"></div>
|
||||
<%= link_to "More", organization_path(@organization, :list =>1), :class => "more-btn-center mt30" , :target => "_blank" %>
|
||||
|
@ -201,13 +201,16 @@
|
|||
<% end %>
|
||||
<% else %>
|
||||
<% if field.field_type == "Post" %> <%# 讨论类型 %>
|
||||
<% message_ats = get_message_org(@organization.id, field.id) %>
|
||||
<% ids = field.org_document_comments.map{|o| o.id}.join(",") %>
|
||||
<% org_subfield = OrgSubfield.find(field.id) %>
|
||||
<% org_subfield_ids = org_subfield.org_document_comments.map(&:id) << 0 %>
|
||||
<% org_acts = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{org_subfield.id})").order('updated_at desc') %>
|
||||
<%# message_ats = get_message_org(@organization.id, field.id) %>
|
||||
<%# ids = field.org_document_comments.map{|o| o.id}.join(",") %>
|
||||
<div class="box1 bg-grey" style="display:<%= field.hide == 0?'block':'none' %>;" id="org_subfield_<%= field.id %>">
|
||||
<% if field.status == 0 %>
|
||||
<div class="content">
|
||||
<div class="box-top" id="message_<%= field.id %>"><h2 class="box-title"><%= field.name %></h2></div>
|
||||
<% if message_ats.blank? %>
|
||||
<% if org_acts.blank? %>
|
||||
<p class="nocontent">暂无内容,敬请期待!</p>
|
||||
<div class="cl"></div>
|
||||
<% if !field.subfield_subdomain_dir.nil? %> <!--讨论帖子-->
|
||||
|
@ -226,7 +229,7 @@
|
|||
<div class="course-list">
|
||||
<ul class="clearfix">
|
||||
|
||||
<% message_ats.first(3).each do |act| %>
|
||||
<% org_acts.first(3).each do |act| %>
|
||||
<%= render :partial => 'organizations/org_new_forum_pic', :locals => {:activity => act, :field => field, :organization => @organization} %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
@ -249,7 +252,7 @@
|
|||
<% else %>
|
||||
<div class="content">
|
||||
<div class="box-top" id="message_<%= field.id %>"><h2 class="box-title"><%= field.name %></h2></div>
|
||||
<% if message_ats.blank? %>
|
||||
<% if org_acts.blank? %>
|
||||
<p class="nocontent">暂无内容,敬请期待!</p>
|
||||
<div class="cl"></div>
|
||||
<% if !field.subfield_subdomain_dir.nil? %> <!--讨论帖子-->
|
||||
|
@ -264,7 +267,7 @@
|
|||
<div class="cl"></div>
|
||||
<% else %>
|
||||
<div class="row">
|
||||
<% message_ats.each do |act| %>
|
||||
<% org_acts.each do |act| %>
|
||||
<%= render :partial => 'organizations/org_new_forum_list', :locals => {:activity => act, :field => field, :organization => @organization} %>
|
||||
<% end %>
|
||||
<!--row-ziyuan end-->
|
||||
|
|
|
@ -1,15 +1,74 @@
|
|||
|
||||
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||
<% document = activity.org_act %>
|
||||
<% org_subfield_id = params[:org_subfield_id] %>
|
||||
<% flag = 2 %>
|
||||
<div class="row-ziyuan fl">
|
||||
<%= link_to image_tag(url_to_avatar(activity.creator),:width => "40", :height => "40"), user_path(activity.creator), :class => "fl user-img" %>
|
||||
<!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
|
||||
<%= link_to image_tag(url_to_avatar(document.creator),:width => "40", :height => "40"), user_path(document.creator), :class => "fl user-img" %>
|
||||
<div class="note-box fl">
|
||||
<%= link_to activity.title.to_s, organization_path(@organization, :org_subfield_id => field.id), :target => '_blank', :class => "fl note-title" %>
|
||||
<%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
|
||||
<p class="fl"><span >发布时间:<%= format_date activity.updated_at %></span>
|
||||
<span> 作者:<%= activity.try(:creator).try(:realname).nil? ? activity.try(:creator).try(:login) : activity.try(:creator).try(:realname) %></span>
|
||||
<span class="fr right-info2"> <%= activity.children.count %></span> </p>
|
||||
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "fl note-title" %>
|
||||
<p class="fl"><span >发布时间:<%= format_date document.created_at %></span>
|
||||
<span> 作者:<%= document.try(:creator).try(:realname).nil? ? document.try(:creator).try(:login) : document.try(:creator).try(:realname) %></span>
|
||||
<span class="fr right-info2"> <%= document.children.count %></span> </p>
|
||||
</div>
|
||||
|
||||
</div><!--row-ziyuan end-->
|
||||
</div>
|
||||
<% elsif activity.container_type == 'OrgSubfield' %>
|
||||
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||
<% message = Message.find(activity.org_act_id) %>
|
||||
<% if message.board.org_subfield_id %>
|
||||
<div class="row-ziyuan fl">
|
||||
<%= link_to image_tag(url_to_avatar(message.author),:width => "40", :height => "40"), user_path(message.author), :class => "fl user-img" %>
|
||||
<!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
|
||||
<div class="note-box fl">
|
||||
<% if message.parent_id.nil? %>
|
||||
<span><%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "fl note-title" %></span>
|
||||
<% else %>
|
||||
<span><%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "fl note-title" %></span>
|
||||
<% end %>
|
||||
<%#= link_to activity.title.to_s, organization_path(@organization, :org_subfield_id => field.id), :target => '_blank', :class => "fl note-title" %>
|
||||
<%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
|
||||
<p class="fl"><span >发布时间:<%= format_date message.created_on %></span>
|
||||
<span> 作者:<%= message.try(:author).try(:realname).nil? ? message.try(:author).try(:login) : message.try(:author).try(:realname) %></span>
|
||||
<span class="fr right-info2"> <%= message.children.count %></span> </p>
|
||||
</div>
|
||||
</div><!--row-ziyuan end-->
|
||||
<% else %>
|
||||
<div class="row-ziyuan fl">
|
||||
<%= link_to image_tag(url_to_avatar(message.author),:width => "40", :height => "40"), user_path(message.author), :class => "fl user-img" %>
|
||||
<!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
|
||||
<div class="note-box fl">
|
||||
<% if message.parent_id.nil? %>
|
||||
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "fl note-title" %>
|
||||
<% else %>
|
||||
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "fl note-title" %>
|
||||
<% end %>
|
||||
<%#= link_to activity.title.to_s, organization_path(@organization, :org_subfield_id => field.id), :target => '_blank', :class => "fl note-title" %>
|
||||
<%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
|
||||
<p class="fl"><span >发布时间:<%= format_date message.created_on %></span>
|
||||
<span> 作者:<%= message.try(:author).try(:realname).nil? ? message.try(:author).try(:login) : message.try(:author).try(:realname) %></span>
|
||||
<span class="fr right-info2"> <%= message.children.count %></span> </p>
|
||||
</div>
|
||||
</div><!--row-ziyuan end-->
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||
<% news = News.find(activity.org_act_id) %>
|
||||
<div class="row-ziyuan fl">
|
||||
<%= link_to image_tag(url_to_avatar(news.author),:width => "40", :height => "40"), user_path(news.author), :class => "fl user-img" %>
|
||||
<!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
|
||||
<div class="note-box fl">
|
||||
<%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "fl note-title" %>
|
||||
<%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
|
||||
<p class="fl"><span >发布时间:<%= format_date news.created_on %></span>
|
||||
<span> 作者:<%= news.try(:author).try(:realname).nil? ? news.try(:author).try(:login) : news.try(:author).try(:realname) %></span>
|
||||
<span class="fr right-info2"> <%= news.comments.count %></span> </p>
|
||||
</div>
|
||||
</div><!--row-ziyuan end-->
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,23 +1,123 @@
|
|||
<li>
|
||||
<a href="/#" title="" >
|
||||
<div class="course-list-img">
|
||||
<% iamge_path = get_image_path_from_content(activity.content) %>
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), organization_path(@organization, :org_subfield_id => field.id), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), organization_path(@organization, :org_subfield_id => field.id), :target => "_blank" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<h5>
|
||||
<span><%= link_to activity.title.to_s, organization_path(@organization, :org_subfield_id => field.id), :target => '_blank' %></span>
|
||||
</h5>
|
||||
<div class="item-btm clearfix">
|
||||
<%=link_to activity.try(:creator).try(:realname).nil? ? activity.try(:creator).try(:login) : activity.try(:creator).try(:realname), user_path(activity.creator), :class=>"publisher-name fl", :target => "_blank" %></a>
|
||||
<p class="pass-time fl"><span><%= format_date activity.created_at %></span></p>
|
||||
<div class="fr right-info"> <span> <%= activity.children.count %></span></div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
|
||||
<% document = activity.org_act %>
|
||||
<% org_subfield_id = params[:org_subfield_id] %>
|
||||
<% flag = 2 %>
|
||||
<li>
|
||||
<a href="/#" title="" >
|
||||
<div class="course-list-img">
|
||||
<% iamge_path = get_image_path_from_content(document.content) %>
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<h5><%#= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %>
|
||||
<span><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank' %></span>
|
||||
</h5>
|
||||
<div class="item-btm clearfix">
|
||||
<%=link_to document.try(:creator).try(:realname).nil? ? document.try(:creator).try(:login) : document.try(:creator).try(:realname), user_path(document.creator), :class=>"publisher-name fl", :target => "_blank" %></a>
|
||||
<p class="pass-time fl"><span><%= format_date document.created_at %></span></p>
|
||||
<div class="fr right-info"> <span> <%= document.children.count %></span></div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<% elsif activity.container_type == 'OrgSubfield' %>
|
||||
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where("id=#{activity.org_act_id}").count > 0 %>
|
||||
<% message = Message.find(activity.org_act_id) %>
|
||||
<% if message.board.org_subfield_id %>
|
||||
<li>
|
||||
<a href="/#" title="" >
|
||||
<div class="course-list-img">
|
||||
<% if message.parent_id.nil? %>
|
||||
<% content = message.content%>
|
||||
<% else %>
|
||||
<% content = message.parent.content%>
|
||||
<% end %>
|
||||
<% iamge_path = get_image_path_from_content(content) %>
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<h5>
|
||||
<% if message.parent_id.nil? %>
|
||||
<span><%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank' %></span>
|
||||
<% else %>
|
||||
<span><%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank'%></span>
|
||||
<% end %>
|
||||
<%#= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %>
|
||||
<%#= link_to document.subject, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
|
||||
</h5>
|
||||
<div class="item-btm clearfix">
|
||||
<%=link_to message.try(:author).try(:realname).nil? ? message.try(:author).try(:login) : message.try(:author).try(:realname), user_path(message.author), :class=>"publisher-name fl", :target => "_blank" %></a>
|
||||
<p class="pass-time fl"><span><%= format_date message.created_on %></span></p>
|
||||
<div class="fr right-info"> <span> <%= message.children.count %></span></div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<% else %>
|
||||
<li>
|
||||
<a href="/#" title="" >
|
||||
<div class="course-list-img">
|
||||
<% if message.parent_id.nil? %>
|
||||
<% content = message.content%>
|
||||
<% else %>
|
||||
<% content = message.parent.content%>
|
||||
<% end %>
|
||||
<% iamge_path = get_image_path_from_content(content) %>
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), board_message_path(message.board,activity), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), board_message_path(message.board,activity), :target => "_blank" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<h5>
|
||||
<% if message.parent_id.nil? %>
|
||||
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :class=> "postGrey"
|
||||
%>
|
||||
<% else %>
|
||||
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :class=> "postGrey"
|
||||
%>
|
||||
<% end %>
|
||||
|
||||
<%#= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %>
|
||||
<%#= link_to document.subject, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
|
||||
</h5>
|
||||
<div class="item-btm clearfix">
|
||||
<%=link_to message.try(:author).try(:realname).nil? ? message.try(:author).try(:login) : message.try(:author).try(:realname), user_path(message.author), :class=>"publisher-name fl", :target => "_blank" %></a>
|
||||
<p class="pass-time fl"><span><%= format_date message.created_on %></span></p>
|
||||
<div class="fr right-info"> <span> <%= message.children.count %></span></div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %>
|
||||
<% news = News.find(activity.org_act_id) %>
|
||||
<li>
|
||||
<a href="/#" title="" >
|
||||
<div class="course-list-img">
|
||||
<% iamge_path = get_image_path_from_content(news.description) %>
|
||||
<% if iamge_path.nil? %>
|
||||
<%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), news_path(news), :target => "_blank" %>
|
||||
<% else %>
|
||||
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), news_path(news), :target => "_blank" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<h5><%#= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %>
|
||||
<span><%= link_to news.title.to_s, news_path(news), :target => '_blank' %></span>
|
||||
</h5>
|
||||
<div class="item-btm clearfix">
|
||||
<%=link_to news.try(:author).try(:realname).nil? ? news.try(:author).try(:login) : news.try(:author).try(:realname), user_path(news.author), :class=>"publisher-name fl", :target => "_blank" %></a>
|
||||
<p class="pass-time fl"><span><%= format_date news.created_on %></span></p>
|
||||
<div class="fr right-info"> <span> <%= news.comments.count %></span></div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue