= render partial: 'head' - content_for :main do %table.table %thead %tr %th Код %th Название %th Производитель %th Категория %th %th %tbody - @products.each do |product| %tr %td - unless product.code.blank? =product.code %td %a{:href => edit_admin_product_path(product)}= product.title - if not product.published %span.label.label-warning Черновик %td= product.manufacturer.title %td= product.catalogue_category.title %td = link_to admin_product_new_from_copy_path(product), class: 'btn-dts pull-right' do %i.icon-copy %td = link_to admin_product_path(product), method: :delete, data: {confirm: "Вы действительно хотите удалить товар \"#{product.title}\"?"}, class: 'btn-dts-remove pull-right' do %span.glyphicon.glyphicon-remove = paginate @products, :theme => 'bootstrap', :window => 2 - content_for :manage do %a.btn.btn-default{:href => new_admin_product_path} Добавить товар - content_for :filter do = form_tag admin_products_path, method: :get do %fieldset .form-group = label_tag :text, 'Текст или код товара' = text_field_tag :text, nil, value: @search.text, class: 'form-control' .form-group = label_tag :published, 'Публикация' = select_tag :published, options_for_select([['Нет', false], ['Да', true]], @search.published), include_blank: true, class: 'form-control' .form-group = label_tag :manufacturer_id, 'Производитель' = select_tag :manufacturer_id, options_from_collection_for_select(Manufacturer.readable_collection, :id, :title, @search.manufacturer_id), include_blank: true, class: 'form-control' .form-group = label_tag :catalogue_category_id, 'Категория' = select_tag :catalogue_category_id, options_from_collection_for_select(format_select_options(CatalogueCategory.readable_collection), :id, :title, @search.catalogue_category_id), include_blank: true, class: 'form-control' = submit_tag "Фильтровать", :class => 'btn btn-default', name: nil %a.btn.btn-danger{ href: admin_products_path } Сбросить