shoppe 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -182,14 +182,6 @@ header.main {
182
182
  dt label { font-weight:500;}
183
183
  dd { }
184
184
  dd input[type=text], dd input[type=password], textarea {
185
- width:100%; padding:5px; border:1px solid #ccc;
186
- -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
187
- -moz-box-sizing: border-box; /* Firefox, other Gecko */
188
- box-sizing: border-box; /* Opera/IE 8+ */
189
- font-size:1.1em;
190
- font-family:$font;
191
- &:focus { border-color:#9AC835; }
192
- &.short { width:100px;}
193
185
  }
194
186
  dd select { width:100%;}
195
187
  dd textarea { height:80px; }
@@ -292,16 +284,20 @@ header.main {
292
284
  p.acceptreject { text-align:center; margin-top:22px; }
293
285
  p.acceptreject a { margin: 0 5px;}
294
286
  p.ship { text-align:center; margin-top:22px;}
295
- p.ship input[type=text] { padding:5px; width:200px; }
287
+ p.ship input[type=text] { }
296
288
  }
297
289
 
298
290
  dl {
299
291
  dt { float:left; width:30%; text-align:right; color:#888;white-space:nowrap}
300
292
  dd { font-weight:bold; margin-left:35%; margin-bottom:6px; white-space:nowrap}
293
+ dt.padding { padding-top:6px;}
301
294
  }
302
295
 
303
- p.ship { background:#fff; text-align:center;padding:15px;border:1px solid #CED2D8;}
304
- p.ship input, p.ship a { margin:0 10px;}
296
+ dl.form {
297
+ margin-top:15px;
298
+ input.text { width:70%}
299
+ a.button { margin-right:5px;}
300
+ }
305
301
 
306
302
  }
307
303
 
@@ -326,6 +322,15 @@ header.main {
326
322
  }
327
323
  }
328
324
 
325
+ .notes {
326
+ background:#fff;
327
+ border:1px solid #CED2D8;
328
+ p { padding:15px;}
329
+ p textarea { border:0; padding:0; width:100%; resize:none; height:100px; font-family:$font; font-size:1.1em}
330
+ h4 { background:#F7F9FC; padding:10px 15px; font-weight:500;}
331
+ h4 input { float:right; margin-top:-3px;}
332
+ }
333
+
329
334
  .order_items {
330
335
  margin:25px 0;
331
336
  table.data {
@@ -407,4 +412,18 @@ span.boolean span.false { color:#c04a4a}
407
412
 
408
413
  .float-right { float:right;}
409
414
 
410
- div.field_with_errors { display:inline;}
415
+ div.field_with_errors { display:inline;}
416
+
417
+ //
418
+ // standard text input box
419
+ //
420
+ input.text, textarea.text {
421
+ width:100%; padding:5px; border:1px solid #ccc;
422
+ -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
423
+ -moz-box-sizing: border-box; /* Firefox, other Gecko */
424
+ box-sizing: border-box; /* Opera/IE 8+ */
425
+ font-size:1.1em;
426
+ font-family:$font;
427
+ &:focus { border-color:#9AC835; }
428
+ &.short { width:100px;}
429
+ }
@@ -19,7 +19,7 @@
19
19
  -moz-box-sizing: border-box;
20
20
  box-sizing: border-box;
21
21
  width: 100%;
22
- border: 1px solid #ccc;
22
+ border: 1px solid #aaa;
23
23
  border-top: 0;
24
24
  background: #fff;
25
25
  box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
@@ -39,7 +39,7 @@
39
39
  overflow: hidden;
40
40
  padding: 0 0 0 8px;
41
41
  height: 23px;
42
- border: 1px solid #ccc;
42
+ border: 1px solid #aaa;
43
43
  border-radius: 5px;
44
44
  background-color: #fff;
45
45
  background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
@@ -1,5 +1,6 @@
1
1
  class Shoppe::DeliveryServicePricesController < Shoppe::ApplicationController
2
-
2
+
3
+ before_filter { @active_nav = :delivery_services }
3
4
  before_filter { @delivery_service = Shoppe::DeliveryService.find(params[:delivery_service_id])}
4
5
  before_filter { params[:id] && @delivery_service_price = @delivery_service.delivery_service_prices.find(params[:id])}
5
6
 
@@ -8,6 +8,11 @@ class Shoppe::OrdersController < Shoppe::ApplicationController
8
8
  @orders = @query.result
9
9
  end
10
10
 
11
+ def update
12
+ @order.update_attributes!(params[:order].permit(:notes))
13
+ redirect_to @order, :notice => "Order has been saved successfully"
14
+ end
15
+
11
16
  def search
12
17
  index
13
18
  render :action => "index"
@@ -29,7 +34,7 @@ class Shoppe::OrdersController < Shoppe::ApplicationController
29
34
  end
30
35
 
31
36
  def pay
32
- @order.pay!(params[:payment_reference], 'Manual')
37
+ @order.pay!(params[:payment_reference], params[:payment_method].blank? ? 'Unknown' : params[:payment_method])
33
38
  redirect_to @order, :notice => "Order has been marked as paid successfully"
34
39
  end
35
40
 
@@ -4,23 +4,23 @@
4
4
  .splitContainer
5
5
  %dl.third
6
6
  %dt= f.label :code
7
- %dd= f.text_field :code
7
+ %dd= f.text_field :code, :class => 'text'
8
8
 
9
9
  %dl.third
10
10
  %dt= f.label :min_weight
11
- %dd= f.text_field :min_weight
11
+ %dd= f.text_field :min_weight, :class => 'text'
12
12
  %dl.third
13
13
  %dt= f.label :max_weight
14
- %dd= f.text_field :max_weight
14
+ %dd= f.text_field :max_weight, :class => 'text'
15
15
 
16
16
  = field_set_tag "Pricing" do
17
17
  .splitContainer
18
18
  %dl.third
19
19
  %dt= f.label :price
20
- %dd= f.text_field :price
20
+ %dd= f.text_field :price, :class => 'text'
21
21
  %dl.third
22
22
  %dt= f.label :cost_price
23
- %dd= f.text_field :cost_price
23
+ %dd= f.text_field :cost_price, :class => 'text'
24
24
  %dl.third
25
25
  %dt= f.label :tax_rate_id
26
26
  %dd= f.collection_select :tax_rate_id, Shoppe::TaxRate.ordered, :id, :description, {:include_blank => true}, {:class => 'chosen-with-deselect', :data => {:placeholder => "No tax"}}
@@ -4,10 +4,10 @@
4
4
  .splitContainer
5
5
  %dl.half
6
6
  %dt= f.label :name
7
- %dd= f.text_field :name
7
+ %dd= f.text_field :name, :class => 'text'
8
8
  %dl.half
9
9
  %dt= f.label :code
10
- %dd= f.text_field :code
10
+ %dd= f.text_field :code, :class => 'text'
11
11
  .splitContainer
12
12
  %dl.half
13
13
  %dt= f.label :active
@@ -23,11 +23,11 @@
23
23
  .splitContainer
24
24
  %dl.half
25
25
  %dt= f.label :courier, "Courier Name"
26
- %dd= f.text_field :courier
26
+ %dd= f.text_field :courier, :class => 'text'
27
27
  %dl.half
28
28
  %dt= f.label :tracking_url, "Tracking URL"
29
29
  %dd
30
- = f.text_field :tracking_url
30
+ = f.text_field :tracking_url, :class => 'text'
31
31
  %p.help Use <code>{{consignment_number}}</code> to insert the consignment number.
32
32
 
33
33
  %p.submit
@@ -33,20 +33,28 @@
33
33
 
34
34
  - if !@order.paid?
35
35
  = form_tag [:pay, @order] do
36
- %p.ship
37
- = text_field_tag 'payment_reference', '', :placeholder => "Enter payment reference..."
38
- = submit_tag "Mark as paid", :class => 'button green'
36
+ %dl.form
37
+ %dt.padding= label_tag 'payment_method', 'Payment Method'
38
+ %dd= text_field_tag 'payment_method', '', :class => 'text'
39
+ %dl
40
+ %dt.padding= label_tag 'payment_reference', 'Payment Reference'
41
+ %dd= text_field_tag 'payment_reference', '', :class => 'text'
42
+ %dl
43
+ %dd= submit_tag "Mark as paid", :class => 'button green button-mini'
39
44
 
40
45
  - if @order.accepted? && !@order.shipped?
41
46
  = form_tag [:ship, @order] do
42
- %p.ship
43
- = text_field_tag 'consignment_number', '', :placeholder => "Enter consignment number..."
44
- = submit_tag "Ship", :class => 'button green'
47
+ %dl.form
48
+ %dt.padding= label_tag 'consignment_number', 'Consignment Number'
49
+ %dd= text_field_tag 'consignment_number', '', :class => 'text'
50
+ %dl
51
+ %dd= submit_tag "Mark as shipped", :class => 'button green button-mini'
45
52
 
46
53
  - if @order.paid? && !(@order.accepted? || @order.rejected?)
47
- %p.ship
48
- = link_to 'Accept order', [:accept, @order], :method => :post, :class => 'button green'
49
- = link_to "Reject order", [:reject, @order], :method => :post, :class => 'button purple'
54
+ %dl.form
55
+ %dd
56
+ = link_to "Accept", [:accept, @order], :method => :post, :class => 'button green'
57
+ = link_to "Reject", [:reject, @order], :method => :post, :class => 'button purple'
50
58
 
51
59
  .status-bar
52
60
  %ul
@@ -79,7 +87,7 @@
79
87
  %p= link_to "Tracking URL", @order.courier_tracking_url
80
88
  - else
81
89
  %p Consignment # <b>#{@order.consignment_number}</b>
82
-
90
+
83
91
  .order_items
84
92
  .table
85
93
  %table.data
@@ -118,3 +126,10 @@
118
126
  %td.money= number_to_currency @order.total_before_tax
119
127
  %td.money= number_to_currency @order.tax
120
128
  %td.money= number_to_currency @order.total
129
+ .notes
130
+ = form_for @order do |f|
131
+ %h4
132
+ = f.submit "Save Notes", :class => 'button button-mini green'
133
+ Order Notes
134
+ %p= f.text_area :notes
135
+
@@ -4,13 +4,13 @@
4
4
  .splitContainer
5
5
  %dl.half
6
6
  %dt= f.label :name
7
- %dd= f.text_field :name
7
+ %dd= f.text_field :name, :class => 'text'
8
8
  %dl.half
9
9
  %dt= f.label :permalink
10
- %dd= f.text_field :permalink
10
+ %dd= f.text_field :permalink, :class => 'text'
11
11
  %dl
12
12
  %dt= f.label :description
13
- %dd= f.text_area :description
13
+ %dd= f.text_area :description, :class => 'text'
14
14
  = field_set_tag "Attachments" do
15
15
 
16
16
  %dl
@@ -8,22 +8,22 @@
8
8
  .splitContainer
9
9
  %dl.third
10
10
  %dt= f.label :title
11
- %dd= f.text_field :title
11
+ %dd= f.text_field :title, :class => 'text'
12
12
  %dl.third
13
13
  %dt= f.label :permalink
14
- %dd= f.text_field :permalink
14
+ %dd= f.text_field :permalink, :class => 'text'
15
15
  %dl.third
16
16
  %dt= f.label :sku, 'SKU'
17
- %dd= f.text_field :sku
17
+ %dd= f.text_field :sku, :class => 'text'
18
18
  %dl
19
19
  %dt= f.label :description
20
- %dd= f.text_area :description
20
+ %dd= f.text_area :description, :class => 'text'
21
21
  %dl
22
22
  %dt= f.label :short_description
23
- %dd= f.text_area :short_description
23
+ %dd= f.text_area :short_description, :class => 'text'
24
24
  %dl
25
25
  %dt= f.label :in_the_box, "What's in the box?"
26
- %dd= f.text_area :in_the_box
26
+ %dd= f.text_area :in_the_box, :class => 'text'
27
27
 
28
28
  = field_set_tag "Attributes" do
29
29
  .margin
@@ -71,10 +71,10 @@
71
71
  .splitContainer
72
72
  %dl.third
73
73
  %dt= f.label :price
74
- %dd= f.text_field :price
74
+ %dd= f.text_field :price, :class => 'text'
75
75
  %dl.third
76
76
  %dt= f.label :cost_price
77
- %dd= f.text_field :cost_price
77
+ %dd= f.text_field :cost_price, :class => 'text'
78
78
  %dl.third
79
79
  %dt= f.label :tax_rate_id
80
80
  %dd= f.collection_select :tax_rate_id, Shoppe::TaxRate.ordered, :id, :description, {:include_blank => true}, {:class => 'chosen-with-deselect', :data => {:placeholder => "No tax"}}
@@ -97,7 +97,7 @@
97
97
  .splitContainer
98
98
  %dl.half
99
99
  %dt= f.label :weight
100
- %dd= f.text_field :weight
100
+ %dd= f.text_field :weight, :class => 'text'
101
101
 
102
102
  %dl.half
103
103
  %dt= f.label :stock_control
@@ -9,10 +9,10 @@
9
9
  .splitContainer
10
10
  %dl.half
11
11
  %dt= f.label :name
12
- %dd= f.text_field :name, :class => 'focus'
12
+ %dd= f.text_field :name, :class => 'focus text'
13
13
  %dl.half
14
14
  %dt= f.label :rate
15
- %dd= f.text_field :rate
15
+ %dd= f.text_field :rate, :class => 'text'
16
16
 
17
17
  = field_set_tag "Countries" do
18
18
  %dl
@@ -0,0 +1,5 @@
1
+ class AddNotesToOrders < ActiveRecord::Migration
2
+ def change
3
+ add_column :shoppe_orders, :notes, :text
4
+ end
5
+ end
@@ -15,6 +15,8 @@ module Shoppe
15
15
  g.helper false
16
16
  end
17
17
 
18
+ config.assets.precompile += ['shoppe/sub.css']
19
+
18
20
  initializer 'shoppe.initialize' do |app|
19
21
  # Preload the config
20
22
  Shoppe.config
@@ -1,3 +1,3 @@
1
1
  module Shoppe
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20131020204719) do
14
+ ActiveRecord::Schema.define(version: 20131021135208) do
15
15
 
16
16
  create_table "nifty_attachments", force: true do |t|
17
17
  t.integer "parent_id"
@@ -114,6 +114,7 @@ ActiveRecord::Schema.define(version: 20131020204719) do
114
114
  t.string "payment_reference"
115
115
  t.string "payment_method"
116
116
  t.decimal "delivery_cost_price", precision: 8, scale: 2
117
+ t.text "notes"
117
118
  end
118
119
 
119
120
  create_table "shoppe_product_attributes", force: true do |t|
@@ -1078,3 +1078,10 @@ Migrating to AddCountriesToTaxRatesAndDeliveryPrices (20131020204719)
1078
1078
  SQL (0.2ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20131020204719')
1079
1079
   (0.3ms) COMMIT
1080
1080
  ActiveRecord::SchemaMigration Load (0.2ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1081
+ ActiveRecord::SchemaMigration Load (1.0ms) SELECT `schema_migrations`.* FROM `schema_migrations`
1082
+ Migrating to AddNotesToOrders (20131021135208)
1083
+  (25.9ms) ALTER TABLE `shoppe_orders` ADD `notes` text
1084
+  (0.1ms) BEGIN
1085
+ SQL (1.7ms) INSERT INTO `schema_migrations` (`version`) VALUES ('20131021135208')
1086
+  (0.4ms) COMMIT
1087
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT `schema_migrations`.* FROM `schema_migrations`
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoppe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -379,6 +379,7 @@ files:
379
379
  - db/migrate/20131017180920_create_shoppe_countries.rb
380
380
  - db/migrate/20131017183211_create_shoppe_tax_rates.rb
381
381
  - db/migrate/20131020204719_add_countries_to_tax_rates_and_delivery_prices.rb
382
+ - db/migrate/20131021135208_add_notes_to_orders.rb
382
383
  - db/seeds.rb
383
384
  - db/seeds_data/poe400.jpg
384
385
  - db/seeds_data/snom-870-blk.jpg
@@ -464,7 +465,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
464
465
  version: '0'
465
466
  segments:
466
467
  - 0
467
- hash: -2288796444690138098
468
+ hash: -782620393111766145
468
469
  required_rubygems_version: !ruby/object:Gem::Requirement
469
470
  none: false
470
471
  requirements:
@@ -473,7 +474,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
473
474
  version: '0'
474
475
  segments:
475
476
  - 0
476
- hash: -2288796444690138098
477
+ hash: -782620393111766145
477
478
  requirements: []
478
479
  rubyforge_project:
479
480
  rubygems_version: 1.8.23