<% activities.each do |act| %>
    <% if act.org_act_type == "HomeworkCommon" %>
        <% activity = HomeworkCommon.find(act.org_act_id) %>
        <li>
          <a href="/#" title="">
            <div class="course-list-img">
              <% iamge_path = get_image_path_from_content(activity.description) %>
              <% if iamge_path.nil? %>
                  <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), student_work_index_url_in_org(activity.id), :target => "_blank" %>
                  <!--<img width="370" height="220" alt="#" src="/images/org_new_style/default-img.jpg">-->
              <% else %>
                  <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), student_work_index_url_in_org(activity.id), :target => "_blank" %>
                  <!--<img width="370" height="220" src="/files/uploads/image<%#= iamge_path %>" alt="" />-->
              <% end %>
            </div>
            <h5>
              <%= link_to activity.name.to_s, student_work_index_url_in_org(activity.id), :target => '_blank' %>
            </h5>
            <div class="item-btm clearfix">
            <%=link_to activity.try(:user).try(:realname).nil? ? activity.try(:user).try(:login) : activity.try(:user).try(:realname), user_path(activity.user), :class=>"publisher-name fl", :target => "_blank" %></a>
          <p class="pass-time fl"><span><%= format_date activity.updated_at %></span></p>
          <div class="fr right-info"> <span> <%= activity.journals_for_messages.count %></span></div>
          </div>
          </a>
        </li>
    <% elsif act.org_act_type == "Message" %>
        <% activity = Message.find(act.org_act_id) %>
        <li>
          <a href="/#" title="">
            <div class="course-list-img">
              <% iamge_path = get_image_path_from_content(activity.content) %>
              <% if iamge_path.nil? %>
                  <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank" %>
              <% else %>
                  <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), board_message_url_in_org(activity.board_id, activity.id), :target => "_blank" %>
              <% end %>
            </div>
            <h5>
              <% 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' %>
              <% else %>
                  <%= link_to activity.parent.subject.to_s.html_safe, board_message_url_in_org(activity.board_id, activity.id), :target => '_blank' %>
              <% end %>
            </h5>
            <div class="item-btm clearfix">
            <%=link_to activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname), user_path(activity.author), :class=>"publisher-name fl", :target => "_blank" %></a>
          <p class="pass-time fl"><span><%= format_date activity.updated_on %></span></p>
          <div class="fr right-info"> <span> <%= activity.children.count %></span></div>
          </div>
          </a>
        </li>
    <% elsif act.org_act_type == "News" %>
        <% activity = News.find(act.org_act_id) %>
        <li>
          <a href="/#" title="">
            <div class="course-list-img">
              <% iamge_path = get_image_path_from_content(activity.description) %>
              <% if iamge_path.nil? %>
                  <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), news_url_in_org(activity.id), :target => "_blank" %>
              <% else %>
                  <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), news_url_in_org(activity.id), :target => "_blank" %>
              <% end %>
            </div>
            <h5>
              <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank' %>
            </h5>
            <div class="item-btm clearfix">
            <%=link_to activity.try(:author).try(:realname).nil? ? activity.try(:author).try(:login) : activity.try(:author).try(:realname), user_path(activity.author), :class=>"publisher-name fl", :target => "_blank" %></a>
          <p class="pass-time fl"><span><%= format_date activity.created_on %></span></p>
          <div class="fr right-info"> <span> <%= activity.comments.count %></span></div>
          </div>
          </a>
        </li>
    <% 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%>
        <% if ( activity.polls_status==2) %>
        <li>
          <a href="/#" title="">
            <div class="course-list-img">
              <% iamge_path = get_image_path_from_content(activity.polls_description) %>
              <% if iamge_path.nil? %>
                  <%= link_to image_tag("/images/org_new_style/default-img.jpg", :width => "370", :height => "220"), news_url_in_org(activity.id), :target => "_blank" %>
              <% else %>
                  <%= link_to image_tag("/files/uploads/image#{iamge_path}", :width => "370", :height => "220"), news_url_in_org(activity.id), :target => "_blank" %>
              <% end %>
            </div>
            <h5>
              <% if has_commit %>
                  <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s + "/poll_result", :target => '_blank' %>
              <% else %>
                  <%= link_to poll_name, Setting.protocol + "://" + Setting.host_name + "/poll/" + activity.id.to_s, :target => '_blank' %>
              <% end %>
            </h5>
            <div class="item-btm clearfix">
            <%=link_to activity.try(:user).try(:realname).nil? ? activity.try(:user).try(:login) : activity.try(:user).try(:realname), user_path(activity.user), :class=>"publisher-name fl", :target => "_blank" %></a>
          <p class="pass-time fl"><span><%= format_date activity.published_at %></span></p>
          <div class="fr right-info"> <span> 0 </span></div>
          </div>
          </a>
        </li>
     <% end %>
    <% end %>

<% end %>

