edit refact
This commit is contained in:
@@ -7,6 +7,8 @@ ActiveAdmin.register Software do
|
||||
|
||||
menu priority: 2
|
||||
|
||||
actions :all, except: [:edit]
|
||||
|
||||
index do
|
||||
selectable_column
|
||||
id_column
|
||||
@@ -94,46 +96,4 @@ ActiveAdmin.register Software do
|
||||
end
|
||||
end
|
||||
|
||||
form do |f|
|
||||
f.inputs "Details" do
|
||||
f.input :name
|
||||
f.input :title
|
||||
f.input :author
|
||||
f.input :platform, as: :select, collection: %w[tic80 ebitengine love c64]
|
||||
f.input :status, as: :select, collection: %w[development demo released archived]
|
||||
f.input :highlighted
|
||||
f.input :license
|
||||
f.input :desc, as: :text, input_html: { rows: 4 }
|
||||
f.input :story, as: :text, input_html: { rows: 8 }
|
||||
end
|
||||
|
||||
f.inputs "Images" do
|
||||
f.has_many :software_images, allow_destroy: true, new_record: true do |si|
|
||||
si.input :image_id, as: :select, label: "Image",
|
||||
collection: Image.order(:original_filename).map { |img| [img.original_filename, img.id] }
|
||||
si.input :is_default, as: :boolean
|
||||
si.input :position, as: :number, input_html: { min: 0 }
|
||||
end
|
||||
end
|
||||
|
||||
f.inputs "External Links" do
|
||||
f.has_many :external_links, allow_destroy: true, new_record: true do |el|
|
||||
el.input :label
|
||||
el.input :url
|
||||
end
|
||||
end
|
||||
|
||||
f.inputs "Releases" do
|
||||
f.has_many :releases, allow_destroy: true, new_record: true do |r|
|
||||
r.input :version
|
||||
r.input :html_folder_path
|
||||
r.input :cartridge_path
|
||||
r.input :source_path
|
||||
r.input :docs_folder_path
|
||||
r.input :web_playable
|
||||
end
|
||||
end
|
||||
|
||||
f.actions
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user