shoppe 0.0.7 → 0.0.8
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.
- data/app/assets/images/shoppe/chosen-sprite.png +0 -0
- data/app/assets/images/shoppe/chosen-sprite@2x.png +0 -0
- data/app/assets/images/shoppe/icons/bag.svg +1 -0
- data/app/assets/images/shoppe/icons/balance.svg +1 -0
- data/app/assets/images/shoppe/icons/box.svg +1 -0
- data/app/assets/images/shoppe/icons/building.svg +1 -0
- data/app/assets/images/shoppe/icons/chart.svg +1 -0
- data/app/assets/images/shoppe/icons/chat.svg +1 -0
- data/app/assets/images/shoppe/icons/checkbox.svg +1 -0
- data/app/assets/images/shoppe/icons/checkbox2.svg +1 -0
- data/app/assets/images/shoppe/icons/cloud.svg +1 -0
- data/app/assets/images/shoppe/icons/cone.svg +1 -0
- data/app/assets/images/shoppe/icons/credit_card.svg +1 -0
- data/app/assets/images/shoppe/icons/currency.svg +1 -0
- data/app/assets/images/shoppe/icons/flowchart.svg +1 -0
- data/app/assets/images/shoppe/icons/gift.svg +1 -0
- data/app/assets/images/shoppe/icons/globe.svg +1 -0
- data/app/assets/images/shoppe/icons/id.svg +1 -0
- data/app/assets/images/shoppe/icons/id2.svg +1 -0
- data/app/assets/images/shoppe/icons/locked.svg +1 -0
- data/app/assets/images/shoppe/icons/report.svg +1 -0
- data/app/assets/images/shoppe/icons/search.svg +1 -0
- data/app/assets/images/shoppe/icons/support.svg +1 -0
- data/app/assets/images/shoppe/icons/tags.svg +1 -0
- data/app/assets/images/shoppe/icons/toolbox.svg +1 -0
- data/app/assets/images/shoppe/icons/unlocked.svg +1 -0
- data/app/assets/images/shoppe/icons/wallet.svg +1 -0
- data/app/assets/images/shoppe/move.svg +1 -0
- data/app/assets/javascripts/shoppe/application.coffee +32 -1
- data/app/assets/javascripts/shoppe/chosen.jquery.js +1166 -0
- data/app/assets/javascripts/shoppe/jquery_ui.js +6 -0
- data/app/assets/stylesheets/shoppe/application.scss +95 -20
- data/app/assets/stylesheets/shoppe/chosen.css +430 -0
- data/app/assets/stylesheets/shoppe/elements.scss +6 -7
- data/app/controllers/shoppe/delivery_service_prices_controller.rb +1 -1
- data/app/controllers/shoppe/products_controller.rb +1 -1
- data/app/helpers/shoppe/shoppe_helper.rb +2 -0
- data/app/models/shoppe/delivery_service_price.rb +1 -0
- data/app/models/shoppe/order.rb +18 -1
- data/app/models/shoppe/order_item.rb +11 -5
- data/app/models/shoppe/product.rb +19 -4
- data/app/models/shoppe/product/product_attributes.rb +15 -0
- data/app/models/shoppe/product_attribute.rb +51 -0
- data/app/views/shoppe/delivery_service_prices/_form.html.haml +23 -19
- data/app/views/shoppe/delivery_service_prices/edit.html.haml +1 -1
- data/app/views/shoppe/delivery_service_prices/index.html.haml +1 -1
- data/app/views/shoppe/delivery_service_prices/new.html.haml +1 -1
- data/app/views/shoppe/delivery_services/_form.html.haml +27 -25
- data/app/views/shoppe/delivery_services/edit.html.haml +1 -1
- data/app/views/shoppe/delivery_services/index.html.haml +12 -8
- data/app/views/shoppe/delivery_services/new.html.haml +1 -1
- data/app/views/shoppe/orders/index.html.haml +16 -12
- data/app/views/shoppe/orders/show.html.haml +28 -25
- data/app/views/shoppe/product_categories/_form.html.haml +7 -6
- data/app/views/shoppe/product_categories/edit.html.haml +1 -1
- data/app/views/shoppe/product_categories/index.html.haml +8 -4
- data/app/views/shoppe/product_categories/new.html.haml +1 -1
- data/app/views/shoppe/products/_form.html.haml +88 -45
- data/app/views/shoppe/products/edit.html.haml +1 -1
- data/app/views/shoppe/products/index.html.haml +14 -13
- data/app/views/shoppe/products/new.html.haml +1 -1
- data/app/views/shoppe/users/_form.html.haml +17 -15
- data/app/views/shoppe/users/edit.html.haml +1 -1
- data/app/views/shoppe/users/index.html.haml +1 -1
- data/app/views/shoppe/users/new.html.haml +1 -1
- data/db/migrate/20131012123829_create_shoppe_product_attributes.rb +11 -0
- data/db/migrate/20131012163301_add_public_boolean_to_product_attributes.rb +5 -0
- data/db/migrate/20131013123937_add_cost_prices_to_various_objects.rb +8 -0
- data/db/migrate/20131013131658_add_stock_control_boolean_to_products.rb +5 -0
- data/db/seeds.rb +78 -30
- data/lib/shoppe/version.rb +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +22 -6
- data/test/dummy/log/development.log +29 -0
- metadata +42 -5
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
= content_for :header do
|
4
4
|
%p.buttons= link_to "Search Orders", '#', :class => 'button', :rel => 'searchOrders'
|
5
|
-
%h2
|
5
|
+
%h2.orders
|
6
6
|
Orders
|
7
7
|
%span= page_entries_info @orders
|
8
8
|
|
@@ -45,16 +45,20 @@
|
|
45
45
|
%th Total
|
46
46
|
%th Paid?
|
47
47
|
%tbody
|
48
|
-
-
|
49
|
-
%tr
|
50
|
-
%td
|
51
|
-
|
52
|
-
|
53
|
-
%
|
54
|
-
%
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
48
|
+
- if @orders.empty?
|
49
|
+
%tr.empty
|
50
|
+
%td{:colspan => 6} No orders to display.
|
51
|
+
- else
|
52
|
+
- for order in @orders
|
53
|
+
%tr
|
54
|
+
%td= link_to order.number, order
|
55
|
+
%td= order.customer_name
|
56
|
+
%td= status_tag order.status
|
57
|
+
%td
|
58
|
+
%ul
|
59
|
+
- for item in order.order_items
|
60
|
+
%li #{item.quantity} x #{item.product.title}
|
61
|
+
%td= number_to_currency order.total
|
62
|
+
%td= boolean_tag order.paid?
|
59
63
|
|
60
64
|
= paginate @orders
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
= content_for :header do
|
4
4
|
%p.buttons= link_to "Back to orders", :orders, :class => 'button'
|
5
|
-
%h2 Order
|
5
|
+
%h2.orders Order <b>##{@order.number}</b>
|
6
6
|
|
7
7
|
#order
|
8
8
|
.details
|
@@ -31,7 +31,6 @@
|
|
31
31
|
%dt Build Time
|
32
32
|
%dd= distance_of_time_in_words(@order.created_at, @order.received_at)
|
33
33
|
|
34
|
-
|
35
34
|
- if !@order.paid?
|
36
35
|
= form_tag [:pay, @order] do
|
37
36
|
%p.ship
|
@@ -45,7 +44,7 @@
|
|
45
44
|
= submit_tag "Ship", :class => 'button green'
|
46
45
|
|
47
46
|
- if @order.paid? && !(@order.accepted? || @order.rejected?)
|
48
|
-
%p.
|
47
|
+
%p.ship
|
49
48
|
= link_to 'Accept order', [:accept, @order], :method => :post, :class => 'button green'
|
50
49
|
= link_to "Reject order", [:reject, @order], :method => :post, :class => 'button purple'
|
51
50
|
|
@@ -86,32 +85,36 @@
|
|
86
85
|
%table.data
|
87
86
|
%thead
|
88
87
|
%tr
|
89
|
-
%th Qty
|
88
|
+
%th.qty Qty
|
90
89
|
%th Item
|
91
90
|
%th SKU
|
92
|
-
%th
|
93
|
-
%th
|
94
|
-
%th
|
91
|
+
%th.money Cost
|
92
|
+
%th.money Price
|
93
|
+
%th.money= Shoppe.config[:tax_name]
|
94
|
+
%th.money Sub-Total
|
95
95
|
%tbody
|
96
96
|
- for item in @order.order_items
|
97
97
|
%tr
|
98
|
-
%td= item.quantity
|
99
|
-
%td= link_to item.product.title, [:edit, item.product]
|
100
|
-
%td= item.product.sku
|
101
|
-
%td= number_to_currency item.
|
102
|
-
%td= number_to_currency item.
|
103
|
-
%td= number_to_currency item.
|
98
|
+
%td.qty= item.quantity
|
99
|
+
%td.product= link_to item.product.title, [:edit, item.product]
|
100
|
+
%td.sku= item.product.sku
|
101
|
+
%td.money= number_to_currency item.total_cost
|
102
|
+
%td.money= number_to_currency item.sub_total
|
103
|
+
%td.money= number_to_currency item.tax_amount
|
104
|
+
%td.money= number_to_currency item.total
|
105
|
+
- if @order.delivery_service
|
106
|
+
%td.qty
|
107
|
+
%td.product= link_to @order.delivery_service.name, [:edit, @order.delivery_service]
|
108
|
+
%td.sku
|
109
|
+
%td.money= number_to_currency @order.delivery_cost_price
|
110
|
+
%td.money= number_to_currency @order.delivery_price
|
111
|
+
%td.money= number_to_currency @order.delivery_tax_amount
|
112
|
+
%td.money= number_to_currency @order.delivery_price + @order.delivery_tax_amount
|
104
113
|
%tfoot
|
105
114
|
%tr
|
106
|
-
%td.
|
107
|
-
%td
|
108
|
-
|
109
|
-
%td.
|
110
|
-
%td= number_to_currency @order.
|
111
|
-
|
112
|
-
%td.right.bold{:colspan => 5}= Shoppe.config[:tax_name]
|
113
|
-
%td= number_to_currency @order.tax
|
114
|
-
%tr
|
115
|
-
%td.right.bold{:colspan => 5} Total
|
116
|
-
%td= number_to_currency @order.total
|
117
|
-
|
115
|
+
%td.qty= @order.total_items
|
116
|
+
%td{:colspan => 2}
|
117
|
+
%td.money= number_to_currency @order.total_cost
|
118
|
+
%td.money= number_to_currency @order.total_before_tax
|
119
|
+
%td.money= number_to_currency @order.tax
|
120
|
+
%td.money= number_to_currency @order.total
|
@@ -1,12 +1,13 @@
|
|
1
1
|
= form_for @product_category do |f|
|
2
2
|
= f.error_messages
|
3
3
|
= field_set_tag 'Category Details' do
|
4
|
-
|
5
|
-
%
|
6
|
-
|
7
|
-
|
8
|
-
%
|
9
|
-
|
4
|
+
.splitContainer
|
5
|
+
%dl.half
|
6
|
+
%dt= f.label :name
|
7
|
+
%dd= f.text_field :name
|
8
|
+
%dl.half
|
9
|
+
%dt= f.label :permalink
|
10
|
+
%dd= f.text_field :permalink
|
10
11
|
%dl
|
11
12
|
%dt= f.label :description
|
12
13
|
%dd= f.text_area :description
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
= content_for :header do
|
4
4
|
%p.buttons=link_to "New category", :new_product_category, :class => 'button green'
|
5
|
-
%h2 Product Categories
|
5
|
+
%h2.products Product Categories
|
6
6
|
|
7
7
|
.table
|
8
8
|
%table.data
|
@@ -10,6 +10,10 @@
|
|
10
10
|
%tr
|
11
11
|
%th Name
|
12
12
|
%tbody
|
13
|
-
-
|
14
|
-
%tr
|
15
|
-
%td
|
13
|
+
- if @product_categories.empty?
|
14
|
+
%tr.empty
|
15
|
+
%td No categories to display.
|
16
|
+
- else
|
17
|
+
- for cat in @product_categories
|
18
|
+
%tr
|
19
|
+
%td= link_to cat.name, [:edit, cat]
|
@@ -1,19 +1,20 @@
|
|
1
1
|
= form_for @product, :html => {:multipart => true} do |f|
|
2
2
|
= f.error_messages
|
3
|
-
= field_set_tag "Category" do
|
4
|
-
%dl
|
5
|
-
%dt= f.label :product_category_id
|
6
|
-
%dd= f.collection_select :product_category_id, Shoppe::ProductCategory.ordered, :id, :name, :include_blank => true
|
7
3
|
= field_set_tag "Product Information" do
|
8
4
|
%dl
|
9
|
-
%dt= f.label :
|
10
|
-
%dd= f.
|
11
|
-
|
12
|
-
|
13
|
-
%
|
14
|
-
|
15
|
-
|
16
|
-
%
|
5
|
+
%dt= f.label :product_category_id
|
6
|
+
%dd= f.collection_select :product_category_id, Shoppe::ProductCategory.ordered, :id, :name, {:include_blank => true}, {:class => 'chosen'}
|
7
|
+
|
8
|
+
.splitContainer
|
9
|
+
%dl.third
|
10
|
+
%dt= f.label :title
|
11
|
+
%dd= f.text_field :title
|
12
|
+
%dl.third
|
13
|
+
%dt= f.label :permalink
|
14
|
+
%dd= f.text_field :permalink
|
15
|
+
%dl.third
|
16
|
+
%dt= f.label :sku, 'SKU'
|
17
|
+
%dd= f.text_field :sku
|
17
18
|
%dl
|
18
19
|
%dt= f.label :description
|
19
20
|
%dd= f.text_area :description
|
@@ -23,46 +24,88 @@
|
|
23
24
|
%dl
|
24
25
|
%dt= f.label :in_the_box, "What's in the box?"
|
25
26
|
%dd= f.text_area :in_the_box
|
26
|
-
|
27
|
+
|
28
|
+
= field_set_tag "Attributes" do
|
29
|
+
.margin
|
30
|
+
%table.productAttributes
|
31
|
+
%thead
|
32
|
+
%tr
|
33
|
+
%td Name
|
34
|
+
%td Value
|
35
|
+
%td.searchable Searchable?
|
36
|
+
%td.searchable Public?
|
37
|
+
%td.remove Remove
|
38
|
+
%td
|
39
|
+
%tbody
|
40
|
+
%tr.template{:style => 'display:none;'}
|
41
|
+
%td= text_field_tag 'product[product_attributes_array][][key]', '', :placeholder => 'Name'
|
42
|
+
%td= text_field_tag 'product[product_attributes_array][][value]', '', :placeholder => 'Value'
|
43
|
+
%td.searchable= check_box_tag 'product[product_attributes_array][][searchable]', '1'
|
44
|
+
%td.searchable= check_box_tag 'product[product_attributes_array][][public]', '1'
|
45
|
+
%td.remove= link_to "Remove", '#', :class => 'button button-mini purple'
|
46
|
+
%td.handle
|
47
|
+
- for attribute in @product.product_attributes
|
48
|
+
%tr
|
49
|
+
%td= text_field_tag 'product[product_attributes_array][][key]', attribute.key, :placeholder => 'Name'
|
50
|
+
%td= text_field_tag 'product[product_attributes_array][][value]', attribute.value, :placeholder => 'Value'
|
51
|
+
%td.searchable= check_box_tag 'product[product_attributes_array][][searchable]', '1', attribute.searchable?
|
52
|
+
%td.searchable= check_box_tag 'product[product_attributes_array][][public]', '1', attribute.public?
|
53
|
+
%td.remove= link_to "Remove", '#', :class => 'button button-mini purple'
|
54
|
+
%td.handle
|
55
|
+
%p.addAttribute= link_to "Add attribute", '#', :data => {:behavior => 'addAttributeToAttributesTable'}, :class => 'button button-mini green'
|
27
56
|
|
28
|
-
|
29
|
-
|
30
|
-
%
|
31
|
-
=
|
32
|
-
%
|
33
|
-
|
34
|
-
|
35
|
-
%
|
36
|
-
=
|
37
|
-
%
|
57
|
+
= field_set_tag "Attachments" do
|
58
|
+
.splitContainer
|
59
|
+
%dl.half
|
60
|
+
%dt= f.label :default_image_file, "Default Image"
|
61
|
+
%dd
|
62
|
+
= attachment_preview @product.default_image
|
63
|
+
%p= f.file_field :default_image_file
|
64
|
+
%dl.half
|
65
|
+
%dt= f.label :data_sheet_file, "Datasheet"
|
66
|
+
%dd
|
67
|
+
= attachment_preview @product.data_sheet
|
68
|
+
%p= f.file_field :data_sheet_file
|
38
69
|
|
39
70
|
= field_set_tag "Pricing" do
|
40
|
-
|
41
|
-
%
|
42
|
-
|
43
|
-
|
44
|
-
%
|
45
|
-
|
71
|
+
.splitContainer
|
72
|
+
%dl.third
|
73
|
+
%dt= f.label :price
|
74
|
+
%dd= f.text_field :price
|
75
|
+
%dl.third
|
76
|
+
%dt= f.label :cost_price
|
77
|
+
%dd= f.text_field :cost_price
|
78
|
+
%dl.third
|
79
|
+
%dt= f.label :tax_rate
|
80
|
+
%dd= f.text_field :tax_rate
|
46
81
|
|
47
82
|
= field_set_tag "Website Properties" do
|
48
|
-
|
49
|
-
|
50
|
-
%
|
51
|
-
= f.
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
%
|
56
|
-
= f.
|
57
|
-
|
83
|
+
.splitContainer
|
84
|
+
|
85
|
+
%dl.half
|
86
|
+
%dt= f.label :active, "On sale?"
|
87
|
+
%dd.checkbox
|
88
|
+
= f.check_box :active
|
89
|
+
= f.label :active, "If checked, this product will be displayed within the public store"
|
90
|
+
%dl.half
|
91
|
+
%dt= f.label :featured, "Featured?"
|
92
|
+
%dd.checkbox
|
93
|
+
= f.check_box :featured
|
94
|
+
= f.label :featured, "If checked, this product will appear on your homepage"
|
58
95
|
|
59
96
|
= field_set_tag "Stock Control" do
|
60
|
-
|
61
|
-
%
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
97
|
+
.splitContainer
|
98
|
+
%dl.third
|
99
|
+
%dt= f.label :stock_control
|
100
|
+
%dd.checkbox
|
101
|
+
= f.check_box :stock_control
|
102
|
+
= f.label :stock_control, "Enable stock control for this product?"
|
103
|
+
%dl.third
|
104
|
+
%dt= f.label :stock, "Current stock"
|
105
|
+
%dd= f.text_field :stock
|
106
|
+
%dl.third
|
107
|
+
%dt= f.label :weight
|
108
|
+
%dd= f.text_field :weight
|
66
109
|
|
67
110
|
%p.submit
|
68
111
|
- unless @product.new_record?
|
@@ -1,11 +1,8 @@
|
|
1
1
|
- @page_title = "Products"
|
2
2
|
|
3
3
|
= content_for :header do
|
4
|
-
%p.buttons
|
5
|
-
|
6
|
-
= link_to "New category", :new_product_category, :class => 'button green'
|
7
|
-
|
8
|
-
%h2 Products
|
4
|
+
%p.buttons= link_to "New product", :new_product, :class => 'button green'
|
5
|
+
%h2.products Products
|
9
6
|
|
10
7
|
.table
|
11
8
|
%table.data
|
@@ -16,12 +13,16 @@
|
|
16
13
|
%th Price
|
17
14
|
%th Stock
|
18
15
|
%tbody
|
19
|
-
-
|
20
|
-
%tr
|
21
|
-
%
|
22
|
-
|
16
|
+
- if @products.empty?
|
17
|
+
%tr.empty
|
18
|
+
%td{:colspan => 4} No products to display.
|
19
|
+
- else
|
20
|
+
- for category, products in @products
|
23
21
|
%tr
|
24
|
-
%
|
25
|
-
|
26
|
-
%
|
27
|
-
|
22
|
+
%th{:colspan => 4}= category.name
|
23
|
+
- for product in products
|
24
|
+
%tr
|
25
|
+
%td= product.sku
|
26
|
+
%td= link_to product.title, [:edit, product]
|
27
|
+
%td= number_to_currency product.price
|
28
|
+
%td= product.stock
|
@@ -1,22 +1,24 @@
|
|
1
1
|
= form_for @user do |f|
|
2
2
|
= f.error_messages
|
3
3
|
= field_set_tag "User Details" do
|
4
|
-
|
5
|
-
%
|
6
|
-
|
7
|
-
|
8
|
-
%
|
9
|
-
|
4
|
+
.splitContainer
|
5
|
+
%dl.half
|
6
|
+
%dt= f.label :first_name
|
7
|
+
%dd= f.text_field :first_name
|
8
|
+
%dl.half
|
9
|
+
%dt= f.label :last_name
|
10
|
+
%dd= f.text_field :last_name
|
10
11
|
= field_set_tag "Login" do
|
11
|
-
|
12
|
-
%
|
13
|
-
|
14
|
-
|
15
|
-
%
|
16
|
-
|
17
|
-
|
18
|
-
%
|
19
|
-
|
12
|
+
.splitContainer
|
13
|
+
%dl.third
|
14
|
+
%dt= f.label :email_address
|
15
|
+
%dd= f.text_field :email_address
|
16
|
+
%dl.third
|
17
|
+
%dt= f.label :password
|
18
|
+
%dd= f.password_field :password
|
19
|
+
%dl.third
|
20
|
+
%dt= f.label :password_confirmation, "...and again"
|
21
|
+
%dd= f.password_field :password_confirmation
|
20
22
|
|
21
23
|
|
22
24
|
%p.submit
|