提交作品时左侧导航栏对应班级的导航栏

This commit is contained in:
cxt 2016-09-14 20:58:15 +08:00
parent f880ab1c14
commit abdc08c7af
4 changed files with 16 additions and 4 deletions

View File

@ -85,6 +85,14 @@ class HomeworkCommonController < ApplicationController
homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new
@homework.end_time = params[:homework_common][:end_time] || Time.now
@homework.course_id = params[:course_id]
if params[:homework_type] && params[:homework_type].to_i != @homework.homework_type
if @homework.homework_type == 2
@homework.homework_detail_programing.destroy if @homework.homework_detail_programing
@homework.homework_tests.destroy_all
elsif @homework.homework_type == 3
@homework.homework_detail_group.destroy if @homework.homework_detail_group
end
end
@homework.homework_type = params[:homework_type].to_i || @homework.homework_type
anonymous = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1
if anonymous != @homework.anonymous_comment

View File

@ -571,7 +571,7 @@ class StudentWorkController < ApplicationController
@student_work = StudentWork.new
#end
respond_to do |format|
format.html{ render :layout => "new_base_user"}
format.html{ render :layout => "base_courses"}
end
end
@ -657,7 +657,7 @@ class StudentWorkController < ApplicationController
render_403
else
respond_to do |format|
format.html{ render :layout => "new_base_user"}
format.html{ render :layout => "base_courses"}
end
end
end

View File

@ -2,6 +2,7 @@
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<%= javascript_include_tag 'homework','baiduTemplate' %>
<% end %>
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner mb10">
<div class="NewsBannerName">编辑作品</div>
</div>
@ -83,6 +84,7 @@
<% end%>
</div><!----HomeWorkCon end-->
</div>
</div>
<script type="text/javascript">
<% if @homework.homework_detail_group %>
$(function(){

View File

@ -197,7 +197,8 @@
});
</script>
<div class="homepageRightBanner mb10">
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner mb10 ml10">
<div class="NewsBannerName">提交作品</div>
</div>
<div class="cl"></div>
@ -297,4 +298,5 @@
<div class="cl"></div>
<% end%>
</div><!----HomeWorkCon end-->
</div>
</div>
</div>