- @index ||= 0 .page{:id => "page-#{@index+1}"} .part{:id => "part-#{@index+1}"} = hidden_field_tag "part[#{@index}][name]", part.name, :id => "part_#{@index}_name" %p %label{:for => "part_#{@index}_filter_id"} Filter = select_tag "part[#{@index}][filter_id]", options_for_select([['', '']] + TextFilter.descendants.map { |s| s.filter_name }.sort, part.filter_id), :id => "part_#{@index}_filter_id" %span#reference-links Reference: %span{:id => "filter-reference-link-#{@index}"} = link_to_function "Filter", "load_filter_reference(#{@index});" %span{:id => "tag-reference-link-#{@index}"} = link_to_function 'Available Tags', "load_tag_reference(#{@index});" = render_region :part_controls %div ~ text_area_tag "part[#{@index}][content]", h(part.content), :class => "textarea", :style => "width: 100%", :id => "part_#{@index}_content" - @index += 1