Merge branch 'gitlab_guange' of http://repository.trustie.net/xianbo/trustie2 into gitlab_guange
need it
This commit is contained in:
commit
ee746b2d64
|
@ -168,9 +168,15 @@ class StudentWorkController < ApplicationController
|
||||||
|
|
||||||
def create
|
def create
|
||||||
# 提交作品前先判断是否已经提交
|
# 提交作品前先判断是否已经提交
|
||||||
|
@has_commit = false;
|
||||||
if hsd_committed_work?(User.current.id, @homework.id)
|
if hsd_committed_work?(User.current.id, @homework.id)
|
||||||
flash[:notice] = l(:notice_successful_create)
|
@work = StudentWork.where("user_id =? and homework_common_id =?", User.current.id, @homework.id).first
|
||||||
redirect_to edit_student_work_url(params[:student_work])
|
@has_commit = true;
|
||||||
|
#flash[:notice] = l(:notice_successful_create)
|
||||||
|
#redirect_to edit_student_work_url(params[:student_work])
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if params[:student_work]
|
if params[:student_work]
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<div id="popbox02">
|
||||||
|
<div class="ni_con">
|
||||||
|
<div><p align='center' style='margin-top: 35px'>您已提交过作品,请不要重复提交,如果想修改作品请点击编辑。</p></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="ni_btn mt10">
|
||||||
|
<a href="javascript:" class="tijiao" onclick="clickOK();" style="margin-bottom: 15px;margin-top:15px;" >
|
||||||
|
编 辑
|
||||||
|
</a>
|
||||||
|
<a href="javascript:" class="tijiao" onclick="clickCanel();" style="margin-bottom: 15px;margin-top:15px;" >
|
||||||
|
取 消
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
function clickOK() {
|
||||||
|
window.location.href = '<%= edit_student_work_path(@work.id)%>';
|
||||||
|
}
|
||||||
|
function clickCanel() {
|
||||||
|
hideModal('#popbox02');
|
||||||
|
window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>';
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -1,4 +1,12 @@
|
||||||
<% if @submit_result%>
|
<% if @has_commit %>
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/has_commit_work') %>');
|
||||||
|
showModal('ajax-modal', '500px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||||
|
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||||
|
$('#ajax-modal').parent().css("top","").css("left","");
|
||||||
|
$('#ajax-modal').parent().addClass("anonymos");
|
||||||
|
<% elsif @submit_result%>
|
||||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_information') %>');
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_information') %>');
|
||||||
showModal('ajax-modal', '500px');
|
showModal('ajax-modal', '500px');
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
|
|
Loading…
Reference in New Issue