caboose-store 0.0.3 → 0.0.4
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 +8 -8
- data/app/assets/javascripts/caboose_store/admin_products.js +80 -0
- data/app/assets/stylesheets/caboose_store/admin_products.css +86 -0
- data/app/models/caboose_store/schema.rb +9 -0
- data/app/views/caboose_store/orders/_admin_header.html.erb +2 -2
- data/app/views/caboose_store/products/_admin_header.html.erb +2 -2
- data/app/views/caboose_store/variants/admin_edit.html.erb +1 -1
- data/lib/caboose-store/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDg1ZTI3ZjIwMGRjYTMyNWY2MWYxZGZmNjNkYzljNjRjY2YzZDc0Yw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjBhZjY4MGQzMjZjM2FiMTBmM2ZlODU1ZWMyODJiZjYyMTNlMmUyOQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWM1MzIxYzE4N2UyM2ZmZWJlMDViMmM1OWM3MjA4NWNjODE2ZTdhY2U0NTVi
|
10
|
+
NDM4MWRkYzdkMmVkODNlOWQ0NTIyMDk4N2RjZDdjYTQ0NTJmMzBiYWI5Yjdj
|
11
|
+
ZmUzN2E5NWRiZGVhOTUxNWFhNzNkZDE3NDNjZDRmYjc3Y2ZlMjk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Njk5NDA0NjNkYzRiZTA3NDI5NGM5NjgwYjVlNzlkYTY4NzQxOGEyNDE4NGFh
|
14
|
+
NjMwZDFhYjc2MGFjOTY1YWU5MjU2MTVkN2VkZDcwZjVhYzk2ZDA1OWNkMjI1
|
15
|
+
YTExYjhmMDBiM2QwYzZjYTM2ZDIxZDhhZGRlZTVmMDc3NTM2NGI=
|
@@ -0,0 +1,80 @@
|
|
1
|
+
|
2
|
+
function delete_product(product_id, confirm)
|
3
|
+
{
|
4
|
+
if (!confirm)
|
5
|
+
{
|
6
|
+
var p = $('<p/>')
|
7
|
+
.addClass('note error')
|
8
|
+
.append("Are you sure you want to delete the product?<br />This can't be undone.")
|
9
|
+
.append("<br /><br />")
|
10
|
+
.append($("<input/>").attr('type', 'button').val('Yes').click(function() { delete_product(product_id, true); }))
|
11
|
+
.append(' ')
|
12
|
+
.append($("<input/>").attr('type', 'button').val('No').click(function() { cancel_delete_product(product_id); }));
|
13
|
+
modal.autosize(p);
|
14
|
+
return;
|
15
|
+
}
|
16
|
+
modal.autosize("<p class='loading'>Deleting product...</p>");
|
17
|
+
$.ajax({
|
18
|
+
url: '/admin/products/' + product_id,
|
19
|
+
type: 'delete',
|
20
|
+
success: function(resp) {
|
21
|
+
if (resp.error)
|
22
|
+
modal.autosize("<p class='note error'>" + resp.error + "</p>");
|
23
|
+
if (resp.redirect)
|
24
|
+
window.location = resp.redirect;
|
25
|
+
}
|
26
|
+
});
|
27
|
+
}
|
28
|
+
|
29
|
+
function cancel_delete_product(product_id)
|
30
|
+
{
|
31
|
+
var p = $('<p/>').append($("<input/>").attr('type', 'button').val('Delete this product').click(function() { delete_product(product_id); }));
|
32
|
+
modal.autosize(p);
|
33
|
+
}
|
34
|
+
|
35
|
+
function add_variant(product_id)
|
36
|
+
{
|
37
|
+
modal.autosize("<p class='loading'>Adding variant...</p>");
|
38
|
+
$.ajax({
|
39
|
+
url: '/admin/products/' + product_id + '/variants',
|
40
|
+
type: 'post',
|
41
|
+
success: function(resp) {
|
42
|
+
if (resp.error)
|
43
|
+
modal.autosize("<p class='note error'>" + resp.error + "</p>");
|
44
|
+
if (resp.refresh)
|
45
|
+
window.location.reload(true);
|
46
|
+
}
|
47
|
+
})
|
48
|
+
}
|
49
|
+
|
50
|
+
function delete_variant(variant_id, confirm)
|
51
|
+
{
|
52
|
+
if (!confirm)
|
53
|
+
{
|
54
|
+
var p = $('<p/>')
|
55
|
+
.addClass('note error')
|
56
|
+
.append("Are you sure you want to delete the variant?<br />This can't be undone.<br /><br />")
|
57
|
+
.append($("<input/>").attr('type', 'button').val('Confirm').click(function() { delete_variant(variant_id, true); }))
|
58
|
+
.append(' ')
|
59
|
+
.append($("<input/>").attr('type', 'button').val('Cancel').click(function() { cancel_delete_variant(variant_id); }));
|
60
|
+
modal.autosize(p);
|
61
|
+
return;
|
62
|
+
}
|
63
|
+
modal.autosize("<p class='loading'>Deleting product...</p>");
|
64
|
+
$.ajax({
|
65
|
+
url: '/admin/variants/' + variant_id,
|
66
|
+
type: 'delete',
|
67
|
+
success: function(resp) {
|
68
|
+
if (resp.error)
|
69
|
+
modal.autosize("<p class='note error'>" + resp.error + "</p>");
|
70
|
+
if (resp.redirect)
|
71
|
+
window.location = resp.redirect;
|
72
|
+
}
|
73
|
+
});
|
74
|
+
}
|
75
|
+
|
76
|
+
function cancel_delete_variant(variant_id)
|
77
|
+
{
|
78
|
+
var link = $('<a/>').attr('href','#').click(function(e) { e.preventDefault(); delete_variant(variant_id); });
|
79
|
+
modal.autosize(link);
|
80
|
+
}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
|
2
|
+
#modal_tabs {
|
3
|
+
width: 200px;
|
4
|
+
float: left;
|
5
|
+
/*
|
6
|
+
position: absolute;
|
7
|
+
top: 41px;
|
8
|
+
left: 0;
|
9
|
+
*/
|
10
|
+
list-style: none;
|
11
|
+
margin: 0;
|
12
|
+
padding: 0;
|
13
|
+
border-top: #ccc 1px solid;
|
14
|
+
}
|
15
|
+
#modal_tabs ul li {
|
16
|
+
list-style: none;
|
17
|
+
margin: 0;
|
18
|
+
padding: 0;
|
19
|
+
}
|
20
|
+
#modal_tabs li.back {
|
21
|
+
padding: 10px 0;
|
22
|
+
}
|
23
|
+
#modal_tabs a {
|
24
|
+
display: block;
|
25
|
+
margin: 0;
|
26
|
+
padding: 16px 12px 12px 12px;
|
27
|
+
text-decoration: none;
|
28
|
+
background: #efefef;
|
29
|
+
border-bottom: #ccc 1px solid;
|
30
|
+
color: #000;
|
31
|
+
}
|
32
|
+
#modal_tabs a:hover {
|
33
|
+
background: #666;
|
34
|
+
color: #fff;
|
35
|
+
}
|
36
|
+
#modal_tabs li.selected a {
|
37
|
+
background: transparent;
|
38
|
+
color: #000;
|
39
|
+
font-weight: bold;
|
40
|
+
}
|
41
|
+
#modal_content2 {
|
42
|
+
margin-left: 220px;
|
43
|
+
}
|
44
|
+
#modal_content h1 {
|
45
|
+
height: 30px;
|
46
|
+
padding-bottom: 10px;
|
47
|
+
border-bottom: #666 1px dotted;
|
48
|
+
}
|
49
|
+
#variants_wrapper {
|
50
|
+
width: 100%;
|
51
|
+
}
|
52
|
+
#variants {
|
53
|
+
border-collapse: collapse;
|
54
|
+
}
|
55
|
+
#variants td {
|
56
|
+
margin: 0;
|
57
|
+
padding: 0;
|
58
|
+
border: #666 1px dotted;
|
59
|
+
}
|
60
|
+
#variants td input[type='text'] {
|
61
|
+
background: transparent;
|
62
|
+
color: #000;
|
63
|
+
border: 0;
|
64
|
+
font-size: 75%;
|
65
|
+
}
|
66
|
+
#variants th {
|
67
|
+
font-size: 85%;
|
68
|
+
}
|
69
|
+
#variants td.edit a {
|
70
|
+
display: block;
|
71
|
+
padding: 12px 12px;
|
72
|
+
border: 0;
|
73
|
+
}
|
74
|
+
#variants td.edit a:hover {
|
75
|
+
background: #333;
|
76
|
+
color: #fff;
|
77
|
+
}
|
78
|
+
#variants td.delete a {
|
79
|
+
display: block;
|
80
|
+
padding: 12px 12px;
|
81
|
+
border: 0;
|
82
|
+
}
|
83
|
+
#variants td.delete a:hover {
|
84
|
+
background: #333;
|
85
|
+
color: #fff;
|
86
|
+
}
|
@@ -143,4 +143,13 @@ class CabooseStore::Schema < Caboose::Utilities::Schema
|
|
143
143
|
}
|
144
144
|
end
|
145
145
|
|
146
|
+
def self.load_data
|
147
|
+
if !CabooseStore::Category.exists?(1)
|
148
|
+
CabooseStore::Category.create({ :id => 1, :name => 'All Products', :url => '/products', :slug => 'products' })
|
149
|
+
end
|
150
|
+
if !CabooseStore::Vendor.exists?(1)
|
151
|
+
CabooseStore::Vendor.create({ :id => 1, :name => 'Unknown' })
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
146
155
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<% content_for :caboose_css do %>
|
2
|
-
<%= stylesheet_link_tag "admin_products" %>
|
2
|
+
<%= stylesheet_link_tag "caboose_store/admin_products" %>
|
3
3
|
<% end %>
|
4
4
|
<% content_for :caboose_js do %>
|
5
5
|
<%= javascript_include_tag "caboose/model/all" %>
|
6
|
-
<%= javascript_include_tag "admin_products" %>
|
6
|
+
<%= javascript_include_tag "caboose_store/admin_products" %>
|
7
7
|
<% end %>
|
8
8
|
|
9
9
|
<h1>Edit Product - <%= @product.title %></h1>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<% content_for :caboose_css do %>
|
2
|
-
<%= stylesheet_link_tag "admin_products" %>
|
2
|
+
<%= stylesheet_link_tag "caboose_store/admin_products" %>
|
3
3
|
<% end %>
|
4
4
|
<% content_for :caboose_js do %>
|
5
5
|
<%= javascript_include_tag "caboose/model/all" %>
|
6
|
-
<%= javascript_include_tag "admin_products" %>
|
6
|
+
<%= javascript_include_tag "caboose_store/admin_products" %>
|
7
7
|
<% end %>
|
8
8
|
|
9
9
|
<h1>Edit Product - <%= @product.title %></h1>
|
@@ -40,7 +40,7 @@ v = @variant
|
|
40
40
|
|
41
41
|
<% content_for :caboose_js do %>
|
42
42
|
<%= javascript_include_tag "caboose/model/all" %>
|
43
|
-
<%= javascript_include_tag "admin_products" %>
|
43
|
+
<%= javascript_include_tag "caboose_store/admin_products" %>
|
44
44
|
<script type='text/javascript'>
|
45
45
|
|
46
46
|
$(document).ready(function() {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: caboose-cms
|
@@ -39,6 +39,7 @@ files:
|
|
39
39
|
- app/assets/images/caboose_store/loading_small_white_on_black.gif
|
40
40
|
- app/assets/images/caboose_store/loading_white_on_black.gif
|
41
41
|
- app/assets/javascripts/caboose_store/admin.js
|
42
|
+
- app/assets/javascripts/caboose_store/admin_products.js
|
42
43
|
- app/assets/javascripts/caboose_store/application.js
|
43
44
|
- app/assets/javascripts/caboose_store/modal.js
|
44
45
|
- app/assets/javascripts/caboose_store/modal_integration.js
|
@@ -47,6 +48,7 @@ files:
|
|
47
48
|
- app/assets/javascripts/caboose_store/shortcut.js
|
48
49
|
- app/assets/javascripts/caboose_store/station.js
|
49
50
|
- app/assets/stylesheets/caboose_store/admin.css
|
51
|
+
- app/assets/stylesheets/caboose_store/admin_products.css
|
50
52
|
- app/assets/stylesheets/caboose_store/application.css
|
51
53
|
- app/assets/stylesheets/caboose_store/bound_input.css
|
52
54
|
- app/assets/stylesheets/caboose_store/caboose.css
|