没有登录平台或者没有加入竞赛的用户在点击作品提交时,请给出相应的提示
This commit is contained in:
parent
dd1badcdc0
commit
6329578f9b
|
@ -3123,6 +3123,7 @@ module ApplicationHelper
|
||||||
#根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量
|
#根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量
|
||||||
def user_for_homework_common homework,is_teacher,work
|
def user_for_homework_common homework,is_teacher,work
|
||||||
count = homework.student_works.has_committed.count
|
count = homework.student_works.has_committed.count
|
||||||
|
if User.current.logged?
|
||||||
if User.current.member_of_course?(homework.course)
|
if User.current.member_of_course?(homework.course)
|
||||||
if is_teacher #老师显示作品数量
|
if is_teacher #老师显示作品数量
|
||||||
link_to "作品(#{count})", student_work_index_url_in_org(homework.id, 2), :class => "c_blue"
|
link_to "作品(#{count})", student_work_index_url_in_org(homework.id, 2), :class => "c_blue"
|
||||||
|
@ -3165,13 +3166,17 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
link_to "作品(#{count})",student_work_index_url_in_org(homework.id, 2),:class => "c_blue"
|
link_to "作品(#{count})", "javascript:void(0)", :class => "c_blue", :onclick => "notice_sure_box('您不是班级成员,不能提交作品<br/>请先从老师处获取邀请码后加入班级,再提交作品')"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
link_to "作品(#{count})", "javascript:void(0)", :class => "c_blue", :onclick => "login_notice_box('#{signin_url_without_domain}');"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量
|
#根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量
|
||||||
def user_for_contest_work homework,is_contestant,work
|
def user_for_contest_work homework,is_contestant,work
|
||||||
count = homework.contestant_works.has_committed.count
|
count = homework.contestant_works.has_committed.count
|
||||||
|
if User.current.logged?
|
||||||
if User.current.member_of_contest?(homework.contest)
|
if User.current.member_of_contest?(homework.contest)
|
||||||
if !is_contestant #老师显示作品数量
|
if !is_contestant #老师显示作品数量
|
||||||
link_to "作品(#{count})", contestant_works_path(:work =>homework.id, :tab => 2), :class => "c_blue"
|
link_to "作品(#{count})", contestant_works_path(:work =>homework.id, :tab => 2), :class => "c_blue"
|
||||||
|
@ -3193,7 +3198,10 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
link_to "作品(#{count})",contestant_works_path(:work =>homework.id, :tab => 2),:class => "c_blue"
|
link_to "作品(#{count})", "javascript:void(0)", :class => "c_blue", :onclick => "notice_sure_box('您不是参赛者,不能提交作品<br/>请加入竞赛,待审批通过后再提交作品')"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
link_to "作品(#{count})", "javascript:void(0)", :class => "c_blue", :onclick => "login_notice_box('#{signin_url_without_domain}');"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,14 @@
|
||||||
/* Redmine - project management software
|
/* Redmine - project management software
|
||||||
Copyright (C) 2006-2013 Jean-Philippe Lang */
|
Copyright (C) 2006-2013 Jean-Philippe Lang */
|
||||||
|
|
||||||
|
//未登录弹框提示
|
||||||
|
function login_notice_box(url){
|
||||||
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="'+ url +'" class="muban_icons_close fr"></a></div>'+
|
||||||
|
'<div class="clear mt15"><p class="text_c f14">您还没有登录,不能提交作品<br/>请登录</p><div class="cl"></div>'+
|
||||||
|
'<a href="'+ url +'" class="fr sy_btn_blue mt10 mr10" style="margin-right: 124px;">知道了</a></div></div>';
|
||||||
|
pop_box_new(htmlvalue, 300, 170);
|
||||||
|
}
|
||||||
|
|
||||||
//动态高度控制
|
//动态高度控制
|
||||||
function description_show_hide(id){
|
function description_show_hide(id){
|
||||||
showNormalImage('activity_description_'+id);
|
showNormalImage('activity_description_'+id);
|
||||||
|
@ -1765,6 +1773,14 @@ function delete_confirm_box_3(url, str){
|
||||||
pop_box_new(htmlvalue, 300, 140);
|
pop_box_new(htmlvalue, 300, 140);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//提示框:只有一个按钮,点击关闭弹框
|
||||||
|
function notice_sure_box(str){
|
||||||
|
var htmlvalue = '<div id="muban_popup_box" style="width:350px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
|
'<div class="clear mt15"><p class="text_c f14">' + str + '</p><div class="cl"></div>'+
|
||||||
|
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10 mr10" onclick="hideModal();" style="margin-right: 124px;">知道了</a></div></div>';
|
||||||
|
pop_box_new(htmlvalue, 350, 140);
|
||||||
|
}
|
||||||
|
|
||||||
//提示框:只有一个确定按钮,点击关闭弹框
|
//提示框:只有一个确定按钮,点击关闭弹框
|
||||||
function notice_box(str){
|
function notice_box(str){
|
||||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||||
|
|
Loading…
Reference in New Issue