= haml "products/menu".to_sym %h1 Product Linking :javascript $(function() { $( "#tabs" ).tabs(); }); #tabs %ul %li %a(href="#local_unlinked")Local unlinked (#{settings.supplier.name}) (#{@local_products.unlinked.count}) %li %a(href="#local_linked")Local linked (#{settings.supplier.name}) (#{@local_products.linked.count}) %li %a(href="#remote_linked")Remote linked (#{settings.supplier.remote_products.linked.count}) %li %a(href="#remote_unlinked")Remote unlinked (#{settings.supplier.remote_products.unlinked.count}) #local_linked %table.pure-table.pure-table-striped %thead %tr %th Local Product %th Remote Product %th Action %tbody - @local_products.linked.each do |local_product| %tr %td=local_product_link(local_product) %td=remote_product_link(local_product.remote_product) %td %a.pure-button(href="/product/#{local_product.id}/link") = link_icon Change Link #local_unlinked %table.pure-table.pure-table-striped %thead %tr %th Local Product %th Suggested Remote Products %th Action %tbody - @local_products.unlinked.each do |local_product| %tr %td=local_product_link(local_product) %td -local_product.link_suggestions.each do |suggested_product| %form.pure-form.pure-form-aligned(action="/product/#{local_product.id}/link" method="post") %input(type="hidden" name="remote_product_id" value="#{suggested_product.id}") %input(type="hidden" name="redirect_to" value="links") %button.pure-button.pure-button-primary(type="submit") %small %small Link to = suggested_product.name %br %td %a.pure-button.pure-button-primary(href="/product/#{local_product.id}/link") = link_icon Link #remote_linked = haml "remote_products/_table".to_sym, locals: {products: @remote_products.supplied_by(settings.supplier).linked} #remote_unlinked = haml "remote_products/_table".to_sym, locals: {products: @remote_products.supplied_by(settings.supplier).unlinked}