comable_backend 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/comable/admin/application.coffee +4 -0
  3. data/app/assets/stylesheets/comable/admin/_common.scss +23 -0
  4. data/app/assets/stylesheets/comable/admin/_flow.scss +149 -0
  5. data/app/assets/stylesheets/comable/admin/application.scss +1 -0
  6. data/app/assets/stylesheets/comable/admin/overrides/bootstrap.scss +1 -0
  7. data/app/controllers/comable/admin/application_controller.rb +24 -4
  8. data/app/controllers/comable/admin/dashboard_controller.rb +4 -4
  9. data/app/controllers/comable/admin/orders_controller.rb +82 -1
  10. data/app/controllers/comable/admin/payment_methods_controller.rb +1 -0
  11. data/app/controllers/comable/admin/products_controller.rb +16 -0
  12. data/app/controllers/comable/admin/stocks_controller.rb +16 -0
  13. data/app/controllers/comable/admin/trackers_controller.rb +58 -0
  14. data/app/controllers/comable/admin/{customers_controller.rb → users_controller.rb} +8 -8
  15. data/app/helpers/comable/admin/orders_helper.rb +30 -0
  16. data/app/views/comable/admin/categories/index.slim +2 -2
  17. data/app/views/comable/admin/dashboard/show.slim +9 -10
  18. data/app/views/comable/admin/orders/_payment_state.slim +40 -0
  19. data/app/views/comable/admin/orders/_shipment_state.slim +44 -0
  20. data/app/views/comable/admin/orders/edit.slim +112 -0
  21. data/app/views/comable/admin/orders/index.slim +22 -6
  22. data/app/views/comable/admin/orders/show.slim +141 -110
  23. data/app/views/comable/admin/payment_methods/_form.slim +6 -2
  24. data/app/views/comable/admin/products/_form.slim +9 -9
  25. data/app/views/comable/admin/products/index.slim +16 -0
  26. data/app/views/comable/admin/shared/_header.slim +3 -3
  27. data/app/views/comable/admin/shared/_sidebar.slim +5 -3
  28. data/app/views/comable/admin/shared/export.xlsx.axlsx +17 -0
  29. data/app/views/comable/admin/shipment_methods/_form.slim +2 -2
  30. data/app/views/comable/admin/stocks/_form.slim +2 -2
  31. data/app/views/comable/admin/stocks/index.slim +16 -0
  32. data/app/views/comable/admin/store/_form.slim +2 -2
  33. data/app/views/comable/admin/trackers/_form.slim +109 -0
  34. data/app/views/comable/admin/trackers/edit.slim +27 -0
  35. data/app/views/comable/admin/trackers/index.slim +37 -0
  36. data/app/views/comable/admin/trackers/new.slim +16 -0
  37. data/app/views/comable/admin/{customers → users}/edit.slim +10 -10
  38. data/app/views/comable/admin/{customers → users}/index.slim +20 -20
  39. data/app/views/comable/admin/users/show.slim +88 -0
  40. data/app/views/layouts/comable/admin/application.slim +1 -1
  41. data/config/routes.rb +31 -4
  42. metadata +19 -8
  43. data/app/views/comable/admin/customers/show.slim +0 -88
@@ -12,7 +12,7 @@ html
12
12
  body id="#{"comable-#{controller_name.singularize}"}"
13
13
  = render 'comable/admin/shared/notifier'
14
14
 
15
- - if current_customer.signed_in?
15
+ - if current_comable_user.signed_in?
16
16
  = render 'comable/admin/shared/header'
17
17
 
18
18
  #wrapper
data/config/routes.rb CHANGED
@@ -6,17 +6,44 @@ Comable::Core::Engine.routes.draw do
6
6
 
7
7
  resources :products do
8
8
  resources :stocks
9
+
10
+ collection do
11
+ get :export
12
+ post :import
13
+ end
14
+ end
15
+
16
+ resources :stocks do
17
+ collection do
18
+ get :export
19
+ post :import
20
+ end
21
+ end
22
+
23
+ resources :orders do
24
+ collection do
25
+ get :export
26
+ end
27
+
28
+ member do
29
+ post :cancel
30
+ post :resume
31
+ post :cancel_payment
32
+ post :resume_payment
33
+ post :ship
34
+ post :cancel_shipment
35
+ post :resume_shipment
36
+ end
9
37
  end
10
- resources :stocks
11
38
 
12
39
  resources :categories
13
- resources :orders
14
- resources :customers
40
+ resources :users
15
41
  resources :shipment_methods
16
42
  resources :payment_methods
43
+ resources :trackers
17
44
  resource :store, controller: :store, only: [:show, :edit, :update]
18
45
 
19
- devise_for :customer, path: :user, class_name: Comable::Customer.name, module: :devise, controllers: {
46
+ devise_for :user, path: :user, class_name: Comable::User.name, module: :devise, controllers: {
20
47
  sessions: 'comable/admin/user_sessions'
21
48
  }
22
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comable_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - YOSHIDA Hiroki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-07 00:00:00.000000000 Z
11
+ date: 2015-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: comable_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.4
19
+ version: 0.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.3.4
26
+ version: 0.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -294,6 +294,7 @@ files:
294
294
  - app/assets/stylesheets/comable/admin/_common.scss
295
295
  - app/assets/stylesheets/comable/admin/_dashboard.scss
296
296
  - app/assets/stylesheets/comable/admin/_errors.scss
297
+ - app/assets/stylesheets/comable/admin/_flow.scss
297
298
  - app/assets/stylesheets/comable/admin/_mixins.scss
298
299
  - app/assets/stylesheets/comable/admin/_orders.scss
299
300
  - app/assets/stylesheets/comable/admin/_overrides.scss
@@ -306,7 +307,6 @@ files:
306
307
  - app/assets/stylesheets/comable/admin/overrides/tagit.scss
307
308
  - app/controllers/comable/admin/application_controller.rb
308
309
  - app/controllers/comable/admin/categories_controller.rb
309
- - app/controllers/comable/admin/customers_controller.rb
310
310
  - app/controllers/comable/admin/dashboard_controller.rb
311
311
  - app/controllers/comable/admin/orders_controller.rb
312
312
  - app/controllers/comable/admin/payment_methods_controller.rb
@@ -314,18 +314,21 @@ files:
314
314
  - app/controllers/comable/admin/shipment_methods_controller.rb
315
315
  - app/controllers/comable/admin/stocks_controller.rb
316
316
  - app/controllers/comable/admin/store_controller.rb
317
+ - app/controllers/comable/admin/trackers_controller.rb
317
318
  - app/controllers/comable/admin/user_sessions_controller.rb
319
+ - app/controllers/comable/admin/users_controller.rb
318
320
  - app/helpers/comable/admin/application_helper.rb
321
+ - app/helpers/comable/admin/orders_helper.rb
319
322
  - app/helpers/comable/admin/products_helper.rb
320
323
  - app/helpers/comable/admin/shipment_methods_helper.rb
321
324
  - app/helpers/comable/admin/stores_helper.rb
322
325
  - app/views/comable/admin/categories/index.slim
323
- - app/views/comable/admin/customers/edit.slim
324
- - app/views/comable/admin/customers/index.slim
325
- - app/views/comable/admin/customers/show.slim
326
326
  - app/views/comable/admin/dashboard/_widget.slim
327
327
  - app/views/comable/admin/dashboard/show.slim
328
328
  - app/views/comable/admin/orders/_google_map.slim
329
+ - app/views/comable/admin/orders/_payment_state.slim
330
+ - app/views/comable/admin/orders/_shipment_state.slim
331
+ - app/views/comable/admin/orders/edit.slim
329
332
  - app/views/comable/admin/orders/index.slim
330
333
  - app/views/comable/admin/orders/show.slim
331
334
  - app/views/comable/admin/payment_methods/_form.slim
@@ -346,6 +349,7 @@ files:
346
349
  - app/views/comable/admin/shared/_setup_search_form.slim
347
350
  - app/views/comable/admin/shared/_sidebar.slim
348
351
  - app/views/comable/admin/shared/_value_fields.slim
352
+ - app/views/comable/admin/shared/export.xlsx.axlsx
349
353
  - app/views/comable/admin/shipment_methods/_form.slim
350
354
  - app/views/comable/admin/shipment_methods/edit.slim
351
355
  - app/views/comable/admin/shipment_methods/index.slim
@@ -356,7 +360,14 @@ files:
356
360
  - app/views/comable/admin/stocks/new.slim
357
361
  - app/views/comable/admin/store/_form.slim
358
362
  - app/views/comable/admin/store/edit.slim
363
+ - app/views/comable/admin/trackers/_form.slim
364
+ - app/views/comable/admin/trackers/edit.slim
365
+ - app/views/comable/admin/trackers/index.slim
366
+ - app/views/comable/admin/trackers/new.slim
359
367
  - app/views/comable/admin/user_sessions/new.slim
368
+ - app/views/comable/admin/users/edit.slim
369
+ - app/views/comable/admin/users/index.slim
370
+ - app/views/comable/admin/users/show.slim
360
371
  - app/views/kaminari/comable_backend/_first_page.html.slim
361
372
  - app/views/kaminari/comable_backend/_gap.html.slim
362
373
  - app/views/kaminari/comable_backend/_last_page.html.slim
@@ -1,88 +0,0 @@
1
- .comable-page
2
- .comable-page-heading
3
- ul.pull-right.list-inline
4
- li.btn-group
5
- = link_to comable.edit_admin_customer_path(@customer), class: 'btn btn-default' do
6
- span.fa.fa-edit>
7
- = Comable.t('admin.actions.edit')
8
- = link_to Comable.t('admin.nav.order'), comable.admin_orders_path(q: { customer_id_eq: @customer.id }), class: 'btn btn-default'
9
- li
10
- / TODO: Comment out after implemented.
11
- / = link_to Comable.t('admin.nav.orders.cart'), '#', class: 'btn btn-default'
12
-
13
- h1.page-header
14
- ol.breadcrumb
15
- li>
16
- = link_to Comable.t('admin.nav.customer'), comable.admin_customers_path
17
- li.active
18
- = @customer.human_id
19
- - if @customer.bill_full_name
20
- small<
21
- = Comable.t('honorific', name: @customer.bill_full_name)
22
-
23
- .comable-page-body
24
- section
25
- dl.dl-horizontal
26
- dt
27
- = @customer.class.human_attribute_name(:role)
28
- dd
29
- = @customer.role.text
30
- dt
31
- = @customer.class.human_attribute_name(:email)
32
- dd
33
- = @customer.email
34
- - if @customer.bill_address
35
- dt
36
- = @customer.class.human_attribute_name(:bill_address)
37
- dd
38
- ul.list-unstyled
39
- li = @customer.bill_address.zip_code
40
- li = @customer.bill_address.full_name
41
- li = @customer.bill_address.state_name
42
- li = @customer.bill_address.city
43
- li = @customer.bill_address.detail
44
- li = "#{@customer.bill_address.class.human_attribute_name(:phone_number)}: #{@customer.bill_address.phone_number}"
45
-
46
- - if @customer.orders.any?
47
- section
48
- .panel.panel-default
49
- .panel-heading
50
- .panel-title
51
- = Comable.t('admin.nav.customers.new_orders', count: 5)
52
-
53
- table.table
54
- thead
55
- tr
56
- th
57
- = @customer.orders.klass.human_attribute_name(:code)
58
- th
59
- = @customer.orders.klass.human_attribute_name(:state)
60
- th
61
- = @customer.orders.klass.human_attribute_name(:bill_full_name)
62
- th
63
- = @customer.orders.klass.human_attribute_name(:order_details)
64
- th
65
- = @customer.orders.klass.human_attribute_name(:total_price)
66
- th
67
- = @customer.orders.klass.human_attribute_name(:completed_at)
68
- tbody
69
- - @customer.orders.limit(5).each do |order|
70
- tr
71
- td
72
- = link_to order.code, comable.admin_order_path(order)
73
- td
74
- = order.human_state_name
75
- td
76
- = order.bill_full_name
77
- td
78
- ul.list-unstyled
79
- - order.order_details.each do |order_detail|
80
- li
81
- | #{order_detail.name_with_sku} x #{order_detail.quantity}
82
- td
83
- = number_to_currency order.total_price
84
- td
85
- = l order.completed_at
86
-
87
- .panel-footer.text-right
88
- = link_to Comable.t('admin.more'), comable.admin_orders_path(search_customer_id: @customer.id), class: 'btn btn-default'