diff --git a/app/views/layouts/base_org2.html.erb b/app/views/layouts/base_org2.html.erb
index f9e8a0b7b..393af9330 100644
--- a/app/views/layouts/base_org2.html.erb
+++ b/app/views/layouts/base_org2.html.erb
@@ -150,58 +150,13 @@
<% elsif field.status.to_i == 3 %>
-
+
+
+ <% 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/ad-default.jpg", :width => "369", :height => "169"), 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 => "369", :height => "169"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank" %>
+ <% end %>
+ <% 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 %>
+ <% 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(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 %>
+ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), board_message_path(message.board,activity), :target => "_blank" %>
+ <% 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/ad-default.jpg", :width => "369", :height => "169"), news_path(news), :target => "_blank" %>
+ <% else %>
+ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "369", :height => "169"), news_path(news), :target => "_blank" %>
+ <% end %>
+ <% end %>
+ <% end %>
+
+
+ <% end %>
+ <% else %>
+
+ <% 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 => "369", :height => "169"), 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 => "369", :height => "169"), 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 => "369", :height => "169"), org_subfield_files_path(field), :class => "more-btn-center mt30", :target => "_blank" %>
+ <% end %>
+
+ <% end %>
+<% end %>
diff --git a/app/views/organizations/_org_subfield_leftM2.html.erb b/app/views/organizations/_org_subfield_leftM2.html.erb
index 9c4237c15..aec1a88fe 100644
--- a/app/views/organizations/_org_subfield_leftM2.html.erb
+++ b/app/views/organizations/_org_subfield_leftM2.html.erb
@@ -1,27 +1,233 @@
-
+<% if is_default_field?(field) %>
+ <% case field.name %>
+ <% when 'course' %>
+ <% if @course_acts.blank? %>
+ <%= render :partial => 'organizations/org_subfield_leftM2_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/right_top.jpg", :width => "85", :height => "85"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% else %>
+ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% end %>
+
+ <%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
+
+
<%= format_date activity.updated_at %>
+
+
+ <% 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 => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% else %>
+ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% 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 => "h4-title fl mt10" %>
+ <% else %>
+ <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
+ <% end %>
+
+
<%= format_date activity.updated_on %>
+
+
+ <% 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 => "85", :height => "85"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% else %>
+ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% end %>
+
+ <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
+
+
<%= format_date activity.created_on %>
+
+
+ <% 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/files-default.jpg", :width => "85", :height => "85"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% else %>
+ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% end %>
+
+ <% if has_commit %>
+ <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "h4-title fl mt10" %>
+ <% else %>
+ <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank', :class => "h4-title fl mt10" %>
+ <% end %>
+
+
<%= format_date activity.published_at %>
+
+
+ <% end %>
+ <% end %>
+ <% end %>
+ <% end %>
+ <% when 'project' %>
+ <% if @project_acts.blank? %>
+ <%= render :partial => 'organizations/org_subfield_leftM2_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 => "85", :height => "85"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% else %>
+ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% end %>
+
+ <%= link_to activity.subject.to_s, issue_url_in_org(activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
+
+
<%= format_date activity.updated_on %>
+
+
+ <% 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 => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% else %>
+ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% 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 => "h4-title fl mt10" %>
+ <% else %>
+ <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
+ <% end %>
+
+
<%= format_date activity.updated_on %>
+
+
+ <% 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 => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% else %>
+ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% end %>
+
+ <%= link_to activity.description.to_s.html_safe, news_url_in_org(activity.id), :target => '_blank', :class => "h4-title fl mt10" %>
+
+
<%= format_date activity.created_on %>
+
+
+ <% 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_leftM2_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 => "85", :height => "85"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% else %>
+ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% end %>
+
+ <%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "h4-title fl mt10" %>
+
+
<%= format_date document.created_at %>
+
+
+ <% 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 => "85", :height => "85"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% else %>
+ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% 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 => "h4-title fl mt10" %>
+ <% else %>
+ <%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "h4-title fl mt10" %>
+ <% end %>
+
+
<%= format_date message.created_on %>
+
+
+ <% else %>
+
+ <% if iamge_path.nil? %>
+ <%= link_to image_tag("/images/default_blank/files-default.jpg", :width => "85", :height => "85"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% else %>
+ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% end %>
+
+ <% if message.parent_id.nil? %>
+ <%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "h4-title fl mt10" %>
+ <% else %>
+ <%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "h4-title fl mt10" %>
+ <% end %>
+
+
<%= format_date message.created_on %>
+
+
+ <% 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/files-default.jpg", :width => "85", :height => "85"), news_path(news), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% else %>
+ <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "85", :height => "85"), news_path(news), :target => "_blank", :class =>"sn-news-smallimg fl" %>
+ <% end %>
+
+ <%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "h4-title fl mt10" %>
+
+
<%= format_date news.created_on %>
+
+
+ <% end %>
+ <% end %>
+ <% end %>
+ <% end %>
+ <% end %>
+<% end %>
+
+
\ No newline at end of file
diff --git a/app/views/organizations/_org_subfield_leftM2_default.html.erb b/app/views/organizations/_org_subfield_leftM2_default.html.erb
new file mode 100644
index 000000000..1b47d9d5c
--- /dev/null
+++ b/app/views/organizations/_org_subfield_leftM2_default.html.erb
@@ -0,0 +1,26 @@
+