by_scroll: {\r
type: 'list',\r
},\r
+ by_author: {\r
+ type: 'list',\r
+ },\r
show: {\r
type: 'show',\r
},\r
count_by_scroll: {\r
type: 'count',\r
},\r
+ count_by_author: {\r
+ type: 'count',\r
+ },\r
new: {\r
type: 'new',\r
},\r
by_sheet: {\r
type: 'list',\r
},\r
+ by_author: {\r
+ type: 'list',\r
+ },\r
show: {\r
type: 'show',\r
},\r
count_by_sheet: {\r
type: 'count',\r
},\r
+ count_by_author: {\r
+ type: 'count',\r
+ },\r
new: {\r
type: 'new',\r
},\r
by_panel: {\r
type: 'list',\r
},\r
+ by_author: {\r
+ type: 'list',\r
+ },\r
show: {\r
type: 'show',\r
},\r
count_by_panel: {\r
type: 'count',\r
},\r
+ count_by_author: {\r
+ type: 'count',\r
+ },\r
new: {\r
type: 'new',\r
},\r
if params[:json]
jsn = JSON.parse_no_except(params[:json])
end
- @prm = if params[:panel].empty?
+ @prm = if params[:panel] == nil or params[:panel].empty?
jsn
else
params[:panel]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
else
before_filter :authenticate_reader, :only => [
- :index, :show, :by_panel, :by_scroll, :count, :count_by_panel, :count_by_scroll
+ :index, :show, :by_panel, :by_scroll, :by_author, :count, :count_by_panel, :count_by_scroll, :count_by_author
]
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
filer_list
end
+ def by_author
+ filer_list
+ end
+
def show
set_show
respond_to do |format|
list_count
end
+ def count_by_author
+ list_count
+ end
+
def new
form_new
end
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
else
before_filter :authenticate_reader, :only => [
- :index, :show, :by_sheet, :by_panel, :count, :count_by_sheet, :count_by_panel
+ :index, :show, :by_sheet, :by_panel, :by_author, :count, :count_by_sheet, :count_by_panel, :count_by_author
]
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
filer_list
end
+ def by_author
+ filer_list
+ end
+
def show
set_show
respond_to do |format|
list_count
end
+ def count_by_author
+ list_count
+ end
+
def new
form_new
end
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
else
before_filter :authenticate_reader, :only => [
- :index, :show, :by_story, :by_sheet, :count, :count_by_story, :count_by_sheet
+ :index, :show, :by_story, :by_sheet, :by_author, :count, :count_by_story, :count_by_sheet, :count_by_author
]
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
filer_list
end
+ def by_author
+ filer_list
+ end
+
def show
set_show
respond_to do |format|
list_count
end
+ def count_by_author
+ list_count
+ end
+
def new
form_new
end
validates :url, :presence => true, :length => {:maximum => 200}, :uniqueness => {:scope => :name}, :url => {:message => I18n.t('errors.messages.url')} #{:allow_blank => true}
validates :system_picture_id, :presence => true, :numericality => true, :existence => {:both => false}
- def supply_default
- end
-
- def overwrite
- end
-
def caption_with_group
self.license_group.caption + '/' + self.caption
end
'licenses.name'
end
- def self.list_opt
- {:license_group => {}}
- end
-
- def self.list_json_opt
- {:include => {:license_group => {}}}
- end
-
def self.show_opt
{:include => {:license_group => {}}}
end
res
end
+=begin
+ def supply_default
+ end
+
+ def overwrite
+ end
+
+ def self.list_opt
+ {:license_group => {}}
+ end
+
+ def self.list_json_opt
+ {:include => {:license_group => {}}}
+ end
+
def credit_pictures_attr
return @credit_pictures_attr if @credit_pictures_attr
begin
@credit_pictures_attr = {} unless @credit_pictures_attr
@credit_pictures_attr
end
+=end
def self.export(dt = nil)
opt = {}
def self.collect_element_value elements, name
elements.map {|e|
- e.map {|o|
- if o['_destroy'] or o[:_destroy]
- nil
- else
- o[name]
- end
- }.compact
- }.flatten
+ if e['_destroy'] or e[:_destroy]
+ nil
+ else
+ e[name]
+ end
+ }
end
def self.validate_serial ary, offset = 0
end
def validate_child
# r1 = Panel.validate_elements_id validate_id_list
- return true
Panel.validate_elements_serial validate_serial_list
end
validates :link, :length => {:maximum => 200}, :url => {:allow_blank => true, :message => I18n.t('errors.messages.url')}
validates :x, :presence => true, :numericality => true
validates :y, :presence => true, :numericality => true
- validates :width, :presence => true, :numericality => true, :not_zero => true#, :reverse => true, :resize => true, :sync_vh => true
- validates :height, :presence => true, :numericality => true, :not_zero => true#, :reverse => true, :resize => true, :sync_vh => true
+ validates :width, :presence => true, :numericality => true, :not_zero => true, :reverse => true, :sync_vh => true
+ validates :height, :presence => true, :numericality => true, :not_zero => true, :reverse => true, :sync_vh => true
validates :z, :presence => true, :numericality => {:greater_than => 0}
validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
end
def filename
- self.flip + self.picture.filename
+ self.picture.filename + '?subdir=' + self.flip
end
def url
title: コマのスクコマ一覧
by_scroll:
title: スクロールのスクコマ一覧
+ by_author:
+ title: 作家のスクコマ一覧
show:
title: スクコマ詳細
new:
title: ストーリーのスト紙一覧
by_sheet:
title: 用紙のスト紙一覧
+ by_author:
+ title: 作家のスト紙一覧
show:
title: スト紙詳細
new:
title: 用紙の紙コマ一覧
by_panel:
title: コマの紙コマ一覧
+ by_author:
+ title: 作家の紙コマ一覧
show:
title: 紙コマ詳細
new:
member do
get :by_panel
get :by_scroll
+ get :by_author
get :count_by_panel
get :count_by_scroll
+ get :count_by_author
get :edit
put :update
delete :destroy
member do
get :by_story
get :by_sheet
+ get :by_author
get :count_by_story
get :count_by_sheet
+ get :count_by_author
get :edit
put :update
delete :destroy
member do
get :by_sheet
get :by_panel
+ get :by_author
get :count_by_sheet
get :count_by_panel
+ get :count_by_author
get :edit
put :update
delete :destroy
collection do
get :index
get :show
+ get :count
get :search
end
member do
if list_manifest.has_id?
filter_item_id = @options[:id]
if list_manifest.pre_id?
- list_manifest.model.path_name + '/' + filter_item_id.to_s + '/' + list_manifest.action_name
+ '/' + list_manifest.model.path_name + '/' + filter_item_id.to_s + '/' + list_manifest.action_name
else
- list_manifest.model.path_name + '/' + list_manifest.action_name + '/' + filter_item_id.to_s
+ '/' + list_manifest.model.path_name + '/' + list_manifest.action_name + '/' + filter_item_id.to_s
end
else
- list_manifest.model.path_name + '/' + list_manifest.action_name
+ '/' + list_manifest.model.path_name + '/' + list_manifest.action_name
end
end
opt.merge!(self.show_opt)
item = self.find(item_id, opt)
item.boosts 'read'
- raise ActiveRecord::Forbidden unless item.visible?(operators)
+ raise ActiveRecord::Forbidden if item.visible?(operators) == false
item
end
self.root.own? operators
end
+ # super return if my item
def visible? operators
- return false unless super
+ return false if super == false
self.root.visible? operators
end
+++ /dev/null
-class ResizeValidator < ActiveModel::EachValidator\r
- def validate_each(record, attribute, value)\r
- if record.picture and record.picture.flag_resize < 0\r
- record.errors[attribute] << (options[:message] || I18n.t('activerecord.errors.messages.resize')) unless value == record.picture[attribute]\r
- end\r
- end\r
-end\r
-\r
class ReverseValidator < ActiveModel::EachValidator\r
def validate_each(record, attribute, value)\r
- if record.picture and record.picture.flag_reverse < 0\r
+ record.picture.boosts 'post'\r
+ if record.picture and record.picture.license_extend.reverse < 0\r
record.errors[attribute] << (options[:message] || I18n.t('activerecord.errors.messages.reverse')) if value < 0\r
end\r
end\r
class SyncVhValidator < ActiveModel::EachValidator\r
def validate_each(record, attribute, value)\r
- if record.picture and record.picture.flag_sync_vh < 0\r
+ record.picture.boosts 'post'\r
+ if record.picture and record.picture.license_extend.sync_vh < 0\r
record.errors[attribute] << (options[:message] || I18n.t('activerecord.errors.messages.sync_vh')) unless sync?(record)\r
end\r
end\r
"by_scroll": {\r
"type": "list"\r
},\r
+ "by_author": {\r
+ "type": "list"\r
+ },\r
"show": {\r
"type": "show"\r
},\r
"count_by_scroll": {\r
"type": "count"\r
},\r
+ "count_by_author": {\r
+ "type": "count"\r
+ },\r
"new": {\r
"type": "new"\r
},\r
"by_sheet": {\r
"type": "list"\r
},\r
+ "by_author": {\r
+ "type": "list"\r
+ },\r
"show": {\r
"type": "show"\r
},\r
"count_by_sheet": {\r
"type": "count"\r
},\r
+ "count_by_author": {\r
+ "type": "count"\r
+ },\r
"new": {\r
"type": "new"\r
},\r
"by_panel": {\r
"type": "list"\r
},\r
+ "by_author": {\r
+ "type": "list"\r
+ },\r
"show": {\r
"type": "show"\r
},\r
"count_by_panel": {\r
"type": "count"\r
},\r
+ "count_by_author": {\r
+ "type": "count"\r
+ },\r
"new": {\r
"type": "new"\r
},\r
speech['speech_balloon_template_id'] = dsb['id']\r
speech["speech_balloon_template_classname"] = dsb["classname"]\r
speech['writing_format_id'] = dwf['id']\r
- speech["writing_format_classname"] = 'Pettanr' + dwf["classname"]\r
- # speech["writing_format_classname"] = dwf["classname"]\r
+ # speech["writing_format_classname"] = 'Pettanr' + dwf["classname"]\r
+ speech["writing_format_classname"] = dwf["classname"]\r
\r
e['balloon_attributes'] = balloon\r
e['speech_attributes'] = speech\r