socialforge/app/views/poll/_poll.html.erb

43 lines
1.6 KiB
Plaintext
Raw Normal View History

2015-01-20 11:42:28 +08:00
<li title="<%= poll.polls_name %>">
<% if @is_teacher %>
<% if has_commit_poll?(poll.id ,User.current) %>
<sapn class="polls_title fl"> <%= poll.polls_name %></sapn>
<% else %>
<%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %>
<% end %>
<% else %>
<% if has_commit_poll?(poll.id ,User.current) && poll.polls_status == 2 %>
<sapn class="polls_title fl" >
<%= poll.polls_name %>
</sapn>
<% elsif (!has_commit_poll?(poll.id ,User.current)) && poll.polls_status == 2 %>
<%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %>
<% end %>
<% end %>
</li>
<li>
<%if @is_teacher && poll.polls_status == 2%>
<%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%>
<% end%>
</li>
<li>
<% if @is_teacher %>
<!--新建状态的问卷可删除-->
<%= link_to(l(:button_delete), poll,
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %>
<% end%>
</li>
<li>
<% if @is_teacher && poll.polls_status == 1%>
<!--新建状态的问卷可编辑-->
<%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%>
<% end%>
</li>
<li>
<% if @is_teacher && poll.polls_status == 2%>
<%= link_to "重新发布", republish_poll_poll_path(poll.id), :remote => true, :class => 'polls_de fr ml20' %>
<% end %>
</li>
<li class="polls_date fr">
<%= format_time poll.created_at%>
</li>