作品提交完成后弹出作品信息对话框

This commit is contained in:
cxt 2015-11-05 14:47:29 +08:00
parent 48cef54b9e
commit 1b988a0a7f
4 changed files with 40 additions and 1 deletions

View File

@ -193,11 +193,15 @@ class StudentWorkController < ApplicationController
user_activity.updated_at = Time.now
user_activity.save
end
@student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id).first
respond_to do |format|
format.js
=begin
format.html {
flash[:notice] = l(:notice_successful_create)
redirect_to student_work_index_url(:homework => @homework.id)
}
=end
end
return
end

View File

@ -0,0 +1,28 @@
<div id="popbox02">
<div class="ni_con">
<h2>您刚上传的作品信息:</h2>
<p>
作品名称:<%=@student_work.name%>
</p>
<p>
作品描述:<%=@student_work.description%>
</p>
<p>
<span class="fl">附件:</span>
<% if @student_work.attachments.count == 0%>
<%= "无附件"%>
<% else %>
<div class="fl">
<% @student_work.attachments.each do |attachment| %>
<span style="display: block"><%=attachment.filename %></span>
<% end %>
</div>
<% end %>
</p>
<div class="ni_btn">
<a href="javascript:" class="tijiao" onclick="clickOK('<%= student_work_index_url(:homework => @homework.id)%>');" style="margin-bottom: 20px;" >
确&nbsp;&nbsp;定
</a>
</div>
</div>
</div>

View File

@ -0,0 +1,7 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_information') %>');
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");

View File

@ -73,7 +73,7 @@
:url => {:controller => 'student_work',
:action => 'create',
:homework => @homework.id
}) do |f|%>
},:remote=>true ) do |f| %>
<div class=" c_red mb10">
提示:作品名称和描述中不要出现真实的姓名信息
</div>