comable_frontend 0.4.1 → 0.4.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 579942b136c94b56c0611087feab3531a74199ca
4
- data.tar.gz: d1c958f90bda97a66044fa951643ebc5919a3bd8
3
+ metadata.gz: fe65bcf31263e266c7bac888896e42e1cf9fe632
4
+ data.tar.gz: 3178cdd2a4a40456628b29d021c361bf277d891e
5
5
  SHA512:
6
- metadata.gz: 22a575fd34ed0d4d1dbd14693b9ffd82c7b9b0ab01c3b36eb90c2c2f9374ace3a2b11a4af6c62da197ceca33861e63c9dda991fa360219933ba3cfaa43b41cd8
7
- data.tar.gz: 926f576b0b47332c4df17709faeb92bac55ccae21ee469a04f57b82d356dffc560f9c386d5eeaf856ecc0a0da9d1008d0cc639cace115392d8f69b304f1125e1
6
+ metadata.gz: 78eefb1e487c62ca3f68e038d7bc03746e0a290a01ed7be4e1e7cbf18b7bebf5b72523a768ea31ebb164db87b3f98d4627e1c0aad36ebcf324ea1a11948def55
7
+ data.tar.gz: 0fd2d5bd6372f451fe7a3608271fe590d523d8b68c93d4cae3a74b209c00a8f67cb0584cf29d525c1c4fed2961b52080ad33c3297938ba7fbffbb6f245652515
data/Rakefile CHANGED
@@ -16,6 +16,11 @@ end
16
16
  APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__)
17
17
  load 'rails/tasks/engine.rake'
18
18
 
19
+ def command(string)
20
+ puts string
21
+ system string
22
+ end
23
+
19
24
  if File.exist?('comable.gemspec')
20
25
  $LOAD_PATH.unshift File.expand_path('..', __FILE__)
21
26
  require 'tasks/release'
@@ -45,9 +50,7 @@ if File.exist?('comable.gemspec')
45
50
  namespace :migrate do
46
51
  task :all do
47
52
  FRAMEWORKS.each do |framework|
48
- command = "cd #{framework} && test -d db && bundle exec rake db:migrate RAILS_ENV=#{Rails.env}"
49
- puts command
50
- system command
53
+ command "cd #{framework} && test -d db/migrate && bundle exec rake db:migrate RAILS_ENV=#{Rails.env}"
51
54
  end
52
55
  end
53
56
  end
@@ -59,11 +62,8 @@ if File.exist?('comable.gemspec')
59
62
 
60
63
  namespace :reset do
61
64
  task :all do
62
- FRAMEWORKS.each do |framework|
63
- command = "cd #{framework} && test -d db && bundle exec rake db:migrate:reset RAILS_ENV=#{Rails.env}"
64
- puts command
65
- system command
66
- end
65
+ command "bundle exec rake db:drop db:create RAILS_ENV=#{Rails.env}"
66
+ Rake::Task['db:migrate'].invoke
67
67
  end
68
68
  end
69
69
  end
@@ -90,6 +90,7 @@ end
90
90
  namespace :brakeman do
91
91
  task :all do
92
92
  FRAMEWORKS.each do |framework|
93
+ next unless File.directory?("#{framework}/app")
93
94
  sh "brakeman --exit-on-warn --ignore-config .brakeman.ignore #{framework}"
94
95
  end
95
96
  end
@@ -50,6 +50,7 @@ body.comable-checkout-layout {
50
50
  nav {
51
51
  &.navbar {
52
52
  @include border-radius(0);
53
+ margin-bottom: 0;
53
54
  }
54
55
 
55
56
  .navbar-nav > li > a {
@@ -295,7 +296,8 @@ table {
295
296
  }
296
297
 
297
298
  // main
298
- main {
299
+ main.container {
300
+ margin-top: 20px;
299
301
  }
300
302
 
301
303
  #comable-order {
@@ -311,11 +313,6 @@ main {
311
313
  }
312
314
  }
313
315
 
314
- footer {
315
- margin: 30px;
316
- text-align: center;
317
- }
318
-
319
316
  .comable-mini-cart {
320
317
  $width: 250px;
321
318
  $image-size: 40px;
@@ -418,8 +415,24 @@ footer {
418
415
  margin-bottom: 20px;
419
416
  padding-bottom: 20px;
420
417
 
421
- &:not(:last-child) {
422
- border-bottom: 1px solid $list-group-border;
418
+ a {
419
+ font-weight: normal;
420
+
421
+ &:link, &:visited, &:hover, &:active {
422
+ color: #444;
423
+ }
424
+ }
425
+
426
+ a {
427
+ display: block;
428
+ overflow: hidden;
429
+
430
+ img {
431
+ @include transition(all 0.5s ease 0s);
432
+ &:hover {
433
+ @include transform(scale(1.1) rotate(-1.5deg));
434
+ }
435
+ }
423
436
  }
424
437
  }
425
438
  }
@@ -432,3 +445,83 @@ footer {
432
445
  height: 100%;
433
446
  overflow: hidden;
434
447
  }
448
+
449
+ body.comable-checkout-layout footer {
450
+ margin-top: 30px;
451
+ text-align: center;
452
+
453
+ .container {
454
+ display: none;
455
+ }
456
+ }
457
+
458
+ body:not(.comable-checkout-layout) footer {
459
+ margin-top: 30px;
460
+ background-color: #edeff1;
461
+ border-top: 2px solid #e3e3e3;
462
+
463
+ .container {
464
+ padding: 30px;
465
+ color: #036;
466
+ }
467
+
468
+ h3 {
469
+ padding-bottom: 10px;
470
+ border-bottom: 1px solid $list-group-border;
471
+ }
472
+
473
+ li {
474
+ padding: 3px 0;
475
+ }
476
+
477
+ .credit {
478
+ border-top: 2px solid #ccc;
479
+ text-align: center;
480
+ padding: 20px;
481
+ background-color: #e3e3e3;
482
+ }
483
+ }
484
+
485
+ // home
486
+ #comable-home {
487
+ section {
488
+ padding: 100px;
489
+ text-align: center;
490
+
491
+ & > h2 {
492
+ margin: 0;
493
+ }
494
+
495
+ & > *:last-child {
496
+ margin-bottom: 0;
497
+ padding-bottom: 0;
498
+ }
499
+ }
500
+
501
+ .comable-home-top {
502
+ padding: 0;
503
+ overflow: hidden;
504
+ max-height: 600px;
505
+
506
+ img {
507
+ width: 100%;
508
+ height: auto;
509
+ }
510
+ }
511
+
512
+ .comable-home-one {
513
+ color: white;
514
+ background-color: #444;
515
+ background-image: image-url('comable/frontend/home-one.jpg');
516
+ background-position: top center;
517
+ background-size: cover;
518
+ }
519
+
520
+ .comable-home-two {
521
+ }
522
+
523
+ #comable-product {
524
+ padding-top: 100px;
525
+ padding-bottom: 60px;
526
+ }
527
+ }
@@ -0,0 +1,14 @@
1
+ module Comable
2
+ class HomeController < Comable::ApplicationController
3
+ before_filter :load_products, only: :show
4
+
5
+ def show
6
+ end
7
+
8
+ private
9
+
10
+ def load_products
11
+ @products = Comable::Product.limit(5)
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,24 @@
1
+ #comable-home
2
+ section.comable-home-top
3
+ = image_tag 'comable/frontend/home-top.jpg'
4
+
5
+ section#comable-product
6
+ .container
7
+ .products
8
+ = render 'comable/shared/products'
9
+
10
+ section.comable-home-one
11
+ h2
12
+ = Comable.t('sample_header')
13
+ h3
14
+ = Comable.t('sample_subheader')
15
+ p
16
+ = Comable.t('sample_text')
17
+
18
+ section.comable-home-two
19
+ h2
20
+ = Comable.t('sample_header')
21
+ h3
22
+ = Comable.t('sample_subheader')
23
+ p
24
+ = Comable.t('sample_text')
@@ -14,18 +14,7 @@
14
14
  = listed_categories Comable::Category.roots
15
15
 
16
16
  .products.col-sm-10
17
- - @products.each_slice(3) do |products|
18
- ul.row
19
- - products.each do |product|
20
- li.product.col-sm-4
21
- = link_to comable.product_path(product), class: 'thumbnail' do
22
- = image_tag product.image_url, width: '100%'
23
- .name
24
- = link_to product.name, comable.product_path(product)
25
- .caption
26
- = product.caption
27
- .price
28
- = number_to_currency product.price
17
+ = render 'comable/shared/products'
29
18
 
30
19
  .text-center
31
20
  = paginate @products, theme: :comable_frontend
@@ -1,2 +1,39 @@
1
1
  footer
2
- | Powered by #{link_to 'Comable', 'https://github.com/hyoshida/comable'}
2
+ .container
3
+ .row
4
+ .col-md-4
5
+ h3
6
+ = Comable.t('support')
7
+ ul.list-unstyled
8
+ li
9
+ i.glyphicon.glyphicon-earphone>
10
+ | 0123-XX-XXXX
11
+ li
12
+ i.glyphicon.glyphicon-envelope>
13
+ | comable@example.com
14
+ .col-md-4
15
+ h3
16
+ = Comable.t('pages')
17
+ ul.list-unstyled
18
+ li
19
+ = link_to Comable.t('home'), comable.root_path
20
+ li
21
+ = link_to Comable.t('products'), comable.products_path
22
+ li
23
+ = link_to Comable.t('cart'), comable.cart_path
24
+ li
25
+ = link_to Comable.t('my_account'), comable.user_path
26
+ .col-md-4
27
+ h3
28
+ = Comable.t('my_account')
29
+ ul.list-unstyled
30
+ li
31
+ = link_to Comable.t('sign_in'), comable.new_user_session_path
32
+ li
33
+ = link_to Comable.t('my_account'), comable.user_path
34
+ li
35
+ = link_to Comable.t('change_email_or_password'), comable.edit_user_path
36
+ li
37
+ = link_to Comable.t('edit_your_address_book'), comable.addresses_user_path
38
+ .credit
39
+ | Powered by #{link_to Comable.app_name, Comable.homepage}
@@ -0,0 +1,23 @@
1
+ ul.row
2
+ - @products.each do |product|
3
+ li.col-xs-6.col-sm-3
4
+ .thumbnail.text-center
5
+ = link_to comable.product_path(product) do
6
+ = image_tag product.image_url, width: '100%'
7
+ h5
8
+ = link_to product.name, comable.product_path(product)
9
+ - if product.caption.present?
10
+ p
11
+ = product.caption
12
+ strong
13
+ = number_to_currency product.price
14
+ p
15
+ = form_tag comable.add_cart_path do
16
+ - stock = product.stocks.first
17
+ - if stock && stock.stocked?
18
+ .add_cart.form-inline.form-group
19
+ = hidden_field_tag :stock_id, stock.id
20
+ = submit_tag Comable.t('add_to_cart'), class: 'btn btn-default'
21
+ - else
22
+ .soldout
23
+ = submit_tag Comable.t('soldout'), class: 'btn btn-default', disabled: true
@@ -32,7 +32,7 @@ html
32
32
  - else
33
33
  = render 'comable/shared/header'
34
34
 
35
- main.container
35
+ main class="#{'container' if controller_name != 'home'}"
36
36
  - flash.each do |name, msg|
37
37
  = content_tag(:div, msg, id: "flash_#{name}")
38
38
 
data/config/routes.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  Comable::Core::Engine.routes.draw do
2
- root to: 'products#index'
2
+ root to: 'home#show'
3
3
 
4
+ resource :home, only: :show
4
5
  resources :products
5
6
 
6
7
  resource :cart do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comable_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
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-05-15 00:00:00.000000000 Z
11
+ date: 2015-06-01 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.4.1
19
+ version: 0.4.2
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.4.1
26
+ version: 0.4.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -205,12 +205,15 @@ extra_rdoc_files: []
205
205
  files:
206
206
  - MIT-LICENSE
207
207
  - Rakefile
208
+ - app/assets/images/comable/frontend/home-one.jpg
209
+ - app/assets/images/comable/frontend/home-top.jpg
208
210
  - app/assets/javascripts/comable/frontend/application.coffee
209
211
  - app/assets/stylesheets/comable/frontend/application.scss
210
212
  - app/assets/stylesheets/comable/frontend/products.scss
211
213
  - app/assets/stylesheets/comable/products.scss
212
214
  - app/controllers/comable/application_controller.rb
213
215
  - app/controllers/comable/carts_controller.rb
216
+ - app/controllers/comable/home_controller.rb
214
217
  - app/controllers/comable/orders_controller.rb
215
218
  - app/controllers/comable/products_controller.rb
216
219
  - app/controllers/comable/users_controller.rb
@@ -218,6 +221,7 @@ files:
218
221
  - app/controllers/concerns/comable/shipment_action.rb
219
222
  - app/controllers/concerns/comable/signin_action.rb
220
223
  - app/views/comable/carts/show.slim
224
+ - app/views/comable/home/show.slim
221
225
  - app/views/comable/orders/confirm.slim
222
226
  - app/views/comable/orders/create.slim
223
227
  - app/views/comable/orders/delivery.slim
@@ -232,6 +236,7 @@ files:
232
236
  - app/views/comable/shared/_footer.slim
233
237
  - app/views/comable/shared/_header.slim
234
238
  - app/views/comable/shared/_header_for_checkout.slim
239
+ - app/views/comable/shared/_products.slim
235
240
  - app/views/comable/shared/_tracker.slim
236
241
  - app/views/comable/users/_address.slim
237
242
  - app/views/comable/users/addresses.slim
@@ -246,7 +251,7 @@ files:
246
251
  - lib/comable/frontend/engine.rb
247
252
  - lib/comable_frontend.rb
248
253
  - lib/tasks/comable_backend_tasks.rake
249
- homepage: https://github.com/hyoshida/comable#comable
254
+ homepage: https://github.com/appirits/comable#comable
250
255
  licenses:
251
256
  - MIT
252
257
  metadata: {}
@@ -266,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
266
271
  version: '0'
267
272
  requirements: []
268
273
  rubyforge_project:
269
- rubygems_version: 2.4.5
274
+ rubygems_version: 2.2.2
270
275
  signing_key:
271
276
  specification_version: 4
272
277
  summary: Provide frontend functions for Comable.