Merge branch 'Homework' of http://repository.trustie.net/xianbo/trustie2 into Homework

This commit is contained in:
z9hang 2014-11-06 16:06:08 +08:00
commit 0d31ec53b5
3 changed files with 27 additions and 27 deletions

View File

@ -1007,6 +1007,7 @@ class BidsController < ApplicationController
# 启动匿评 # 启动匿评
def start_anonymous_comment def start_anonymous_comment
@bid = Bid.find(params[:id]) @bid = Bid.find(params[:id])
@course = @bid.courses.first
if(@bid.comment_status == 0) if(@bid.comment_status == 0)
homeworks = @bid.homeworks homeworks = @bid.homeworks
if(homeworks && homeworks.size >= 2) if(homeworks && homeworks.size >= 2)

View File

@ -1927,7 +1927,6 @@ module ApplicationHelper
end end
def anonymous_comment_notice(bid, course) def anonymous_comment_notice(bid, course)
link =
case bid.comment_status case bid.comment_status
when 0 when 0
@student_size ||= searchStudent(course).size @student_size ||= searchStudent(course).size

View File

@ -23,10 +23,10 @@
<%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %> <%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %>
</span> </span>
<span style="float: right"> <span style="float: right">
<% if(User.current.logged? && (!Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %> <% if User.current.logged? && is_cur_course_student(@course) %>
<% cur_user_homework = cur_user_homework_for_bid(bid) %> <% cur_user_homework = cur_user_homework_for_bid(bid) %>
<% if cur_user_homework!= nil && cur_user_homework.count == 0 %> <% if cur_user_homework!= nil && cur_user_homework.empty? %>
<%= link_to l(:label_commit_homework),new_homework_attach_path(bid) %> <%= link_to l(:label_commit_homework),new_exercise_book_path(bid) %>
<% else %> <% else %>
<span style="color: green; float: right"> <span style="color: green; float: right">
<%= l(:lable_has_commit_homework)%> <%= l(:lable_has_commit_homework)%>