diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 86bb71710..51428f3a3 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -76,7 +76,7 @@ class OrganizationsController < ApplicationController def show # 组织新类型 show_mode:判断标准 1为新类型,0为旧 - if @organization.show_mode.to_i == 1 && params[:org_subfield_id].nil? && params[:list] .nil? + if @organization.show_mode.t == 1 && params[:org_subfield_id].nil? && params[:list] .nil? if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization) # REDO:时间紧,暂时先这样 @org_logo_attchment = Attachment.where("container_id =? and container_type =? and attachtype =?", @organization, "Organization", 0).order("created_on desc").first @@ -165,7 +165,7 @@ class OrganizationsController < ApplicationController 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.join(',')}) and container_type = 'project' - and org_act_type in ('Message', 'Issue') order by updated_at desc limit 8;") + and org_act_type in ('Message', 'Issue') order by updated_at desc limit 5;") else project_acts = nil end @@ -176,7 +176,7 @@ class OrganizationsController < ApplicationController 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.join(',')}) and container_type = 'course' - and org_act_type in ('HomeworkCommon', 'Poll', 'Message', 'News', 'Course') order by updated_at desc limit 8;") + and org_act_type in ('HomeworkCommon', 'Poll', 'Message', 'News', 'Course') order by updated_at desc limit 5;") else project_acts = nil end diff --git a/app/views/organizations/_org_subfield_leftMD.html.erb b/app/views/organizations/_org_subfield_leftMD.html.erb index 5216ddcf2..773c8b336 100644 --- a/app/views/organizations/_org_subfield_leftMD.html.erb +++ b/app/views/organizations/_org_subfield_leftMD.html.erb @@ -1,258 +1,291 @@ -
-

<%= field.name %>更多

-
+ <% if is_default_field?(field) %> <% case field.name %> <% when 'course' %> <% if @course_acts.blank? %> - <%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %> +
+

<%= field.name %>

+
+ <%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %> +
+
+
<% else %> - <% @course_acts.first(4).each do |act| %> - <% if act.org_act_type == "HomeworkCommon" %> - <% activity = HomeworkCommon.find(act.org_act_id) %> - <% iamge_path = get_image_path_from_content(activity.description) %> -
- <% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> - <% else %> - <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> - <% end %> -

- <%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %> -

-
- <%= link_to activity.description.to_s.html_safe, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %> -
- 更多 -
- <% elsif act.org_act_type == "Message" %> - <% activity = Message.find(act.org_act_id) %> - <% iamge_path = get_image_path_from_content(activity.content) %> -
- <% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.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(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> - <% end %> -

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

-
- <%= link_to activity.content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %> -
- 更多 -
- <% elsif act.org_act_type == "News" %> - <% activity = News.find(act.org_act_id) %> - <% iamge_path = get_image_path_from_content(activity.description) %> -
- <% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> - <% else %> - <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> - <% end %> -

- <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %> -

-
- <%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %> -
- 更多 -
- <% elsif act.org_act_type == "Poll" %> - <% activity = Poll.find(act.org_act_id) %> - <% 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) %> +
+

<%= field.name %>更多

+
+ <% @course_acts.first(4).each do |act| %> + <% if act.org_act_type == "HomeworkCommon" %> + <% activity = HomeworkCommon.find(act.org_act_id) %> + <% iamge_path = get_image_path_from_content(activity.description) %>
<% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-resourcesimg" %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> <% else %> - <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-resourcesimg" %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> <% end %>

- <% if has_commit %> - <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-title sn-hidden" %> + <%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %> +

+
+ <%= link_to activity.description.to_s.html_safe, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %> +
+ 更多 +
+ <% elsif act.org_act_type == "Message" %> + <% activity = Message.find(act.org_act_id) %> + <% iamge_path = get_image_path_from_content(activity.content) %> +
+ <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.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(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% end %> +

+ <% if activity.parent_id.nil? %> + <%= link_to activity.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-title sn-hidden" %> <% else %> - <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-title sn-hidden" %> + <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-title sn-hidden" %> <% end %>

- <%= link_to activity.polls_description.to_s.html_safe, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-tag" %> + <%= link_to activity.content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %> +
+ 更多 +
+ <% elsif act.org_act_type == "News" %> + <% activity = News.find(act.org_act_id) %> + <% iamge_path = get_image_path_from_content(activity.description) %> +
+ <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% end %> +

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

+
+ <%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %> +
+ 更多 +
+ <% elsif act.org_act_type == "Poll" %> + <% activity = Poll.find(act.org_act_id) %> + <% 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) %> +
+ <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-resourcesimg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-resourcesimg" %> + <% end %> +

+ <% if has_commit %> + <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-title sn-hidden" %> + <% else %> + <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-title sn-hidden" %> + <% end %> +

+
+ <%= link_to activity.polls_description.to_s.html_safe, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "resources-tag" %> +
+ 更多 +
+ <% end %> + <% end %> + <% end %> +
+
+
+ <% end %> + <% when 'project' %> + <% if @project_acts.blank? %> +
+

<%= field.name %>

+
+ <%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %> +
+
+
+ <% else %> +
+

<%= field.name %>更多

+
+ <% @project_acts.first(4).each do |act| %> + <% if act.org_act_type == "Issue" %> + <% activity = Issue.find(act.org_act_id) %> + <% iamge_path = get_image_path_from_content(activity.description) %> +
+ <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% else %> + <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% end %> +

+ <%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %> +

+
+ <%= link_to activity.description.to_s.html_safe, issue_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %> +
+ 更多 +
+ <% elsif act.org_act_type == "Message" %> + <% activity = Message.find(act.org_act_id) %> + <% iamge_path = get_image_path_from_content(activity.content) %> +
+ <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.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(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% end %> +

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

+
+ <%= link_to activity.content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %> +
+ 更多 +
+ <% elsif act.org_act_type == "News" %> + <% activity = News.find(act.org_act_id) %> + <% iamge_path = get_image_path_from_content(activity.description) %> +
+ <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.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(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> + <% end %> +

+ <%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %> +

+
+ <%= link_to activity.content.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %>
更多
<% end %> <% end %> - <% end %> - <% end %> - <% when 'project' %> - <% if @project_acts.blank? %> - <%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %> - <% else %> - <% @project_acts.first(4).each do |act| %> - <% if act.org_act_type == "Issue" %> - <% activity = Issue.find(act.org_act_id) %> - <% iamge_path = get_image_path_from_content(activity.description) %> -
- <% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> - <% else %> - <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "185", :height => "125"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> - <% end %> -

- <%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %> -

-
- <%= link_to activity.description.to_s.html_safe, issue_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %> -
- 更多 -
- <% elsif act.org_act_type == "Message" %> - <% activity = Message.find(act.org_act_id) %> - <% iamge_path = get_image_path_from_content(activity.content) %> -
- <% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.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(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> - <% end %> -

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

-
- <%= link_to activity.content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %> -
- 更多 -
- <% elsif act.org_act_type == "News" %> - <% activity = News.find(act.org_act_id) %> - <% iamge_path = get_image_path_from_content(activity.description) %> -
- <% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), board_message_url_in_org(activity.board_id, activity.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(activity.board_id, activity.id), :target => "_blank", :class =>"sn-resourcesimg" %> - <% end %> -

- <%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-title sn-hidden" %> -

-
- <%= link_to activity.content.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "resources-tag" %> -
- 更多 -
- <% end %> - <% end %> +
+
+
+ <% end %> <% end %> <% else %> <% if field.field_type == "Post" %> <% org_acts = get_subfield_acts field %> <% if org_acts.blank? %> - <%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %> +
+

<%= field.name %>

+
+ <%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %> +
+
+
<% else %> - <% 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) %> -
- <% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/files-default.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" %> -

-
- <%= 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" %> -
- 更多 -
- <% 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 %> -
- <% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/files-default.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 %> -

-
- <%= link_to content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %> -
- 更多 -
- <% else %> -
- <% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/files-default.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 %> -

-
- <%= link_to content.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-tag" %> -
- 更多 -
- <% 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 %>更多

+
+ <% 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) %>
<% if iamge_path.nil? %> - <%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "185", :height => "125"), news_path(news), :target => "_blank", :class =>"sn-resourcesimg" %> + <%= 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"), news_path(news), :target => "_blank", :class =>"sn-resourcesimg" %> + <%= 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 news.title.to_s, news_path(news), :target => '_blank', :class => "resources-title sn-hidden" %> + <%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "resources-title sn-hidden" %>

- <%= link_to news.description.to_s.html_safe, news_path(news), :target => '_blank', :class => "resources-tag" %> + <%= 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" %>
更多
+ <% 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 %> +
+ <% 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 %> +

+
+ <%= link_to content.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "resources-tag" %> +
+ 更多 +
+ <% else %> +
+ <% 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 %> +

+
+ <%= link_to content.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "resources-tag" %> +
+ 更多 +
+ <% 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) %> +
+ <% 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" %> +
+ 更多 +
+ <% end %> <% end %> <% end %> - <% end %> +
+
+
+ <% end %> <% end %> <% end %> -
-
-
\ No newline at end of file diff --git a/app/views/organizations/_org_subfield_leftMD_default.html.erb b/app/views/organizations/_org_subfield_leftMD_default.html.erb index e20318476..c080d5481 100644 --- a/app/views/organizations/_org_subfield_leftMD_default.html.erb +++ b/app/views/organizations/_org_subfield_leftMD_default.html.erb @@ -1,11 +1,11 @@
- -

仪器资源

-
- 测试服务 - 开放日 - 仪器共享 - 定制测试 -
- 更多 + + + + + + + + +
\ No newline at end of file