Sha256: c29f2999e8fa4d9a46710f895e89ddaedb926ac93b7f9d43f53109888f61593c

Contents?: true

Size: 1.52 KB

Versions: 33

Compression:

Stored size: 1.52 KB

Contents

<h1>Unmatched Products</h1>

<p style="margin: 0 0 6px"><a href="/admin/products">All Products</a></p>

<br />
<form method="get" action="/admin/products/add-upcs">
	<select name="vendor_id">
		<option value="">Choose Vendor</option>
		
		<% CabooseStore::Vendor.all.each do |vendor| %>
			<option value="<%= vendor.id %>"
				<%= 'selected' if params[:vendor_id] and params[:vendor_id].to_i == vendor.id %>
			><%= vendor.name %></option>
		<% end %>
	</select>
	
	<input type="submit" value="Filter">
</form><br />

<% content_for :caboose_js do %>
	<script>
		$(document).ready(function() {
			$('form').one('submit', function(event) {
				event.preventDefault();
				
				// Prevent the form from being submitted by button click
				$('form input[type=submit]').attr('disabled', true);
				
				// If the vendor id has a value send it through; otherwise reload the page
				if ($('form select').val() != "") {
					$('form').submit();
				} else {
					window.location.href = '/admin/products/add-upcs';
				}
			});
		});
	</script>
<% end %>

<% if @products.count > 0 %>
	<table class='data' id='properties_table'>
		<tr>
			<th>ID</th>
			<th>Title</th>
			<th>Vendor</th>
		</tr>
		
		<% @products.each do |product| %>
			<tr onclick="window.location='/admin/products/<%= product.id %>/general';">
				<td><%= raw product.id %></td>
				<td><%= raw product.title %></td>
				<td><%= raw product.vendor.nil? ? 'Unknown' : product.vendor.name %></td>
			</tr>
		<% end %>
	</table>
<% else %>
  <p>There are no products right now.</p>
<% end %>

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
caboose-store-0.0.43 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.42 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.41 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.40 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.39 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.38 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.37 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.36 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.35 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.34 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.33 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.32 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.31 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.30 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.29 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.28 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.27 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.26 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.25 app/views/caboose_store/products/admin_add_upcs.html.erb
caboose-store-0.0.24 app/views/caboose_store/products/admin_add_upcs.html.erb