OSDN Git Service
(root)
/
pettanr
/
pettanr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix new element dialog
[pettanr/pettanr.git]
/
app
/
controllers
/
panels_controller.rb
diff --git
a/app/controllers/panels_controller.rb
b/app/controllers/panels_controller.rb
index
8d4b05e
..
6c9e438
100644
(file)
--- a/
app/controllers/panels_controller.rb
+++ b/
app/controllers/panels_controller.rb
@@
-10,20
+10,14
@@
class PanelsController < ApplicationController
before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy, :catch]
end
before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy, :catch]
end
- def self.model
- Panel
- end
private
def panel_list
set_list
private
def panel_list
set_list
- list_result = @list.open(@operators,
- {:id => params[:id], :page => params[:page], :page_size => params[:page_size]}
- )
- @items = list_result.items
- @pager = list_result.paginate
+ @items = @list.items
+ @pager = @list.page_status.pager
respond_to do |format|
format.html
respond_to do |format|
format.html
- format.json { render json: @items.map{|i| i.attributes}.to_json }
+ list_json_format @list, format
format.atom
format.rss
end
format.atom
format.rss
end
@@
-56,8
+50,8
@@
class PanelsController < ApplicationController
def show_html_format format
format.html {
if @operators.author
def show_html_format format
format.html {
if @operators.author
- @new_scroll_items = assist_items('
scroll', 'private
')
- @fresh_scroll_items = assist_items('
scroll_panel', 'private
').map {|sp| sp.scroll}
+ @new_scroll_items = assist_items('
home', 'scrolls
')
+ @fresh_scroll_items = assist_items('
home', 'scroll_panels
').map {|sp| sp.scroll}
end
}
end
end
}
end
@@
-74,26
+68,6
@@
class PanelsController < ApplicationController
end
end
end
end
end
end
-
- def count
- list_count
- end
-
- def count_by_scroll
- list_count
- end
-
- def count_by_sheet
- list_count
- end
-
- def count_by_author
- list_count
- end
-
- def count_by_speech_balloon_template
- list_count
- end
def new
set_new
def new
set_new
@@
-155,20
+129,21
@@
class PanelsController < ApplicationController
def update
@item = Panel.edit(params[:id], @operators)
def update
@item = Panel.edit(params[:id], @operators)
- @item.boost
+ @item.boost
s 'post'
jsn = nil
if params[:json]
jsn = JSON.parse(params[:json])
end
@prm = params[:panel] || jsn
jsn = nil
if params[:json]
jsn = JSON.parse(params[:json])
end
@prm = params[:panel] || jsn
-
self.model
.fold_extend_settings @prm
+
@item.class
.fold_extend_settings @prm
@item.attributes = @prm
@item.attributes = @prm
- @item.refresh
+
#
@item.refresh
respond_to do |format|
respond_to do |format|
- if @item.store @
item.packed_attributes
, @operators
+ if @item.store @
prm
, @operators
updated_html_format format
updated_json_format format
else
updated_html_format format
updated_json_format format
else
+ p @item.errors
format.html {
flash[:notice] = I18n.t('flash.notice.not_updated', :model => @my_model_class.model_name.human)
@editor = Editor::PanelEditor.new @item, @operators
format.html {
flash[:notice] = I18n.t('flash.notice.not_updated', :model => @my_model_class.model_name.human)
@editor = Editor::PanelEditor.new @item, @operators