type: 'hidden',\r
},\r
},\r
+ original_picture_id: {\r
+ label: {\r
+ type: 'none',\r
+ },\r
+ tag: {\r
+ type: 'hidden',\r
+ },\r
+ },\r
+ license_group_id: {\r
+ tag: {\r
+ type: 'select',\r
+ },\r
+ },\r
+ },\r
+ field_names: [\r
+ 'id',\r
+ 'original_picture_id',\r
+ 'license_group_id',\r
+ ]\r
+ },\r
+ original_picture_license: {\r
+ fields: {\r
+ id: {\r
+ label: {\r
+ type: 'none',\r
+ },\r
+ tag: {\r
+ type: 'hidden',\r
+ },\r
+ },\r
+ original_picture_id: {\r
+ label: {\r
+ type: 'none',\r
+ },\r
+ tag: {\r
+ type: 'hidden',\r
+ },\r
+ },\r
license_group_id: {\r
+ label: {\r
+ type: 'none',\r
+ },\r
+ tag: {\r
+ type: 'hidden',\r
+ },\r
+ },\r
+ license_id: {\r
tag: {\r
type: 'select',\r
},\r
},\r
+ license_settings: {\r
+ # boost_name: 'license_group',\r
+ row_break: true,\r
+ },\r
+ license_group_module_name: {\r
+ label: {\r
+ type: 'none',\r
+ },\r
+ tag: {\r
+ type: 'hidden',\r
+ },\r
+ },\r
},\r
field_names: [\r
'id',\r
'original_picture_id',\r
'license_group_id',\r
+ 'license_id',\r
+ 'license_settings',\r
+ 'license_group_module_name',\r
]\r
},\r
speech_balloon_template: {\r
'overlap', \r
],\r
},\r
+ pettanr_creative_commons_v30_licenses_attribute: {\r
+ fields: {\r
+ artist_name: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ caption: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ artist_url: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ source_url: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ more_permission_url: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ },\r
+ field_names: [\r
+ 'artist_name', \r
+ 'caption', \r
+ 'artist_url', \r
+ 'source_url', \r
+ 'more_permission_url', \r
+ ],\r
+ },\r
pettanr_creative_commons_v30_licenses_credit_picture: {\r
fields: {\r
source_url_btn_id: {\r
'overlap', \r
],\r
},\r
+ pettanr_pettan_commons_v01_licenses_attribute: {\r
+ fields: {\r
+ artist_name: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ caption: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ sources: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ },\r
+ field_names: [\r
+ 'artist_name', \r
+ 'caption', \r
+ 'sources', \r
+ ],\r
+ },\r
pettanr_pettan_commons_v01_licenses_credit_picture: {\r
fields: {\r
source_url_btn_id: {\r
'trackback', \r
],\r
},\r
+ pettanr_pettan_protected_v01_licenses_attribute: {\r
+ fields: {\r
+ artist_name: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ caption: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ sources: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ },\r
+ field_names: [\r
+ 'artist_name', \r
+ 'caption', \r
+ 'sources', \r
+ ],\r
+ },\r
pettanr_pettan_protected_v01_licenses_credit_picture: {\r
fields: {\r
source_url_btn_id: {\r
'trackback', \r
],\r
},\r
+ pettanr_pettan_public_v01_licenses_attribute: {\r
+ fields: {\r
+ artist_name: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ caption: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ sources: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ },\r
+ field_names: [\r
+ 'artist_name', \r
+ 'caption', \r
+ 'sources', \r
+ ],\r
+ },\r
pettanr_pettan_public_v01_licenses_credit_picture: {\r
fields: {\r
source_url_btn_id: {\r
'trackback', \r
],\r
},\r
+ pettanr_public_domain_v01_licenses_attribute: {\r
+ fields: {\r
+ artist_name: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ source_url: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ note: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ },\r
+ field_names: [\r
+ 'artist_name', \r
+ 'source_url', \r
+ 'note', \r
+ ],\r
+ },\r
pettanr_public_domain_v01_licenses_credit_picture: {\r
fields: {\r
source_url_btn_id: {\r
'trackback', \r
],\r
},\r
+ pettanr_unknown_v01_licenses_attribute: {\r
+ fields: {\r
+ source_url: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ note: {\r
+ tag: {\r
+ type: 'text',\r
+ },\r
+ row_break: true,\r
+ },\r
+ },\r
+ field_names: [\r
+ 'source_url', \r
+ 'note', \r
+ ],\r
+ },\r
pettanr_unknown_v01_licenses_credit_picture: {\r
fields: {\r
source_url_btn_id: {\r
},\r
},\r
},\r
+ original_picture_license_group: {\r
+ },\r
original_picture_license: {\r
args: {\r
boost: {\r
# expand license_group_settings\r
- license_group: {\r
+ license: {\r
+ template_name: 'license_group',\r
extend_model_class_name: 'Attribute',\r
item_name_for_extend_model: 'attribute',\r
},\r
- credit_picture: {\r
- template_name: 'license_group',\r
- extend_model_class_name: 'CreditPicture',\r
- item_name_for_extend_model: 'credit_picture',\r
- },\r
},\r
},\r
},\r
}, \r
artist: {\r
}, \r
+ system_picture: {\r
+ }, \r
},\r
has_many: {\r
},\r
required: true,\r
}\r
},\r
- artist_name: {\r
- type: 'text',\r
+ system_picture_id: {\r
+ type: 'number',\r
rules : {\r
required: true,\r
+ number: true,\r
}\r
},\r
license_group_settings: {\r
}, \r
artist: {\r
}, \r
+ system_picture: {\r
+ }, \r
},\r
has_many: {\r
},\r
required: true,\r
}\r
},\r
- artist_name: {\r
- type: 'text',\r
+ system_picture_id: {\r
+ type: 'number',\r
+ rules : {\r
+ required: true,\r
+ number: true,\r
+ }\r
+ },\r
+ license_group_id: {\r
+ type: 'number',\r
rules : {\r
required: true,\r
+ number: true,\r
}\r
},\r
license_group_settings: {\r
},\r
},\r
},\r
+ original_picture_license: {\r
+ associations: {\r
+ belongs_to: {\r
+ original_picture: {\r
+ }, \r
+ license: {\r
+ }, \r
+ system_picture: {\r
+ }, \r
+ },\r
+ has_many: {\r
+ },\r
+ has_one: {\r
+ },\r
+ },\r
+ attributes: {\r
+ original_picture_id: {\r
+ type: 'number',\r
+ rules : {\r
+ required: true,\r
+ number: true,\r
+ }\r
+ },\r
+ license_group_id: {\r
+ type: 'number',\r
+ source: {\r
+ type: 'model',\r
+ },\r
+ rules : {\r
+ required: true,\r
+ number: true,\r
+ }\r
+ },\r
+ license_id: {\r
+ type: 'number',\r
+ source: {\r
+ type: 'filter',\r
+ args: {\r
+ resource_list_name: 'by_license_group',\r
+ filter_column_name: 'license_group_id',\r
+ },\r
+ },\r
+ rules : {\r
+ required: true,\r
+ number: true,\r
+ }\r
+ },\r
+ license_settings: {\r
+ type: 'text',\r
+ rules : {\r
+ }\r
+ },\r
+ license_group_module_name: {\r
+ type: 'text',\r
+ rules : {\r
+ required: true,\r
+ }\r
+ },\r
+ },\r
+ },\r
speech_balloon_template: {\r
associations: {\r
belongs_to: {\r
},\r
pettanr_creative_commons_v30_licenses_attribute: {\r
attributes: {\r
- license_id: {\r
- type: 'number',\r
- rules : {\r
- required: true,\r
- number: true,\r
- }\r
- },\r
artist_name: {\r
type: 'text',\r
rules : {\r
},\r
pettanr_pettan_commons_v01_licenses_attribute: {\r
attributes: {\r
- license_id: {\r
- type: 'number',\r
- rules : {\r
- required: true,\r
- number: true,\r
- }\r
- },\r
artist_name: {\r
type: 'text',\r
rules : {\r
},\r
pettanr_pettan_protected_v01_licenses_attribute: {\r
attributes: {\r
- license_id: {\r
- type: 'number',\r
- rules : {\r
- required: true,\r
- number: true,\r
- }\r
- },\r
artist_name: {\r
type: 'text',\r
rules : {\r
},\r
pettanr_pettan_public_v01_licenses_attribute: {\r
attributes: {\r
- license_id: {\r
- type: 'number',\r
- rules : {\r
- required: true,\r
- number: true,\r
- }\r
- },\r
artist_name: {\r
type: 'text',\r
rules : {\r
},\r
pettanr_public_domain_v01_licenses_attribute: {\r
attributes: {\r
- license_id: {\r
- type: 'number',\r
- rules : {\r
- required: true,\r
- number: true,\r
- }\r
- },\r
artist_name: {\r
type: 'text',\r
rules : {\r
},\r
pettanr_unknown_v01_licenses_attribute: {\r
attributes: {\r
- license_id: {\r
- type: 'number',\r
- rules : {\r
- required: true,\r
- number: true,\r
- }\r
- },\r
- system_picture_id: {\r
- type: 'number',\r
- rules : {\r
- required: true,\r
- number: true,\r
- }\r
- },\r
source_url: {\r
type: 'text',\r
rules : {\r
'artist_id', \r
'license_id', \r
'md5', \r
- 'artist_name', \r
+ 'system_picture_id', \r
'license_group_settings', \r
'credit_picture_settings', \r
'license_settings', \r
'height', \r
'filesize', \r
'artist_id', \r
+ 'license_group_id', \r
'license_id', \r
'md5', \r
- 'artist_name', \r
+ 'system_picture_id', \r
'license_group_settings', \r
'credit_picture_settings', \r
'license_settings', \r
def new
@original_picture = OriginalPicture.show params[:original_picture_id], @operators
- @original_picture_license_group = OriginalPictureLicenseGroup.new()
- @original_picture_license_group.supply_default @original_picture.id
-
+ @item = OriginalPictureLicenseGroup.new()
+ @item.supply_default @original_picture.id
+
respond_to do |format|
- format.html
- format.js
+ format.html {
+ @form = Locmare::Bucket.factory @item.item_name, @item, true, true, @operators
+ }
+ format.json { render json: @item.to_json }
end
end
-
+
def create
- @original_picture = OriginalPicture.show params[:original_picture_id], @operators
- @original_picture_license_group = OriginalPictureLicenseGroup.new params[:original_picture_license_group]
- @license_group = LicenseGroup.show @original_picture_license_group.license_group_id, @operators
- @ctl = @license_group.template_path_name
- @attr = @license_group.template_module.new_attribute {}
- @attr.supply_default @operators
+ @my_model_class = OriginalPictureLicenseGroup
- respond_to do |format|
- if @original_picture_license_group.valid?
- format.html { render :template => "#{@ctl}/attributes/new" }
- format.js { render :template => "#{@ctl}/attributes/new" }
- else
- format.html { render action: "new" }
- format.js { render action: "new" }
+ @item = @my_model_class.new
+ @my_model_class.fold_extend_settings params[@my_model_class.item_name]
+ @item.attributes = params[@my_model_class.item_name]
+ @item.overwrite
+ @original_picture = OriginalPicture.show @item.original_picture, @operators
+
+ if @item.valid?
+ # switch my_model_class
+ @item = OriginalPictureLicenseGroup.build_original_picture_license @item, nil, @operators
+ respond_to do |format|
+ format.html {
+ @form = Locmare::Bucket.factory @item.item_name, @item, true, true, @operators
+ render :template => @item.path_name + '/new'
+ }
+ format.json {
+ render json: @item.to_json(), status: :created, location: @item
+ }
+ end
+ else
+ respond_to do |format|
+ format.html {
+ @form = Locmare::Bucket.factory @item.item_name, @item, true, true, @operators
+ render action: "new"
+ }
+ format.json {
+ render json: @item.errors, status: :unprocessable_entity
+ }
end
end
end
--- /dev/null
+class OriginalPictureLicensesController < ApplicationController
+ before_filter :authenticate_user, :only => [:new, :create]
+ before_filter :authenticate_artist, :only => [:new, :create]
+
+ def new
+ # use @item, @original_picture, @form
+
+ respond_to do |format|
+ format.html
+ end
+ end
+
+ def create
+ @my_model_class = OriginalPictureLicense
+
+ @item = @my_model_class.new
+ @my_model_class.fold_extend_settings params[@my_model_class.item_name]
+ @item.attributes = params[@my_model_class.item_name]
+ @item.overwrite
+ @item.boosts 'post'
+ @original_picture = OriginalPicture.show @item.original_picture, @operators
+
+ if @item.valid?
+ # switch my_model_class
+ @item = OriginalPictureLicense.build_resource_picture @item, @original_picture, params[@my_model_class.item_name]
+ respond_to do |format|
+ format.html {
+ render main_app.new_resource_picture_path
+ }
+ format.json { render json: @item.to_json, status: :created }
+ end
+ else
+ respond_to do |format|
+ format.html {
+ @form = Locmare::Bucket.factory @item.item_name, @item, true, true, @operators
+ render action: "new"
+ }
+ format.json {
+ render json: @item.errors, status: :unprocessable_entity
+ }
+ end
+ end
+ end
+end
format.jpeg { send_data(@item.restore(params[:subdir]), opt ) }
show_html_format format
show_json_format format
+ show_prof_format format
end
end
end
def new
- @original_picture = OriginalPicture.edit params[:original_picture_id], @operators
- @imager = PettanImager.load @original_picture.restore
- @original_picture_license_group = OriginalPictureLicenseGroup.new params[:original_picture_license_group]
- @license_group = LicenseGroup.show @original_picture_license_group.license_group_id
- @resource_picture = @original_picture.resource_picture
- unless @resource_picture
- @resource_picture = ResourcePicture.new
- @resource_picture.supply_default
- end
- @resource_picture.attributes = params[:resource_picture]
- @resource_picture.overwrite @original_picture
- @license = @resource_picture.license
-
+ # use @item, @original_picture
respond_to do |format|
- format.html # new.html.erb
- format.js
+ format.html
end
end
def create
@original_picture = OriginalPicture.edit params[:original_picture_id], @operators
@imager = PettanImager.load @original_picture.restore
- @original_picture_license_group = OriginalPictureLicenseGroup.new params[:original_picture_license_group]
- @license_group = LicenseGroup.show @original_picture_license_group.license_group_id, @operators
- @resource_picture = @original_picture.resource_picture
- unless @resource_picture
- @resource_picture = ResourcePicture.new
- @resource_picture.supply_default
+ jsn = nil
+ if params[:json]
+ jsn = JSON.parse_no_except(params[:json])
end
- @resource_picture.attributes = params[:resource_picture]
- @resource_picture.overwrite @original_picture
- @resource_picture.boosts 'post'
- @license = @resource_picture.license
-
+ @prm = if params[:resource_picture] == nil or params[:resource_picture].empty?
+ jsn
+ else
+ params[:resource_picture]
+ end
+ @item = @original_picture.resource_picture || ResourcePicture.new
+ @item.attributes = @prm
+ @item.overwrite @original_picture
+ @item.boosts 'post'
+
respond_to do |format|
- if @resource_picture.store(@imager)
- format.html { redirect_to @resource_picture }
- format.json { render json: @resource_picture.to_json(ResourcePicture.show_json_opt), status: :created, location: @resource_picture }
+ if @item.store(@imager)
+ format.html { redirect_to @item }
+ format.json { render json: @item.to_json, status: :created, location: @item }
else
format.html { render action: "new" }
- format.json { render json: @resource_picture.errors, status: :unprocessable_entity }
+ format.json { render json: @item.errors, status: :unprocessable_entity }
end
end
end
--- /dev/null
+module OriginalPictureLicensesHelper
+end
validates :caption, :presence => true, :length => {:maximum => 30}
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}
+ validates :license_group_settings, :boost => {:boost_name => :license_group}
+ validates :credit_picture_settings, :boost => {:boost_name => :credit_picture}
def overwrite
end
--- /dev/null
+class OriginalPictureLicense < Peta::Item
+ load_manifest
+ belongs_to :original_picture
+ belongs_to :license_group
+ belongs_to :license
+
+ validates :original_picture_id, :presence => true, :numericality => true, :existence => {:both => false}
+ validates :license_group_id, :presence => true, :numericality => true, :existence => {:both => false}
+ validates :license_id, :presence => true, :numericality => true, :existence => {:both => false}
+ validates :license_group_module_name, :presence => true, :length => {:maximum => 50}
+ validates :license_settings, :boost => {:boost_name => :license}
+
+ def supply_default oid
+ self.original_picture_id = oid
+ self.license_group_id = nil
+ self.license_id = nil
+ end
+
+ def self.build_resource_picture opl, original_picture, params
+ my_model_class = ResourcePicture
+
+ attr = params.merge(
+ :license_group_id => opl.license_group_id,
+ :system_picture_id => opl.license.system_picture_id,
+ :license_group_module_name => opl.license_group.module_name,
+ :license_group_settings => opl.license.license_group_settings,
+ :credit_picture_settings => opl.license.credit_picture_settings
+ )
+ resource_picture = my_model_class.new
+ resource_picture.attributes = attr
+ resource_picture.overwrite original_picture
+ resource_picture.boosts 'post'
+ resource_picture
+ end
+
+end
class OriginalPictureLicenseGroup < Peta::Item
+ load_manifest
belongs_to :original_picture
belongs_to :license_group
def supply_default oid
self.original_picture_id = oid
+ self.license_group_id = nil
+ end
+
+ def self.build_original_picture_license oplg, license_id, operators
+ my_model_class = OriginalPictureLicense
+
+ original_picture = OriginalPicture.show oplg.original_picture_id, operators
+ license_group = LicenseGroup.show oplg.license_group_id
+ attr = {
+ :original_picture_id => original_picture.id,
+ :license_group_id => license_group.id,
+ :license_id => license_id,
+ :license_group_module_name => license_group.module_name
+ }
+ opl = my_model_class.new
+ opl.attributes = attr
+ opl.boosts 'post'
+ # rare case of supply_default
+ # Attribute need artist name by @operators
+ opl.boosters.each do |boost_name, booster|
+ booster.extend_item.supply_default operators
+ end
+ opl
end
end
validates :license_id, :presence => true, :numericality => true, :existence => {:both => false}
validates :system_picture_id, :presence => true, :numericality => true, :existence => {:both => false}
validates :artist_id, :presence => true, :numericality => true, :existence => {:both => false}
- validates :artist_name, :presence => true
validates :license_group_module_name, :presence => true, :length => {:maximum => 50}
def supply_default
attr = {:width => rp.width, :height => rp.height, :ext => rp.ext, :filesize => rp.filesize,
:original_picture_id => rp.original_picture_id, :license_id => rp.license_id,
:system_picture_id => rp.system_picture_id, :artist_id => rp.artist_id,
- :md5 => rp.md5, :artist_name => rp.artist_name,
+ :md5 => rp.md5,
:license_group_module_name => rp.license_group_module_name,
:license_group_settings => rp.license_group_settings,
:credit_picture_settings => rp.credit_picture_settings,
validates :license_id, :presence => true, :numericality => true, :existence => {:both => false}
validates :system_picture_id, :presence => true, :numericality => true, :existence => {:both => false}
validates :original_picture_id, :presence => true, :numericality => true, :existence => {:both => false}
- validates :artist_name, :presence => true
validates :license_group_module_name, :presence => true, :length => {:maximum => 50}
validates :picture_id, :presence => true, :numericality => true, :existence => {:both => false}
+ validates :license_settings, :boost => {:boost_name => :license}
+ validates :license_group_settings, :boost => {:boost_name => :license_group}
+ validates :credit_picture_settings, :boost => {:boost_name => :credit_picture}
def supply_default
end
def overwrite op
attr = {:width => op.width, :height => op.height, :ext => op.ext, :filesize => op.filesize,
- :original_picture_id => op.id, :artist_id => op.artist_id, :md5 => op.md5
+ :original_picture_id => op.id, :artist_id => op.artist_id, :md5 => op.md5,
+ :created_at => Time.now, :updated_at => Time.now
}
self.attributes = attr
end
+++ /dev/null
-<%= form_for(@original_picture_license_group) do |f| %>
- <%= render 'system/error_explanation', :obj => @original_picture_license_group %>
-
- <div class="field">
- <%= f.label :license_group_id %><br />
- <%= f.collection_select :license_group_id, LicenseGroup.enable_list().map {|l| [l.caption, l.id] }, :last, :first %>
- <%= f.hidden_field :original_picture_id %>
- </div>
- <%= hidden_field_tag :original_picture_id, @original_picture.id %>
-
- <div class="actions">
- <%= f.submit %>
- </div>
-<% end %>
+++ /dev/null
-<%= form_for(@original_picture_license_group) do |f| %>
- <%= render 'system/error_explanation', :obj => @original_picture_license_group %>
-
- <table class="no-border">
- <tr>
- <td><%= t_m 'OriginalPictureLicenseGroup.license_group_id' -%></td>
- <td><%= f.collection_select :license_group_id, LicenseGroup.enable_list().map {|l| [l.caption, l.id] }, :last, :first %></td>
- <td><%= t 'original_picture_license_groups.new.no_blank' %></td>
- </tr>
- </table>
- <%= f.hidden_field :original_picture_id %>
- <%= hidden_field_tag :original_picture_id, @original_picture.id %>
-
- <div class="actions">
- <%= f.submit t 'original_picture_license_groups.new.next' %>
- </div>
-<% end %>
<h1><%= t '.title' -%></h1>
<img src="<%= @original_picture.url -%>">
-<%= render 'form' %>
+<%= render @form.template_name, :form => @form %>
+++ /dev/null
-$("#oplg").html("<%= escape_javascript(render('form')) -%>");
--- /dev/null
+<h1><%= t('pettanr_pettan_commons_v01_licenses.title') %></h1>
+<% @page_title = t('pettanr_pettan_commons_v01_licenses.title') %>
+<%= tag(:img, @original_picture.opt_img_tag) -%>
+<%= render @form.template_name, :form => @form %>
<div>
- <%= link_to h(truncate(item.artist.name, :length => 12)), artist_path(item.artist) %>
+ <%# link_to h(truncate(item.artist.name, :length => 12)), artist_path(item.artist) %>
<%= render item.credit_template, :picture => item %>
</div>
<div>
<%= t_m 'Picture.md5' -%>:<%= picture.md5 %>
</div>
- <div>
- <%= t_m 'Picture.artist_id' -%>:<%= link_to h(picture.artist.name), artist_path(picture.artist) %>
- </div>
- <div>
- <%= t_m 'Picture.license_id' -%>:<%= link_to h(picture.license.caption), license_path(picture.license) %>
- </div>
- <div>
- <%= t_m 'Picture.artist_name' -%>:<%= h picture.artist_name %>
- </div>
</td>
</tr>
</table>
<img src="<%= @original_picture.url -%>">
-<%= form_for(@resource_picture, :url => '/resource_pictures', :method => :post) do |f| %>
+<%= form_for(@item, :url => '/resource_pictures', :method => :post) do |f| %>
<%= hidden_field_tag :original_picture_id, @original_picture.id %>
+ <%= hidden_field_tag :json, @item.to_json %>
- <%= hidden_field_tag 'original_picture_license_group[original_picture_id]', @original_picture_license_group.original_picture_id %>
- <%= hidden_field_tag 'original_picture_license_group[license_group_id]', @original_picture_license_group.license_group_id %>
-
- <%= f.hidden_field :original_picture_id %>
- <%= f.hidden_field :license_id %>
- <%= f.hidden_field :system_picture_id %>
- <%= f.hidden_field :artist_name %>
- <%= f.hidden_field :license_group_module_name %>
- <%= f.hidden_field :license_group_settings %>
- <%= f.hidden_field :credit_picture_settings %>
- <%= f.hidden_field :license_settings %>
-
- <%= render :partial => @resource_picture.license_group_module_name.tableize + '/attributes/confirm' %>
+ <div>
+ <h2><%= t('credit.full') -%></h2>
+ <%= render @item.full_credit_template, :picture => @item %>
+ </div>
+ <div>
+ <h2><%= t('credit.digest') -%></h2>
+ <%= render @item.credit_template, :picture => @item %>
+ </div>
<div class="actions">
<%= f.submit t 'resource_pictures.new.publish' %>
<div>
- <%= link_to h(truncate(item.artist.name, :length => 12)), artist_path(item.artist) %>
+ <%# link_to icon_tag('Artist'), artist_path(item.artist) %>
<%= render item.credit_template, :picture => item %>
</div>
<p>
<%= link_to t('original_pictures.show.replace'), edit_original_picture_path(@item.original_picture) %>
+ <%= link_to t('show'), original_picture_path(@item.original_picture) %>
<%= link_to t('original_pictures.index.stop'), resource_picture_path(@item), :method => :delete %>
</p>
<% end -%>
-<%= select_tag tag.form_field_name, options_for_select(t_select_items(tag.items), :selected => tag.value.to_s), tag.options %>
+<%= select_tag tag.form_field_name,
+ options_for_select(tag.source_by_model? ? tag.items : t_select_items(tag.items), :selected => tag.value.to_s),
+ tag.options
+%>
original_picture: 原画
picture: 実素材
resource_picture: 素材
+ original_picture_license_group: ライセンスグループ選択
+ original_picture_license: ライセンス選択
speech_balloon_template: フキダシテンプレート
writing_format: 記法
license_group: ライセンスグループ
md5: MD5
artist_id: 絵師
license_id: ライセンス
+ system_picture_id: ライセンスマーク
artist_name: 著作者名
license_group_settings: ライセンスフラグ
credit_picture_settings: クレジット拡張データ
filesize: ファイルサイズ
md5: MD5
artist_id: 絵師
+ license_group_id: ライセンス
license_id: ライセンス
+ system_picture_id: ライセンスマーク
artist_name: 著作者名
license_group_settings: ライセンスフラグ
credit_picture_settings: クレジット拡張データ
license_group_id: ライセンスグループ
created_at: 作成
updated_at: 更新
+ original_picture_license:
+ original_picture_id: 原画
+ license_group_id: ライセンスグループ
+ license_id: ライセンス
+ license_settings: ライセンス拡張データ
+ license_group_module_name: ライセンスモジュール名
+ created_at: 作成
+ updated_at: 更新
speech_balloon_template:
name: 管理名
module_name: モジュール名
provider_original_picture:
created_at: 作成
updated_at: 更新
+ pettanr_creative_commons_v30_licenses_license:
+ open: クローズドな利用
+ commercial: 商用利用
+ official: 公式ライセンス
+ attribution: クレジットの表示
+ derive: 改変
+ thumbnail: サムネイルの作成
+ gif_convert: GIFフォーマットへの変換
+ reverse: 反転
+ sync_vh: 縦横比の改変
+ overlap: 重ね合わせ
+ pettanr_creative_commons_v30_licenses_credit_picture:
+ source_url_btn_id: URLボタン
+ source_url_off_btn_id: URLはないボタン
+ pettanr_creative_commons_v30_licenses_attribute:
+ artist_name: 著作者名
+ caption: 作品の名前
+ artist_url: 作者のホームページURL
+ source_url: 参考にした画像のURL
+ more_permission_url: 追加的許諾のURL
+ pettanr_pettan_commons_v01_licenses_license:
+ open: クローズドな利用
+ commercial: 商用利用
+ official: 公式ライセンス
+ attribution: クレジットの表示
+ derive: 改変
+ thumbnail: サムネイルの作成
+ gif_convert: GIFフォーマットへの変換
+ reverse: 反転
+ sync_vh: 縦横比の改変
+ overlap: 重ね合わせ
+ pettanr_pettan_commons_v01_licenses_credit_picture:
+ source_url_btn_id: URLボタン
+ source_url_off_btn_id: URLはないボタン
+ pettanr_pettan_commons_v01_licenses_attribute:
+ artist_name: 著作者名
+ caption: 作品の名前
+ sources: 参考にした画像のURL
+ pettanr_pettan_protected_v01_licenses_license:
+ open: クローズドな利用
+ commercial: 商用利用
+ official: 公式ライセンス
+ attribution: クレジットの表示
+ derive: 改変
+ thumbnail: サムネイルの作成
+ gif_convert: GIFフォーマットへの変換
+ reverse: 反転
+ sync_vh: 縦横比の改変
+ overlap: 重ね合わせ
+ trackback: トラックバック
+ pettanr_pettan_protected_v01_licenses_credit_picture:
+ source_url_btn_id: URLボタン
+ source_url_off_btn_id: URLはないボタン
+ pettanr_pettan_protected_v01_licenses_attribute:
+ artist_name: 著作者名
+ caption: 作品の名前
+ sources: 参考にした画像のURL
+ pettanr_pettan_public_v01_licenses_license:
+ open: クローズドな利用
+ commercial: 商用利用
+ official: 公式ライセンス
+ attribution: クレジットの表示
+ derive: 改変
+ thumbnail: サムネイルの作成
+ gif_convert: GIFフォーマットへの変換
+ reverse: 反転
+ sync_vh: 縦横比の改変
+ overlap: 重ね合わせ
+ trackback: トラックバック
+ pettanr_pettan_public_v01_licenses_credit_picture:
+ source_url_btn_id: URLボタン
+ pettanr_pettan_public_v01_licenses_attribute:
+ artist_name: 著作者名
+ caption: 作品の名前
+ sources: 参考にした画像のURL
+ pettanr_public_domain_v01_licenses_license:
+ open: クローズドな利用
+ commercial: 商用利用
+ official: 公式ライセンス
+ attribution: クレジットの表示
+ derive: 改変
+ thumbnail: サムネイルの作成
+ gif_convert: GIFフォーマットへの変換
+ reverse: 反転
+ sync_vh: 縦横比の改変
+ overlap: 重ね合わせ
+ trackback: トラックバック
+ pettanr_public_domain_v01_licenses_credit_picture:
+ source_url_btn_id: URLボタン
+ source_url_off_btn_id: URLはないボタン
+ pettanr_public_domain_v01_licenses_attribute:
+ artist_name: 著作者名
+ caption: 作品の名前
+ source_url: 参考にした画像のURL
+ note: 備考
+ pettanr_unknown_v01_licenses_license:
+ open: クローズドな利用
+ commercial: 商用利用
+ official: 公式ライセンス
+ attribution: クレジットの表示
+ derive: 改変
+ thumbnail: サムネイルの作成
+ gif_convert: GIFフォーマットへの変換
+ reverse: 反転
+ sync_vh: 縦横比の改変
+ overlap: 重ね合わせ
+ trackback: トラックバック
+ pettanr_unknown_v01_licenses_credit_picture:
+ source_url_btn_id: URLボタン
+ source_url_off_btn_id: URLはないボタン
+ pettanr_unknown_v01_licenses_attribute:
+ source_url: 参考にした画像のURL
+ note: 備考
pettanr_creative_commons_v30_licenses/license:
- open: クローズドな利用
- commercial: 商用利用
- official: 公式ライセンス
- attribution: クレジットの表示
- derive: 改変
- thumbnail: サムネイルの作成
- gif_convert: GIFフォーマットへの変換
- reverse: 反転
- sync_vh: 縦横比の改変
- overlap: 重ね合わせ
+ open: クローズドな利用
+ commercial: 商用利用
+ official: 公式ライセンス
+ attribution: クレジットの表示
+ derive: 改変
+ thumbnail: サムネイルの作成
+ gif_convert: GIFフォーマットへの変換
+ reverse: 反転
+ sync_vh: 縦横比の改変
+ overlap: 重ね合わせ
pettanr_creative_commons_v30_licenses/credit_picture:
- source_url_btn_id: URLボタン
- source_url_off_btn_id: URLはないボタン
+ source_url_btn_id: URLボタン
+ source_url_off_btn_id: URLはないボタン
pettanr_creative_commons_v30_licenses/attribute:
- license_id: ライセンスID
- system_picture_id: マーク画像ID
- artist_name: 著作者名
- caption: 作品の名前
- artist_url: 作者のホームページURL
- source_url: 参考にした画像のURL
- more_permission_url: 追加的許諾のURL
+ artist_name: 著作者名
+ caption: 作品の名前
+ artist_url: 作者のホームページURL
+ source_url: 参考にした画像のURL
+ more_permission_url: 追加的許諾のURL
pettanr_pettan_commons_v01_licenses/license:
- open: クローズドな利用
- commercial: 商用利用
- official: 公式ライセンス
- attribution: クレジットの表示
- derive: 改変
- thumbnail: サムネイルの作成
- gif_convert: GIFフォーマットへの変換
- reverse: 反転
- sync_vh: 縦横比の改変
- overlap: 重ね合わせ
+ open: クローズドな利用
+ commercial: 商用利用
+ official: 公式ライセンス
+ attribution: クレジットの表示
+ derive: 改変
+ thumbnail: サムネイルの作成
+ gif_convert: GIFフォーマットへの変換
+ reverse: 反転
+ sync_vh: 縦横比の改変
+ overlap: 重ね合わせ
pettanr_pettan_commons_v01_licenses/credit_picture:
- source_url_btn_id: URLボタン
- source_url_off_btn_id: URLはないボタン
+ source_url_btn_id: URLボタン
+ source_url_off_btn_id: URLはないボタン
pettanr_pettan_commons_v01_licenses/attribute:
- license_id: ライセンスID
- system_picture_id: マーク画像ID
- artist_name: 著作者名
- caption: 作品の名前
- sources: 参考にした画像のURL
+ artist_name: 著作者名
+ caption: 作品の名前
+ sources: 参考にした画像のURL
pettanr_pettan_protected_v01_licenses/license:
- open: クローズドな利用
- commercial: 商用利用
- official: 公式ライセンス
- attribution: クレジットの表示
- derive: 改変
- thumbnail: サムネイルの作成
- gif_convert: GIFフォーマットへの変換
- reverse: 反転
- sync_vh: 縦横比の改変
- overlap: 重ね合わせ
- trackback: トラックバック
+ open: クローズドな利用
+ commercial: 商用利用
+ official: 公式ライセンス
+ attribution: クレジットの表示
+ derive: 改変
+ thumbnail: サムネイルの作成
+ gif_convert: GIFフォーマットへの変換
+ reverse: 反転
+ sync_vh: 縦横比の改変
+ overlap: 重ね合わせ
+ trackback: トラックバック
pettanr_pettan_protected_v01_licenses/credit_picture:
- source_url_btn_id: URLボタン
- source_url_off_btn_id: URLはないボタン
+ source_url_btn_id: URLボタン
+ source_url_off_btn_id: URLはないボタン
pettanr_pettan_protected_v01_licenses/attribute:
- license_id: ライセンスID
- system_picture_id: マーク画像ID
- artist_name: 著作者名
- caption: 作品の名前
- sources: 参考にした画像のURL
+ artist_name: 著作者名
+ caption: 作品の名前
+ sources: 参考にした画像のURL
pettanr_pettan_public_v01_licenses/license:
- open: クローズドな利用
- commercial: 商用利用
- official: 公式ライセンス
- attribution: クレジットの表示
- derive: 改変
- thumbnail: サムネイルの作成
- gif_convert: GIFフォーマットへの変換
- reverse: 反転
- sync_vh: 縦横比の改変
- overlap: 重ね合わせ
- trackback: トラックバック
+ open: クローズドな利用
+ commercial: 商用利用
+ official: 公式ライセンス
+ attribution: クレジットの表示
+ derive: 改変
+ thumbnail: サムネイルの作成
+ gif_convert: GIFフォーマットへの変換
+ reverse: 反転
+ sync_vh: 縦横比の改変
+ overlap: 重ね合わせ
+ trackback: トラックバック
pettanr_pettan_public_v01_licenses/credit_picture:
- source_url_btn_id: URLボタン
+ source_url_btn_id: URLボタン
pettanr_pettan_public_v01_licenses/attribute:
- license_id: ライセンスID
- system_picture_id: マーク画像ID
- artist_name: 著作者名
- caption: 作品の名前
- sources: 参考にした画像のURL
+ artist_name: 著作者名
+ caption: 作品の名前
+ sources: 参考にした画像のURL
pettanr_public_domain_v01_licenses/license:
- open: クローズドな利用
- commercial: 商用利用
- official: 公式ライセンス
- attribution: クレジットの表示
- derive: 改変
- thumbnail: サムネイルの作成
- gif_convert: GIFフォーマットへの変換
- reverse: 反転
- sync_vh: 縦横比の改変
- overlap: 重ね合わせ
- trackback: トラックバック
+ open: クローズドな利用
+ commercial: 商用利用
+ official: 公式ライセンス
+ attribution: クレジットの表示
+ derive: 改変
+ thumbnail: サムネイルの作成
+ gif_convert: GIFフォーマットへの変換
+ reverse: 反転
+ sync_vh: 縦横比の改変
+ overlap: 重ね合わせ
+ trackback: トラックバック
pettanr_public_domain_v01_licenses/credit_picture:
- source_url_btn_id: URLボタン
- source_url_off_btn_id: URLはないボタン
+ source_url_btn_id: URLボタン
+ source_url_off_btn_id: URLはないボタン
pettanr_public_domain_v01_licenses/attribute:
- license_id: ライセンスID
- system_picture_id: マーク画像ID
- artist_name: 著作者名
- caption: 作品の名前
- source_url: 参考にした画像のURL
- note: 備考
+ artist_name: 著作者名
+ caption: 作品の名前
+ source_url: 参考にした画像のURL
+ note: 備考
pettanr_unknown_v01_licenses/license:
- open: クローズドな利用
- commercial: 商用利用
- official: 公式ライセンス
- attribution: クレジットの表示
- derive: 改変
- thumbnail: サムネイルの作成
- gif_convert: GIFフォーマットへの変換
- reverse: 反転
- sync_vh: 縦横比の改変
- overlap: 重ね合わせ
- trackback: トラックバック
+ open: クローズドな利用
+ commercial: 商用利用
+ official: 公式ライセンス
+ attribution: クレジットの表示
+ derive: 改変
+ thumbnail: サムネイルの作成
+ gif_convert: GIFフォーマットへの変換
+ reverse: 反転
+ sync_vh: 縦横比の改変
+ overlap: 重ね合わせ
+ trackback: トラックバック
pettanr_unknown_v01_licenses/credit_picture:
- source_url_btn_id: URLボタン
- source_url_off_btn_id: URLはないボタン
+ source_url_btn_id: URLボタン
+ source_url_off_btn_id: URLはないボタン
pettanr_unknown_v01_licenses/attribute:
- license_id: ライセンスID
- system_picture_id: マーク画像ID
- source_url: 参考にした画像のURL
- note: 備考
+ source_url: 参考にした画像のURL
+ note: 備考
picture_io:
error: 画像保管庫との手続きで異常が発生しました。
select_items:
original_picture_license_groups:
new:
title: 画像の公開(ライセンスグループの選択)
- next: 次へ
no_blank: 必須項目
create:
title: 画像の公開(ライセンスグループの選択)
+ submit:
+ new: 次へ
+ original_picture_licenses:
+ new:
+ title: 画像の公開(ライセンスの選択)
+ no_blank: 必須項目
+ create:
+ title: 画像の公開(ライセンスの選択)
+ submit:
+ new: 次へ
speech_balloon_templates:
index:
title: フキダシテンプレート一覧
marker: ■
catch: 掴む
editor: 編集メニュー
+ credit:
+ digest: 簡易クレジット
+ full: クレジット
tab:
creator:
home: 作る・見せる
post :create
end
end
+ resources :original_picture_licenses do
+ new do
+ post :new
+ end
+ collection do
+ post :create
+ end
+ end
resources :provider_sources do
collection do
get :index
--- /dev/null
+class CreateOriginalPictureLicenses < ActiveRecord::Migration
+ def change
+ create_table :original_picture_licenses do |t|
+ t.integer :original_picture_id, :null => false, :default => 0
+ t.integer :license_group_id, :null => false, :default => 0
+ t.integer :license_id, :null => false, :default => 0
+ t.text :license_settings
+ t.text :license_group_module_name, :null => false, :limit => 50, :default => "StandardLicense"
+
+ t.timestamps
+ end
+ end
+end
--- /dev/null
+class LicenseOnExtend < ActiveRecord::Migration
+ def up
+ remove_column :resource_pictures, :artist_name
+ remove_column :pictures, :artist_name
+ end
+
+ def down
+ end
+end
'select'
end
+ def model_manifest
+ ::Manifest.manifest.models[@field.field_manifest.model_name]
+ end
+
+ def model_attribute_manifest
+ self.model_manifest.attributes[@field.field_manifest.column_name]
+ end
+
def select_item_name
- model = ::Manifest.manifest.models[@field.field_manifest.model_name]
- attr = model.attributes[@field.field_manifest.column_name]
- attr.source.select_item_name
+ self.model_attribute_manifest.source.select_item_name
end
def items
- ::Manifest.manifest.system_resources.select_items[self.select_item_name]
+ if self.model_attribute_manifest.source.type == 'model'
+ ::Manifest.manifest.system_resources.select_items[self.select_item_name]
+ else
+ resource_model_name = self.model_attribute_manifest.source.resource_model_name
+ resource_list_name = self.model_attribute_manifest.source.resource_list_name
+ filter_column_name = self.model_attribute_manifest.source.filter_column_name
+ filter_id = self.form.item.attributes[filter_column_name]
+ list = Locmare::ListGroup.list resource_model_name, resource_list_name
+ list.items(nil, {:id => filter_id},
+ 0, -1 # no limit
+ ).map {|i| [i.caption, i.id] }
+ end
+ end
+
+ def source_by_model?
+ case self.model_attribute_manifest.source.type
+ when 'model', 'filter'
+ true
+ when 'magic_number'
+ false
+ else
+ nil
+ end
end
end
ManifestBase.require_modules "manifest/model/attribute/source/",
- %w|base model magic_number|
+ %w|base model filter magic_number|
module Manifest
module ModelModule
def self.types
{
- 'model' => ModelSource, 'magic_number' => MagicNumberSource
+ 'model' => ModelSource, 'filter' => FilterSource, 'magic_number' => MagicNumberSource
}
end
--- /dev/null
+module Manifest
+ module ModelModule
+ module AttributeModule
+ module SourceModule
+ class FilterSource < ModelSource
+ attr :filter_column_name
+
+ def set_default
+ super
+ end
+
+ def init
+ super
+ @filter_column_name = @args['filter_column_name']
+ end
+
+ end
+
+ end
+ end
+ end
+end
{}
end
- def self.show item_id, operators
+ def self.show item_id, operators = nil
opt = {}
opt.merge!(self.show_opt)
item = self.find(item_id, opt)
item.boosts 'read'
- raise ActiveRecord::Forbidden if item.visible?(operators) == false
+ raise ActiveRecord::Forbidden if operators and item.visible?(operators) == false
item
end
"artist_id",\r
"license_id",\r
"md5",\r
- "artist_name",\r
+ "system_picture_id",\r
"license_group_settings",\r
"credit_picture_settings",\r
"license_settings",\r
"height",\r
"filesize",\r
"artist_id",\r
+ "license_group_id",\r
"license_id",\r
"md5",\r
- "artist_name",\r
+ "system_picture_id",\r
"license_group_settings",\r
"credit_picture_settings",\r
"license_settings",\r
"t"\r
]\r
},\r
+ "original_picture_license_group": {\r
+ "fields": {\r
+ "id": {\r
+ "label": {\r
+ "type": "none"\r
+ },\r
+ "tag": {\r
+ "type": "hidden"\r
+ }\r
+ },\r
+ "original_picture_id": {\r
+ "label": {\r
+ "type": "none"\r
+ },\r
+ "tag": {\r
+ "type": "hidden"\r
+ }\r
+ },\r
+ "license_group_id": {\r
+ "tag": {\r
+ "type": "select"\r
+ }\r
+ }\r
+ },\r
+ "field_names": [\r
+ "id",\r
+ "original_picture_id",\r
+ "license_group_id"\r
+ ]\r
+ },\r
+ "original_picture_license": {\r
+ "fields": {\r
+ "id": {\r
+ "label": {\r
+ "type": "none"\r
+ },\r
+ "tag": {\r
+ "type": "hidden"\r
+ }\r
+ },\r
+ "original_picture_id": {\r
+ "label": {\r
+ "type": "none"\r
+ },\r
+ "tag": {\r
+ "type": "hidden"\r
+ }\r
+ },\r
+ "license_group_id": {\r
+ "label": {\r
+ "type": "none"\r
+ },\r
+ "tag": {\r
+ "type": "hidden"\r
+ }\r
+ },\r
+ "license_id": {\r
+ "tag": {\r
+ "type": "select"\r
+ }\r
+ },\r
+ "license_settings": {\r
+ "row_break": true\r
+ },\r
+ "license_group_module_name": {\r
+ "label": {\r
+ "type": "none"\r
+ },\r
+ "tag": {\r
+ "type": "hidden"\r
+ }\r
+ }\r
+ },\r
+ "field_names": [\r
+ "id",\r
+ "original_picture_id",\r
+ "license_group_id",\r
+ "license_id",\r
+ "license_settings",\r
+ "license_group_module_name"\r
+ ]\r
+ },\r
"speech_balloon_template": {\r
"fields": {\r
"id": {\r
"overlap"\r
]\r
},\r
+ "pettanr_creative_commons_v30_licenses_attribute": {\r
+ "fields": {\r
+ "artist_name": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ },\r
+ "caption": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ },\r
+ "artist_url": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ },\r
+ "source_url": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ },\r
+ "more_permission_url": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ }\r
+ },\r
+ "field_names": [\r
+ "artist_name",\r
+ "caption",\r
+ "artist_url",\r
+ "source_url",\r
+ "more_permission_url"\r
+ ]\r
+ },\r
"pettanr_creative_commons_v30_licenses_credit_picture": {\r
"fields": {\r
"source_url_btn_id": {\r
"overlap"\r
]\r
},\r
+ "pettanr_pettan_commons_v01_licenses_attribute": {\r
+ "fields": {\r
+ "artist_name": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ },\r
+ "caption": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ },\r
+ "sources": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ }\r
+ },\r
+ "field_names": [\r
+ "artist_name",\r
+ "caption",\r
+ "sources"\r
+ ]\r
+ },\r
"pettanr_pettan_commons_v01_licenses_credit_picture": {\r
"fields": {\r
"source_url_btn_id": {\r
"trackback"\r
]\r
},\r
+ "pettanr_pettan_protected_v01_licenses_attribute": {\r
+ "fields": {\r
+ "artist_name": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ },\r
+ "caption": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ },\r
+ "sources": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ }\r
+ },\r
+ "field_names": [\r
+ "artist_name",\r
+ "caption",\r
+ "sources"\r
+ ]\r
+ },\r
"pettanr_pettan_protected_v01_licenses_credit_picture": {\r
"fields": {\r
"source_url_btn_id": {\r
"trackback"\r
]\r
},\r
+ "pettanr_pettan_public_v01_licenses_attribute": {\r
+ "fields": {\r
+ "artist_name": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ },\r
+ "caption": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ },\r
+ "sources": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ }\r
+ },\r
+ "field_names": [\r
+ "artist_name",\r
+ "caption",\r
+ "sources"\r
+ ]\r
+ },\r
"pettanr_pettan_public_v01_licenses_credit_picture": {\r
"fields": {\r
"source_url_btn_id": {\r
"trackback"\r
]\r
},\r
+ "pettanr_public_domain_v01_licenses_attribute": {\r
+ "fields": {\r
+ "artist_name": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ },\r
+ "source_url": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ },\r
+ "note": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ }\r
+ },\r
+ "field_names": [\r
+ "artist_name",\r
+ "source_url",\r
+ "note"\r
+ ]\r
+ },\r
"pettanr_public_domain_v01_licenses_credit_picture": {\r
"fields": {\r
"source_url_btn_id": {\r
"trackback"\r
]\r
},\r
+ "pettanr_unknown_v01_licenses_attribute": {\r
+ "fields": {\r
+ "source_url": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ },\r
+ "note": {\r
+ "tag": {\r
+ "type": "text"\r
+ },\r
+ "row_break": true\r
+ }\r
+ },\r
+ "field_names": [\r
+ "source_url",\r
+ "note"\r
+ ]\r
+ },\r
"pettanr_unknown_v01_licenses_credit_picture": {\r
"fields": {\r
"source_url_btn_id": {\r
"original_picture": {},\r
"picture": {},\r
"resource_picture": {},\r
+ "original_picture_license_group": {},\r
"speech_balloon_template": {},\r
"writing_format": {},\r
"license_group": {},\r
}\r
}\r
},\r
- "original_picture_license_group": {\r
+ "original_picture_license_group": {},\r
+ "original_picture_license": {\r
"args": {\r
"boost": {\r
- "license_group": {\r
+ "license": {\r
+ "template_name": "license_group",\r
"extend_model_class_name": "Attribute",\r
"item_name_for_extend_model": "attribute"\r
- },\r
- "credit_picture": {\r
- "template_name": "license_group",\r
- "extend_model_class_name": "CreditPicture",\r
- "item_name_for_extend_model": "credit_picture"\r
}\r
}\r
}\r
"associations": {\r
"belongs_to": {\r
"license": {},\r
- "artist": {}\r
+ "artist": {},\r
+ "system_picture": {}\r
},\r
"has_many": {},\r
"has_one": {}\r
"required": true\r
}\r
},\r
- "artist_name": {\r
- "type": "text",\r
+ "system_picture_id": {\r
+ "type": "number",\r
"rules": {\r
- "required": true\r
+ "required": true,\r
+ "number": true\r
}\r
},\r
"license_group_settings": {\r
"belongs_to": {\r
"original_picture": {},\r
"license": {},\r
- "artist": {}\r
+ "artist": {},\r
+ "system_picture": {}\r
},\r
"has_many": {},\r
"has_one": {}\r
"required": true\r
}\r
},\r
- "artist_name": {\r
- "type": "text",\r
+ "system_picture_id": {\r
+ "type": "number",\r
"rules": {\r
- "required": true\r
+ "required": true,\r
+ "number": true\r
+ }\r
+ },\r
+ "license_group_id": {\r
+ "type": "number",\r
+ "rules": {\r
+ "required": true,\r
+ "number": true\r
}\r
},\r
"license_group_settings": {\r
}\r
},\r
"original_picture_license_group": {\r
- "attributes": {}\r
+ "associations": {\r
+ "belongs_to": {\r
+ "original_picture": {},\r
+ "license_group": {}\r
+ },\r
+ "has_many": {},\r
+ "has_one": {}\r
+ },\r
+ "attributes": {\r
+ "original_picture_id": {\r
+ "type": "number",\r
+ "rules": {\r
+ "required": true,\r
+ "number": true\r
+ }\r
+ },\r
+ "license_group_id": {\r
+ "type": "number",\r
+ "rules": {\r
+ "required": true,\r
+ "number": true\r
+ },\r
+ "source": {\r
+ "type": "model"\r
+ }\r
+ }\r
+ }\r
+ },\r
+ "original_picture_license": {\r
+ "associations": {\r
+ "belongs_to": {\r
+ "original_picture": {},\r
+ "license": {},\r
+ "system_picture": {}\r
+ },\r
+ "has_many": {},\r
+ "has_one": {}\r
+ },\r
+ "attributes": {\r
+ "original_picture_id": {\r
+ "type": "number",\r
+ "rules": {\r
+ "required": true,\r
+ "number": true\r
+ }\r
+ },\r
+ "license_group_id": {\r
+ "type": "number",\r
+ "source": {\r
+ "type": "model"\r
+ },\r
+ "rules": {\r
+ "required": true,\r
+ "number": true\r
+ }\r
+ },\r
+ "license_id": {\r
+ "type": "number",\r
+ "source": {\r
+ "type": "filter",\r
+ "args": {\r
+ "resource_list_name": "by_license_group",\r
+ "filter_column_name": "license_group_id"\r
+ }\r
+ },\r
+ "rules": {\r
+ "required": true,\r
+ "number": true\r
+ }\r
+ },\r
+ "license_settings": {\r
+ "type": "text",\r
+ "rules": {}\r
+ },\r
+ "license_group_module_name": {\r
+ "type": "text",\r
+ "rules": {\r
+ "required": true\r
+ }\r
+ }\r
+ }\r
},\r
"speech_balloon_template": {\r
"associations": {\r
},\r
"pettanr_creative_commons_v30_licenses_attribute": {\r
"attributes": {\r
- "license_id": {\r
- "type": "number",\r
- "rules": {\r
- "required": true,\r
- "number": true\r
- }\r
- },\r
"artist_name": {\r
"type": "text",\r
"rules": {\r
},\r
"pettanr_pettan_commons_v01_licenses_attribute": {\r
"attributes": {\r
- "license_id": {\r
- "type": "number",\r
- "rules": {\r
- "required": true,\r
- "number": true\r
- }\r
- },\r
"artist_name": {\r
"type": "text",\r
"rules": {\r
},\r
"pettanr_pettan_protected_v01_licenses_attribute": {\r
"attributes": {\r
- "license_id": {\r
- "type": "number",\r
- "rules": {\r
- "required": true,\r
- "number": true\r
- }\r
- },\r
"artist_name": {\r
"type": "text",\r
"rules": {\r
},\r
"pettanr_pettan_public_v01_licenses_attribute": {\r
"attributes": {\r
- "license_id": {\r
- "type": "number",\r
- "rules": {\r
- "required": true,\r
- "number": true\r
- }\r
- },\r
"artist_name": {\r
"type": "text",\r
"rules": {\r
},\r
"pettanr_public_domain_v01_licenses_attribute": {\r
"attributes": {\r
- "license_id": {\r
- "type": "number",\r
- "rules": {\r
- "required": true,\r
- "number": true\r
- }\r
- },\r
"artist_name": {\r
"type": "text",\r
"rules": {\r
},\r
"pettanr_unknown_v01_licenses_attribute": {\r
"attributes": {\r
- "license_id": {\r
- "type": "number",\r
- "rules": {\r
- "required": true,\r
- "number": true\r
- }\r
- },\r
- "system_picture_id": {\r
- "type": "number",\r
- "rules": {\r
- "required": true,\r
- "number": true\r
- }\r
- },\r
"source_url": {\r
"type": "text",\r
"rules": {\r