root/app/views/admin/artworks/_form.rhtml @ 1caaf4a7
b689e231 | Marc Dequènes (Duck) | <p>
|
|
<%
|
|||
selected_artwork_set_id = (@artwork ? @artwork.artwork_set_id : nil)
|
|||
selected_artwork_group_id = (@artwork ? @artwork.artwork_group_id : nil)
|
|||
fc30c2a2 | Marc Dequènes (Duck) | selected_artwork_size_id = (@artwork ? @artwork.artwork_size_id : nil)
|
|
b689e231 | Marc Dequènes (Duck) | ||
form_for_resource do |f|
|
|||
%>
|
|||
<%=
|
|||
stacking_form(f) do |table|
|
|||
table.category _("General") do |cat|
|
|||
cat.field :title, _("Title:"), :text_field
|
|||
cat.field :artwork_set_id, _("Set:"), :collection_select, @artwork_sets, :id, :name, :include_blank => true
|
|||
cat.conditional_block(:set_details, @artwork, :artwork_set_id) do |bl|
|
|||
bl.field :artwork_set_position, _("Position into Artwork Set:"), :text_field
|
|||
bl.custom_field :artwork_group_id, _("Group:"),
|
|||
"<select id=\"artwork_artwork_group_id\" name=\"artwork[artwork_group_id]\">" +
|
|||
render(:partial => 'admin/artwork_groups/select_for_artwork_set',
|
|||
:locals => {:form_object => resource_name, :form_field => "artwork_group_id",
|
|||
:artwork_set_id => selected_artwork_set_id, :selected => selected_artwork_group_id}) +
|
|||
"</select>"
|
|||
bl.conditional_block(:group_details, @artwork, :artwork_group_id) do |bl2|
|
|||
bl2.field :artwork_group_position, _("Position into Artwork Group:"), :text_field
|
|||
end
|
|||
end
|
|||
cat.custom_field :artwork_size_id, _("Size:"),
|
|||
fc30c2a2 | Marc Dequènes (Duck) | render(:partial => 'admin/artwork_sizes/selector', :locals => {:form_object => resource_name, :form_field => "artwork_size_id", :selected => selected_artwork_size_id})
|
|
3807b362 | Marc Dequènes (Duck) | cat.field :artwork_material_ids, _("Materials:"), :collection_select, @artwork_materials, :id, :name, {:include_blank => true}, {:multiple => true, :size => [@artwork_materials.size + 1, 10].min}
|
|
70e65017 | Marc Dequènes (Duck) | cat.field :artwork_support_ids, _("Supports"), :collection_select, @artwork_supports, :id, :name, {:include_blank => true}, {:multiple => true, :size => [@artwork_supports.size + 1, 10].min}
|
|
b689e231 | Marc Dequènes (Duck) | end
|
|
table.category _("Result") do |cat|
|
|||
cat.field :artwork_condition_id, _("Condition:"), :collection_select, @artwork_conditions, :id, :name
|
|||
cat.category _("Placement") do |cat2|
|
|||
cat2.field :artwork_placement_reason_id, _("Reason:"), :collection_select, @artwork_placement_reasons, :id, :name, :include_blank => true
|
|||
cat2.conditional_block(:placement_details, @artwork, :artwork_placement_reason_id) do |bl|
|
|||
bl.field :placement_location, _("Location:"), :text_field
|
|||
bl.field :placement_date, _("Date:"), :date_select
|
|||
end
|
|||
end
|
|||
form_comment(cat)
|
|||
end
|
|||
676cb428 | Marc Dequènes (Duck) | table.content display_standard_form_buttons(submit_label)
|
|
b689e231 | Marc Dequènes (Duck) | end
|
|
%>
|
|||
<%
|
|||
end
|
|||
%>
|
|||
</p>
|
|||
<%=
|
|||
observe_field_with_reload :artwork_artwork_set_id,
|
|||
:url => { :controller => 'artwork_groups', :action => 'select_for_artwork_set' },
|
|||
:update => :artwork_artwork_group_id,
|
|||
:with => "'form_object=#{resource_name}&form_field=artwork_group_id&initial_artwork_set_id=#{selected_artwork_set_id}&initial_artwork_group_id=#{selected_artwork_group_id}&artwork_set_id=' + escape(value)"
|
|||
%>
|