Conflicts: app/controllers/organizations_controller.rbdev_wuhao
						commit
						c00c674c34
					
				@ -0,0 +1,107 @@
 | 
				
			||||
<% 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 %>
 | 
				
			||||
 | 
				
			||||
@ -1,14 +1,74 @@
 | 
				
			||||
 | 
				
			||||
<% 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(activity.creator),:width => "40", :height => "40"), user_path(activity.creator), :class => "fl user-img" %>
 | 
				
			||||
      <!--<a href="#" class="fl user-img" ><img src="images/detailimg4.jpg" /></a>-->
 | 
				
			||||
      <div class="ziyuan-box fl">
 | 
				
			||||
        <%= link_to activity.title.to_s, news_url_in_org(activity.id), :target => '_blank', :class => "fl ziyuan-title" %>
 | 
				
			||||
        <p class="fl"><span >发布时间:<%= format_date activity.updated_at %></span>
 | 
				
			||||
          <span> 作者:<%= activity.try(:creator).try(:realname).nil? ? activity.try(:creator).try(:login) : activity.try(:creator).try(:realname) %></span>
 | 
				
			||||
          <span class="fr right-info2"> <%= activity.children.count %></span> </p>
 | 
				
			||||
      <%= 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 %>
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
    </div><!--row-ziyuan end-->
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
					Loading…
					
					
				
		Reference in new issue