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

63 lines
2.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%= stylesheet_link_tag 'polls', :media => 'all' %>
<div class="polls_content" id="polls" style="width:677px;">
<div class="polls_head">
<h2>所有问卷
<span><%= @obj_count%></span>
</h2>
<% if @is_teacher%>
<%= link_to l(:label_new_poll), new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => "newbtn" %>
<% end%>
</div>
<div class="cl"></div>
<div class="polls_list">
<% @polls.each do |poll|%>
<% unless !@is_teacher && poll.polls_status != 2 %>
<ul id="polls_<%= poll.id %>">
<li>
<% 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%>
<%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%>
<% end%>
</li>
<li>
<% if @is_teacher && poll.polls_status == 1 #新建状态的问卷可删除%>
<%= 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 class="polls_date fr">
<%= format_time poll.created_at%>
</li>
</ul>
<% end %>
<div class="cl"></div>
<% end%>
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div class="cl"></div>
</div><!--列表end-->
</div><!--问卷内容end-->