Project

General

Profile

« Previous | Next » 

Revision fc30c2a2

Added by Marc Dequènes over 12 years ago

  • ID fc30c2a2a992f7470aeee259d71120ed3d55331e

[fix] added 'selected' parameter to artwork size generic selector and pass currently selected size in artwork edit page (closes #1)

View differences:

app/views/admin/artworks/_form.rhtml
2 2
<%
3 3
selected_artwork_set_id = (@artwork ? @artwork.artwork_set_id : nil)
4 4
selected_artwork_group_id = (@artwork ? @artwork.artwork_group_id : nil)
5
selected_artwork_size_id = (@artwork ? @artwork.artwork_size_id : nil)
5 6

  
6 7
form_for_resource do |f|
7 8
%>
......
23 24
      end
24 25
    end
25 26
    cat.custom_field :artwork_size_id,  _("Size:"),
26
      render(:partial => 'admin/artwork_sizes/selector', :locals => {:form_object => resource_name, :form_field => "artwork_size_id"})
27
      render(:partial => 'admin/artwork_sizes/selector', :locals => {:form_object => resource_name, :form_field => "artwork_size_id", :selected => selected_artwork_size_id})
27 28
    cat.field :artwork_material_id, _("Material:"), :collection_select, @artwork_materials, :id, :name
28 29
    cat.field :technique_ids, _("Techniques"), :collection_select, @techniques, :id, :name, {:include_blank => true}, {:multiple => true, :size => [@techniques.size + 1, 10].min}
29 30
  end

Also available in: Unified diff