@ -1,18 +1,22 @@
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
<h2 class="h2-title mb18"><%= field.name %><a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
<% if is_default_field?(field) %>
<% case field.name %>
<% when 'course' %>
<% if @course_acts.blank? %>
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
<h2 class="h2-title mb18"><%= field.name %></h2>
<%= render :partial => 'organizations/org_subfield_rightT_default', :locals => {:field => field} %>
<div class="cl"></div>
</div>
<% else %>
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
<h2 class="h2-title mb18"><%= field.name %></h2>
<% @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) %>
<div class="sn-index-active">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/right_top .jpg", :width => "330", :height => "210"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<%= link_to image_tag("/images/default_blank/right-01 .jpg", :width => "330", :height => "210"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), student_work_index_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<% end %>
@ -26,7 +30,7 @@
<% iamge_path = get_image_path_from_content(activity.content) %>
<div class="sn-index-active">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/files-default .jpg", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<%= link_to image_tag("/images/default_blank/right-01 .jpg", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<% end %>
@ -44,7 +48,7 @@
<% iamge_path = get_image_path_from_content(activity.description) %>
<div class="sn-index-active">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/files-default .jpg", :width => "330", :height => "210"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<%= link_to image_tag("/images/default_blank/right-01 .jpg", :width => "330", :height => "210"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), news_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<% end %>
@ -61,7 +65,7 @@
<% if ( activity.polls_status==2) %>
<div class="sn-index-active">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/files-default .jpg", :width => "330", :height => "210"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-activeimg" %>
<%= link_to image_tag("/images/default_blank/right-01 .jpg", :width => "330", :height => "210"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-activeimg" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => "_blank", :class =>"sn-activeimg" %>
<% end %>
@ -77,18 +81,27 @@
<% end %>
<% end %>
<% end %>
<div class="cl"></div>
</div>
<% end %>
<% when 'project' %>
<% if @project_acts.blank? %>
<%= render :partial => 'organizations/org_subfield_leftMD_default', :locals => {:field => field} %>
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
<h2 class="h2-title mb18"><%= field.name %></h2>
<%= render :partial => 'organizations/org_subfield_rightT_default', :locals => {:field => field} %>
<div class="cl"></div>
</div>
<% else %>
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
<h2 class="h2-title mb18"><%= field.name %><a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
<% @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) %>
<div class="sn-index-active">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/files-default .jpg", :width => "330", :height => "210"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<%= link_to image_tag("/images/default_blank/right-01 .jpg", :width => "330", :height => "210"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), issue_url_in_org(activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<% end %>
@ -102,7 +115,7 @@
<% iamge_path = get_image_path_from_content(activity.content) %>
<div class="sn-index-active">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/files-default .jpg", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<%= link_to image_tag("/images/default_blank/right-01 .jpg", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<% end %>
@ -120,7 +133,7 @@
<% iamge_path = get_image_path_from_content(activity.description) %>
<div class="sn-index-active">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/files-default .jpg", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<%= link_to image_tag("/images/default_blank/right-01 .jpg", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank", :class =>"sn-activeimg" %>
<% end %>
@ -131,14 +144,22 @@
</div>
<% end %>
<% end %>
<div class="cl"></div>
</div>
<% 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} %>
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
<h2 class="h2-title mb18"><%= field.name %></h2>
<%= render :partial => 'organizations/org_subfield_rightT_default', :locals => {:field => field} %>
<div class="cl"></div>
</div>
<% else %>
<div class="sn-index-activebox" style="display:<%= field.hide == 0?'block':'none' %>;">
<h2 class="h2-title mb18"><%= field.name %><a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
<% 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 %>
@ -147,7 +168,7 @@
<% iamge_path = get_image_path_from_content(document.content) %>
<div class="sn-index-active">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/files-default .jpg", :width => "330", :height => "210"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-activeimg" %>
<%= link_to image_tag("/images/default_blank/right-01 .jpg", :width => "330", :height => "210"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-activeimg" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => "_blank", :class =>"sn-activeimg" %>
<% end %>
@ -168,7 +189,7 @@
<% if message.board.org_subfield_id %>
<div class="sn-index-active">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/files-default .jpg", :width => "330", :height => "210"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-activeimg" %>
<%= link_to image_tag("/images/default_blank/right-01 .jpg", :width => "330", :height => "210"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-activeimg" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_url_in_org(message.board.id,message.id), :target => "_blank", :class =>"sn-activeimg" %>
<% end %>
@ -184,7 +205,7 @@
<% else %>
<div class="sn-index-active">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/files-default .jpg", :width => "330", :height => "210"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-activeimg" %>
<%= link_to image_tag("/images/default_blank/right-01 .jpg", :width => "330", :height => "210"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-activeimg" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), board_message_path(message.board,activity), :target => "_blank", :class =>"sn-activeimg" %>
<% end %>
@ -204,7 +225,7 @@
<% iamge_path = get_image_path_from_content(news.description) %>
<div class="sn-index-active">
<% if iamge_path.nil? %>
<%= link_to image_tag("/images/default_blank/files-default .jpg", :width => "330", :height => "210"), news_path(news), :target => "_blank", :class =>"sn-activeimg" %>
<%= link_to image_tag("/images/default_blank/right-01 .jpg", :width => "330", :height => "210"), news_path(news), :target => "_blank", :class =>"sn-activeimg" %>
<% else %>
<%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "330", :height => "210"), news_path(news), :target => "_blank", :class =>"sn-activeimg" %>
<% end %>
@ -216,8 +237,8 @@
<% end %>
<% end %>
<% end %>
<div class="cl"></div>
</div>
<% end %>
<% end %>
<% end %>
<div class="cl"></div>
</div>