1 class PanelsController < ApplicationController
2 if Manifest.manifest.magic_numbers['run_mode'] == 0
3 before_action :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
4 before_action :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
6 before_action :authenticate_reader, :only => [
7 :index, :show, :by_scroll, :by_sheet, :by_author, :by_speech_balloon_template
9 before_action :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
10 before_action :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
18 respond_to do |format|
20 list_json_format @finder, format
27 if params[:mode] == 'filer'
35 filer_list param: params[:id]
39 filer_list param: params[:id]
43 filer_list param: params[:id]
46 def by_speech_balloon_template
47 filer_list param: params[:id]
50 def show_html_format format
53 @new_scroll_items = assist_items('home', 'scrolls')
54 @fresh_scroll_items = assist_items('home', 'scroll_panels').map {|sp| sp.scroll}
61 respond_to do |format|
62 show_html_format format
63 show_prof_format format
64 if params[:with_elements]
65 show_json_format_for_root format
67 show_json_format format
75 respond_to do |format|
77 @editor = Editor::PanelEditor.new @item, @operators
78 render :template => @editor.template_name, :locals => {
82 format.json { render json: @item.to_json }
88 respond_to do |format|
90 @editor = Editor::PanelEditor.new @item, @operators
91 render :template => @editor.template_name, :locals => {
95 format.json { render json: @item.to_json }
110 @item = @my_model_class.new
111 # @item.boosts 'post'
114 jsn = JSON.parse_no_except(params[:json])
116 @prm = if params[:panel] == nil or params[:panel].empty?
119 @item.permit_params(params)
121 @item.class.fold_extend_settings @prm
123 respond_to do |format|
124 if @item.store @prm, @operators
125 created_html_format format
126 created_json_format format
128 not_created_html_format format
129 not_created_json_format format
135 @item = Panel.edit(params[:id], @operators)
139 jsn = JSON.parse(params[:json])
141 @prm = if params[:panel] == nil or params[:panel].empty?
144 @item.permit_params(params)
146 @item.class.fold_extend_settings @prm
148 respond_to do |format|
149 if @item.store @prm, @operators
150 updated_html_format format
151 updated_json_format format
153 not_updated_html_format format
154 not_updated_json_format format
161 @item = @my_model_class.edit(params[:id], @operators)
162 render_destroy '/home/' + @item.path_name