office_clerk 0.1 → 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -2
- data/.travis.yml +1 -2
- data/Gemfile +1 -22
- data/Gemfile.lock +41 -64
- data/Rakefile +3 -3
- data/app/assets/images/{admin → office_clerk}/baskets-2.jpg +0 -0
- data/app/assets/images/{admin → office_clerk}/baskets.jpg +0 -0
- data/app/assets/images/{admin → office_clerk}/categories-2.jpg +0 -0
- data/app/assets/images/{admin → office_clerk}/categories.jpg +0 -0
- data/app/assets/images/{admin → office_clerk}/clerks-2.jpg +0 -0
- data/app/assets/images/{admin → office_clerk}/clerks.jpg +0 -0
- data/app/assets/images/{admin → office_clerk}/orders-2.jpg +0 -0
- data/app/assets/images/{admin → office_clerk}/orders.jpg +0 -0
- data/app/assets/images/{admin → office_clerk}/products-2.jpg +0 -0
- data/app/assets/images/{admin → office_clerk}/products.jpg +0 -0
- data/app/assets/images/office_clerk/purchases-2.jpg +0 -0
- data/app/assets/images/{admin → office_clerk}/purchases.jpg +0 -0
- data/app/assets/images/{admin → office_clerk}/suppliers-2.jpg +0 -0
- data/app/assets/images/{admin → office_clerk}/suppliers.jpg +0 -0
- data/app/assets/javascripts/{admin.js → office_clerk.js} +2 -2
- data/app/assets/stylesheets/{admin.css.scss → office_clerk.scss} +8 -10
- data/app/controllers/admin_controller.rb +2 -2
- data/app/controllers/baskets_controller.rb +6 -1
- data/app/controllers/{application_controller.rb → office_controller.rb} +3 -1
- data/app/controllers/products_controller.rb +0 -2
- data/app/controllers/sessions_controller.rb +3 -3
- data/app/controllers/shop_controller.rb +2 -2
- data/app/helpers/{application_helper.rb → office_helper.rb} +1 -1
- data/app/helpers/orders_helper.rb +1 -1
- data/app/helpers/shop_helper.rb +11 -0
- data/app/views/baskets/edit.html.haml +2 -2
- data/app/views/baskets/index.html.haml +2 -2
- data/app/views/baskets/show.html.haml +1 -1
- data/app/views/categories/index.html.haml +1 -1
- data/app/views/clerks/index.html.haml +1 -1
- data/app/views/layouts/_header_extra.haml +6 -0
- data/app/views/layouts/{admin.html.haml → office_clerk.haml} +3 -2
- data/app/views/manage/_hash.haml +7 -0
- data/app/views/manage/all.haml +8 -3
- data/app/views/orders/index.html.haml +1 -1
- data/app/views/orders/show.html.haml +1 -1
- data/app/views/products/index.html.haml +1 -1
- data/app/views/purchases/index.html.haml +1 -1
- data/app/views/sessions/sign_in.haml +1 -1
- data/app/views/suppliers/index.html.haml +1 -1
- data/bin/rails +12 -4
- data/config/environments/development.rb +1 -1
- data/config/environments/test.rb +0 -36
- data/config/initializers/session_store.rb +1 -1
- data/config/locales/config.yml +2 -16
- data/config/routes.rb +1 -1
- data/lib/office_clerk/engine.rb +22 -0
- data/lib/office_clerk/shipping_method.rb +7 -3
- data/lib/office_clerk/version.rb +3 -0
- data/lib/office_clerk.rb +13 -2
- data/lib/tasks/office_clerk_tasks.rake +4 -0
- data/office_clerk.gemspec +22 -19
- data/spec/controllers/baskets_controller_spec.rb +1 -0
- data/spec/controllers/categories_controller_spec.rb +1 -0
- data/spec/controllers/clerks_controller_spec.rb +1 -0
- data/spec/controllers/orders_controller_spec.rb +1 -0
- data/spec/controllers/products_controller_spec.rb +1 -0
- data/spec/controllers/purchases_controller_spec.rb +1 -0
- data/spec/controllers/sessions_controller_spec.rb +1 -0
- data/spec/controllers/suppliers_controller_spec.rb +1 -0
- data/spec/features/baskets/buttons_spec.rb +0 -1
- data/spec/models/baskets/items_spec.rb +2 -2
- data/spec/routing/baskets_routing_spec.rb +2 -0
- data/spec/routing/categories_routing_spec.rb +1 -0
- data/spec/routing/orders_routing_spec.rb +1 -0
- data/spec/routing/products_routing_spec.rb +1 -0
- data/spec/routing/purchases_routing_spec.rb +1 -0
- data/spec/routing/suppliers_routing_spec.rb +1 -0
- data/spec/spec_helper.rb +7 -4
- data/spec/support/factory_girl.rb +6 -0
- data/test_app/README.rdoc +28 -0
- data/test_app/app/assets/javascripts/application.js +15 -0
- data/test_app/app/assets/stylesheets/application.css +13 -0
- data/test_app/app/controllers/application_controller.rb +5 -0
- data/test_app/app/helpers/application_helper.rb +2 -0
- data/test_app/app/views/layouts/sales_clerk.haml +9 -0
- data/test_app/bin/bundle +3 -0
- data/test_app/bin/rails +4 -0
- data/test_app/bin/rake +4 -0
- data/test_app/config/application.rb +28 -0
- data/test_app/config/boot.rb +4 -0
- data/test_app/config/database.yml +25 -0
- data/test_app/config/environment.rb +5 -0
- data/test_app/config/environments/development.rb +32 -0
- data/test_app/config/environments/production.rb +80 -0
- data/test_app/config/environments/test.rb +39 -0
- data/test_app/config/initializers/backtrace_silencers.rb +7 -0
- data/test_app/config/initializers/filter_parameter_logging.rb +4 -0
- data/test_app/config/initializers/inflections.rb +16 -0
- data/test_app/config/initializers/mime_types.rb +5 -0
- data/{config → test_app/config}/initializers/secret_token.rb +1 -1
- data/test_app/config/initializers/session_store.rb +3 -0
- data/test_app/config/initializers/wrap_parameters.rb +14 -0
- data/test_app/config/locales/en.yml +23 -0
- data/test_app/config/routes.rb +4 -0
- data/{config.ru → test_app/config.ru} +0 -3
- data/test_app/db/migrate/20141114205525_clerks.office.rb +16 -0
- data/test_app/db/migrate/20141114205526_suppliers.office.rb +10 -0
- data/test_app/db/migrate/20141114205527_categories.office.rb +19 -0
- data/test_app/db/migrate/20141114205528_items.office.rb +15 -0
- data/test_app/db/migrate/20141114205529_orders.office.rb +22 -0
- data/test_app/db/migrate/20141114205530_baskets.office.rb +13 -0
- data/test_app/db/migrate/20141114205531_purchases.office.rb +12 -0
- data/test_app/db/migrate/20141114205532_products.office.rb +28 -0
- data/test_app/db/schema.rb +138 -0
- data/test_app/db/seeds.rb +7 -0
- data/test_app/public/404.html +58 -0
- data/test_app/public/422.html +58 -0
- data/test_app/public/500.html +57 -0
- data/{app/mailers/.keep → test_app/public/favicon.ico} +0 -0
- data/test_app/public/robots.txt +5 -0
- data/test_app/spec/rails_helper.rb +50 -0
- data/test_app/spec/spec_helper.rb +85 -0
- metadata +134 -159
- data/Guardfile +0 -28
- data/app/assets/images/admin/purchases-2.jpg +0 -0
- data/app/assets/images/header.gif +0 -0
- data/app/assets/images/hihih.jpg +0 -0
- data/app/assets/images/koe.jpg +0 -0
- data/app/assets/images/shop/basket.jpg +0 -0
- data/app/assets/images/shop/farfalla-logo.jpg +0 -0
- data/app/assets/images/shop/header.gif +0 -0
- data/app/assets/images/shop/header.jpg +0 -0
- data/app/assets/images/shop/header.png +0 -0
- data/app/assets/images/shop/ikkuna.jpg +0 -0
- data/app/assets/images/shop/kansi.jpg +0 -0
- data/app/assets/images/shop/kansi.png +0 -0
- data/app/assets/images/shop/logo.png +0 -0
- data/app/assets/images/shop/menu-gourmet.jpg +0 -0
- data/app/assets/images/shop/menu-hius.jpg +0 -0
- data/app/assets/images/shop/menu-huonetuoksu.jpg +0 -0
- data/app/assets/images/shop/menu-info.jpg +0 -0
- data/app/assets/images/shop/menu-kasvo.jpg +0 -0
- data/app/assets/images/shop/menu-laukut.jpg +0 -0
- data/app/assets/images/shop/menu-luomu.jpg +0 -0
- data/app/assets/images/shop/menu-men.jpg +0 -0
- data/app/assets/images/shop/menu-oljy.jpg +0 -0
- data/app/assets/images/shop/menu-tuoksu1.jpg +0 -0
- data/app/assets/images/shop/menu-vaatteet.jpg +0 -0
- data/app/assets/images/shop/menu-valaisin.jpg +0 -0
- data/app/assets/images/shop/menu-vartalo.jpg +0 -0
- data/app/assets/images/shop/spacer.gif +0 -0
- data/app/assets/images/shop/tausta.jpg +0 -0
- data/app/assets/images/shop/tervetuloa.gif +0 -0
- data/app/assets/images/shop/valk.png +0 -0
- data/app/assets/images/shop/valk3.png +0 -0
- data/app/assets/images/shop/violetti-lev.jpg +0 -0
- data/app/assets/images/shop/violetti.jpg +0 -0
- data/app/assets/javascripts/shop.js +0 -31
- data/app/assets/stylesheets/shop-receipt.css.scss +0 -80
- data/app/assets/stylesheets/shop.css.scss +0 -424
- data/app/views/layouts/shop.html.haml +0 -99
- data/app/views/shop/_groups.html.haml +0 -8
- data/app/views/shop/_menu.html.haml +0 -5
- data/app/views/shop/_sub.html.haml +0 -0
- data/app/views/shop/checkout.haml +0 -142
- data/app/views/shop/group.html.haml +0 -9
- data/app/views/shop/liikkeemme.html.haml +0 -59
- data/app/views/shop/main_group.html.haml +0 -9
- data/app/views/shop/order.haml +0 -109
- data/app/views/shop/product.html.haml +0 -67
- data/app/views/shop/product_list.html.haml +0 -53
- data/app/views/shop/saved_search.html +0 -6
- data/app/views/shop/sub_group.html.haml +0 -19
- data/app/views/shop/tilaushistoria.html.haml +0 -221
- data/app/views/shop/toimitusehdot.html.haml +0 -99
- data/app/views/shop/tuotteista.html.haml +0 -40
- data/app/views/shop/welcome.html.haml +0 -103
- data/config/application.example.yml +0 -13
- data/config/application.rb +0 -59
- data/config/application.yml +0 -13
- data/config/initializers/attack.rb +0 -32
- data/lib/assets/.keep +0 -0
- data/lib/tasks/.keep +0 -0
- data/public/images/missing/list.png +0 -0
- data/public/images/missing/product.png +0 -0
- data/public/images/missing/thumb.png +0 -0
- data/spec/features/shop_spec.rb +0 -63
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a2b4bc40578de23126465f66caf7875b16d756a
|
4
|
+
data.tar.gz: 0921190739bd31c9e5687fcdf9f2a3a82553d41b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2dd8a0e3fd11659919f9bdf9ef5e72428d285448d01ab8628d11af4cfbaa4ba0d0167c6c5dde2030dccb2f3f2426ed7da3b9bdd98a6ad762a0340daa475fc6c
|
7
|
+
data.tar.gz: c6c5bced0d3646e2b9e3810d84fef728c29340bd147c63fb6649b6e162b6208a25daaf2bbb06d29ea2db4b33f4fd7e94f378fbb1325792144b7c82335b0e7af1
|
data/.gitignore
CHANGED
@@ -4,11 +4,13 @@
|
|
4
4
|
/vendor/ruby/
|
5
5
|
|
6
6
|
# minimal Rails specific artifacts
|
7
|
-
|
8
|
-
|
7
|
+
*.sqlite3
|
8
|
+
*.sqlite3-journal
|
9
9
|
/log/*
|
10
10
|
/tmp/*
|
11
11
|
.ruby-version
|
12
|
+
test_app/tmp
|
13
|
+
test_app/log
|
12
14
|
|
13
15
|
# configuration file introduced in Rails 4.1
|
14
16
|
/config/secrets.yml
|
data/.travis.yml
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
language: ruby
|
2
|
-
before_script:
|
3
|
-
- RAILS_ENV=test bundle exec rake db:schema:load
|
4
2
|
script:
|
3
|
+
- RAILS_ENV=test bundle exec rake db:migrate
|
5
4
|
- CODECLIMATE_REPO_TOKEN=3f97bb5305cd65f6683587a32b4b3eae42cfec26d3de56374b10b3efb78ccf6a bundle exec rspec
|
6
5
|
rvm:
|
7
6
|
- 1.9.3
|
data/Gemfile
CHANGED
@@ -1,21 +1,9 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
|
3
|
+
gem "office_clerk" , :path => "../"
|
4
4
|
|
5
|
-
gem 'rails'
|
6
5
|
gem 'sqlite3'
|
7
6
|
|
8
|
-
# extensions, reporting, printing
|
9
|
-
gem 'accountant_clerk' , github: "rubyclerks/accountant_clerk"
|
10
|
-
#gem 'accountant_clerk' , path: "../accountant_clerk"
|
11
|
-
|
12
|
-
gem 'print_clerk' , github: "rubyclerks/print_clerk"
|
13
|
-
#gem 'print_clerk' , path: "../print_clerk"
|
14
|
-
|
15
|
-
gem 'post_clerk' , github: "rubyclerks/post_clerk"
|
16
|
-
#gem 'post_clerk' , path: "../post_clerk"
|
17
|
-
|
18
|
-
|
19
7
|
# template
|
20
8
|
gem "ransack", github: "activerecord-hackery/ransack", branch: "rails-4"
|
21
9
|
|
@@ -30,21 +18,13 @@ gem "rb-readline"
|
|
30
18
|
gem 'uglifier', '>= 1.3.0'
|
31
19
|
gem 'coffee-rails'
|
32
20
|
|
33
|
-
#one wishes one would not need it. alas . . .
|
34
|
-
gem 'rack-attack'
|
35
|
-
|
36
21
|
group :development do
|
37
22
|
gem 'better_errors' , :platforms=>[:mri_20, :mri_21, :rbx]
|
38
23
|
gem 'binding_of_caller', :platforms=>[:mri_19, :mri_20, :mri_21,:rbx]
|
39
24
|
gem "i18n-tasks"
|
40
25
|
gem 'quiet_assets'
|
41
|
-
gem 'rails_layout'
|
42
26
|
# gem "jeweler", "> 1.6.4"
|
43
27
|
end
|
44
|
-
group :development, :test do
|
45
|
-
gem "spring"
|
46
|
-
gem "spring-commands-rspec"
|
47
|
-
end
|
48
28
|
group :test do
|
49
29
|
# gem "poltergeist"
|
50
30
|
# gem "phantomjs"
|
@@ -60,4 +40,3 @@ group :test do
|
|
60
40
|
gem 'guard-rails'
|
61
41
|
gem 'guard-rspec'
|
62
42
|
end
|
63
|
-
|
data/Gemfile.lock
CHANGED
@@ -10,56 +10,33 @@ GIT
|
|
10
10
|
i18n
|
11
11
|
polyamorous (~> 1.1)
|
12
12
|
|
13
|
-
GIT
|
14
|
-
remote: git://github.com/rubyclerks/accountant_clerk.git
|
15
|
-
revision: 180a37904680284caf2fe4d37c739f69fa76f621
|
16
|
-
specs:
|
17
|
-
accountant_clerk (0.2)
|
18
|
-
flot-rails (~> 0.0.6)
|
19
|
-
office_clerk (~> 0.1)
|
20
|
-
|
21
13
|
GIT
|
22
14
|
remote: git://github.com/rubyclerks/db_fixtures_dump.git
|
23
15
|
revision: 2d00815c8cb4a9bf143564a8a1de082b6e30282c
|
24
16
|
specs:
|
25
17
|
db_fixtures_dump (0.0.9)
|
26
18
|
|
27
|
-
GIT
|
28
|
-
remote: git://github.com/rubyclerks/post_clerk.git
|
29
|
-
revision: e8933edc2ecf62eed79417f7db92e5f5c1ace53e
|
30
|
-
specs:
|
31
|
-
post_clerk (0.4)
|
32
|
-
office_clerk (~> 0.1)
|
33
|
-
|
34
|
-
GIT
|
35
|
-
remote: git://github.com/rubyclerks/print_clerk.git
|
36
|
-
revision: c73c5f7bcb7f0af73b37bc627fa2d0fa0faee6f0
|
37
|
-
specs:
|
38
|
-
print_clerk (0.2)
|
39
|
-
office_clerk (~> 0.1)
|
40
|
-
|
41
19
|
PATH
|
42
|
-
remote:
|
20
|
+
remote: ../
|
43
21
|
specs:
|
44
|
-
office_clerk (0.
|
22
|
+
office_clerk (0.4)
|
45
23
|
barby
|
46
|
-
bcrypt-ruby
|
47
|
-
bootstrap-sass (~> 3.1
|
48
|
-
bootstrap_form
|
24
|
+
bcrypt-ruby (~> 3.1)
|
25
|
+
bootstrap-sass (~> 3.1)
|
26
|
+
bootstrap_form (~> 2.2)
|
49
27
|
chunky_png
|
50
|
-
haml
|
51
|
-
jquery-rails
|
52
|
-
|
53
|
-
|
54
|
-
|
28
|
+
haml (~> 4.0)
|
29
|
+
jquery-ui-rails (~> 5.0)
|
30
|
+
kramdown (~> 1.5)
|
31
|
+
opal-jquery (~> 0.2)
|
32
|
+
opal-rails (~> 0.6)
|
33
|
+
paperclip (~> 4.1)
|
55
34
|
prawn
|
56
|
-
rails (~> 4.0.1)
|
57
|
-
rails-i18n
|
58
|
-
sass-rails
|
59
|
-
simple_form
|
60
|
-
|
61
|
-
will_paginate
|
62
|
-
will_paginate-bootstrap
|
35
|
+
rails (~> 4.0, >= 4.0.1)
|
36
|
+
rails-i18n (~> 4.0)
|
37
|
+
sass-rails (~> 4.0)
|
38
|
+
simple_form (~> 3.0)
|
39
|
+
will_paginate-bootstrap (~> 1.0)
|
63
40
|
|
64
41
|
GEM
|
65
42
|
remote: https://rubygems.org/
|
@@ -124,7 +101,7 @@ GEM
|
|
124
101
|
codeclimate-test-reporter (0.4.1)
|
125
102
|
simplecov (>= 0.7.1, < 1.0.0)
|
126
103
|
coderay (1.1.0)
|
127
|
-
coffee-rails (4.1
|
104
|
+
coffee-rails (4.0.1)
|
128
105
|
coffee-script (>= 2.2.0)
|
129
106
|
railties (>= 4.0.0, < 5.0)
|
130
107
|
coffee-script (2.3.0)
|
@@ -151,10 +128,8 @@ GEM
|
|
151
128
|
factory_girl (~> 4.5.0)
|
152
129
|
railties (>= 3.0.0)
|
153
130
|
ffi (1.9.6)
|
154
|
-
flot-rails (0.0.6)
|
155
|
-
jquery-rails
|
156
131
|
formatador (0.2.5)
|
157
|
-
guard (2.8.
|
132
|
+
guard (2.8.2)
|
158
133
|
formatador (>= 0.2.4)
|
159
134
|
listen (~> 2.7)
|
160
135
|
lumberjack (~> 1.0)
|
@@ -163,7 +138,7 @@ GEM
|
|
163
138
|
guard-bundler (2.0.0)
|
164
139
|
bundler (~> 1.0)
|
165
140
|
guard (~> 2.2)
|
166
|
-
guard-rails (0.
|
141
|
+
guard-rails (0.7.0)
|
167
142
|
guard (~> 2.0)
|
168
143
|
guard-rspec (4.3.1)
|
169
144
|
guard (~> 2.1)
|
@@ -197,7 +172,7 @@ GEM
|
|
197
172
|
launchy (2.4.3)
|
198
173
|
addressable (~> 2.3)
|
199
174
|
libv8 (3.16.14.3)
|
200
|
-
listen (2.7.
|
175
|
+
listen (2.7.12)
|
201
176
|
celluloid (>= 0.15.2)
|
202
177
|
rb-fsevent (>= 0.9.3)
|
203
178
|
rb-inotify (>= 0.9)
|
@@ -206,11 +181,27 @@ GEM
|
|
206
181
|
mime-types (>= 1.16, < 3)
|
207
182
|
method_source (0.8.2)
|
208
183
|
mime-types (2.4.3)
|
209
|
-
mini_portile (0.6.
|
184
|
+
mini_portile (0.6.1)
|
210
185
|
minitest (4.7.5)
|
211
186
|
multi_json (1.10.1)
|
212
|
-
nokogiri (1.6.
|
213
|
-
mini_portile (
|
187
|
+
nokogiri (1.6.4.1)
|
188
|
+
mini_portile (~> 0.6.0)
|
189
|
+
opal (0.6.2)
|
190
|
+
source_map
|
191
|
+
sprockets
|
192
|
+
opal-activesupport (0.0.5)
|
193
|
+
opal
|
194
|
+
opal-jquery (0.2.0)
|
195
|
+
opal (>= 0.5.0, < 1.0.0)
|
196
|
+
opal-rails (0.6.3)
|
197
|
+
jquery-rails
|
198
|
+
opal (~> 0.6.0)
|
199
|
+
opal-activesupport (>= 0.0.5)
|
200
|
+
opal-jquery (>= 0.1.0)
|
201
|
+
opal-rspec (~> 0.3.0.beta1)
|
202
|
+
rails (>= 3.2.13, < 5.0)
|
203
|
+
opal-rspec (0.3.0.beta3)
|
204
|
+
opal (>= 0.6.0, < 1.0.0)
|
214
205
|
paperclip (4.2.0)
|
215
206
|
activemodel (>= 3.0.0)
|
216
207
|
activesupport (>= 3.0.0)
|
@@ -229,8 +220,6 @@ GEM
|
|
229
220
|
quiet_assets (1.0.3)
|
230
221
|
railties (>= 3.1, < 5.0)
|
231
222
|
rack (1.5.2)
|
232
|
-
rack-attack (4.2.0)
|
233
|
-
rack
|
234
223
|
rack-test (0.6.2)
|
235
224
|
rack (>= 1.0)
|
236
225
|
rails (4.0.11)
|
@@ -244,7 +233,6 @@ GEM
|
|
244
233
|
rails-i18n (4.0.3)
|
245
234
|
i18n (~> 0.6)
|
246
235
|
railties (~> 4.0)
|
247
|
-
rails_layout (1.0.23)
|
248
236
|
railties (4.0.11)
|
249
237
|
actionpack (= 4.0.11)
|
250
238
|
activesupport (= 4.0.11)
|
@@ -291,9 +279,8 @@ GEM
|
|
291
279
|
simplecov-html (~> 0.8.0)
|
292
280
|
simplecov-html (0.8.0)
|
293
281
|
slop (3.6.0)
|
294
|
-
|
295
|
-
|
296
|
-
spring (>= 0.9.1)
|
282
|
+
source_map (3.0.1)
|
283
|
+
json
|
297
284
|
sprockets (2.11.3)
|
298
285
|
hike (~> 1.2)
|
299
286
|
multi_json (~> 1.0)
|
@@ -318,8 +305,6 @@ GEM
|
|
318
305
|
hitimes
|
319
306
|
tins (1.3.3)
|
320
307
|
ttfunk (1.4.0)
|
321
|
-
turbolinks (2.5.2)
|
322
|
-
coffee-rails
|
323
308
|
tzinfo (0.3.42)
|
324
309
|
uglifier (2.5.3)
|
325
310
|
execjs (>= 0.3.0)
|
@@ -337,7 +322,6 @@ PLATFORMS
|
|
337
322
|
ruby
|
338
323
|
|
339
324
|
DEPENDENCIES
|
340
|
-
accountant_clerk!
|
341
325
|
better_errors
|
342
326
|
binding_of_caller
|
343
327
|
capybara
|
@@ -355,17 +339,10 @@ DEPENDENCIES
|
|
355
339
|
i18n-tasks
|
356
340
|
libv8 (= 3.16.14.3)
|
357
341
|
office_clerk!
|
358
|
-
post_clerk!
|
359
|
-
print_clerk!
|
360
342
|
quiet_assets
|
361
|
-
rack-attack
|
362
|
-
rails
|
363
|
-
rails_layout
|
364
343
|
ransack!
|
365
344
|
rb-readline
|
366
345
|
rspec-rails
|
367
|
-
spring
|
368
|
-
spring-commands-rspec
|
369
346
|
sqlite3
|
370
347
|
therubyracer
|
371
348
|
uglifier (>= 1.3.0)
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
2
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
-
require 'i18n-spec/tasks'
|
4
|
-
require File.expand_path('../config/application', __FILE__)
|
5
3
|
|
6
|
-
|
4
|
+
require File.expand_path('../test_app/config/application', __FILE__)
|
5
|
+
|
6
|
+
TestApp::Application.load_tasks
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
@@ -37,9 +37,7 @@ $tausta-bg: scale-color($primary-color, $lightness: 95%);
|
|
37
37
|
a.online{
|
38
38
|
color: green;
|
39
39
|
}
|
40
|
-
|
41
|
-
font-size: 1.7rem;
|
42
|
-
};
|
40
|
+
|
43
41
|
.alert-notice {
|
44
42
|
background-color: #00FFEB;
|
45
43
|
padding: 8px;
|
@@ -100,30 +98,30 @@ thead, tbody { vertical-align: top;
|
|
100
98
|
}
|
101
99
|
|
102
100
|
.products{
|
103
|
-
background: image-url('
|
101
|
+
background: image-url('office_clerk/products-2.jpg') no-repeat;
|
104
102
|
}
|
105
103
|
|
106
104
|
.baskets{
|
107
|
-
background: image-url('
|
105
|
+
background: image-url('office_clerk/baskets-2.jpg') no-repeat;
|
108
106
|
}
|
109
107
|
|
110
108
|
.orders{
|
111
|
-
background: image-url('
|
109
|
+
background: image-url('office_clerk/orders-2.jpg') no-repeat;
|
112
110
|
}
|
113
111
|
|
114
112
|
.purchases{
|
115
|
-
background: image-url('
|
113
|
+
background: image-url('office_clerk/purchases-2.jpg') no-repeat;
|
116
114
|
height: 161px;
|
117
115
|
}
|
118
116
|
|
119
117
|
.categories{
|
120
|
-
background: image-url('
|
118
|
+
background: image-url('office_clerk/categories-2.jpg') no-repeat;
|
121
119
|
}
|
122
120
|
|
123
121
|
.suppliers{
|
124
|
-
background: image-url('
|
122
|
+
background: image-url('office_clerk/suppliers-2.jpg') no-repeat;
|
125
123
|
}
|
126
124
|
|
127
125
|
.clerks{
|
128
|
-
background: image-url('
|
126
|
+
background: image-url('office_clerk/clerks-2.jpg') no-repeat;
|
129
127
|
}
|
@@ -18,7 +18,12 @@ class BasketsController < AdminController
|
|
18
18
|
order = @basket.kori || Order.new( :basket => @basket )
|
19
19
|
order.pos_checkout( current_clerk.email )
|
20
20
|
order.save!
|
21
|
-
|
21
|
+
styles = OfficeClerk.config(:print_styles)
|
22
|
+
if(styles && styles.split.include?("receipt"))
|
23
|
+
redirect_to receipt_order_path(order)
|
24
|
+
else
|
25
|
+
redirect_to order_path(order)
|
26
|
+
end
|
22
27
|
end
|
23
28
|
|
24
29
|
def show
|
@@ -1,8 +1,10 @@
|
|
1
|
-
class
|
1
|
+
class OfficeController < ApplicationController
|
2
2
|
# Prevent CSRF attacks by raising an exception.
|
3
3
|
# For APIs, you may want to use :null_session instead.
|
4
4
|
protect_from_forgery with: :exception
|
5
5
|
helper_method :current_clerk , :current_basket , :current_basket_or_nil
|
6
|
+
helper OfficeHelper
|
7
|
+
include OfficeClerk::Engine.routes.url_helpers
|
6
8
|
|
7
9
|
# users are stored in the session by email
|
8
10
|
# if user is not logged i , return nil
|
@@ -1,5 +1,5 @@
|
|
1
|
-
class SessionsController <
|
2
|
-
layout "
|
1
|
+
class SessionsController < OfficeController
|
2
|
+
layout "sales_clerk"
|
3
3
|
|
4
4
|
def sign_in
|
5
5
|
end
|
@@ -8,7 +8,7 @@ class SessionsController < ApplicationController
|
|
8
8
|
clerk = Clerk.where(:email => params[:email]).limit(1).first
|
9
9
|
if clerk && clerk.valid_password?(params[:password])
|
10
10
|
session[:clerk_email] = clerk.email
|
11
|
-
url = clerk.admin ? baskets_url : root_url
|
11
|
+
url = clerk.admin ? office.baskets_url : root_url
|
12
12
|
redirect_to url , :notice => I18n.t(:signed_in)
|
13
13
|
else
|
14
14
|
redirect_to :sign_in , :notice => I18n.t(:sign_in_invalid)
|
data/app/helpers/shop_helper.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module ShopHelper
|
2
2
|
def parents(group)
|
3
3
|
parents = []
|
4
|
+
group = group.category
|
4
5
|
while group
|
5
6
|
parents << group
|
6
7
|
group = group.category
|
@@ -14,4 +15,14 @@ module ShopHelper
|
|
14
15
|
prods.delete(product)
|
15
16
|
prods.sample(get)
|
16
17
|
end
|
18
|
+
|
19
|
+
# a short version of a desciption text. now we use markdown and often have a bold "header"
|
20
|
+
# so if we find a bold we use just that, regardless of length given
|
21
|
+
# otherwise we try and find a space close to the given length, to avoid ugly half-words
|
22
|
+
def short text , len = 110
|
23
|
+
ind = text.index( "**" , 10) || text.index( "**" , 10)
|
24
|
+
return text[0 .. ind + 1] if ind
|
25
|
+
ind = text.index(" " , len - 10)
|
26
|
+
ind ? text[0 .. ind + 1] : text[0 .. len +1]
|
27
|
+
end
|
17
28
|
end
|
@@ -56,12 +56,12 @@
|
|
56
56
|
= link_to t(:make_order), order_basket_path(@basket), :class => "btn btn-primary make_order"
|
57
57
|
.col-md-2
|
58
58
|
= link_to t(:make_purchase), purchase_basket_path(@basket), :class => "btn btn-primary make_purchase"
|
59
|
-
.col-md-2
|
59
|
+
.col-md-2
|
60
60
|
= link_to t(:checkout), checkout_basket_path(@basket) , :target => "_blank" , :class => "btn btn-primary print_order"
|
61
61
|
- elsif @basket.isa(:order)
|
62
62
|
.col-md-2
|
63
63
|
= link_to t(:to_order), order_path(@basket.kori), :class => "btn btn-primary to_order"
|
64
|
-
.col-md-2
|
64
|
+
.col-md-2
|
65
65
|
= link_to t(:print_order), invoice_order_path(@basket.kori), :target => "_blank" , :class => "btn btn-primary print_order" , :target => "_blank"
|
66
66
|
- elsif @basket.isa(:purchase)
|
67
67
|
.col-md-2
|
@@ -5,9 +5,9 @@
|
|
5
5
|
%h2= t(:baskets)
|
6
6
|
= paginate @baskets
|
7
7
|
.col-md-2
|
8
|
-
= link_to t(:new) + ' ' + t(:basket) , new_basket_path , :class => "btn btn-primary"
|
8
|
+
= link_to t(:new) + ' ' + t(:basket) , office.new_basket_path , :class => "btn btn-primary"
|
9
9
|
.col-md-3
|
10
|
-
= image_tag "
|
10
|
+
= image_tag "office_clerk/baskets.jpg" , :class => "img-responsive"
|
11
11
|
.row
|
12
12
|
.col-md-9
|
13
13
|
%div
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
= render "small" , :basket => @basket
|
14
14
|
|
15
|
-
.col-md-12
|
15
|
+
.col-md-12
|
16
16
|
= link_to t(:back), orders_path, :class => "btn btn-warning"
|
17
17
|
= link_to t(:destroy) , basket_path(@basket), :data => { :confirm => t(:are_you_sure) }, :method => :delete, :title => t(:destroy) , :class => "btn btn-danger" unless @basket.kori_type
|
18
18
|
= link_to t(:print_order), receipt_order_path(@basket.kori) , :target => "_blank" , :class => "btn btn-primary print_order" if @basket.isa(:order)
|
@@ -7,7 +7,7 @@
|
|
7
7
|
.col-md-2
|
8
8
|
= link_to t(:new) + ' ' + t(:category) , new_category_path , :class => "btn btn-primary"
|
9
9
|
.col-md-3
|
10
|
-
= image_tag "
|
10
|
+
= image_tag "office_clerk/categories.jpg" , :class => "img-responsive"
|
11
11
|
.row
|
12
12
|
.col-md-9
|
13
13
|
%div
|
@@ -7,7 +7,7 @@
|
|
7
7
|
.col-md-2
|
8
8
|
= link_to t(:new) + ' ' + t(:clerk) , new_clerk_path , :class => "btn btn-primary"
|
9
9
|
.col-md-3
|
10
|
-
= image_tag "
|
10
|
+
= image_tag "office_clerk/clerks.jpg" , :class => "img-responsive"
|
11
11
|
.row
|
12
12
|
.col-md-9
|
13
13
|
%div
|
@@ -4,8 +4,9 @@
|
|
4
4
|
%meta{:charset => "utf-8"}/
|
5
5
|
%title Office Clerk
|
6
6
|
%meta{:content => "Office Clerk", :name => "description"}
|
7
|
-
= stylesheet_link_tag "
|
8
|
-
= javascript_include_tag "
|
7
|
+
= stylesheet_link_tag "office_clerk"
|
8
|
+
= javascript_include_tag "office_clerk"
|
9
|
+
= render "layouts/header_extra"
|
9
10
|
= csrf_meta_tags
|
10
11
|
= yield :head
|
11
12
|
%body{:style => ""}
|
data/app/views/manage/all.haml
CHANGED
@@ -39,7 +39,7 @@
|
|
39
39
|
|
40
40
|
= render "baskets/small" , :basket => @order.basket
|
41
41
|
|
42
|
-
.col-md-12
|
42
|
+
.col-md-12
|
43
43
|
= link_to t(:back), orders_path, :class => "btn btn-warning"
|
44
44
|
- print_styles.each do |style|
|
45
45
|
= link_to t("print_" + style) , print_path(style), :class => "btn btn-primary" , :target => "_blank"
|
@@ -14,7 +14,7 @@
|
|
14
14
|
.col-md-2
|
15
15
|
= link_to t(:new) + ' ' + t(:product) , new_product_path , :class => "btn btn-primary"
|
16
16
|
.col-md-3
|
17
|
-
= image_tag "
|
17
|
+
= image_tag "office_clerk/products.jpg" , :class => "img-responsive"
|
18
18
|
|
19
19
|
.row
|
20
20
|
.col-md-9
|