= javascript_tag "var #{type}_member='#{generate_template(zone_form, :zone_members, {:partial => type + "_member"})}';"

.omega.six.columns{id: "#{type}_members"}
  %fieldset.no-border-bottom
    %legend{align: "center"}= t("spree.type")
    %ul.member-list.fields{id: "ul-nested-#{type.dasherize}"}
      - members_of_type = zone_form.object.zone_members.select { |member| member.zoneable_type && member.zoneable_type == "Spree::#{type.camelize}" }
      = zone_form.fields_for :zone_members, members_of_type do |member_form|
        = render partial: "#{type}_member", locals: { f: member_form }
    .field.align-center
      = button_link_to t("spree.add_#{type}"), "##{type}_member", { icon: 'icon-plus', id:"nested-#{type.dasherize}" }
