From a96fafd704284eeea52872105f6967bb447ec45b Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 31 May 2016 18:37:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=89=EF=BC=88=E6=9C=AA?= =?UTF-8?q?=E5=AE=8C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 1 - .../_link_subfield_more.html.erb | 6 +- .../organizations/_org_custom_left3.html.erb | 235 +++++++++++++++--- app/views/organizations/_show_custom.html.erb | 15 +- 4 files changed, 205 insertions(+), 52 deletions(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 4d704ba5f..437014528 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -149,7 +149,6 @@ module OrganizationsHelper 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') - org_acts end def allow_to_create?(org, type) diff --git a/app/views/organizations/_link_subfield_more.html.erb b/app/views/organizations/_link_subfield_more.html.erb index cb4a82ed1..59c12f1a1 100644 --- a/app/views/organizations/_link_subfield_more.html.erb +++ b/app/views/organizations/_link_subfield_more.html.erb @@ -1,9 +1,9 @@ <% if !field.subfield_subdomain_dir.nil? %> <% if !request.local? and Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", @organization.id).map(&:subname).include?(request.subdomain) %> - <%= link_to "更多", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "more" , :target => "_blank" %> + <%= link_to "更多", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "por_more_index fr" , :target => "_blank" %> <% else %> - <%= link_to "更多", show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "more" , :target => "_blank" %> + <%= link_to "更多", show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "por_more_index fr" , :target => "_blank" %> <% end %> <% else %> - <%= link_to "更多", organization_path(@organization, :org_subfield_id => field.id), :class => "more" , :target => "_blank" %> + <%= link_to "更多", organization_path(@organization, :org_subfield_id => field.id), :class => "por_more_index fr" , :target => "_blank" %> <% end %> \ No newline at end of file diff --git a/app/views/organizations/_org_custom_left3.html.erb b/app/views/organizations/_org_custom_left3.html.erb index db20d42a1..adc1840fb 100644 --- a/app/views/organizations/_org_custom_left3.html.erb +++ b/app/views/organizations/_org_custom_left3.html.erb @@ -1,37 +1,200 @@ -
-

精华帖子更多>

-
-
- - 阿里前副总裁里前副总裁:里前副总裁:里前副总裁::阿里巴巴给我上的10 -

1分钟前 窦豆

-

本文选自阿本文选自阿里本文选自阿里本文选自阿里本文选自阿里本文选自阿里里巴巴前副总裁、首任美籍高管波特·埃里斯曼《阿里传》在这本书里,波特概括了他在阿里巴巴任职的8年中,学到的40堂课这40堂课简单明了地概括了马云的经营理念,以及阿里终成帝国的必

-
- -
-
- -
-
+
+ <% if acts.blank? %> +

<%= field.name %>

+

该模块暂时没有发布内容

+ <% else %> +

<%= field.name %> + <%= render :partial => 'organizations/link_subfield_more', :locals => {:field => field} %> +

+ <% 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) %> +
+
+ <% if iamge_path.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" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "299", :height => "246"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %> + <% end %> + <%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "por_post_title" %> +

+ <%= time_from_now(document.created_at) %> + <%= link_to document.creator, user_path(document.creator), :class => "por_hot_name", :target => "_blank" %> +

+

+ <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => document.id, :content=> document.content, :maxheight => 40, :maxwordsnum => 60} %> + 本文选自阿本文选自阿里本文选自阿里本文选自阿里本文选自阿里本文选自阿里里巴巴前副总裁、首任美籍高管波特·埃里斯曼《阿里传》在这本书里,波特概括了他在阿里巴巴任职的8年中,学到的40堂课这40堂课简单明了地概括了马云的经营理念,以及阿里终成帝国的必

+
+ +
+ + + + +
+ <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% end %> +

+ <%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-title sn-hidden" %> +

+
+ <%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => document.id, :content=> document.content, :maxheight=>54, :maxwordsnum => 28} %> + <%#= link_to document.content.to_s.html_safe, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-tag" %> +
+ <%#= link_to "更多", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :class => "more-btn", :target => "_blank" %> + +
+ <% 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 %> + <% iamge_path = get_image_path_from_content(content) %> + <% if message.board.org_subfield_id %> +
+
+ + 阿里前副总裁里前副总裁:里前副总裁:里前副总裁::阿里巴巴给我上的10 +

1分钟前 窦豆

+

本文选自阿本文选自阿里本文选自阿里本文选自阿里本文选自阿里本文选自阿里里巴巴前副总裁、首任美籍高管波特·埃里斯曼《阿里传》在这本书里,波特概括了他在阿里巴巴任职的8年中,学到的40堂课这40堂课简单明了地概括了马云的经营理念,以及阿里终成帝国的必

+
+ +
+ + + + + +
+ <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% 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 => "resources-title sn-hidden" %> + <% else %> + <%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "resources-title sn-hidden" %> + <% end %> +

+
+ <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28} %> + <%#= link_to content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %> +
+ <%#= link_to "更多", board_message_url_in_org(message.board.id,message.id), :class => "more-btn", :target => "_blank" %> +
+ <% else %> +
+
+ + 阿里前副总裁里前副总裁:里前副总裁:里前副总裁::阿里巴巴给我上的10 +

1分钟前 窦豆

+

本文选自阿本文选自阿里本文选自阿里本文选自阿里本文选自阿里本文选自阿里里巴巴前副总裁、首任美籍高管波特·埃里斯曼《阿里传》在这本书里,波特概括了他在阿里巴巴任职的8年中,学到的40堂课这40堂课简单明了地概括了马云的经营理念,以及阿里终成帝国的必

+
+ +
+ + + + + + +
+ <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-resourcesimg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-resourcesimg" %> + <% end %> +

+ <% if message.parent_id.nil? %> + <%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "resources-title sn-hidden" %> + <% else %> + <%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-title sn-hidden" %> + <% end %> +

+
+ <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => message.id, :content=> content, :maxheight=>54, :maxwordsnum => 28} %> + <%#= link_to content.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-tag" %> +
+ <%#= link_to "更多", board_message_path(message.board,activity), :class => "more-btn", :target => "_blank" %> +
+ <% 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) %> + <% iamge_path = get_image_path_from_content(news.description) %> +
+
+ + 阿里前副总裁里前副总裁:里前副总裁:里前副总裁::阿里巴巴给我上的10 +

1分钟前 窦豆

+

本文选自阿本文选自阿里本文选自阿里本文选自阿里本文选自阿里本文选自阿里里巴巴前副总裁、首任美籍高管波特·埃里斯曼《阿里传》在这本书里,波特概括了他在阿里巴巴任职的8年中,学到的40堂课这40堂课简单明了地概括了马云的经营理念,以及阿里终成帝国的必

+
+ +
+ + + + + +
+ <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), news_path(news), :target => "_blank", :class =>"sn-resourcesimg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), news_path(news), :target => "_blank", :class =>"sn-resourcesimg" %> + <% end %> +

+ <%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "resources-title sn-hidden" %> +

+
+ <%#= link_to news.description.to_s.html_safe, news_path(news), :target => '_blank', :class => "resources-tag" %> + <%= render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id => news.id, :content=> news.description, :maxheight=>54, :maxwordsnum => 28, :maxwordsnum => 28} %> +
+ <%#= link_to "更多", news_path(news), :class => "more-btn", :target => "_blank" %> +
+ <% end %> + <% end %> + + + + + + + + +
+ <% end %>
\ No newline at end of file diff --git a/app/views/organizations/_show_custom.html.erb b/app/views/organizations/_show_custom.html.erb index 4d0d6470f..6f5c64379 100644 --- a/app/views/organizations/_show_custom.html.erb +++ b/app/views/organizations/_show_custom.html.erb @@ -2,15 +2,10 @@ <% @subfield_content.each do |field| %> <% if field.status.to_i == 1 %> <%= render :partial => 'organizations/org_custom_left1', :locals => {:field => field} %> - <% elsif field.status.to_i == 3 %> - <%#= render :partial => 'organizations/org_subfield_leftM', :locals => {:field => field} %> -
- <%#= render :partial => 'organizations/org_subfield_leftM1', :locals => {:field => field} %> - <%= render :partial => 'organizations/org_custom_left3', :locals => {:field => field} %> -
-
<% elsif field.status.to_i == 2 %> <%= render :partial => 'organizations/org_custom_left2', :locals => {:field => field} %> + <% elsif field.status.to_i == 3 %> + <%= render :partial => 'organizations/org_custom_left3', :locals => {:field => field, :acts => get_subfield_acts(field) }%> <% end %> <% end %>
@@ -22,11 +17,7 @@ <% elsif field.status.to_i == 5 %> <%= render :partial => 'organizations/org_custom_right2', :locals => {:field => field} %> <% elsif field.status.to_i == 6 %> - <% if field.field_type == "Resource" %> - <%= render :partial => 'organizations/org_custom_right3', :locals => {:field => field} %> - <% else %> <%# 只允许显示一个模块 %> - <%= render :partial => 'organizations/org_custom_right3', :locals => {:field => field} %> - <% end %> + <%= render :partial => 'organizations/org_custom_right3', :locals => {:field => field} %> <% end %> <% end %>