From b6f5bfc4506d950401e54369ec1f53fa5ab21b80 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 27 Apr 2016 09:45:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=B3=E4=B8=8B=E7=89=88=E6=9C=AC=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=AE=9A=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_org2.html.erb | 9 +- .../_org_subfield_rightD.html.erb | 4 +- .../_org_subfield_rightM.html.erb | 98 +++++++++++++++++++ 3 files changed, 101 insertions(+), 10 deletions(-) diff --git a/app/views/layouts/base_org2.html.erb b/app/views/layouts/base_org2.html.erb index fc65b653f..0e3ae2a4d 100644 --- a/app/views/layouts/base_org2.html.erb +++ b/app/views/layouts/base_org2.html.erb @@ -233,14 +233,7 @@ <% elsif field.status.to_i == 7 %> -
-

关注北斗

-
- -

卫星导航仿真与测试开放实验室
扫一扫 关注我!

-
-
-
+ <%= render :partial => 'organizations/org_subfield_rightM', :locals => {:field => field} %> <% elsif field.status.to_i == 8 %> <%= render :partial => 'organizations/org_subfield_rightD', :locals => {:field => field} %> <% end %> diff --git a/app/views/organizations/_org_subfield_rightD.html.erb b/app/views/organizations/_org_subfield_rightD.html.erb index 7bc2d565d..131ae5183 100644 --- a/app/views/organizations/_org_subfield_rightD.html.erb +++ b/app/views/organizations/_org_subfield_rightD.html.erb @@ -25,14 +25,14 @@ <% 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 %> - <% iamge_path = get_image_path_from_content(content) %> + <% iamge_path = get_image_path_from_content(message.content) %> <% if iamge_path.nil? %> <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "369", :height => "169"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %> <% else %> <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "369", :height => "169"), board_message_url_in_org(message.board.id,message.id), :target => "_blank" %> <% end %> <% else %> - <% iamge_path = get_image_path_from_content(content) %> + <% iamge_path = get_image_path_from_content(message.content) %> <% if iamge_path.nil? %> <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "370", :height => "220"), board_message_path(message.board,activity), :target => "_blank" %> <% else %> diff --git a/app/views/organizations/_org_subfield_rightM.html.erb b/app/views/organizations/_org_subfield_rightM.html.erb index e69de29bb..f293b1ea8 100644 --- a/app/views/organizations/_org_subfield_rightM.html.erb +++ b/app/views/organizations/_org_subfield_rightM.html.erb @@ -0,0 +1,98 @@ +<% if is_default_field?(field) %> + <% case field.name %> +<% when 'course' %> +

暂无内容!

+ <% when 'project' %> +

暂无内容!

+ <% end %> +<% else %> + <% if field.field_type == "Post" %> <%# 讨论类型 %> + <% org_acts = get_subfield_acts field %> + <% unless org_acts.blank? %> + <% activity = org_acts.first %> +
+ <% 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) %> +

<%= field.name %>

+
+ <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "fl sn-index-wximg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "fl sn-index-wximg" %> + <% end %> +

<%=link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %>

+
+
+ <% 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.board.org_subfield_id %> + <% iamge_path = get_image_path_from_content(message.content) %> +

<%= field.name %>

+
+ <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "fl sn-index-wximg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "fl sn-index-wximg" %> + <% end %> +

<%=link_to message.content.to_s.html_safe, board_message_url_in_org(message.board.id, message.id), :target => "_blank" %>

+
+
+ <% else %> + <% iamge_path = get_image_path_from_content(message.content) %> +

<%= field.name %>

+
+ <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), board_message_path(message.board, activity), :target => "_blank", :class => "fl sn-index-wximg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), board_message_path(message.board, activity), :target => "_blank", :class => "fl sn-index-wximg" %> + <% end %> +

<%=link_to message.content.to_s.html_safe, board_message_path(message.board, activity), :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) %> +

<%= field.name %>

+
+ <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), news_path(news), :target => "_blank", :class => "fl sn-index-wximg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "104", :height => "104"), news_path(news), :target => "_blank", :class => "fl sn-index-wximg" %> + <% end %> +

<%=link_to news.description.to_s.html_safe, news_path(news), :target => "_blank" %>

+
+
+ <% end %> + <% end %> +
+ <% else %> +
+

<%= field.name %>

+
+ +

暂无内容!

+
+
+
+ <% end %> + <% elsif field.field_type == "Resource" %> + <% org_attachs = get_attach_org2(field) %> +
+ <% 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 image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %> + <% else %> + <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :target => "_blank" %> + <% end %> + <% else %> + <%= link_to image_tag("/images/default_blank/ad-default.jpg", :width => "104", :height => "104"), org_subfield_files_path(field), :class => "more-btn-center mt30", :target => "_blank" %> + <% end %> +
+ <% end %> +<% end %>