parent
94542e935a
commit
78ac974a75
|
@ -159,7 +159,7 @@ module CoursesHelper
|
||||||
end
|
end
|
||||||
#获取当前用户在指定作业下提交的作业的集合
|
#获取当前用户在指定作业下提交的作业的集合
|
||||||
def cur_user_homework_for_bid bid
|
def cur_user_homework_for_bid bid
|
||||||
cur_user_homework = HomeworkAttach.where("user_id = ? and bid_id = ?",User.current,params[:id])
|
cur_user_homework = HomeworkAttach.where("user_id = ? and bid_id = ?",User.current,bid.id)
|
||||||
cur_user_homework
|
cur_user_homework
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,13 @@
|
||||||
<span style="float: right">
|
<span style="float: right">
|
||||||
<% if(User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_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? && (!Member.where('user_id = ? and project_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %>
|
||||||
<%# 提交作业按钮 %>
|
<%# 提交作业按钮 %>
|
||||||
<%= link_to l(:label_commit_homework), '#OpenWindow', rel: 'leanModal', onclick: "showSubH(#{bid.id}, '#{bid.name}');" if User.current.member_of?(@project) %>
|
<!--<%= link_to l(:label_commit_homework), '#OpenWindow', rel: 'leanModal', onclick: "showSubH(#{bid.id}, '#{bid.name}');" if User.current.member_of?(@project) %>-->
|
||||||
|
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
|
||||||
|
<% if cur_user_homework!= nil && cur_user_homework.count == 0 %>
|
||||||
|
<%= link_to l(:label_commit_homework),new_homework_attach_path(bid) %>
|
||||||
|
<% else %>
|
||||||
|
<span style="color: green; float: right"><%= l(:lable_has_commit_homework)%></span>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if (User.current.admin?||User.current.id==bid.author_id) %>
|
<% if (User.current.admin?||User.current.id==bid.author_id) %>
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
|
|
|
@ -1277,6 +1277,7 @@ zh:
|
||||||
label_current_contributors: 位当前贡献者
|
label_current_contributors: 位当前贡献者
|
||||||
label_commit_limit: 作业提交时间已过!
|
label_commit_limit: 作业提交时间已过!
|
||||||
label_commit_ar: 作业提交截止时间快到了!
|
label_commit_ar: 作业提交截止时间快到了!
|
||||||
|
lable_has_commit_homework: 您已提交过作业
|
||||||
#modify by men
|
#modify by men
|
||||||
label_x_current_contributors:
|
label_x_current_contributors:
|
||||||
zero: 位当前贡献者
|
zero: 位当前贡献者
|
||||||
|
|
Loading…
Reference in New Issue