默认图片及顺序

This commit is contained in:
huang 2016-06-03 14:14:50 +08:00
parent 7be18b80b4
commit 2d2e9c540a
4 changed files with 17 additions and 16 deletions

View File

@ -7,8 +7,8 @@
<%= render :partial => 'organizations/link_subfield_more', :locals => {:field => field} %>
</h2>
<ul class="por_hotbar_left fl">
<% if acts.count > 0 %>
<% acts.first(2).each do |activity| %>
<% if acts.count > 1 %>
<% acts[1..2].each do |activity| %>
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
<% document = activity.org_act %>
<li>
@ -55,8 +55,8 @@
<% end %>
<% end %>
<% if acts.count > 2 %>
<% activity = acts[2] %>
<% if acts.count > 3 %>
<% activity = acts[3] %>
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
<% document = activity.org_act %>
<li>
@ -104,13 +104,13 @@
</ul>
<% if acts.count > 3 %>
<% activity = acts[3] %>
<%# if acts.count > 3 %>
<% activity = acts.first %>
<% if activity.container_type == 'Organization' && activity.org_act_type == 'OrgDocumentComment' && activity.org_act_id != @organization.home_id %>
<% document = activity.org_act %>
<div class="por_hotbar_right fl">
<% if get_image_path_from_content(document.content).nil? %>
<%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "299", :height => "246"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
<%= link_to image_tag("/images/default_blank/mo-1.jpg", :width => "299", :height => "246"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{get_image_path_from_content(document.content)}", :width => "299", :height => "246"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
<% end %>
@ -119,29 +119,30 @@
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => document.id, :content=> document.content, :maxheight => 80, :maxwordsnum => 90, :maxwidth => 0, :cl => "por_hot_txt_r"} %>
</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 = activity.org_act %>
<% content = message.parent_id.nil? ? message.content : message.parent.content %>
<% title = message.parent_id.nil? ? message.subject : message.parent.subject %>
<% if message.board.org_subfield_id %>
<div class="por_hotbar_right fl">
<% if get_image_path_from_content(document.content).nil? %>
<%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "299", :height => "246"), board_message_url_in_org(:id => message.id, :organization_id => message.organization.id), :target => "_blank" %>
<% if get_image_path_from_content(content).nil? %>
<%= link_to image_tag("/images/default_blank/mo-1.jpg", :width => "299", :height => "246"), board_message_url_in_org(message.board.id, message.id), :target => "_blank" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{get_image_path_from_content(content)}", :width => "299", :height => "246"), board_message_url_in_org(:id => message.id, :organization_id => message.organization.id), :target => "_blank" %>
<%= link_to image_tag("/files/uploads/image#{get_image_path_from_content(content)}", :width => "299", :height => "246"), board_message_url_in_org(message.board.id, message.id), :target => "_blank" %>
<% end %>
<%= link_to title, board_message_url_in_org(:id => message.id, :organization_id => message.organization.id), :class => 'por_hot_title link-black_r', :target => "_blank", :title => title %>
<%= link_to title, board_message_url_in_org(message.board.id, message.id), :class => 'por_hot_title link-black_r', :target => "_blank", :title => title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(message.created_on) %></span><%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name link-blue", :target => "_blank" %></p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 80, :maxwordsnum => 90, :maxwidth => 0, :cl => "por_hot_txt_r"} %>
</div>
<% else %>
<div class="por_hotbar_right fl">
<% if get_image_path_from_content(document.content).nil? %>
<%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "299", :height => "246"), board_message_path(:id => message.id, :organization_id => message.organization.id), :target => "_blank" %>
<%= link_to image_tag("/images/default_blank/mo-1.jpg", :width => "299", :height => "246"), board_message_path(message.board.id, message.id), :target => "_blank" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{get_image_path_from_content(content)}", :width => "299", :height => "246"), board_message_path(:id => message.id, :organization_id => message.organization.id), :target => "_blank" %>
<%= link_to image_tag("/files/uploads/image#{get_image_path_from_content(content)}", :width => "299", :height => "246"), board_message_path(message.board.id, message.id), :target => "_blank" %>
<% end %>
<%= link_to title, board_message_path(:id => message.id, :organization_id => message.organization.id), :class => 'por_hot_title link-black_r', :target => "_blank", :title => title %>
<%= link_to title, board_message_path(message.board.id, message.id), :class => 'por_hot_title link-black_r', :target => "_blank", :title => title %>
<p class="mt5 mb5"><span class="por_time mr10"><%= time_from_now(message.created_on) %></span><%= link_to message.author.show_name, user_path(message.author), :class => "por_hot_name link-blue", :target => "_blank" %></p>
<%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> content, :maxheight => 80, :maxwordsnum => 90, :maxwidth => 0, :cl => "por_hot_txt_r"} %>
</div>
@ -152,7 +153,7 @@
<% path = get_image_path_from_content(news.description) %>
<div class="por_hotbar_right fl">
<% if path.nil? %>
<%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "299", :height => "246"), news_path(news), :target => "_blank" %>
<%= link_to image_tag("/images/default_blank/mo-1.jpg", :width => "299", :height => "246"), news_path(news), :target => "_blank" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{path}", :width => "299", :height => "246"), news_path(news), :target => "_blank" %>
<% end %>
@ -164,6 +165,6 @@
<% end %>
<% end %>
<% end %>
<%# end %>
<div class="cl"></div>
</div><!--por_hotbar end-->

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB