# expand license_group_settings\r
license_group: {\r
resource_name: 'license_group',\r
+ engine_resource_name: 'license_groups',\r
+ engine_resource_extend_column_name: 'license_group_classname',\r
extend_column_name: 'license_group_classname',\r
settings_column_name: 'license_group_settings',\r
extend_model_class_name: 'License',\r
license: {\r
level: 'read',\r
resource_name: 'license_group',\r
+ engine_resource_name: 'license_groups',\r
+ engine_resource_extend_column_name: 'license_group_classname',\r
extend_column_name: 'license_group_classname',\r
+ settings_column_name: 'license_settings',\r
extend_model_class_name: 'Attribute',\r
extend_item_name: 'attribute',\r
},\r
credit_picture: {\r
level: 'read',\r
resource_name: 'license_group',\r
+ engine_resource_name: 'license_groups',\r
+ engine_resource_extend_column_name: 'license_group_classname',\r
extend_column_name: 'license_group_classname',\r
settings_column_name: 'credit_picture_settings',\r
extend_model_class_name: 'CreditPicture',\r
number: true,\r
}\r
},\r
- revision: {\r
- type: 'number',\r
- rules : {\r
- required: true,\r
- number: true,\r
- }\r
- },\r
ext: {\r
type: 'text',\r
rules : {\r
},\r
column_names: [\r
'original_picture_id', \r
- 'revision', \r
'ext', \r
'width', \r
'height', \r
clear: both;
}
+.extend_column {
+ margin-left: 20px;
+}
.filer {
list-style-type: none;
@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.my_engine_name
+ @attr = @license_group.my_engine.new_attribute {}
+ @attr.supply_default @operators
respond_to do |format|
if @original_picture_license_group.valid?
load_manifest
belongs_to :original_picture
belongs_to :license
+ belongs_to :system_picture
belongs_to :artist
has_one :resource_picture
validates :filesize, :presence => true, :numericality => {:greater_than => 0, :less_than_or_equal_to => 2000000}, :natural_number => true
validates :md5, :presence => true, :length => {:minimum => 32, :maximum => 32}
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_classname, :presence => true, :length => {:maximum => 50}
def overwrite rp
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, :artist_id => rp.artist_id,
+ :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,
:license_group_classname => rp.license_group_classname,
:license_group_settings => rp.license_group_settings,
{:src => img, :width => tw, :height => th}
end
+ def alt_name
+ self.license.license_group.caption.to_s + '[' + self.license.caption.to_s + ']'
+ end
+
def symbol_option
self.tmb_opt_img_tag
end
load_manifest
belongs_to :artist
belongs_to :license
+ belongs_to :system_picture
belongs_to :picture
belongs_to :original_picture
validates :md5, :presence => true, :length => {:minimum => 32, :maximum => 32}
validates :artist_id, :presence => true, :numericality => true, :existence => {:both => false}
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_classname, :presence => true, :length => {:maximum => 50}
{:src => self.url('full'), :width => self.width, :height => self.height}
end
+ def alt_name
+ self.license.license_group.caption.to_s + '[' + self.license.caption.to_s + ']'
+ end
+
def symbol_option
self.tmb_opt_img_tag
end
<%= 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_classname %>
<%= f.hidden_field :license_group_settings %>
provider_license: ライセンス対照表
provider_artist: 絵師対照表
provider_original_picture: 原画対照表
+ pettanr_creative_commons_v30_licenses/attribute: クリエイティブコモンズ3.0
+ pettanr_pettan_commons_v01_licenses/attribute: ぺったんコモンズ0.1
+ pettanr_pettan_protected_v01_licenses/attribute: ぺったんProtected0.1
+ pettanr_pettan_public_v01_licenses/attribute: ぺったんパブリック0.1
+ pettanr_public_domain_v01_licenses/attribute: パブリックドメイン
+ pettanr_unknown_v01_licenses/attribute: 不明0.1
attributes:
user:
name: ペンネーム
artist_id: 絵師
license_id: ライセンス
artist_name: 著作者名
- classname: ライセンスクラス名
- credit: クレジット拡張データ
- settings: 拡張データ
+ license_group_settings: ライセンスフラグ
+ credit_picture_settings: クレジット拡張データ
+ license_settings: ライセンス拡張データ
+ license_group_classname: ライセンスクラス名
created_at: 公開日時
updated_at: 公開日時
resource_picture:
artist_id: 絵師
license_id: ライセンス
artist_name: 著作者名
- classname: ライセンスクラス名
- credit: クレジット拡張データ
- settings: 拡張データ
+ license_group_settings: ライセンスフラグ
+ credit_picture_settings: クレジット拡張データ
+ license_settings: ライセンス拡張データ
+ license_group_classname: ライセンスクラス名
picture_id: 実素材
created_at: 作成
updated_at: 更新
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:
+ license_id: ライセンスID
+ system_picture_id: マーク画像ID
+ 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:
+ license_id: ライセンスID
+ system_picture_id: マーク画像ID
+ 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:
+ license_id: ライセンスID
+ system_picture_id: マーク画像ID
+ 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:
+ license_id: ライセンスID
+ system_picture_id: マーク画像ID
+ 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:
+ license_id: ライセンスID
+ system_picture_id: マーク画像ID
+ artist_name: 著作者名
+ caption: 作品の名前
+ source_url: 参考にした画像のURL
+ note: 参考にした画像のURL
pettanr_unknown_v01_licenses/license:
- open: ライセンス
+ 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:
+ license_id: ライセンスID
+ system_picture_id: マーク画像ID
+ source_url: 参考にした画像のURL
+ note: 参考にした画像のURL
picture_io:
error: 画像保管庫との手続きで異常が発生しました。
select_items:
--- /dev/null
+class AddSystemPictureIdOnResourcePicture < ActiveRecord::Migration
+ def up
+ add_column :resource_pictures, :system_picture_id, :integer, :null => false, :default => 0
+ add_column :pictures, :system_picture_id, :integer, :null => false, :default => 0
+ end
+
+ def down
+ end
+end
--- /dev/null
+class AddSystemPictureIdOnResourcePictureData < ActiveRecord::Migration
+ def up
+ ResourcePicture.all.each do |i|
+ if i.system_picture_id == 0 or i.system_picture_id.blank?
+ i.system_picture_id = i.license.system_picture_id
+ s = JSON.parse i.license_group_settings
+ if s['resize']
+ s.delete 'resize'
+ i.license_group_settings = s.to_json
+ end
+ i.boosts 'post'
+ i.save!
+ end
+ end
+ Picture.all.each do |i|
+ if i.system_picture_id == 0 or i.system_picture_id.blank?
+ i.system_picture_id = i.license.system_picture_id
+ s = JSON.parse i.license_group_settings
+ if s['resize']
+ s.delete 'resize'
+ i.license_group_settings = s.to_json
+ end
+ i.boosts 'post'
+ i.save!
+ end
+ end
+ end
+
+ def down
+ end
+end
self.my_engine_resource.resource_items[self.classname]
end
+ def my_engine
+ Object.const_get self.classname
+ end
+
def own? operators
operators.admin?
end
"boost": {\r
"license_group": {\r
"resource_name": "license_group",\r
+ "engine_resource_name": "license_groups",\r
+ "engine_resource_extend_column_name": "license_group_classname",\r
"extend_column_name": "license_group_classname",\r
"settings_column_name": "license_group_settings",\r
"extend_model_class_name": "License",\r
"license": {\r
"level": "read",\r
"resource_name": "license_group",\r
+ "engine_resource_name": "license_groups",\r
+ "engine_resource_extend_column_name": "license_group_classname",\r
"extend_column_name": "license_group_classname",\r
+ "settings_column_name": "license_settings",\r
"extend_model_class_name": "Attribute",\r
"extend_item_name": "attribute"\r
},\r
"credit_picture": {\r
"level": "read",\r
"resource_name": "license_group",\r
+ "engine_resource_name": "license_groups",\r
+ "engine_resource_extend_column_name": "license_group_classname",\r
"extend_column_name": "license_group_classname",\r
"settings_column_name": "credit_picture_settings",\r
"extend_model_class_name": "CreditPicture",\r