<% 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 %>
    <div class="row-ziyuan fl">
      <%= link_to image_tag(url_to_avatar(document.creator),:width => "40", :height => "40"), user_path(document.creator), :class => "fl user-img" %>
      <div class="note-box fl">
        <%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id), :target => '_blank', :class => "fl note-title" %>
        <p class="fl"><span >发布时间：<%= format_date document.created_at %></span>
          <span> 作者：<%= document.try(:creator).try(:realname).nil? ? document.try(:creator).try(:login) : document.try(:creator).try(:realname) %></span>
          <span class="fr right-info2"> <%= document.children.count %></span> </p>
      </div>
    </div>
<% 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 %>
            <div class="row-ziyuan fl">
              <%= link_to image_tag(url_to_avatar(message.author),:width => "40", :height => "40"), user_path(message.author), :class => "fl user-img" %>
              <!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
              <div class="note-box fl">
                <% 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 => "fl note-title" %>
                <% else %>
                    <%= link_to message.parent.subject.to_s.html_safe, board_message_url_in_org(message.board.id,message.id), :target => '_blank', :class => "fl note-title" %>
                <% end %>
                <%#= link_to activity.title.to_s, organization_path(@organization, :org_subfield_id => field.id), :target => '_blank', :class => "fl note-title" %>
                <%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
                <p class="fl"><span >发布时间：<%= format_date message.created_on %></span>
                  <span> 作者：<%= message.try(:author).try(:realname).nil? ? message.try(:author).try(:login) : message.try(:author).try(:realname) %></span>
                  <span class="fr right-info2"> <%= message.children.count %></span> </p>
              </div>
            </div><!--row-ziyuan end-->
        <% else %>
            <div class="row-ziyuan fl">
              <%= link_to image_tag(url_to_avatar(message.author),:width => "40", :height => "40"), user_path(message.author), :class => "fl user-img" %>
              <!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
              <div class="note-box fl">
                <% if message.parent_id.nil? %>
                    <%= link_to message.subject.to_s.html_safe, board_message_path(message.board,message), :target => '_blank', :class => "fl note-title" %>
                <% else %>
                    <%= link_to message.parent.subject.to_s.html_safe, board_message_path(message.board,activity), :target => '_blank', :class => "fl note-title" %>
                <% end %>
                <%#= link_to activity.title.to_s, organization_path(@organization, :org_subfield_id => field.id), :target => '_blank', :class => "fl note-title" %>
                <%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
                <p class="fl"><span >发布时间：<%= format_date message.updated_at %></span>
                  <span> 作者：<%= message.try(:author).try(:realname).nil? ? message.try(:author).try(:login) : message.try(:author).try(:realname) %></span>
                  <span class="fr right-info2"> <%= message.children.count %></span> </p>
              </div>
            </div><!--row-ziyuan 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) %>
        <div class="row-ziyuan fl">
          <%= link_to image_tag(url_to_avatar(news.author),:width => "40", :height => "40"), user_path(news.author), :class => "fl user-img" %>
          <!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
          <div class="note-box fl">
            <%= link_to news.title.to_s, news_path(news), :target => '_blank', :class => "fl note-title" %>
            <%#= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
            <p class="fl"><span >发布时间：<%= format_date news.created_on %></span>
              <span> 作者：<%= news.try(:author).try(:realname).nil? ? news.try(:author).try(:login) : news.try(:author).try(:realname) %></span>
              <span class="fr right-info2"> <%= news.comments.count %></span> </p>
          </div>
        </div><!--row-ziyuan end-->
    <% end %>
<% end %>







