完成组织左二模式

This commit is contained in:
huang 2016-06-01 10:24:50 +08:00
parent 5c27aee2bd
commit 2acc545896
2 changed files with 88 additions and 187 deletions

View File

@ -17,147 +17,104 @@
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% end %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<a href="javascript:void(0);" target="_blank" class=" por_course_time"><%= time_from_now(activity.updated_at) %> </a>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<a class=" por_course_time"><%= time_from_now(activity.updated_at) %></a>
</div>
<% elsif act.org_act_type == "Message" %>
<% activity = act.org_act %>
<% iamge_path = get_image_path_from_content(activity.content) %>
<div class="por_course_bar fl clear">
<%= link_to activity.parent_id.nil? ? activity.subject : activity.parent.subject, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "por_course_title" %>
<a href="javascript:void(0);" target="_blank" class="fl"><img src="/images/org_custom/por_img.jpg" width="140" height="100" alt=""/></a>
<p class="por_course_txt fl">学习程序设计,要学习语言的语法更重要的是求解问题的算法思想。语法的学习需要多尝试,算法的算机程序设计(Z2班)算机程序设计(Z2班)算机程序设计(Z2班)学习需要多思考。学习程序设计</p>
<a href="javascript:void(0);" target="_blank" class=" por_course_time"> 2016春季学期 </a>
</div>
<div class="sn-news-bigbox fl">
<%= link_to activity.parent_id.nil? ? activity.subject : activity.parent.subject, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "por_course_title", :title => activity.parent_id.nil? ? activity.subject : activity.parent.subject %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "140", :height => "100"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"fl" %>
<% end %>
<h3>
<%= link_to activity.parent_id.nil? ? activity.subject.to_s.html_safe : activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
</h3>
<span class="txt-grey"><%= format_date activity.updated_on %></span>
<div class="sn-news-txt">
<div class="sn-news-wrap"><%= activity.content.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<a class=" por_course_time"><%= time_from_now activity.updated_on %></a>
</div>
<% elsif act.org_act_type == "News" %>
<% activity = News.find(act.org_act_id) %>
<% iamge_path = get_image_path_from_content(activity.description) %>
<div class="sn-news-bigbox fl">
<div class="por_course_bar fl clear">
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "por_course_title", :title => activity.title %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "140", :height => "100"), news_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), news_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% end %>
<h3>
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "h3-title" %>
</h3>
<span class="txt-grey"><%= format_date activity.created_on %></span>
<div class="sn-news-txt">
<div class="sn-news-wrap"><%= activity.description.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", news_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<a class=" por_course_time"><%= time_from_now activity.created_on %></a>
</div>
<% elsif act.org_act_type == "Poll" %>
<% activity = Poll.find(act.org_act_id) %>
<% activity = act.org_act %>
<% has_commit = has_commit_poll?(activity.id ,User.current)%>
<% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%>
<% iamge_path = get_image_path_from_content(activity.polls_description) %>
<% if ( activity.polls_status==2) %>
<div class="sn-news-bigbox fl">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<div class="por_course_bar fl clear">
<% if has_commit %>
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "por_course_title", :title => poll_name %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "por_course_title", :title => poll_name %>
<% end %>
<h3>
<% if has_commit %>
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "h3-title" %>
<% else %>
<%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "h3-title" %>
<% end %>
</h3>
<span class="txt-grey"><%= format_date activity.published_at %></span>
<div class="sn-news-txt">
<div class="sn-news-wrap"><%= activity.polls_description.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "140", :height => "100"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"fl" %>
<% end %>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.polls_description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<a class=" por_course_time"><%= time_from_now activity.published_at %></a>
</div>
<% end %>
<% end %>
<% end %>
<% end %>
<% when 'project' %>
<h2 class="h2-title">项目动态</h2>
<% if @project_acts.blank? %>
<h2 class="h2-title">项目动态</h2>
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
<% else %>
<h2 class="h2-title">项目动态</h2>
<div class="cl"></div>
<% @project_acts.first(1).each do |act| %>
<% @project_acts.first(4).each do |act| %>
<% if act.org_act_type == "Issue" %>
<% activity = Issue.find(act.org_act_id) %>
<% activity = act.org_act %>
<% iamge_path = get_image_path_from_content(activity.description) %>
<div class="sn-news-bigbox fl">
<div class="por_course_bar fl clear">
<%= link_to activity.subject, issue_url_in_org(activity.id), :target => '_blank', :class => "por_course_title", :title => activity.subject %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "140", :height => "100"), issue_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), issue_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% end %>
<h3>
<%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "h3-title" %>
</h3>
<span class="txt-grey"><%= format_date activity.updated_on %></span>
<div class="sn-news-txt">
<div class="sn-news-wrap"><%= activity.description.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", issue_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<a class=" por_course_time"><%= time_from_now activity.updated_on %></a>
</div>
<% elsif act.org_act_type == "Message" %>
<% activity = Message.find(act.org_act_id) %>
<% activity = act.org_act %>
<% iamge_path = get_image_path_from_content(activity.content) %>
<div class="sn-news-bigbox fl">
<% subject = activity.parent_id.nil? ? activity.subject : activity.parent.subject %>
<div class="por_course_bar fl clear">
<%= link_to subject, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "por_course_title", :title => subject %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "140", :height => "100"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"fl" %>
<% end %>
<h3> <!--+"(帖子标题)"-->
<%= link_to activity.parent_id.nil? ? activity.subject.to_s.html_safe : activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h3-title" %>
</h3>
<span class="txt-grey"><%= format_date activity.updated_on %></span>
<div class="sn-news-txt">
<div class="sn-news-wrap"><%= activity.content.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.content, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<a class=" por_course_time"><%= time_from_now activity.updated_on %></a>
</div>
<% elsif act.org_act_type == "News" %>
<% activity = News.find(act.org_act_id) %>
<% activity = act.org_act %>
<% iamge_path = get_image_path_from_content(activity.description) %>
<div class="sn-news-bigbox fl">
<div class="por_course_bar fl clear">
<%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "por_course_title", :title => activity.title %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "140", :height => "100"), news_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), news_url_in_org(activity.id), :target => "_blank", :class =>"fl" %>
<% end %>
<h3>
<%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "h3-title" %>
</h3>
<span class="txt-grey">2016-04-08</span>
<div class="sn-news-txt">
<div class="sn-news-wrap"><%= activity.description.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", news_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => activity.id, :content=> activity.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<a class=" por_course_time"><%= time_from_now activity.created_on %></a>
</div>
<% end %>
<% end %>
@ -168,104 +125,68 @@
<% org_acts = get_subfield_acts field %>
<% if org_acts.blank? %>
<h2 class="h2-title"><%= field.name %></h2>
<div class="cl"></div>
<%= render :partial => 'organizations/org_subfield_leftM1_default', :locals => {:field => field} %>
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
<% else %>
<h2 class="h2-title"><%= field.name %>
<%= render :partial => 'organizations/link_subfield_more', :locals => {:field => field} %>
</h2>
<div class="cl"></div>
<% org_acts.first(1).each do |activity| %>
<% org_acts.first(4).each do |activity| %>
<% 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 %>
<% iamge_path = get_image_path_from_content(document.content) %>
<div class="sn-news-bigbox fl">
<div class="por_course_bar fl clear">
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "por_course_title", :title => document.title %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "140", :height => "100"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"fl" %>
<% end %>
<h3>
<%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "h3-title" %>
</h3>
<span class="txt-grey"><%= format_date document.created_at %></span>
<div class="sn-news-txt">
<div class="sn-news-wrap"><%= document.content.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => document.id, :content=> document.content, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<a class=" por_course_time"><%= time_from_now document.created_at %></a>
</div>
<% else 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.parent_id.nil? %>
<% content = message.content%>
<% else %>
<% content = message.parent.content%>
<% end %>
<% if activity.org_act_type == 'Message' and activity.org_act_id and Message.where(:id => activity.org_act_id).count > 0 %>
<% message = activity.org_act %>
<% title = message.parent_id.nil? ? message.subject : message.parent.subject %>
<% content = message.parent_id.nil? ? message.content : message.parent.content%>
<% iamge_path = get_image_path_from_content(content) %>
<% if message.board.org_subfield_id %>
<div class="sn-news-bigbox fl">
<div class="por_course_bar fl clear">
<%= link_to title, board_message_url_in_org(message.board.id, message.id), :target => '_blank', :class => "por_course_title", :title => title %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "140", :height => "100"), board_message_url_in_org(message.board.id, message.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), board_message_url_in_org(message.board.id, message.id), :target => "_blank", :class =>"fl" %>
<% end %>
<h3> <!--+"(帖子标题)"-->
<%= link_to message.parent_id.nil? ? message.subject.to_s.html_safe : message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "h3-title" %>
</h3>
<span class="txt-grey"><%= format_date message.created_on %></span>
<div class="sn-news-txt">
<div class="sn-news-wrap"><%= content.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<a class=" por_course_time"><%= time_from_now message.created_on %></a>
</div>
<% else %>
<div class="sn-news-bigbox fl">
<div class="por_course_bar fl clear">
<%= link_to title, board_message_path(message.board, message.id), :target => '_blank', :class => "por_course_title", :title => title %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "140", :height => "100"), board_message_path(message.board.id, message.id), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), board_message_path(message.board.id, message.id), :target => "_blank", :class =>"fl" %>
<% end %>
<h3>
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "h3-title" %>
<% else %>
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "h3-title" %>
<% end %>
</h3>
<span class="txt-grey"><%= format_date message.created_on %></span>
<div class="sn-news-txt">
<div class="sn-news-wrap"><%= content.to_s.html_safe %></div>
</div>
<div class="sn-read-more">
<% if message.parent_id.nil? %>
<%=link_to "查看全文>>", board_message_path(message.board,message), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
<% else %>
<%=link_to "查看全文>>", board_message_path(message.board,activity), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
<% end %>
</div>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<a class=" por_course_time"><%= time_from_now message.created_on %></a>
</div>
<% 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) %>
<% if activity.org_act_type == 'News' and News.where(:id => activity.org_act_id).count > 0 %>
<% news = activity.org_act %>
<% iamge_path = get_image_path_from_content(news.description) %>
<div class="sn-news-bigbox fl">
<div class="por_course_bar fl clear">
<%= link_to news.title, news_path(news), :target => '_blank', :class => "por_course_title", :title => news.title %>
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "380", :height => "165"), news_path(news), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "140", :height => "100"), news_path(news), :target => "_blank", :class =>"fl" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "380", :height => "165"), news_path(news), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "140", :height => "100"), news_path(news), :target => "_blank", :class =>"fl" %>
<% end %>
<h3>
<%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "h3-title" %>
</h3>
<span class="txt-grey"><%= format_date news.created_on %></span>
<div class="sn-news-txt">
<div class="sn-news-wrap"><%= news.description.to_s.html_safe %></div>
</div>
<div class="sn-read-more"><%=link_to "查看全文>>", news_path(news), :target => "_blank", :class => "sn-link-grey2 sn-fr" %></div>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => news.id, :content=> news.description, :maxheight => 80, :maxwordsnum => 56, :maxwidth => 0, :cl => "por_course_txt fl"} %>
<a class=" por_course_time"><%= time_from_now news.created_on %></a>
</div>
<% end %>
<% end %>
@ -273,18 +194,5 @@
<% end %>
<% end %>
<% end %>
<h2 class="por_h2_index clear">精品课程<a href="javascript:void(0);" target="_blank" class="por_more_index fr">更多></a></h2>
<div class="por_course_bar fl clear">
<a href="javascript:void(0);" target="_blank" class="por_course_title ">2016春计算机程序设计(Z2算机程序设计(Z2班)算机程序设计(Z2班)班)</a>
<a href="javascript:void(0);" target="_blank" class="fl"><img src="/images/org_custom/por_img.jpg" width="140" height="100" alt=""/></a>
<p class="por_course_txt fl">学习程序设计,要学习语言的语法更重要的是求解问题的算法思想。语法的学习需要多尝试,算法的算机程序设计(Z2班)算机程序设计(Z2班)算机程序设计(Z2班)学习需要多思考。学习程序设计</p>
<a href="javascript:void(0);" target="_blank" class=" por_course_time"> 2016春季学期 </a>
</div>
<div class="cl"></div>
<div class="cl"></div>
</div><!--por_course end-->

View File

@ -16,7 +16,7 @@
<% else %>
<%= link_to image_tag("/files/uploads/image#{get_image_path_from_content(acts.first.org_act.content)}", :width => "299", :height => "246"), org_document_comment_path(:id => acts.first.org_act.id, :organization_id => acts.first.org_act.organization.id), :target => "_blank" %>
<% end %>
<%= link_to acts.first.org_act.title, org_document_comment_path(:id => acts.first.org_act.id, :organization_id => acts.first.org_act.organization.id), :target => '_blank', :class => "por_post_title" %>
<%= link_to activity.org_act.title, org_document_comment_path(:id => acts.first.org_act.id, :organization_id => acts.first.org_act.organization.id), :target => '_blank', :class => "por_post_title", :title => activity.org_act.title %>
<p class="mt5 mb5">
<span class="por_time mr10"><%= time_from_now(acts.first.org_act.created_at) %> </span>
<%= link_to acts.first.org_act.creator, user_path(acts.first.org_act.creator), :class => "por_hot_name", :target => "_blank" %>
@ -24,8 +24,9 @@
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => acts.first.org_act.id, :content=> acts.first.org_act.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0, :cl => "por_post_txt"} %>
<% else 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) %>
<% message = activity.org_act %>
<% content = message.parent_id.nil? ? message.content : message.parent.content %>
<% title = message.parent_id.nil? ? message.subject : message.parent.subject %>
<% iamge_path = get_image_path_from_content(content) %>
<% if message.board.org_subfield_id %>
<% if iamge_path.nil? %>
@ -33,11 +34,7 @@
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "299", :height => "246"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %>
<% end %>
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to message.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "por_post_title" %>
<% else %>
<%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "por_post_title" %>
<% end %>
<%= link_to title, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "por_post_title", :title => title %>
<p class="mt5 mb5">
<span class="por_time mr10"><%= time_from_now(message.created_on) %> </span>
<%= link_to message.author, user_path(message.author), :class => "por_hot_name", :target => "_blank" %>
@ -49,11 +46,7 @@
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "299", :height => "246"), board_message_path(message.board, message), :target => "_blank" %>
<% end %>
<% if message.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to message.subject.to_s.html_safe, board_message_path(message.board, message), :target => '_blank', :class => "por_post_title" %>
<% else %>
<%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board, message), :target => '_blank', :class => "por_post_title" %>
<% end %>
<%= link_to title, board_message_path(message.board, message), :target => '_blank', :class => "por_post_title", :title => title %>
<p class="mt5 mb5">
<span class="por_time mr10"><%= time_from_now(message.created_on) %> </span>
<%= link_to message.author, user_path(message.author), :class => "por_hot_name", :target => "_blank" %>
@ -69,7 +62,7 @@
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "299", :height => "246"), news_path(news), :target => "_blank" %>
<% end %>
<%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "por_post_title" %>
<%= link_to news.title, news_path(news), :target => '_blank', :class => "por_post_title", :title => news.title %>
<p class="mt5 mb5">
<span class="por_time mr10"><%= time_from_now(news.created_on) %> </span>
<%= link_to news.author, user_path(news.author), :class => "por_hot_name", :target => "_blank" %>