Fixed navigation and breadcrumb

This commit is contained in:
Saurabh Bhatia 2014-07-11 10:43:28 +08:00
parent 886bf12b98
commit a080ff323d
1 changed files with 8 additions and 7 deletions

View File

@ -6,6 +6,8 @@ class Admin::JournalPapersController < OrbitMemberController
before_action :get_plugins, only: [:index, :writing_journal_setting, :new, :create, :edit, :update] before_action :get_plugins, only: [:index, :writing_journal_setting, :new, :create, :edit, :update]
before_action :set_types, only: [:writing_journal_setting, :new, :edit, :create, :update] before_action :set_types, only: [:writing_journal_setting, :new, :edit, :create, :update]
before_action :find_journal_paper, only: [:destroy] before_action :find_journal_paper, only: [:destroy]
before_action :set_plugin
def index def index
@writing_journals = JournalPaper.all @writing_journals = JournalPaper.all
@ -27,11 +29,6 @@ class Admin::JournalPapersController < OrbitMemberController
def new def new
@journal_paper = JournalPaper.new @journal_paper = JournalPaper.new
@members_data = JournalPaper.member_data rescue nil @members_data = JournalPaper.member_data rescue nil
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @journal_paper }
end
end end
def edit def edit
@ -43,7 +40,7 @@ class Admin::JournalPapersController < OrbitMemberController
respond_to do |format| respond_to do |format|
if @journal_paper.save if @journal_paper.save
format.html { redirect_to admin_journal_papers_path } format.html { redirect_to admin_journal_papers_path }
format.xml { render :xml => @journal_paper, :status => :created, :location => @journal_paper } format.json { render action: 'show', status: :created, location: @journal_paper }
else else
format.html { render action: 'new' } format.html { render action: 'new' }
format.json { render json: @journal_paper.errors, status: :unprocessable_entity } format.json { render json: @journal_paper.errors, status: :unprocessable_entity }
@ -58,7 +55,7 @@ class Admin::JournalPapersController < OrbitMemberController
if @journal_paper.update_attributes(journal_paper_attributes) if @journal_paper.update_attributes(journal_paper_attributes)
format.html { redirect_to admin_journal_papers_path } format.html { redirect_to admin_journal_papers_path }
# format.js { render 'toggle_enable' } # format.js { render 'toggle_enable' }
format.xml { head :ok } format.json { head :no_content }
else else
format.html { render action: "edit" } format.html { render action: "edit" }
format.json { render json: @journal_paper.errors, status: :unprocessable_entity } format.json { render json: @journal_paper.errors, status: :unprocessable_entity }
@ -192,6 +189,10 @@ class Admin::JournalPapersController < OrbitMemberController
@plugins = OrbitApp::Plugin::Registration.all rescue nil @plugins = OrbitApp::Plugin::Registration.all rescue nil
end end
def set_plugin
@plugin = OrbitApp::Plugin::Registration.all.select{|plugin| plugin.app_name.eql? 'JournalPaper'}.first
end
def set_types def set_types
@journal_levels = JournalLevel.all @journal_levels = JournalLevel.all
@author_types = JournalPaperAuthorType.all @author_types = JournalPaperAuthorType.all