1、#1814 未发布的问卷显示在学生的问卷总数中
2、修复问卷标题过长,问卷列表显示异常 3、已发布的问卷可以删除
This commit is contained in:
parent
ad7014f8b6
commit
629c4aaaa1
|
@ -7,7 +7,11 @@ class PollController < ApplicationController
|
||||||
def index
|
def index
|
||||||
if @course
|
if @course
|
||||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
|
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
|
||||||
|
if @is_teacher
|
||||||
polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}")
|
polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}")
|
||||||
|
else
|
||||||
|
polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id} and polls_status = 2")
|
||||||
|
end
|
||||||
@polls = paginateHelper polls,10 #分页
|
@polls = paginateHelper polls,10 #分页
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html{render :layout => 'base_courses'}
|
format.html{render :layout => 'base_courses'}
|
||||||
|
|
|
@ -11,10 +11,8 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="polls_list">
|
<div class="polls_list">
|
||||||
<% @polls.each do |poll|%>
|
<% @polls.each do |poll|%>
|
||||||
|
|
||||||
<% unless !@is_teacher && poll.polls_status != 2 %>
|
|
||||||
<ul id="polls_<%= poll.id %>">
|
<ul id="polls_<%= poll.id %>">
|
||||||
<li>
|
<li title="<%= poll.polls_name %>">
|
||||||
<% if @is_teacher %>
|
<% if @is_teacher %>
|
||||||
<% if has_commit_poll?(poll.id ,User.current) %>
|
<% if has_commit_poll?(poll.id ,User.current) %>
|
||||||
<sapn class="polls_title fl"> <%= poll.polls_name %></sapn>
|
<sapn class="polls_title fl"> <%= poll.polls_name %></sapn>
|
||||||
|
@ -23,25 +21,29 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if has_commit_poll?(poll.id ,User.current) && poll.polls_status == 2 %>
|
<% if has_commit_poll?(poll.id ,User.current) && poll.polls_status == 2 %>
|
||||||
<sapn class="polls_title fl"> <%= poll.polls_name %></sapn>
|
<sapn class="polls_title fl" >
|
||||||
|
<%= poll.polls_name %>
|
||||||
|
</sapn>
|
||||||
<% elsif (!has_commit_poll?(poll.id ,User.current)) && poll.polls_status == 2 %>
|
<% 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" %>
|
<%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%if @is_teacher%>
|
<%if @is_teacher && poll.polls_status == 2%>
|
||||||
<%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%>
|
<%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<% if @is_teacher && poll.polls_status == 1 #新建状态的问卷可删除%>
|
<% if @is_teacher %>
|
||||||
|
<!--新建状态的问卷可删除-->
|
||||||
<%= link_to(l(:button_delete), poll,
|
<%= link_to(l(:button_delete), poll,
|
||||||
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %>
|
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<% if @is_teacher && poll.polls_status == 1 #新建状态的问卷可编辑%>
|
<% if @is_teacher && poll.polls_status == 1%>
|
||||||
|
<!--新建状态的问卷可编辑-->
|
||||||
<%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%>
|
<%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
|
@ -49,8 +51,6 @@
|
||||||
<%= format_time poll.created_at%>
|
<%= format_time poll.created_at%>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margi
|
||||||
a.newbtn{ float:right; display:block; width:80px; height:30px; background:#64bdd9; color:#fff; font-size:14px; margin:10px; text-align:center;}
|
a.newbtn{ float:right; display:block; width:80px; height:30px; background:#64bdd9; color:#fff; font-size:14px; margin:10px; text-align:center;}
|
||||||
a:hover.newbtn{ background:#55a1b9; text-decoration:none;}
|
a:hover.newbtn{ background:#55a1b9; text-decoration:none;}
|
||||||
.polls_list ul{ padding-left:10px; border-bottom:1px dashed #c9c9c9; height:32px; padding-top:8px;}
|
.polls_list ul{ padding-left:10px; border-bottom:1px dashed #c9c9c9; height:32px; padding-top:8px;}
|
||||||
a.polls_title{ font-weight:bold; color:#3e6d8e;}
|
a.polls_title{ font-weight:bold; color:#3e6d8e;max-width: 350px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
|
||||||
.polls_title{ font-weight:bold; color:#3e6d8e;}
|
.polls_title{ font-weight:bold; color:#3e6d8e;}
|
||||||
a.pollsbtn{ display:block; width:66px; height:22px; text-align:center; border:1px solid #64bdd9; color:#64bdd9;}
|
a.pollsbtn{ display:block; width:66px; height:22px; text-align:center; border:1px solid #64bdd9; color:#64bdd9;}
|
||||||
a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;}
|
a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;}
|
||||||
|
|
Loading…
Reference in New Issue