|
|
@ -1,7 +1,7 @@
|
|
|
|
class SubjectsController < ApplicationController
|
|
|
|
class SubjectsController < ApplicationController
|
|
|
|
before_action :require_login, :check_auth, except: [:index]
|
|
|
|
before_action :require_login, :check_auth, except: [:index]
|
|
|
|
# before_action :check_auth, except: [:index]
|
|
|
|
# before_action :check_auth, except: [:index]
|
|
|
|
before_action :find_subject, except: [:index, :create, :append_to_stage]
|
|
|
|
before_action :find_subject, except: [:index, :create, :new, :append_to_stage]
|
|
|
|
before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish,
|
|
|
|
before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish,
|
|
|
|
:search_members, :add_subject_members, :statistics, :shixun_report, :school_report,
|
|
|
|
:search_members, :add_subject_members, :statistics, :shixun_report, :school_report,
|
|
|
|
:up_member_position, :down_member_position]
|
|
|
|
:up_member_position, :down_member_position]
|
|
|
@ -94,6 +94,10 @@ class SubjectsController < ApplicationController
|
|
|
|
@subject.increment!(:visits)
|
|
|
|
@subject.increment!(:visits)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def new
|
|
|
|
|
|
|
|
normal_status("")
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def create
|
|
|
|
def create
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
begin
|
|
|
|
begin
|
|
|
|