From 5c27aee2bd0ac8f2d53ed58c7db2546b4445fb9f Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 1 Jun 2016 09:08:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=BA=8C=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=20=20=20=E5=AE=9A=E4=B9=89=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=88=E6=98=BE=E7=A4=BA=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E4=BB=A5=E7=9C=81=E7=95=A5=E5=8F=B7=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organizations/_org_custom_left2.html.erb | 300 ++++++++++++++++-- .../organizations/_org_custom_left3.html.erb | 19 +- .../_organization_content_extension.html.erb | 6 +- 3 files changed, 289 insertions(+), 36 deletions(-) diff --git a/app/views/organizations/_org_custom_left2.html.erb b/app/views/organizations/_org_custom_left2.html.erb index 649a1dd55..6dd7e0e66 100644 --- a/app/views/organizations/_org_custom_left2.html.erb +++ b/app/views/organizations/_org_custom_left2.html.erb @@ -1,4 +1,282 @@ -
+
+<% if is_default_field?(field) %> + <% case field.name %> + <% when 'course' %> +

课程动态

+ <% if @course_acts.blank? %> +

该模块暂时没有相关内容

+ <% else %> + <% @course_acts.first(4).each do |act| %> + <% if act.org_act_type == "HomeworkCommon" %> + <% activity = act.org_act %> + <% iamge_path = get_image_path_from_content(activity.description) %> +
+ <%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "por_course_title", :title => activity.name.to_s %> + <% if iamge_path.nil? %> + <%= link_to image_tag("/images/default_blank/left-02.jpg", :width => "140", :height => "100"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"fl" %> + <% 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"} %> + + <%= time_from_now(activity.updated_at) %> +
+ <% elsif act.org_act_type == "Message" %> + <% activity = act.org_act %> + <% iamge_path = get_image_path_from_content(activity.content) %> +
+ <%= 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" %> + +

学习程序设计,要学习语言的语法更重要的是求解问题的算法思想。语法的学习需要多尝试,算法的算机程序设计(Z2班)算机程序设计(Z2班)算机程序设计(Z2班)学习需要多思考。学习程序设计

+ 2016春季学期 +
+ + + +
+ <% 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;" %> + <% 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;" %> + <% end %> +

+ <%= 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" %> +

+ <%= format_date activity.updated_on %> +
+
<%= activity.content.to_s.html_safe %>
+
+
<%=link_to "查看全文>>", board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
+
+ <% 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-02.jpg", :width => "380", :height => "165"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% 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;" %> + <% end %> +

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

+ <%= format_date activity.created_on %> +
+
<%= activity.description.to_s.html_safe %>
+
+ +
<%=link_to "查看全文>>", news_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
+
+ <% 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-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;" %> + <% 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;" %> + <% end %> +

+ <% 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 %> +

+ <%= format_date activity.published_at %> +
+
<%= activity.polls_description.to_s.html_safe %>
+
+
<%=link_to "查看全文>>", Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
+
+ <% end %> + <% end %> + <% end %> + <% end %> + <% when 'project' %> + <% if @project_acts.blank? %> +

项目动态

+

该模块暂时没有相关内容

+ <% else %> +

项目动态

+
+ <% @project_acts.first(1).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-02.jpg", :width => "380", :height => "165"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% 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;" %> + <% end %> +

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

+ <%= format_date activity.updated_on %> +
+
<%= activity.description.to_s.html_safe %>
+
+
<%=link_to "查看全文>>", issue_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
+
+ <% 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-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;" %> + <% 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;" %> + <% end %> +

+ <%= 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" %> +

+ <%= format_date activity.updated_on %> +
+
<%= activity.content.to_s.html_safe %>
+
+
<%=link_to "查看全文>>", board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
+
+ <% 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-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;" %> + <% 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;" %> + <% end %> +

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

+ 2016-04-08 +
+
<%= activity.description.to_s.html_safe %>
+
+
<%=link_to "查看全文>>", news_url_in_org(activity.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
+
+ <% end %> + <% end %> + <% end %> + <% end %> +<% else %> + <% if field.field_type == "Post" %> + <% org_acts = get_subfield_acts field %> + <% if org_acts.blank? %> +

<%= field.name %>

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

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

+
+ <% org_acts.first(1).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/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;" %> + <% 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;" %> + <% end %> +

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

+ <%= format_date document.created_at %> +
+
<%= document.content.to_s.html_safe %>
+
+
<%=link_to "查看全文>>", org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
+
+ <% 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-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;" %> + <% 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;" %> + <% end %> +

+ <%= 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" %> +

+ <%= format_date message.created_on %> +
+
<%= content.to_s.html_safe %>
+
+
<%=link_to "查看全文>>", board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
+
+ <% else %> +
+ <% 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;" %> + <% 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;" %> + <% end %> +

+ <% 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 %> +

+ <%= format_date message.created_on %> +
+
<%= content.to_s.html_safe %>
+
+
+ <% 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 %> +
+
+ <% 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-02.jpg", :width => "380", :height => "165"), news_path(news), :target => "_blank", :class =>"sn-news-bigimg",:style=>"display:block;" %> + <% 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;" %> + <% end %> +

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

+ <%= format_date news.created_on %> +
+
<%= news.description.to_s.html_safe %>
+
+
<%=link_to "查看全文>>", news_path(news), :target => "_blank", :class => "sn-link-grey2 sn-fr" %>
+
+ <% end %> + <% end %> + <% end %> + <% end %> + <% end %> +<% end %> + + + +

精品课程更多>

2016春计算机程序设计(Z2算机程序设计(Z2班)算机程序设计(Z2班)班) @@ -6,23 +284,7 @@

学习程序设计,要学习语言的语法更重要的是求解问题的算法思想。语法的学习需要多尝试,算法的算机程序设计(Z2班)算机程序设计(Z2班)算机程序设计(Z2班)学习需要多思考。学习程序设计

2016春季学期
-
- 2016春计算机程序设计(Z2班) - -

学习程序设计,要学习语言的语法更重要的是求解问题的算法思想。语法的学习需要多尝试,算法的学习需要多思考。学习程序设计

- 2016春季学期 -
-
- 2016春计算机程序设计(Z2班) - -

学习程序设计,要学习语言的语法更重要的是求解问题的算法思想。语法的学习需要多尝试,算法的学习需要多思考。学习程序设计

- 2016春季学期 -
-
- 2016春计算机程序设计(Z2班) - -

学习程序设计,要学习语言的语法更重要的是求解问题的算法思想。语法的学习需要多尝试,算法的学习需要多思考。学习程序设计

- 2016春季学期 -
+ +
\ 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 fdf06a023..63cb584cc 100644 --- a/app/views/organizations/_org_custom_left3.html.erb +++ b/app/views/organizations/_org_custom_left3.html.erb @@ -1,7 +1,7 @@
<% if acts.blank? %>

<%= field.name %>

-

该模块暂时没有发布内容

+

该模块暂时没有相关内容

<% else %>

<%= field.name %> <%= render :partial => 'organizations/link_subfield_more', :locals => {:field => field} %> @@ -21,9 +21,7 @@ <%= time_from_now(acts.first.org_act.created_at) %> <%= link_to acts.first.org_act.creator, user_path(acts.first.org_act.creator), :class => "por_hot_name", :target => "_blank" %>

-
- <%=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} %> -
+ <%=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) %> @@ -44,9 +42,7 @@ <%= time_from_now(message.created_on) %> <%= link_to message.author, user_path(message.author), :class => "por_hot_name", :target => "_blank" %>

-
- <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0} %> -
+ <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0, :cl => "por_post_txt"} %> <% else %> <% if iamge_path.nil? %> <%= link_to image_tag("/images/default_blank/left-04.jpg", :width => "299", :height => "246"), board_message_path(message.board, message), :target => "_blank" %> @@ -62,9 +58,7 @@ <%= time_from_now(message.created_on) %> <%= link_to message.author, user_path(message.author), :class => "por_hot_name", :target => "_blank" %>

-
- <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0} %> -
+ <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => message.id, :content=> message.content, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0, :cl => "por_post_txt"} %> <% end %> <% end %> <% if activity.org_act_type == 'News' and News.where("id=?", activity.org_act_id).count > 0 %> @@ -80,12 +74,9 @@ <%= time_from_now(news.created_on) %> <%= link_to news.author, user_path(news.author), :class => "por_hot_name", :target => "_blank" %>

-
- <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => news.id, :content=> news.description, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0} %> -
+ <%=render :partial =>"organizations/organization_content_extension", :locals => {:user_activity_id => news.id, :content=> news.description, :maxheight => 40, :maxwordsnum => 60, :maxwidth => 0, :cl => "por_post_txt"} %> <% end %> <% end %> - <% unless acts[1..5].nil? %> <% acts[1..5].each do |activity| %> diff --git a/app/views/organizations/_organization_content_extension.html.erb b/app/views/organizations/_organization_content_extension.html.erb index c63011586..a486edd65 100644 --- a/app/views/organizations/_organization_content_extension.html.erb +++ b/app/views/organizations/_organization_content_extension.html.erb @@ -1,7 +1,7 @@ -

-

+

+ <%= content.to_s.html_safe%> -

+