<% content_for :page_title do %> <%= Spree.t(plural_resource_name(Spree::Vendor)) %> <% end %> <% content_for :page_actions do %> <%= button_link_to Spree.t(:new_vendor), new_object_url, { class: "btn-success", icon: 'add', id: 'admin_new_vendor' } %> <% end if can?(:create, Spree::Vendor) %> <% content_for :table_filter do %>
<%= search_form_for [:admin, @search] do |f| %>
<%= label_tag :q_name_cont, Spree.t(:name) %> <%= f.text_field :name_cont, tabindex: 1, class: "form-control js-quick-search-target" %>
<%= label_tag :q_state_in, Spree.t(:state) %> <%= f.select :state_in, options_for_select(vendor_state_options), { multiple: 'please select' }, class: 'select2', multiple: true %>
<%= button Spree.t(:filter_results), 'search' %>
<% end %>
<% end %> <%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection } %> <% if @vendors.any? %> <% @vendors.each do |vendor| %> <% end %>
<%= Spree.t(:user) %> <%= sort_link @search, :name, I18n.t(:name, scope: 'activerecord.attributes.spree/vendor') %> <%= sort_link @search, :state, I18n.t(:state, scope: 'activerecord.attributes.spree/vendor') %>
<%= vendor.users.first.email rescue nil %> <%= vendor.name %> <%= vendor.state.humanize.downcase %> <%= link_to_edit vendor, no_text: true, class: 'edit' if can?(:edit, vendor) %> <%= link_to_with_icon 'translate', nil, spree.admin_translations_path('vendor', vendor.id), title: Spree.t(:'i18n.translations'), class: 'btn btn-sm btn-primary' if defined? (SpreeGlobalize)%>
<% else %>
<%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Vendor)) %>
<% end %> <%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection } %>