office_clerk 0.4 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +11 -36
  3. data/LICENSE +22 -0
  4. data/app/assets/javascripts/office_clerk.js +0 -7
  5. data/app/assets/stylesheets/{office_clerk.scss → office_clerk.css.scss} +0 -0
  6. data/app/controllers/orders_controller.rb +10 -1
  7. data/app/controllers/products_controller.rb +2 -32
  8. data/app/controllers/shop_controller.rb +1 -0
  9. data/app/helpers/orders_helper.rb +6 -5
  10. data/app/helpers/shop_helper.rb +8 -7
  11. data/app/mailers/order_mailer.rb +19 -0
  12. data/app/views/addresses/_form_fields.html.haml +4 -4
  13. data/app/views/baskets/edit.html.haml +1 -1
  14. data/app/views/categories/edit.html.haml +22 -18
  15. data/app/views/clerks/edit.html.haml +6 -9
  16. data/app/views/layouts/office_clerk.haml +1 -0
  17. data/app/views/layouts/sales_clerk.haml +10 -0
  18. data/app/views/order_mailer/cancel.html.haml +6 -0
  19. data/app/views/order_mailer/confirm.html.haml +7 -0
  20. data/app/views/order_mailer/paid.html.haml +6 -0
  21. data/app/views/order_mailer/shipped.html.haml +6 -0
  22. data/app/views/orders/edit.html.haml +1 -1
  23. data/app/views/orders/show.html.haml +48 -44
  24. data/app/views/products/_head.haml +4 -2
  25. data/app/views/products/edit.html.haml +35 -24
  26. data/app/views/products/show.html.haml +32 -41
  27. data/app/views/purchases/edit.html.haml +4 -4
  28. data/app/views/sessions/sign_up.haml +1 -1
  29. data/app/views/shop/_product_box.haml +13 -0
  30. data/app/views/suppliers/edit.html.haml +2 -2
  31. data/bin/rails +3 -15
  32. data/config/environments/production.rb +2 -77
  33. data/config/locales/config.yml +1 -1
  34. data/config/locales/en.yml +75 -45
  35. data/config/locales/fi.yml +60 -67
  36. data/config/routes.rb +1 -1
  37. data/db/migrate/20131226143612_categories.rb +2 -1
  38. data/db/migrate/20131226151332_products.rb +2 -1
  39. data/lib/office_clerk.rb +2 -7
  40. data/lib/office_clerk/version.rb +1 -1
  41. data/lib/templates/haml/scaffold/_form.html.haml +1 -1
  42. data/office_clerk.gemspec +6 -12
  43. data/spec/features/products/edit_spec.rb +0 -4
  44. data/spec/mailers/order_mailer_spec.rb +24 -0
  45. data/spec/models/baskets/items_spec.rb +3 -3
  46. data/spec/models/locale_spec.rb +4 -0
  47. data/test_app/db/migrate/20141114205527_categories.office.rb +2 -2
  48. data/test_app/db/migrate/20141114205532_products.office.rb +2 -2
  49. data/test_app/db/schema.rb +4 -2
  50. data/todo +0 -4
  51. metadata +68 -111
  52. data/config/initializers/migrate.rb +0 -6
  53. data/config/initializers/simple_form.rb +0 -149
  54. data/config/initializers/simple_form_bootstrap.rb +0 -48
  55. data/db/seeds.rb +0 -4
  56. data/test/fixtures/baskets.yml +0 -41993
  57. data/test/fixtures/categories.yml +0 -638
  58. data/test/fixtures/clerks.yml +0 -694
  59. data/test/fixtures/items.yml +0 -83651
  60. data/test/fixtures/orders.yml +0 -58918
  61. data/test/fixtures/products.yml +0 -110904
  62. data/test/fixtures/purchases.yml +0 -1755
  63. data/test/fixtures/suppliers.yml +0 -341
@@ -7,4 +7,4 @@ config:
7
7
  tax: 24.0
8
8
  free_shipping: 100
9
9
  print_styles: ""
10
-
10
+ mail_buttons: "confirm cancel paid shipped"
@@ -3,50 +3,6 @@ en:
3
3
  empty: Empty
4
4
  online_eq: Online?
5
5
  actions: Actions
6
- activerecord:
7
- attributes:
8
- basket:
9
- created_at: Created
10
- total_price: Price
11
- clerk:
12
- city: City
13
- email: Email
14
- name: Name
15
- password: Passord
16
- password_confirmation: Password confirmation
17
- phone: Phone
18
- street: Street
19
- order:
20
- email: Email
21
- ordered_on: Ordered on
22
- product:
23
- description: Description
24
- ean: Ean
25
- inventory: Inventory
26
- name: Name
27
- online: online
28
- price: Price
29
- scode: Supplier code
30
- tax: Tax rate
31
- weight: Weight
32
- purchase:
33
- name: Name
34
- ordered_on: Ordered on
35
- received_on: Received on
36
- supplier:
37
- city: City
38
- name: Name
39
- phone: Phone
40
- street: Street
41
- supplier_name: Supplier
42
- models:
43
- basket: Cart
44
- category: Product group
45
- clerk: User
46
- order: Order
47
- product: Product
48
- purchase: Purchase
49
- supplier: Supplier
50
6
  add: Add
51
7
  add_inventory: Add Inventory
52
8
  add_to_basket: Add to basket
@@ -56,7 +12,6 @@ en:
56
12
  are_you_sure: Are you sure?
57
13
  as_inventory: As Inventory
58
14
  back: Back
59
- barcode: Barcode
60
15
  basket: Basket
61
16
  basket_empty: Basket is empty
62
17
  basket_locked: Basket is locked, unlock to change
@@ -64,12 +19,15 @@ en:
64
19
  between: ' between'
65
20
  cancel: Cancel
66
21
  canceled_on: Canceled on
22
+ cancel_order_button: Cancel email
67
23
  categories: Product Categories
68
24
  category: Product Category
69
25
  choose_product_for_basket: Choose product for basket
26
+ checkout: Checkout
70
27
  city: City
71
28
  clerk: User
72
29
  clerks: Users
30
+ confirm_order_button: Send Confirmation Email
73
31
  contact: Contact
74
32
  cost: Cost
75
33
  count: Count
@@ -91,6 +49,7 @@ en:
91
49
  filter: Filter
92
50
  first_name: First Name
93
51
  history: Order history
52
+ home: Home
94
53
  info: Info
95
54
  inventorized: Inventorized
96
55
  inventory: Inventory
@@ -101,6 +60,7 @@ en:
101
60
  link: Link
102
61
  made_offline: taken offline
103
62
  made_online: made online
63
+ manage: Manage
104
64
  main_picture: Main Picture
105
65
  make_order: Make Order
106
66
  make_purchase: Make Purchase
@@ -111,27 +71,38 @@ en:
111
71
  new_item: New product item
112
72
  next: Next
113
73
  not_online: not online
74
+ notice: Notice
114
75
  online: Online
115
76
  order: Order
116
77
  order_number: Number
78
+ order_more_for_free_shipping: "Order %{more} € for free shipping"
117
79
  order_total: Order total
118
80
  ordered: Ordered
119
81
  ordered_on: Ordered On
120
82
  orders: Orders
121
83
  our_shop: Our shop
84
+ paid: Paid
122
85
  paid_on: Paid on
86
+ paid_order_button: Paid Mail
123
87
  parent: Parent
88
+ password: Password
124
89
  phone: Phone
125
90
  picture: Picture
126
91
  picture2: Picture 2
127
92
  position: Position
128
93
  prev: Previous
94
+ preview: Preview
129
95
  price: Price
130
96
  price_between: Price between
131
97
  print: Print
98
+ print_invoice: Print Invoice
132
99
  print_order: Print Order
100
+ print_reminder: Print Reminder
101
+ print_slip: Print Package Slip
102
+ print_receipt: Print Receipt
133
103
  product: Product
134
104
  product_added: Product added
105
+ product_item: Product Item
135
106
  product_line: Product Line
136
107
  product_line_has_inventory: Product Line has inventori
137
108
  products: Products
@@ -142,10 +113,13 @@ en:
142
113
  received: Received
143
114
  received_on: Received On
144
115
  scode: Supplier code
116
+ select: Select
145
117
  search: Search
118
+ ship: Ship
146
119
  shipment_price: Shipment price
147
120
  shipment_type: Shipment type
148
121
  shipped_on: Shipped on
122
+ shipped_order_button: Ship Order Email
149
123
  shop: Shop
150
124
  show: Show
151
125
  sign_in: Log in
@@ -160,6 +134,7 @@ en:
160
134
  street2: Street2
161
135
  supplier: Supplier
162
136
  suppliers: Suppliers
137
+ summary: Summary
163
138
  tax: Vat
164
139
  tax_percent: Tax percent
165
140
  tax_rate: Vat rate
@@ -180,3 +155,58 @@ en:
180
155
  next_label: Next →
181
156
  page_gap: '…'
182
157
  previous_label: '← Previous'
158
+ activerecord:
159
+ attributes:
160
+ basket:
161
+ created_at: Created
162
+ total_price: Price
163
+ clerk:
164
+ city: City
165
+ email: Email
166
+ name: Name
167
+ password: Passord
168
+ password_confirmation: Password confirmation
169
+ phone: Phone
170
+ street: Street
171
+ category:
172
+ name: Name
173
+ online: Online
174
+ category: Parent
175
+ link: Link
176
+ position: Position
177
+ description: Description
178
+ order:
179
+ email: Email
180
+ ordered_on: Ordered on
181
+ purchase:
182
+ name: Name
183
+ ordered_on: Ordered on
184
+ received_on: Received on
185
+ product:
186
+ description: Description
187
+ ean: Ean
188
+ inventory: Inventory
189
+ name: Name
190
+ online: online
191
+ price: Price
192
+ scode: Supplier code
193
+ tax: Tax rate
194
+ weight: Weight
195
+ cost: Cost
196
+ supplier: Suppier
197
+ category: Category
198
+ name: Name
199
+ supplier:
200
+ city: City
201
+ name: Name
202
+ phone: Phone
203
+ street: Street
204
+ supplier_name: Supplier
205
+ models:
206
+ basket: Cart
207
+ category: Product group
208
+ clerk: User
209
+ order: Order
210
+ product: Product
211
+ purchase: Purchase
212
+ supplier: Supplier
@@ -1,60 +1,6 @@
1
1
  ---
2
2
  fi:
3
3
  actions: Toimenpiteet
4
- activerecord:
5
- attributes:
6
- basket:
7
- created_at: Luotu
8
- total_price: Hinta
9
- clerk:
10
- city: Kaupunki
11
- email: S-posti
12
- name: Nimi
13
- password: Salasana
14
- password_confirmation: Vahvista salasana
15
- phone: Puhelin
16
- street: Osoite
17
- category:
18
- name: Nimi
19
- online: Netissä
20
- category: Pääryhmä
21
- link: Linkki
22
- position: Järjetysnummero
23
- description: Kuvaus
24
- order:
25
- email: S-posti
26
- ordered_on: Tilattu
27
- product:
28
- description: Kuvaus
29
- ean: Ean
30
- inventory: Inventaario
31
- name: Nimi
32
- online: Netissä
33
- price: Hinta
34
- cost: Kustannus
35
- scode: Tuottajatunnus
36
- tax: Veroprosentti
37
- weight: Paino
38
- supplier: Tuottaja
39
- category: Tuoteryhmä
40
- purchase:
41
- name: Nimi
42
- ordered_on: Tilattu
43
- received_on: Vastaanotettu
44
- supplier:
45
- city: Kaupunki
46
- name: Nimi
47
- phone: Puhelin
48
- street: Osoite
49
- supplier_name: Tuottaja
50
- models:
51
- basket: Ostoskori
52
- category: Tuoteryhmä
53
- clerk: Käyttäjä
54
- order: Tilaus
55
- product: Tuote
56
- purchase: Sisäänosto
57
- supplier: Tuottaja
58
4
  add: Lisää
59
5
  add_inventory: Lisää inventaarioon
60
6
  add_to_basket: Lisää ostoskoriin
@@ -64,13 +10,13 @@ fi:
64
10
  are_you_sure: Oletko varma
65
11
  as_inventory: Inventaarioon
66
12
  back: Listalle
67
- barcode: Viivakoodi
68
13
  basket: Ostoskori
69
14
  basket_empty: Ostoskori on tyhjä
70
15
  basket_locked: Ostoskoria ei voi muuttaa
71
16
  baskets: Ostoskorit
72
17
  between: haarukka
73
18
  cancel: Peruuta
19
+ cancel_order_button: Peruta s-post
74
20
  canceled_on: Peruutettu
75
21
  categories: Tuoteryhmät
76
22
  category: Tuoteryhmä
@@ -79,6 +25,7 @@ fi:
79
25
  city: Kaupunki
80
26
  clerk: Käyttäjä
81
27
  clerks: Käyttäjät
28
+ confirm_order_button: Vahvistus s-post
82
29
  contact: Kontaktihenkilö
83
30
  cost: Kustannus
84
31
  count: Määrä
@@ -110,8 +57,6 @@ fi:
110
57
  items: Tuotteet
111
58
  last_name: Sukunimi
112
59
  link: linkki
113
- login: Kirjaudu sisään
114
- logout: Kirjaudu ulos
115
60
  made_offline: poistettu netistä
116
61
  made_online: laitettu nettiin
117
62
  main_picture: Kuva
@@ -138,6 +83,7 @@ fi:
138
83
  our_shop: Liikkeemme
139
84
  paid: Maksa
140
85
  paid_on: Maksettu
86
+ paid_order_button: Maksettu s-post
141
87
  parent: Tuoteryhmä
142
88
  password: Salasana
143
89
  phone: Puhelin
@@ -145,6 +91,7 @@ fi:
145
91
  picture2: Toinen kuva
146
92
  position: Paikka
147
93
  prev: edellinen
94
+ preview: Esikatselu
148
95
  price: Hinta
149
96
  price_between: Hinta haarukka
150
97
  print: Tulosta
@@ -172,6 +119,7 @@ fi:
172
119
  shipment_price: Lähetyksen hinta
173
120
  shipment_type: Lähetyksen tapa
174
121
  shipped_on: Lähetetty
122
+ shipped_order_button: Lähetetty S-Posti
175
123
  shop: Kauppa
176
124
  show: Näytä
177
125
  sign_in: Kirjaudu sisään
@@ -180,22 +128,13 @@ fi:
180
128
  sign_up: Luo tili
181
129
  signed_in: Sisäänkirjautunut
182
130
  signed_out: Uloskirjautunut
183
- simple_form:
184
- error_notification:
185
- default_message: 'Tarkista uudelleen:'
186
- 'false': Ei
187
- "no": Ei
188
- required:
189
- mark: '*'
190
- text: required
191
- 'true': Kyllä
192
- "yes": Kyllä
193
131
  state: Tila
194
132
  street: Osoite
195
133
  street1: Osoite1
196
134
  street2: Osoite2
197
135
  supplier: Tuottaja
198
136
  suppliers: Tuottajat
137
+ summary: Yhteenveto
199
138
  tax: Alv
200
139
  tax_percent: Veroprosentti
201
140
  tax_rate: Veroprosentti
@@ -216,3 +155,57 @@ fi:
216
155
  next_label: seuraava
217
156
  page_gap: '…'
218
157
  previous_label: edellinen
158
+ activerecord:
159
+ attributes:
160
+ basket:
161
+ created_at: Luotu
162
+ total_price: Hinta
163
+ clerk:
164
+ city: Kaupunki
165
+ email: S-posti
166
+ name: Nimi
167
+ password: Salasana
168
+ password_confirmation: Vahvista salasana
169
+ phone: Puhelin
170
+ street: Osoite
171
+ category:
172
+ name: Nimi
173
+ online: Netissä
174
+ category: Pääryhmä
175
+ link: Linkki
176
+ position: Järjetysnummero
177
+ description: Kuvaus
178
+ order:
179
+ email: S-posti
180
+ ordered_on: Tilattu
181
+ product:
182
+ description: Kuvaus
183
+ ean: Ean
184
+ inventory: Inventaario
185
+ name: Nimi
186
+ online: Netissä
187
+ price: Hinta
188
+ cost: Kustannus
189
+ scode: Tuottajatunnus
190
+ tax: Veroprosentti
191
+ weight: Paino
192
+ supplier: Tuottaja
193
+ category: Tuoteryhmä
194
+ purchase:
195
+ name: Nimi
196
+ ordered_on: Tilattu
197
+ received_on: Vastaanotettu
198
+ supplier:
199
+ city: Kaupunki
200
+ name: Nimi
201
+ phone: Puhelin
202
+ street: Osoite
203
+ supplier_name: Tuottaja
204
+ models:
205
+ basket: Ostoskori
206
+ category: Tuoteryhmä
207
+ clerk: Käyttäjä
208
+ order: Tilaus
209
+ product: Tuote
210
+ purchase: Sisäänosto
211
+ supplier: Tuottaja
@@ -36,6 +36,7 @@ OfficeClerk::Engine.routes.draw do
36
36
  match "search" => "orders#index", :via => [:get, :post]
37
37
  end
38
38
  member do
39
+ get "mail/:act" , :action => :mail , :as => :mail
39
40
  get :pay
40
41
  get :ship
41
42
  patch :ship
@@ -64,7 +65,6 @@ OfficeClerk::Engine.routes.draw do
64
65
  end
65
66
  member do
66
67
  get :delete
67
- get :barcode #print the barcode and price on a 50x25 mm area
68
68
  end
69
69
  end
70
70
 
@@ -4,7 +4,8 @@ class Categories < ActiveRecord::Migration
4
4
  t.references :category
5
5
  t.boolean :online, :default => false
6
6
  t.string :name
7
- t.string :description
7
+ t.text :description , :default => ""
8
+ t.text :summary , :default => ""
8
9
  t.integer :position , :default => 1
9
10
  t.string :link
10
11
  t.attachment :main_picture
@@ -4,7 +4,8 @@ class Products < ActiveRecord::Migration
4
4
  t.float :price , :null => false
5
5
  t.string :name , :null => false
6
6
  t.string :link
7
- t.text :description
7
+ t.text :description , :default => ""
8
+ t.text :summary , :default => ""
8
9
  t.attachment :main_picture
9
10
  t.attachment :extra_picture
10
11
  t.boolean :online , :default => false
@@ -5,19 +5,14 @@ require "jquery-ui-rails"
5
5
  require "kramdown"
6
6
  require "will_paginate"
7
7
 
8
- require 'simple_form'
9
- require "prawn"
10
8
  require 'will_paginate-bootstrap'
11
9
  require 'bootstrap-sass'
12
10
  require 'bootstrap_form'
13
11
  require "paperclip"
14
12
  require 'rails-i18n'
15
-
16
- require "barby"
17
- require "chunky_png"
13
+ require "jquery-rails"
14
+ require "gon"
18
15
  require "bcrypt"
19
- require "opal"
20
- require "opal/rails"
21
16
 
22
17
  require "office_clerk/shipping_method"
23
18