2015-01-21 11:14:01 +08:00
|
|
|
<% has_commit = has_commit_poll?(poll.id ,User.current)%>
|
2015-01-21 17:51:12 +08:00
|
|
|
<% poll_name = poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%>
|
2015-03-24 15:46:23 +08:00
|
|
|
<% if @is_teacher%>
|
|
|
|
<li title="<%= poll.polls_name %>">
|
2015-08-29 17:50:15 +08:00
|
|
|
<div style="width: 310px;float: left;">
|
2015-08-14 17:25:53 +08:00
|
|
|
<% if has_commit %>
|
|
|
|
<%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue"%>
|
|
|
|
<% else %>
|
|
|
|
<%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue" %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2015-03-24 15:46:23 +08:00
|
|
|
</li>
|
|
|
|
|
|
|
|
<% if poll.polls_status == 1%>
|
|
|
|
<li class="pollsbtn fl ml10 pollsbtn_grey">统计结果</li>
|
|
|
|
<% elsif poll.polls_status == 2 || poll.polls_status == 3 %>
|
|
|
|
<li><%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%></li>
|
2015-01-20 11:42:28 +08:00
|
|
|
<% end%>
|
2015-01-27 09:45:15 +08:00
|
|
|
|
|
|
|
<% if poll.polls_status == 1 %>
|
2015-03-25 10:21:33 +08:00
|
|
|
<li><a href="javascript:" class="pollsbtn btn_pu fl ml5" onclick="poll_submit(<%= poll.id%>,<%= poll.polls_name.length %>);">发布问卷</a></li>
|
2015-03-24 15:46:23 +08:00
|
|
|
<% elsif poll.polls_status == 2%>
|
2015-03-25 10:21:33 +08:00
|
|
|
<li><a href="javascript:" class="pollsbtn btn_de fl ml5" onclick="republish_poll(<%= poll.id%>);">取消发布</a></li>
|
2015-01-27 09:45:15 +08:00
|
|
|
<% else%>
|
2015-03-24 15:46:23 +08:00
|
|
|
<li class="pollsbtn fl ml10 pollsbtn_grey" style="margin-left: 5px;" >发布问卷</li>
|
2015-01-20 11:42:28 +08:00
|
|
|
<% end%>
|
2015-01-27 09:45:15 +08:00
|
|
|
|
2015-03-24 15:46:23 +08:00
|
|
|
<%= link_to(l(:button_delete), poll,:method => :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml5 mr10") %>
|
2015-01-27 09:45:15 +08:00
|
|
|
|
2015-03-24 15:46:23 +08:00
|
|
|
<% if poll.polls_status == 1 %>
|
|
|
|
<li><%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml5"%></li>
|
|
|
|
<% else%>
|
|
|
|
<li class="polls_de_grey fr ml5">编辑</li>
|
|
|
|
<% end%>
|
2015-01-27 09:45:15 +08:00
|
|
|
|
2015-03-24 15:46:23 +08:00
|
|
|
<% if poll.polls_status == 2 %>
|
2015-03-25 09:18:23 +08:00
|
|
|
<li><a class="polls_de fr ml5" onclick="close_poll(<%= poll.id%>);" href="javascript:">关闭</a></li>
|
2015-03-24 15:46:23 +08:00
|
|
|
<% else %>
|
|
|
|
<li class="polls_de_grey fr ml5">关闭</li>
|
|
|
|
<% end%>
|
2015-01-27 09:45:15 +08:00
|
|
|
|
2015-06-09 17:08:00 +08:00
|
|
|
<% if poll.polls_status == 1%>
|
|
|
|
<li class="polls_de_grey fr ml5">导出</li>
|
|
|
|
<% elsif poll.polls_status == 2 || poll.polls_status == 3 %>
|
|
|
|
<li><%= link_to "导出", export_poll_poll_path(poll.id,:format => "xls"), :class => "polls_de fr ml5"%></li>
|
2015-08-10 09:12:26 +08:00
|
|
|
|
2015-06-09 17:08:00 +08:00
|
|
|
<% end%>
|
|
|
|
|
|
|
|
|
2015-03-24 15:46:23 +08:00
|
|
|
<li class="polls_date fr"><%= format_date poll.created_at.to_date%></li>
|
|
|
|
<% else%>
|
|
|
|
<% if poll.polls_status == 2%>
|
|
|
|
<% if has_commit%>
|
|
|
|
<li><%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_st fl c_dblue" %></li>
|
|
|
|
<li class="pollsbtn_tip fl ml5">已答</li>
|
|
|
|
<%else%>
|
|
|
|
<%= link_to poll_name, poll_path(poll.id), :class => "polls_title polls_title_st fl c_dblue"%>
|
|
|
|
<%end%>
|
|
|
|
<% end%>
|
|
|
|
<li class="polls_date fr mr10"><%= format_date poll.created_at.to_date%></li>
|
|
|
|
<% end%>
|