将我的题库中的数据设为公开,点击确定后跳转500
This commit is contained in:
parent
59808a8f54
commit
97b303fa99
|
|
@ -1,6 +1,6 @@
|
|||
class HomeworkBankController < ApplicationController
|
||||
before_filter :require_login, :only => [:index, :show, :new, :create, :edit, :update, :destroy, :destroy_all, :choose_user_course, :send_h_bank_to_course]
|
||||
before_filter :find_homework_bank, :only => [:show, :edit, :update, :destroy]
|
||||
before_filter :find_homework_bank, :only => [:show, :edit, :update, :destroy, :set_public]
|
||||
|
||||
def index
|
||||
@order,@b_sort = params[:order] || "updated_at",params[:sort] || "desc"
|
||||
|
|
@ -221,7 +221,10 @@ class HomeworkBankController < ApplicationController
|
|||
|
||||
def set_public
|
||||
@homework.update_attributes(:is_public => true)
|
||||
redirect_to homework_bank_index_path()
|
||||
respond_to do |format|
|
||||
format.html{ redirect_to homework_bank_path(@homework) }
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -53,6 +53,11 @@
|
|||
<ul class="edu-position-hide undis">
|
||||
<li><%= link_to '预览', homework_bank_path(homework), :target => '_blank' %></li>
|
||||
<li><%= link_to '发送', choose_user_course_homework_bank_index_path(:check_homework_bank => ["#{homework.id}"]), :remote => true %></li>
|
||||
<% unless homework.is_public %>
|
||||
<li id="set_homework_public_<%= homework.id %>">
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box('<%= set_public_homework_bank_path(homework) %>', '您确定要公开吗?<br/>公开后不能重设为私有')">设为公开</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if @type.to_i == 1 %>
|
||||
<li><a href="javascript:void(0)" onclick="delete_confirm_box_3('<%= homework_bank_path(homework) %>', '确定要删除该题吗?')">删除</a></li>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
</script>
|
||||
|
||||
<div class="edu-class-container">
|
||||
<p class="mb10"><i class="fa fa-map-marker mr5 color-grey"></i><%= link_to User.current.show_name, user_path(User.current) %> > <%= link_to '课堂教学', courses_path() %> > 题库</p>
|
||||
<p class="mb10"><i class="fa fa-map-marker mr5 color-grey"></i><%= link_to User.current.show_real_name, user_path(User.current) %> > <%= link_to '课堂教学', courses_path() %> > 题库</p>
|
||||
<div class="edu-con-bg01 mt15">
|
||||
<div class="">
|
||||
<div class="edu-tab clearfix mb20">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
hideModal();
|
||||
$("#set_homework_public_<%= @homework.id %>").remove();
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<div class="edu-class-container">
|
||||
<p class="mb10">
|
||||
<i class="fa fa-map-marker mr5 color-grey"></i>
|
||||
<%= link_to User.current.show_name, user_path(User.current) %> > <%= link_to '课堂教学', courses_path() %> > <%= @homework.user == User.current ? link_to('我的题库', homework_bank_index_path()) : link_to('公共题库', homework_bank_index_path(:type => 2)) %></p>
|
||||
<%= link_to User.current.show_real_name, user_path(User.current) %> > <%= link_to '课堂教学', courses_path() %> > <%= @homework.user == User.current ? link_to('我的题库', homework_bank_index_path()) : link_to('公共题库', homework_bank_index_path(:type => 2)) %></p>
|
||||
<div class="edu-con-top clearfix">
|
||||
<p class="ml15 fl color-grey">
|
||||
<% unless @homework.is_public %>
|
||||
|
|
|
|||
Loading…
Reference in New Issue