From 17b2e82963203eaed563c6a42bb87f74a1212db7 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 26 Apr 2016 16:23:08 +0800 Subject: [PATCH] =?UTF-8?q?banner=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_org2.html.erb | 58 +--- .../_org_subfield_leftT.html.erb | 276 ++++++++++++++++++ .../_org_subfield_leftT_default.html | 10 + public/stylesheets/org2.css | 1 + 4 files changed, 289 insertions(+), 56 deletions(-) create mode 100644 app/views/organizations/_org_subfield_leftT_default.html diff --git a/app/views/layouts/base_org2.html.erb b/app/views/layouts/base_org2.html.erb index 5e05dae44..1f6929d43 100644 --- a/app/views/layouts/base_org2.html.erb +++ b/app/views/layouts/base_org2.html.erb @@ -93,7 +93,7 @@ <% @subfield_content.each do |field| %> <% if is_default_field?(field) %> <% case field.name %> - <% when 'activity' %> + <% when 'activity' %> @@ -135,61 +135,7 @@
<% @subfield_content.each do |field| %> <% if field.status.to_i == 1 %> -
- - - - -
+ <%= render :partial => 'organizations/org_subfield_leftT', :locals => {:field => field} %> <% elsif field.status.to_i == 2 %>

业界动态更多

diff --git a/app/views/organizations/_org_subfield_leftT.html.erb b/app/views/organizations/_org_subfield_leftT.html.erb index e69de29bb..e64044a6b 100644 --- a/app/views/organizations/_org_subfield_leftT.html.erb +++ b/app/views/organizations/_org_subfield_leftT.html.erb @@ -0,0 +1,276 @@ +<% if is_default_field?(field) %> + <% case field.name %> + <% when 'course' %> + <% if @course_acts.blank? %> + <%= render :partial => 'organizations/org_subfield_leftT_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) %> + + <% elsif act.org_act_type == "Message" %> + <% activity = Message.find(act.org_act_id) %> + <% iamge_path = get_image_path_from_content(activity.content) %> + + <% elsif act.org_act_type == "News" %> + <% activity = News.find(act.org_act_id) %> + <% iamge_path = get_image_path_from_content(activity.description) %> + + <% 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) %> + + <% end %> + <% end %> + <% end %> +
+
+
+ + + + +
+
+ + +
+
+ <% end %> + <% when 'project' %> + <% if @project_acts.blank? %> + <%= render :partial => 'organizations/org_subfield_leftT_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) %> + + <% elsif act.org_act_type == "Message" %> + <% activity = Message.find(act.org_act_id) %> + <% iamge_path = get_image_path_from_content(activity.content) %> + + <% elsif act.org_act_type == "News" %> + <% activity = News.find(act.org_act_id) %> + <% iamge_path = get_image_path_from_content(activity.description) %> + + <% 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_leftT_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) %> + + <% elsif 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 %> + <% if message.parent_id.nil? %> + <% content = message.content%> + <% else %> + <% content = message.parent.content%> + <% end %> + <% iamge_path = get_image_path_from_content(content) %> + + <% else %> + <% if message.parent_id.nil? %> + <% content = message.content%> + <% else %> + <% content = message.parent.content%> + <% end %> + <% iamge_path = get_image_path_from_content(content) %> + + <% 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) %> + + <% end %> + <% end %> + <% end %> +
+
+
+ + + + +
+
+ + +
+
+ <% end %> + <% end %> +<% end %> + + \ No newline at end of file diff --git a/app/views/organizations/_org_subfield_leftT_default.html b/app/views/organizations/_org_subfield_leftT_default.html new file mode 100644 index 000000000..f2f66758f --- /dev/null +++ b/app/views/organizations/_org_subfield_leftT_default.html @@ -0,0 +1,10 @@ +
+ +
+
+
+ +
+
+
+
\ No newline at end of file diff --git a/public/stylesheets/org2.css b/public/stylesheets/org2.css index e738f841d..19f0c4bdf 100644 --- a/public/stylesheets/org2.css +++ b/public/stylesheets/org2.css @@ -98,6 +98,7 @@ a.sn-search-button {width:53px; height:40px; border:1px solid #ccc; border-left: filter:progid:DXImageTransform.Microsoft.gradient( GradientType = 0,startColorstr = '#80000000',endColorstr = '#80000000')\9; display:block; text-align:left; } .focus .shadow a{ text-decoration:none; color:#fff; font-size:20px; overflow:hidden; margin-left:10px; } .focus .fcon{ position:relative; width:100%; float:left; display:none; background:#000 } +.focus .fcon-default{ position:relative; width:100%; float:left; background:#fff } .focus .fcon img{ display:block; } .focus .fbg{bottom:25px; right:40px; position:absolute; height:21px; text-align:center; z-index: 200; } .focus .fbg div{margin:4px auto 0;overflow:hidden;zoom:1;height:14px}