caboose-store 0.0.19 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDIzZWVlZjgwMDI0ODg4ZmU2M2YyYmZkNzQxZmI4ZTMzMGExNjEzYg==
4
+ YjMzNTUwOTI2MTg4ZTliMTUyNDZmYjg3NDQ2M2I2OTM1NjAzOGJiMg==
5
5
  data.tar.gz: !binary |-
6
- MjIzZjJmMWZmMmY1ODIxMjVlZjM2NWZhM2M1NDdiMTM0OTMyODc0Ng==
6
+ NDA5ZWNkNjA4N2RjZmZlNDcyMDdjOTk3NDYzNTIzN2RhYWMxZTM5ZA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Mjc1N2VjNmRiOWVmZGRlMGQ3MGNhNzA0NGNkNDAxMTIyZWQ0ZmRiN2RmNmQ4
10
- NDhkOTA5Nzk0OTA2NTE4Mzg2OTY5MjdmMzk5YTA2ZDY2ZGVkZGRhNWRmMGZm
11
- YmE2YTAyNTkyZTUxY2U1Yzk2NjEwYmM1M2YyODNjODUzNTE1MjA=
9
+ MjkyOTA2YzZjMWViYTAzNGYxYTE0MThhMGE0MjhhMDNiOWNiNTNhZjM1NzI5
10
+ MGIyMGMzMmJhMjUyYmY5YjkzOTg4ZTE0OTc1NWI1MmNiNzkyODJhYjYzNWNm
11
+ NzI0OWZhZTYyZGYyMzAyZTIxYzJjMTdlYzMzMmY5NWI1YTY3OTY=
12
12
  data.tar.gz: !binary |-
13
- OGEyNzgwZmNhNDM3MzUwYWU5YTc5YjFjNzc0MTNmOGJjNmNkMDFlNjQ4NmZh
14
- N2JiNTU3MzgzYzdlZGFkZDMwMjM2ZWFkOGY4YjhmNmRjZTVkOWM1MTZmMzA5
15
- MTFlNjVhMTJjMWQwZWQyNmRiODExMTNiOWIzM2U0ZjZjM2NjNzg=
13
+ MDQwMWNkODgwZTY4Njc5YTQyODE1MTc3ZDUxMGFmYzFlM2I4YWFhZTZlZjUy
14
+ Njg0YzdlZjBlODIwMGE1YWRmYjAyYjdiMDcyNzU0N2ZjYmI3MTE1ODBhMjM4
15
+ YzZmNDY4Zjk2MjI0N2FiNjI3ZTg3OGI4Y2RmNzgxMjZlYzBkYWY=
@@ -17,54 +17,65 @@ v = @variant
17
17
 
18
18
  <p style='font-size: 75%;'><a href='/admin/products/<%= p.id %>/variant-cols'>Edit visible columns</a></p>
19
19
 
20
- <div id='message'></div>
20
+ <div id='message'><%
21
+ # Make sure we're not trying to highlight a deleted variant
22
+ if @highlight_variant_id
23
+ v = Variant.where(:id => @highlight_variant_id).first
24
+ if v.nil?
25
+ %><p class='note error'>The variant you want to highlight is not in the database.</p><%
26
+ elsif v.status == 'Deleted'
27
+ %><p class='note error'>The variant you want to highlight has been deleted.</p><%
28
+ end
29
+ end
30
+ %></div>
21
31
 
22
32
  <div id='variants_wrapper'>
23
33
  <table id='variants'>
24
- <tr>
25
- <% if @cols['option1' ] && p.option1 %><th valign='bottom'><%= p.option1 %></th><% end %>
26
- <% if @cols['option2' ] && p.option2 %><th valign='bottom'><%= p.option2 %></th><% end %>
27
- <% if @cols['option3' ] && p.option3 %><th valign='bottom'><%= p.option3 %></th><% end %>
28
- <% if @cols['status' ] == true %><th valign='bottom'>Status </th><% end %>
29
- <% if @cols['alternate_id' ] == true %><th valign='bottom'>Alternate ID </th><% end %>
30
- <% if @cols['barcode' ] == true %><th valign='bottom'>Barcode </th><% end %>
31
- <% if @cols['price' ] == true %><th valign='bottom'>Price </th><% end %>
32
- <% if @cols['quantity_in_stock' ] == true %><th valign='bottom'>Quantity </th><% end %>
33
- <% if @cols['weight' ] == true %><th valign='bottom'>Weight </th><% end %>
34
- <% if @cols['length' ] == true %><th valign='bottom'>Length </th><% end %>
35
- <% if @cols['width' ] == true %><th valign='bottom'>Width </th><% end %>
36
- <% if @cols['height' ] == true %><th valign='bottom'>Height </th><% end %>
37
- <% if @cols['cylinder' ] == true %><th valign='bottom'>Cylinder </th><% end %>
38
- <% if @cols['requires_shipping' ] == true %><th valign='bottom'>Requires Shipping </th><% end %>
39
- <% if @cols['allow_backorder' ] == true %><th valign='bottom'>Allow Backorder </th><% end %>
40
- <% if @cols['taxable' ] == true %><th valign='bottom'>Taxable </th><% end %>
41
- <th>&nbsp;</th>
42
- <th>&nbsp;</th>
43
- </tr>
34
+ <tr>
35
+ <% if @cols['option1' ] && p.option1 %><th valign='bottom'><%= p.option1 %></th><% end %>
36
+ <% if @cols['option2' ] && p.option2 %><th valign='bottom'><%= p.option2 %></th><% end %>
37
+ <% if @cols['option3' ] && p.option3 %><th valign='bottom'><%= p.option3 %></th><% end %>
38
+ <% if @cols['status' ] == true %><th valign='bottom'>Status </th><% end %>
39
+ <% if @cols['alternate_id' ] == true %><th valign='bottom'>Alternate ID </th><% end %>
40
+ <% if @cols['barcode' ] == true %><th valign='bottom'>Barcode </th><% end %>
41
+ <% if @cols['price' ] == true %><th valign='bottom'>Price </th><% end %>
42
+ <% if @cols['quantity_in_stock' ] == true %><th valign='bottom'>Quantity </th><% end %>
43
+ <% if @cols['weight' ] == true %><th valign='bottom'>Weight </th><% end %>
44
+ <% if @cols['length' ] == true %><th valign='bottom'>Length </th><% end %>
45
+ <% if @cols['width' ] == true %><th valign='bottom'>Width </th><% end %>
46
+ <% if @cols['height' ] == true %><th valign='bottom'>Height </th><% end %>
47
+ <% if @cols['cylinder' ] == true %><th valign='bottom'>Cylinder </th><% end %>
48
+ <% if @cols['requires_shipping' ] == true %><th valign='bottom'>Requires Shipping </th><% end %>
49
+ <% if @cols['allow_backorder' ] == true %><th valign='bottom'>Allow Backorder </th><% end %>
50
+ <% if @cols['taxable' ] == true %><th valign='bottom'>Taxable </th><% end %>
51
+ <th>&nbsp;</th>
52
+ <th>&nbsp;</th>
53
+ </tr>
44
54
  <% Caboose.log p.variants.where(:status => ['Active', 'Inactive']).first %>
45
55
  <% p.variants.where(:status => ['Active', 'Inactive']).each do |v| %>
46
- <tr <% if @highlight_variant_id && v.id == @highlight_variant_id %>class='highlight'<% end %>>
47
- <% if @cols['option1' ] && p.option1 %><td><div id='variant_<%= v.id %>_option1' ></div></td><% end %>
48
- <% if @cols['option2' ] && p.option2 %><td><div id='variant_<%= v.id %>_option2' ></div></td><% end %>
49
- <% if @cols['option3' ] && p.option3 %><td><div id='variant_<%= v.id %>_option3' ></div></td><% end %>
50
- <% if @cols['status' ] == true %><td><div id='variant_<%= v.id %>_status' ></div></td><% end %>
51
- <% if @cols['alternate_id' ] == true %><td><div id='variant_<%= v.id %>_alternate_id' ></div></td><% end %>
52
- <% if @cols['barcode' ] == true %><td><div id='variant_<%= v.id %>_barcode' ></div></td><% end %>
53
- <% if @cols['price' ] == true %><td><div id='variant_<%= v.id %>_price' ></div></td><% end %>
54
- <% if @cols['quantity_in_stock' ] == true %><td><div id='variant_<%= v.id %>_quantity_in_stock' ></div></td><% end %>
55
- <% if @cols['weight' ] == true %><td><div id='variant_<%= v.id %>_weight' ></div></td><% end %>
56
- <% if @cols['length' ] == true %><td><div id='variant_<%= v.id %>_length' ></div></td><% end %>
57
- <% if @cols['width' ] == true %><td><div id='variant_<%= v.id %>_width' ></div></td><% end %>
58
- <% if @cols['height' ] == true %><td><div id='variant_<%= v.id %>_height' ></div></td><% end %>
59
- <% if @cols['cylinder' ] == true %><td><div id='variant_<%= v.id %>_cylinder' ></div></td><% end %>
60
- <% if @cols['requires_shipping' ] == true %><td><div id='variant_<%= v.id %>_requires_shipping' ></div></td><% end %>
61
- <% if @cols['allow_backorder' ] == true %><td><div id='variant_<%= v.id %>_allow_backorder' ></div></td><% end %>
62
- <% if @cols['taxable' ] == true %><td><div id='variant_<%= v.id %>_taxable' ></div></td><% end %>
63
- <td class='edit'><a href='/admin/products/<%= p.id %>/variants/<%= v.id %>/edit'>Edit</a></td>
64
- <td class='delete'><a href='#' onclick='delete_variant(<%= v.id %>);'>Delete</a></td>
65
- </tr>
56
+ <tr <% if @highlight_variant_id && v.id == @highlight_variant_id %>class='highlight'<% end %>>
57
+ <% if @cols['option1' ] && p.option1 %><td><div id='variant_<%= v.id %>_option1' ></div></td><% end %>
58
+ <% if @cols['option2' ] && p.option2 %><td><div id='variant_<%= v.id %>_option2' ></div></td><% end %>
59
+ <% if @cols['option3' ] && p.option3 %><td><div id='variant_<%= v.id %>_option3' ></div></td><% end %>
60
+ <% if @cols['status' ] == true %><td><div id='variant_<%= v.id %>_status' ></div></td><% end %>
61
+ <% if @cols['alternate_id' ] == true %><td><div id='variant_<%= v.id %>_alternate_id' ></div></td><% end %>
62
+ <% if @cols['barcode' ] == true %><td><div id='variant_<%= v.id %>_barcode' ></div></td><% end %>
63
+ <% if @cols['price' ] == true %><td><div id='variant_<%= v.id %>_price' ></div></td><% end %>
64
+ <% if @cols['quantity_in_stock' ] == true %><td><div id='variant_<%= v.id %>_quantity_in_stock' ></div></td><% end %>
65
+ <% if @cols['weight' ] == true %><td><div id='variant_<%= v.id %>_weight' ></div></td><% end %>
66
+ <% if @cols['length' ] == true %><td><div id='variant_<%= v.id %>_length' ></div></td><% end %>
67
+ <% if @cols['width' ] == true %><td><div id='variant_<%= v.id %>_width' ></div></td><% end %>
68
+ <% if @cols['height' ] == true %><td><div id='variant_<%= v.id %>_height' ></div></td><% end %>
69
+ <% if @cols['cylinder' ] == true %><td><div id='variant_<%= v.id %>_cylinder' ></div></td><% end %>
70
+ <% if @cols['requires_shipping' ] == true %><td><div id='variant_<%= v.id %>_requires_shipping' ></div></td><% end %>
71
+ <% if @cols['allow_backorder' ] == true %><td><div id='variant_<%= v.id %>_allow_backorder' ></div></td><% end %>
72
+ <% if @cols['taxable' ] == true %><td><div id='variant_<%= v.id %>_taxable' ></div></td><% end %>
73
+ <td class='edit'><a href='/admin/products/<%= p.id %>/variants/<%= v.id %>/edit'>Edit</a></td>
74
+ <td class='delete'><a href='#' onclick='delete_variant(<%= v.id %>);'>Delete</a></td>
75
+ </tr>
66
76
  <% end %>
67
77
  </table>
78
+
68
79
  </div>
69
80
  <p><input type='button' value='New Variant' onclick="add_variant(<%= p.id %>);" /></p>
70
81
 
@@ -106,11 +117,7 @@ $(document).ready(function() {
106
117
  <% if @cols['allow_backorder' ] == true %>{ name: 'allow_backorder' , nice_name: 'Allow backorder' , type: 'checkbox' , align: 'center', value: <%= raw Caboose.json(v.allow_backorder ) %>, width: 50, fixed_placeholder: false } <% end %>
107
118
  ]
108
119
  });
109
- <% end %>
110
-
111
- <% if @highlight_variant_id %>
112
- $("#variant_<%= @highlight_variant_id %>_row").highlight();
113
- <% end %>
120
+ <% end %>
114
121
  });
115
122
 
116
123
  var modal = false;
@@ -1,3 +1,3 @@
1
1
  module CabooseStore
2
- VERSION = '0.0.19'
2
+ VERSION = '0.0.20'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.19
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry