组织动态添加poll、

This commit is contained in:
huang 2016-04-01 11:48:13 +08:00
parent 25da925497
commit aee695e94d
1 changed files with 30 additions and 1 deletions

View File

@ -71,7 +71,36 @@
</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 %>