% has_commit = has_commit_poll?(poll.id ,User.current)%>
<% poll_name = poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%>
<% if @is_teacher %>
<% if has_commit %>
<%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl", :style => "max-width: 550px;width: 550px;" %>
<% else %>
<%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl" %>
<% end %>
<% else %>
<% if has_commit && poll.polls_status == 2 %>
<%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl", :style => "max-width: 500px;width: auto;" %>
<% elsif !has_commit && poll.polls_status == 2 %>
<%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl", :style => "max-width: 550px;width: 550px;" %>
<% end %>
<% end %>
<% if !@is_teacher && has_commit && poll.polls_status == 2%>
已答
<% end %>
<%if @is_teacher%>
<% if poll.polls_status == 1 || poll.polls_status == 3 %>
统计结果
<% elsif poll.polls_status == 2%>
<%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%>
<% end%>
<% end%>
<%if @is_teacher %>
<% if poll.polls_status == 1 %>
发布问卷
<% elsif poll.polls_status == 2%>
取消发布
<% else%>
发布问卷
<% end%>
<% end%>
<% if @is_teacher %>
<%= link_to(l(:button_delete), poll,
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml15 mr10") %>
<% end%>
<% if @is_teacher%>
<% if poll.polls_status == 1 %>
<%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml15"%>
<% else%>
编辑
<% end%>
<% end%>
<% if @is_teacher%>
<% if poll.polls_status == 2 %>
关闭
<% else %>
关闭
<% end%>
<% end %>
<%= format_time poll.created_at%>