.comable-page .comable-page-heading ul.pull-right.list-inline li .btn-group role="group" = link_to_previous_page @products, '<', class: 'btn btn-default' do .btn.btn-default disabled="disabled" | < = link_to_next_page @products, '>', class: 'btn btn-default' do .btn.btn-default disabled="disabled" | > li = link_to comable.root_path do = link_to Comable.t('admin.actions.new'), comable.new_admin_product_path, class: 'btn btn-default' h1.page-header = Comable.t('admin.nav.product') small< = @products.total_count = Comable.t('admin.results') .comable-page-body .comable-search = search_form_for @q, url: comable.admin_products_path do |f| .input-group span.input-group-btn button.btn.btn-default.dropdown-toggle type="button" data-toggle="dropdown" i.fa.fa-search span.caret< ul.dropdown-menu role="menu" li = link_to Comable.t('admin.clear_search_conditions'), comable.admin_products_path = f.text_field :code_or_name_cont, class: 'form-control' span.input-group-btn = f.submit Comable.t('admin.search'), class: 'btn btn-default' section - if @products.empty? = Comable.t('admin.not_found') - else table.table.table-striped thead th th = sort_link [:comable, @q], :code th = sort_link [:comable, @q], :name th = sort_link [:comable, @q], :price th = sort_link [:comable, @q], :stocks_quantity tbody - @products.each do |product| - quantity = product.stocks.to_a.sum(&:quantity) tr td.comable-image = link_to comable.admin_product_path(product), class: 'thumbnail' do = image_tag product.image_url, width: '100%' td = link_to product.code, comable.admin_product_path(product) td = product.name td = number_to_currency product.price td strong class="#{(quantity <= 0) ? 'text-danger' : (quantity <= 10) ? 'text-warning' : 'text-success'}" = number_with_delimiter product.stocks.to_a.sum(&:quantity) .text-center = paginate @products, theme: :comable_backend