From eff044772f42afece0e021e0142974b67bfd978c Mon Sep 17 00:00:00 2001 From: yasushiito Date: Fri, 4 Apr 2014 18:13:54 +0900 Subject: [PATCH] fix edit extend_item --- .../manifest/work/controllers.js.coffee.erb | 24 ++ .../javascripts/manifest/work/filers.js.coffee.erb | 4 - .../javascripts/manifest/work/forms.js.coffee.erb | 277 +++++++++++++++ .../javascripts/manifest/work/models.js.coffee.erb | 2 +- app/controllers/application_controller.rb | 8 +- app/controllers/license_groups_controller.rb | 10 +- app/controllers/licenses_controller.rb | 9 + .../speech_balloon_templates_controller.rb | 10 +- app/controllers/writing_formats_controller.rb | 12 +- app/models/balloon.rb | 2 +- app/models/license.rb | 2 +- app/models/speech.rb | 2 +- app/models/speech_balloon.rb | 2 +- config/locales/ja.yml | 4 +- lib/locmare/booster.rb | 19 +- lib/manifest/item/boost.rb | 9 +- lib/peta/content.rb | 1 + lib/peta/system_resource.rb | 10 + lib/validators/boost_validator.rb | 8 + lib/validators/extend_balloon_validator.rb | 6 - lib/validators/extend_speech_balloon_validator.rb | 6 - lib/validators/extend_speech_validator.rb | 6 - public/local_manifest.json | 379 ++++++++++++++++++++- public/manifest.json | 30 +- 24 files changed, 783 insertions(+), 59 deletions(-) create mode 100644 lib/validators/boost_validator.rb delete mode 100644 lib/validators/extend_balloon_validator.rb delete mode 100644 lib/validators/extend_speech_balloon_validator.rb delete mode 100644 lib/validators/extend_speech_validator.rb diff --git a/app/assets/javascripts/manifest/work/controllers.js.coffee.erb b/app/assets/javascripts/manifest/work/controllers.js.coffee.erb index 9316b667..58fd878d 100644 --- a/app/assets/javascripts/manifest/work/controllers.js.coffee.erb +++ b/app/assets/javascripts/manifest/work/controllers.js.coffee.erb @@ -598,6 +598,12 @@ list_name: 'public', }, }, + new: { + type: 'new', + }, + edit: { + type: 'edit', + }, }, }, writing_formats: { @@ -624,6 +630,12 @@ count_by_system_picture: { type: 'count', }, + new: { + type: 'new', + }, + edit: { + type: 'edit', + }, }, }, license_groups: { @@ -644,6 +656,12 @@ list_name: 'public', }, }, + new: { + type: 'new', + }, + edit: { + type: 'edit', + }, }, }, licenses: { @@ -676,6 +694,12 @@ count_by_system_picture: { type: 'count', }, + new: { + type: 'new', + }, + edit: { + type: 'edit', + }, }, }, authors: { diff --git a/app/assets/javascripts/manifest/work/filers.js.coffee.erb b/app/assets/javascripts/manifest/work/filers.js.coffee.erb index 28fb5cc7..97818ff5 100644 --- a/app/assets/javascripts/manifest/work/filers.js.coffee.erb +++ b/app/assets/javascripts/manifest/work/filers.js.coffee.erb @@ -397,7 +397,6 @@ type: 'none', }, edit: { - type: 'none', }, }, writing_format: { @@ -409,7 +408,6 @@ type: 'none', }, edit: { - type: 'none', }, }, license_group: { @@ -430,7 +428,6 @@ type: 'none', }, edit: { - type: 'none', }, }, license: { @@ -456,7 +453,6 @@ summary: { }, edit: { - type: 'none', }, }, author: { diff --git a/app/assets/javascripts/manifest/work/forms.js.coffee.erb b/app/assets/javascripts/manifest/work/forms.js.coffee.erb index 8fafe2c0..80540fe5 100644 --- a/app/assets/javascripts/manifest/work/forms.js.coffee.erb +++ b/app/assets/javascripts/manifest/work/forms.js.coffee.erb @@ -1241,6 +1241,283 @@ 'z', 't', ] + }, + speech_balloon_template: { + fields: { + id: { + args: { + label: { + type: 'none', + }, + tag: { + type: 'hidden', + }, + }, + }, + name: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + classname: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + caption: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + t: { + args: { + tag: { + type: 'number', + }, + row_break: true, + }, + }, + system_picture_id: { + args: { + tag: { + type: 'number', + }, + row_break: true, + }, + }, + settings: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + }, + field_names: [ + 'id', + 'name', + 'classname', + 'caption', + 't', + 'system_picture_id', + 'settings', + ] + }, + writing_format: { + fields: { + id: { + args: { + label: { + type: 'none', + }, + tag: { + type: 'hidden', + }, + }, + }, + name: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + classname: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + caption: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + system_picture_id: { + args: { + tag: { + type: 'number', + }, + row_break: true, + }, + }, + settings: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + }, + field_names: [ + 'id', + 'name', + 'classname', + 'caption', + 'system_picture_id', + 'settings', + ] + }, + license_group: { + fields: { + id: { + args: { + label: { + type: 'none', + }, + tag: { + type: 'hidden', + }, + }, + }, + name: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + classname: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + caption: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + url: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + }, + field_names: [ + 'id', + 'name', + 'classname', + 'caption', + 'url', + ] + }, + license: { + fields: { + id: { + args: { + label: { + type: 'none', + }, + tag: { + type: 'hidden', + }, + }, + }, + license_group_id: { + args: { + label: { + type: 'none', + }, + tag: { + type: 'hidden', + }, + }, + }, + license_group_classname: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + name: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + caption: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + system_picture_id: { + args: { + tag: { + type: 'number', + }, + row_break: true, + }, + }, + url: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + license_group_settings: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + credit_picture_settings: { + args: { + tag: { + type: 'text', + }, + row_break: true, + }, + }, + }, + field_names: [ + 'id', + 'license_group_id', + 'license_group_classname', + 'name', + 'caption', + 'system_picture_id', + 'url', + 'icense_group_settings', + 'credit_picture_settings', + ] } author: { fields: { diff --git a/app/assets/javascripts/manifest/work/models.js.coffee.erb b/app/assets/javascripts/manifest/work/models.js.coffee.erb index e4de010f..bddc23d3 100644 --- a/app/assets/javascripts/manifest/work/models.js.coffee.erb +++ b/app/assets/javascripts/manifest/work/models.js.coffee.erb @@ -1416,7 +1416,7 @@ rules : { } }, - credit_pictures: { + credit_picture_settings: { type: 'text', rules : { } diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2b1f42c7..235e0ef5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -66,8 +66,12 @@ class ApplicationController < ActionController::Base authenticate_user! unless @operators.user? end - def authenticate_resource_reader - authenticate_user! unless @operators.resource_reader? + def authenticate_user + authenticate_user! unless @operators.user? + end + + def authenticate_admin + authenticate_admin! unless @operators.admin? end def authenticate_author diff --git a/app/controllers/license_groups_controller.rb b/app/controllers/license_groups_controller.rb index 5c2aedfd..9d1172fa 100644 --- a/app/controllers/license_groups_controller.rb +++ b/app/controllers/license_groups_controller.rb @@ -1,5 +1,5 @@ class LicenseGroupsController < ApplicationController - before_filter :authenticate_admin!, :only => [] + before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy] def self.model LicenseGroup @@ -28,4 +28,12 @@ class LicenseGroupsController < ApplicationController list_count end + def new + form_new + end + + def edit + form_edit + end + end diff --git a/app/controllers/licenses_controller.rb b/app/controllers/licenses_controller.rb index 40518652..8456d6e5 100644 --- a/app/controllers/licenses_controller.rb +++ b/app/controllers/licenses_controller.rb @@ -2,6 +2,7 @@ class LicensesController < ApplicationController before_filter :authenticate_resource_reader, :only => [ :by_license_group, :by_system_picture, :count_by_license_group, :count_by_system_picture ] + before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy] def self.model License @@ -55,4 +56,12 @@ class LicensesController < ApplicationController list_count end + def new + form_new + end + + def edit + form_edit + end + end diff --git a/app/controllers/speech_balloon_templates_controller.rb b/app/controllers/speech_balloon_templates_controller.rb index 61be8512..848dfe96 100644 --- a/app/controllers/speech_balloon_templates_controller.rb +++ b/app/controllers/speech_balloon_templates_controller.rb @@ -7,7 +7,7 @@ class SpeechBalloonTemplatesController < ApplicationController ] before_filter :authenticate_user, :only => [] end - before_filter :authenticate_admin!, :only => [:destroy] + before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy] def self.model SpeechBalloonTemplate @@ -44,6 +44,14 @@ class SpeechBalloonTemplatesController < ApplicationController list_count end + def new + form_new + end + + def edit + form_edit + end + def destroy @speech_balloon_template = SpeechBalloonTemplate.find(params[:id]) @speech_balloon_template.destroy diff --git a/app/controllers/writing_formats_controller.rb b/app/controllers/writing_formats_controller.rb index 520cf61b..5e72055f 100644 --- a/app/controllers/writing_formats_controller.rb +++ b/app/controllers/writing_formats_controller.rb @@ -5,7 +5,7 @@ class WritingFormatsController < ApplicationController before_filter :authenticate_reader, :only => [:index, :show, :count] before_filter :authenticate_user, :only => [] end - before_filter :authenticate_admin!, :only => [:destroy] + before_filter :authenticate_admin, :only => [:new, :create, :edit, :update, :destroy] def self.model WritingFormat @@ -29,9 +29,17 @@ class WritingFormatsController < ApplicationController show_json_format format end end - + def count list_count end + def new + form_new + end + + def edit + form_edit + end + end diff --git a/app/models/balloon.rb b/app/models/balloon.rb index 74c4122e..279d9f8f 100644 --- a/app/models/balloon.rb +++ b/app/models/balloon.rb @@ -14,7 +14,7 @@ class Balloon < Peta::Element validates :height, :presence => true, :numericality => true, :natural_number => true validates :r, :presence => true, :numericality => true # validates :caption, :presence => true - validates :speech_balloon_template_settings, :extend_balloon => true + validates :speech_balloon_template_settings, :boost => {:resource_name => :speech_balloon_template} def url '/system_pictures/' + self.system_picture.filename diff --git a/app/models/license.rb b/app/models/license.rb index 70e8001f..c21e5923 100644 --- a/app/models/license.rb +++ b/app/models/license.rb @@ -1,5 +1,5 @@ # -class License < Peta::Item +class License < Peta::SystemResource load_manifest belongs_to :license_group belongs_to :system_picture diff --git a/app/models/speech.rb b/app/models/speech.rb index acd0a831..963031c6 100644 --- a/app/models/speech.rb +++ b/app/models/speech.rb @@ -17,7 +17,7 @@ class Speech < Peta::Element validates :width, :presence => true, :numericality => true, :natural_number => true validates :height, :presence => true, :numericality => true, :natural_number => true validates :quotes, :length => {:maximum => 15}, :quotes_even => true - validates :speech_balloon_template_settings, :extend_speech => true + validates :speech_balloon_template_settings, :boost => {:resource_name => :speech_balloon_template} #validates :writing_format_settings @@text_align_texts = ['left', 'left', 'right', 'center'] diff --git a/app/models/speech_balloon.rb b/app/models/speech_balloon.rb index 58c5654d..deeb5fa8 100644 --- a/app/models/speech_balloon.rb +++ b/app/models/speech_balloon.rb @@ -13,7 +13,7 @@ class SpeechBalloon < Peta::Element validates :speech_balloon_template_classname, :presence => true, :length => {:maximum => 50} validates :z, :presence => true, :numericality => {:greater_than => 0} validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0} - validates :speech_balloon_template_settings, :extend_speech_balloon => true + validates :speech_balloon_template_settings, :boost => {:resource_name => :speech_balloon_template} def self.by_author_list_includes { diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 9ebb7dec..8f3cd855 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -127,9 +127,7 @@ ja: reverse: は反転できません。 sync_vh: は縦横比を変更できません。 quotes_even: はカッコの開きと閉じを空白区切りのペアで入力してください。 - speech_balloon_extend: バリデーションに失敗しました。 - balloon_extend: バリデーションに失敗しました。 - speech_extend: バリデーションに失敗しました。 + extend_settings: 拡張データのバリデーションに失敗しました。 template: body: 次の項目を確認してください。 header: diff --git a/lib/locmare/booster.rb b/lib/locmare/booster.rb index c4bf673d..8399bf3e 100644 --- a/lib/locmare/booster.rb +++ b/lib/locmare/booster.rb @@ -5,10 +5,13 @@ module Locmare def initialize manifest, item @manifest = manifest @item = item + raise 'blank foreign_key' + @manifest.name unless self.check_resource # no check # return false unless self.resource.enable? - @item.extend self.engine_extend_module - @item.__send__ @manifest.setter_method_name, self.parsed_settings + if extendable? + @item.extend self.engine_extend_module + @item.__send__ @manifest.setter_method_name, self.parsed_settings + end @boosted = true end @@ -50,6 +53,10 @@ module Locmare Object.const_get self.class_name end + def extendable? + self.engine_module.constants.include? @manifest.extend_module_name + end + # extend module in engine # ex) CircleSpeechBalloon::SpeechBalloonModule def engine_extend_module @@ -62,10 +69,14 @@ module Locmare self.engine_module.const_get @manifest.extend_model_name end + def check_resource + @item.attributes[@manifest.foreign_key].blank? == false + end + # get system resource instance def resource - r = @item.__send__ @manifest.name - raise 'resource not found' unless r + r = @item.__send__ @manifest.resource_name + raise 'resource not found' + @manifest.resource_name unless r r end diff --git a/lib/manifest/item/boost.rb b/lib/manifest/item/boost.rb index a9336de7..e3c1cb69 100644 --- a/lib/manifest/item/boost.rb +++ b/lib/manifest/item/boost.rb @@ -1,7 +1,7 @@ module Manifest module ItemModule class Boost < ManifestBase::NameValues - attr :level, :extend_column_name, :settings_column_name, + attr :level, :resource_name, :extend_column_name, :settings_column_name, :foreign_key, :extend_model_class_name, :extend_item_name, :setter_method_name, :getter_method_name, :extend_module_name @@ -9,9 +9,10 @@ module Manifest def set_default super @values['level'] ||= 'post' - @values['extend_column_name'] ||= @name + '_classname' - @values['settings_column_name'] ||= @name + '_settings' - @values['foreign_key'] ||= @name + '_id' + @values['resource_name'] ||= @name + @values['extend_column_name'] ||= @values['resource_name'] + '_classname' + @values['settings_column_name'] ||= @values['resource_name'] + '_settings' + @values['foreign_key'] ||= @values['resource_name'] + '_id' end def init diff --git a/lib/peta/content.rb b/lib/peta/content.rb index f544a633..1fdc473f 100644 --- a/lib/peta/content.rb +++ b/lib/peta/content.rb @@ -63,6 +63,7 @@ module Peta raise ActiveRecord::Forbidden unless content.own?(operators) content end + # Instance Methods def owner_model diff --git a/lib/peta/system_resource.rb b/lib/peta/system_resource.rb index f425144a..b1ca3bde 100644 --- a/lib/peta/system_resource.rb +++ b/lib/peta/system_resource.rb @@ -12,6 +12,12 @@ module Peta } end + def self.edit system_resource_id, operators + system_resource = self.find system_resource_id, self.show_opt + raise ActiveRecord::Forbidden unless system_resource.own?(operators) + system_resource + end + def my_engine_resource Manifest.manifest.system_resources.engine_resources[self.item_name] end @@ -21,5 +27,9 @@ module Peta er.resource_items.include? self.classname end + def own? operators + operators.admin? + end + end end diff --git a/lib/validators/boost_validator.rb b/lib/validators/boost_validator.rb new file mode 100644 index 00000000..40dce601 --- /dev/null +++ b/lib/validators/boost_validator.rb @@ -0,0 +1,8 @@ +class BoostValidator < ActiveModel::EachValidator + def validate_each(record, attribute, value) + resource = record.boosters[options[:resource_name].to_s].resource + msg = options[:message] || I18n.t('activerecord.errors.messages.extend_settings') + record.errors[attribute] << msg unless resource.valid? + end +end + diff --git a/lib/validators/extend_balloon_validator.rb b/lib/validators/extend_balloon_validator.rb deleted file mode 100644 index 7b9574b2..00000000 --- a/lib/validators/extend_balloon_validator.rb +++ /dev/null @@ -1,6 +0,0 @@ -class ExtendBalloonValidator < ActiveModel::EachValidator - def validate_each(record, attribute, value) - record.errors[attribute] << (options[:message] || I18n.t('activerecord.errors.messages.balloon_extend')) unless true #record.extend_balloon.valid? - end -end - diff --git a/lib/validators/extend_speech_balloon_validator.rb b/lib/validators/extend_speech_balloon_validator.rb deleted file mode 100644 index b4e21d2e..00000000 --- a/lib/validators/extend_speech_balloon_validator.rb +++ /dev/null @@ -1,6 +0,0 @@ -class ExtendSpeechBalloonValidator < ActiveModel::EachValidator - def validate_each(record, attribute, value) - record.errors[attribute] << (options[:message] || I18n.t('activerecord.errors.messages.speech_balloon_extend')) unless record.extend_speech_balloon.valid? - end -end - diff --git a/lib/validators/extend_speech_validator.rb b/lib/validators/extend_speech_validator.rb deleted file mode 100644 index 755c0e09..00000000 --- a/lib/validators/extend_speech_validator.rb +++ /dev/null @@ -1,6 +0,0 @@ -class ExtendSpeechValidator < ActiveModel::EachValidator - def validate_each(record, attribute, value) - record.errors[attribute] << (options[:message] || I18n.t('activerecord.errors.messages.speech_extend')) unless true # record.extend_speech.valid? - end -end - diff --git a/public/local_manifest.json b/public/local_manifest.json index 5f5e6e82..d43cfb56 100644 --- a/public/local_manifest.json +++ b/public/local_manifest.json @@ -587,14 +587,19 @@ } }, "speech_balloon": { + "columns": { + "speech_balloon_template_settings": { + "type": "extend" + } + }, "column_names": [ "panel_id", + "caption", "speech_balloon_template_id", "speech_balloon_template_classname", "z", "t", - "speech_balloon_template_settings", - "caption" + "speech_balloon_template_settings" ], "associations": { "belongs_to": [ @@ -607,6 +612,11 @@ } }, "speech": { + "columns": { + "speech_balloon_template_settings": { + "type": "extend" + } + }, "column_names": [ "speech_balloon_id", "speech_balloon_template_id", @@ -633,6 +643,11 @@ } }, "balloon": { + "columns": { + "speech_balloon_template_settings": { + "type": "extend" + } + }, "column_names": [ "speech_balloon_id", "speech_balloon_template_id", @@ -764,6 +779,28 @@ "system_picture_id", "settings" ], + "extend_settings": { + "circle_speech_balloon_speech_balloon": { + "columns": {}, + "column_names": [] + }, + "circle_speech_balloon_balloon": { + "columns": {}, + "column_names": [] + }, + "circle_speech_balloon_speech": { + "columns": {}, + "column_names": [] + }, + "plain_speech_balloon_speech_balloon": { + "columns": {}, + "column_names": [] + }, + "square_speech_balloon_speech_balloon": { + "columns": {}, + "column_names": [] + } + }, "associations": { "belongs_to": [ "system_picture" @@ -778,6 +815,12 @@ "system_picture_id", "settings" ], + "extend_settings": { + "pettanr_simple_format_writing_format": { + "columns": {}, + "column_names": [] + } + }, "associations": { "belongs_to": [ "system_picture" @@ -792,6 +835,34 @@ "caption", "url" ], + "extend_settings": { + "pettanr_pettan_commons_v01_licenses": { + "columns": { + "open": {}, + "commercial": {}, + "official": {}, + "attribution": {}, + "derive": {}, + "thumbnail": {}, + "gif_convert": {}, + "reverse": {}, + "sync_vh": {}, + "overlap": {} + }, + "column_names": [ + "open", + "commercial", + "official", + "attribution:", + "derive", + "thumbnail", + "gif_convert", + "reverse", + "sync_vh", + "overlap" + ] + } + }, "associations": { "has_many": [ "licenses.by_license_group" @@ -799,6 +870,17 @@ } }, "license": { + "columns": { + "license_group_id": {}, + "license_group_classname": {}, + "name": {}, + "caption": {}, + "system_picture_id": {}, + "url": {}, + "license_group_settings": { + "type": "extend" + } + }, "column_names": [ "license_group_id", "license_group_classname", @@ -1236,9 +1318,7 @@ "summary": { "type": "none" }, - "edit": { - "type": "none" - } + "edit": {} }, "writing_format": { "symbol": {}, @@ -1246,9 +1326,7 @@ "summary": { "type": "none" }, - "edit": { - "type": "none" - } + "edit": {} }, "license_group": { "symbol": {}, @@ -1266,9 +1344,7 @@ "summary": { "type": "none" }, - "edit": { - "type": "none" - } + "edit": {} }, "license": { "symbol": {}, @@ -1290,9 +1366,7 @@ } }, "summary": {}, - "edit": { - "type": "none" - } + "edit": {} }, "author": { "symbol": {}, @@ -2591,6 +2665,283 @@ "t" ] }, + "speech_balloon_template": { + "fields": { + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "name": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "classname": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "caption": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "t": { + "args": { + "tag": { + "type": "number" + }, + "row_break": true + } + }, + "system_picture_id": { + "args": { + "tag": { + "type": "number" + }, + "row_break": true + } + }, + "settings": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + } + }, + "field_names": [ + "id", + "name", + "classname", + "caption", + "t", + "system_picture_id", + "settings" + ] + }, + "writing_format": { + "fields": { + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "name": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "classname": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "caption": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "system_picture_id": { + "args": { + "tag": { + "type": "number" + }, + "row_break": true + } + }, + "settings": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + } + }, + "field_names": [ + "id", + "name", + "classname", + "caption", + "system_picture_id", + "settings" + ] + }, + "license_group": { + "fields": { + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "name": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "classname": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "caption": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "url": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + } + }, + "field_names": [ + "id", + "name", + "classname", + "caption", + "url" + ] + }, + "license": { + "fields": { + "id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "license_group_id": { + "args": { + "label": { + "type": "none" + }, + "tag": { + "type": "hidden" + } + } + }, + "license_group_classname": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "name": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "caption": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "system_picture_id": { + "args": { + "tag": { + "type": "number" + }, + "row_break": true + } + }, + "url": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "license_group_settings": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + }, + "credit_picture_settings": { + "args": { + "tag": { + "type": "text" + }, + "row_break": true + } + } + }, + "field_names": [ + "id", + "license_group_id", + "license_group_classname", + "name", + "caption", + "system_picture_id", + "url", + "icense_group_settings", + "credit_picture_settings" + ] + }, "author": { "fields": { "id": { diff --git a/public/manifest.json b/public/manifest.json index 409de052..4a484def 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -120,7 +120,11 @@ "args": { "parent_model_name": "license_group", "boost": { - "license_group": {} + "license_group": {}, + "credit_picture": { + "extend_item_name": "credit_picture", + "extend_column_name": "license_group_classname" + } } } }, @@ -699,6 +703,12 @@ "args": { "list_name": "public" } + }, + "new": { + "type": "new" + }, + "edit": { + "type": "edit" } } }, @@ -724,6 +734,12 @@ }, "count_by_system_picture": { "type": "count" + }, + "new": { + "type": "new" + }, + "edit": { + "type": "edit" } } }, @@ -743,6 +759,12 @@ "args": { "list_name": "public" } + }, + "new": { + "type": "new" + }, + "edit": { + "type": "edit" } } }, @@ -774,6 +796,12 @@ }, "count_by_system_picture": { "type": "count" + }, + "new": { + "type": "new" + }, + "edit": { + "type": "edit" } } }, -- 2.11.0