This commit is contained in:
t430 2014-05-27 17:24:28 +08:00
commit d2e4601556
4 changed files with 21 additions and 9 deletions

View File

@ -145,6 +145,17 @@ module BidsHelper
people.include?(User.current)
end
# 当前用户是否加入了此课程(包括教师)
def is_cur_course_user? bid
people = []
#people << bid.author
course = bid.courses.first
course.members.each do |member|
people << member.user
end
people.include?(User.current)
end
# def select_option_helper option
# tmp = Hash.new
# option.each do |project|

View File

@ -44,7 +44,7 @@
<% end %>
</td>
<td style="vertical-align: top">
<% if display_id %>
<% if is_cur_course_user? @bid %>
<%= link_to "互评>>" , homework_attach_path(homework)%>
<% end %>
</td>

View File

@ -70,4 +70,12 @@
</li>
<% end %>
</ul>
<% end %>
<% end %>
<!--分页-->
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @feedback_pages %>
</ul>
</div>

View File

@ -145,12 +145,5 @@
<%= render :partial => 'showjour', :locals => {:jour => @jour} %>
</div>
<!--分页-->
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @feedback_pages %>
</ul>
</div>
<div>
</div>