comable_frontend 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/Rakefile +16 -4
- data/app/assets/javascripts/comable/frontend/application.coffee +5 -0
- data/app/assets/stylesheets/comable/frontend/application.scss +434 -0
- data/app/assets/stylesheets/comable/frontend/products.scss +0 -0
- data/app/assets/stylesheets/comable/products.scss +0 -0
- data/app/controllers/comable/application_controller.rb +2 -0
- data/app/controllers/comable/carts_controller.rb +32 -17
- data/app/controllers/comable/customers_controller.rb +5 -5
- data/app/controllers/comable/orders_controller.rb +31 -71
- data/app/controllers/comable/products_controller.rb +15 -1
- data/app/controllers/concerns/comable/payment_action.rb +3 -13
- data/app/controllers/concerns/comable/shipment_action.rb +2 -12
- data/app/controllers/concerns/comable/signin_action.rb +55 -0
- data/app/views/comable/carts/show.slim +65 -20
- data/app/views/comable/customers/_address.slim +7 -7
- data/app/views/comable/customers/addresses.slim +31 -29
- data/app/views/comable/customers/show.slim +60 -2
- data/app/views/comable/orders/confirm.slim +73 -30
- data/app/views/comable/orders/create.slim +6 -4
- data/app/views/comable/orders/delivery.slim +23 -14
- data/app/views/comable/orders/orderer.slim +38 -20
- data/app/views/comable/orders/payment.slim +12 -11
- data/app/views/comable/orders/shipment.slim +12 -10
- data/app/views/comable/orders/signin.slim +22 -0
- data/app/views/comable/products/index.slim +30 -10
- data/app/views/comable/products/show.slim +89 -21
- data/app/views/comable/shared/_address.slim +13 -20
- data/app/views/comable/shared/_address_form.slim +33 -15
- data/app/views/comable/shared/_footer.slim +2 -0
- data/app/views/comable/shared/_header.slim +74 -0
- data/app/views/comable/shared/_header_for_checkout.slim +18 -0
- data/app/views/kaminari/comable_frontend/_gap.html.slim +2 -0
- data/app/views/kaminari/comable_frontend/_next_page.html.slim +7 -0
- data/app/views/kaminari/comable_frontend/_page.html.slim +3 -0
- data/app/views/kaminari/comable_frontend/_paginator.html.slim +11 -0
- data/app/views/kaminari/comable_frontend/_prev_page.html.slim +7 -0
- data/app/views/layouts/comable/application.slim +23 -14
- data/config/routes.rb +9 -12
- data/lib/comable/frontend/engine.rb +8 -0
- metadata +151 -7
- data/app/controllers/concerns/comable/permitted_attributes.rb +0 -15
- data/app/views/comable/orders/new.slim +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4d18df624943b7ddad7e0d53f8d7aa716d1e053
|
4
|
+
data.tar.gz: f6193aaa016436a1b8260edadc950930a15ff03d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0388b3d0f3a8e4fa8711dfc9bad2b45ecd4efb8f82998c8cdb53c8c015aa058ac7e42c299789fd594eb0c668a030c1e20939042d8c7fa14af17ca551eb52c17c
|
7
|
+
data.tar.gz: 3c2390f677786a193c026d0d5fcc0cd02a79eeb97de0ff487fed9cce83ba022c20aa6944d8304d9d756237527b3a69f3dae5934c498805ccd22d9440429f40ab
|
data/MIT-LICENSE
CHANGED
data/Rakefile
CHANGED
@@ -69,16 +69,28 @@ if File.exist?('comable.gemspec')
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
-
task default: ['app:spec:all', 'rubocop']
|
72
|
+
task default: ['app:spec:all', 'rubocop', 'brakeman:all']
|
73
|
+
else
|
74
|
+
task default: ['app:spec', 'rubocop', 'brakeman']
|
73
75
|
end
|
74
76
|
|
75
|
-
task default: ['app:spec', 'rubocop']
|
76
|
-
|
77
77
|
Bundler::GemHelper.install_tasks
|
78
78
|
|
79
79
|
# from https://github.com/rspec/rspec-rails/issues/936
|
80
80
|
task 'test:prepare'
|
81
81
|
|
82
82
|
task :rubocop do
|
83
|
-
|
83
|
+
sh 'rubocop'
|
84
|
+
end
|
85
|
+
|
86
|
+
task :brakeman do
|
87
|
+
sh 'brakeman --exit-on-warn --ignore-config .brakeman.ignore'
|
88
|
+
end
|
89
|
+
|
90
|
+
namespace :brakeman do
|
91
|
+
task :all do
|
92
|
+
FRAMEWORKS.each do |framework|
|
93
|
+
sh "brakeman --exit-on-warn --ignore-config .brakeman.ignore #{framework}"
|
94
|
+
end
|
95
|
+
end
|
84
96
|
end
|
@@ -0,0 +1,434 @@
|
|
1
|
+
//= require jquery-ui
|
2
|
+
//= require_tree
|
3
|
+
|
4
|
+
$lighten-bg: #139bab;
|
5
|
+
$darken-bg: darken($lighten-bg, 10%);
|
6
|
+
|
7
|
+
// brand
|
8
|
+
$brand-primary: $lighten-bg;
|
9
|
+
// navbar
|
10
|
+
$navbar-default-bg: $lighten-bg;
|
11
|
+
$navbar-default-color: #fff;
|
12
|
+
// navbar > link
|
13
|
+
$navbar-default-link-color: $navbar-default-color;
|
14
|
+
$navbar-default-link-active-color: $navbar-default-link-color;
|
15
|
+
$navbar-default-link-hover-color: $navbar-default-link-color;
|
16
|
+
$navbar-default-link-hover-bg: $darken-bg;
|
17
|
+
$navbar-default-link-active-bg: $darken-bg;
|
18
|
+
$navbar-default-link-hover-bg: darken($navbar-default-bg, 10%);
|
19
|
+
$navbar-default-link-active-bg: darken($navbar-default-bg, 10%);
|
20
|
+
// navbar > brand
|
21
|
+
$navbar-default-brand-color: $navbar-default-link-color;
|
22
|
+
$navbar-default-brand-hover-color: $navbar-default-brand-color;
|
23
|
+
// navbar > toggle
|
24
|
+
$navbar-default-toggle-icon-bar-bg: $navbar-default-link-color;
|
25
|
+
$navbar-default-toggle-hover-bg: $navbar-default-link-hover-bg;
|
26
|
+
// button
|
27
|
+
$btn-primary-bg: invert($lighten-bg);
|
28
|
+
$btn-default-border: $btn-primary-bg;
|
29
|
+
$btn-default-border: $btn-primary-bg;
|
30
|
+
$btn-default-color: $btn-primary-bg;
|
31
|
+
|
32
|
+
@import "bootstrap-sprockets";
|
33
|
+
@import "bootstrap";
|
34
|
+
@import "compass/utilities";
|
35
|
+
@import "compass/css3";
|
36
|
+
|
37
|
+
body.comable-checkout-layout {
|
38
|
+
margin: 30px;
|
39
|
+
|
40
|
+
nav {
|
41
|
+
.navbar-brand,
|
42
|
+
.navbar-brand:hover, {
|
43
|
+
color: $lighten-bg;
|
44
|
+
}
|
45
|
+
background: transparent;
|
46
|
+
border: none;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
nav {
|
51
|
+
&.navbar {
|
52
|
+
@include border-radius(0);
|
53
|
+
}
|
54
|
+
|
55
|
+
.navbar-nav > li > a {
|
56
|
+
@include transition(all .15s ease-in);
|
57
|
+
}
|
58
|
+
|
59
|
+
// HACK:
|
60
|
+
// from http://stackoverflow.com/questions/18552714/bootstrap-3-how-to-maximize-input-width-inside-navbar/18562948#18562948
|
61
|
+
.form-group {
|
62
|
+
display: inline !important;
|
63
|
+
.input-group {
|
64
|
+
display: table;
|
65
|
+
padding: 0 6px;
|
66
|
+
.input-group-btn {
|
67
|
+
width: 1% !important;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
.form-control,
|
73
|
+
.btn-default,
|
74
|
+
.btn-default:hover {
|
75
|
+
color: #333;
|
76
|
+
border-color: darken($navbar-default-bg, 10%);
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
.comable-navbar-top {
|
81
|
+
font-size: 11px;
|
82
|
+
height: 30px;
|
83
|
+
line-height: 30px;
|
84
|
+
font-weight: bold;
|
85
|
+
background-color: darken($navbar-default-bg, 10%);
|
86
|
+
|
87
|
+
.navbar-text {
|
88
|
+
margin-top: 0;
|
89
|
+
margin-bottom: 0;
|
90
|
+
}
|
91
|
+
|
92
|
+
.navbar-nav > li > a {
|
93
|
+
padding-top: 0;
|
94
|
+
padding-bottom: 0;
|
95
|
+
line-height: 30px;
|
96
|
+
&:hover {
|
97
|
+
color: lighten($navbar-default-link-hover-bg, 40%);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
.container {
|
102
|
+
padding-left: 0;
|
103
|
+
}
|
104
|
+
|
105
|
+
a:hover {
|
106
|
+
background-color: transparent;
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
button {
|
111
|
+
@extend .btn;
|
112
|
+
}
|
113
|
+
|
114
|
+
input[type="submit"] {
|
115
|
+
@extend .btn;
|
116
|
+
@extend .btn-primary;
|
117
|
+
|
118
|
+
&.btn-default {
|
119
|
+
@extend .btn-default;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
select,
|
124
|
+
input[type="password"],
|
125
|
+
input[type="email"],
|
126
|
+
input[type="text"] {
|
127
|
+
@extend .form-control;
|
128
|
+
margin-right: 0.5em;
|
129
|
+
|
130
|
+
&:last-child {
|
131
|
+
margin-right: 0;
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
table {
|
136
|
+
@extend .table;
|
137
|
+
}
|
138
|
+
|
139
|
+
// Megamenu
|
140
|
+
// from http://jsfiddle.net/apougher/ydcMQ/
|
141
|
+
.menu-large {
|
142
|
+
position: static !important;
|
143
|
+
|
144
|
+
.megamenu {
|
145
|
+
padding: 20px 0px;
|
146
|
+
width: 100%;
|
147
|
+
}
|
148
|
+
|
149
|
+
.megamenu > li > ul {
|
150
|
+
padding: 0;
|
151
|
+
margin: 0;
|
152
|
+
}
|
153
|
+
|
154
|
+
.megamenu > li > ul > li {
|
155
|
+
list-style: none;
|
156
|
+
}
|
157
|
+
|
158
|
+
.megamenu > li > ul > li > a {
|
159
|
+
display: block;
|
160
|
+
padding: 3px 20px;
|
161
|
+
clear: both;
|
162
|
+
font-weight: normal;
|
163
|
+
line-height: 1.428571429;
|
164
|
+
color: #333333;
|
165
|
+
white-space: normal;
|
166
|
+
}
|
167
|
+
|
168
|
+
.megamenu > li ul > li > a:hover,
|
169
|
+
.megamenu > li ul > li > a:focus {
|
170
|
+
text-decoration: none;
|
171
|
+
color: #262626;
|
172
|
+
background-color: #f5f5f5;
|
173
|
+
}
|
174
|
+
|
175
|
+
.megamenu.disabled > a,
|
176
|
+
.megamenu.disabled > a:hover,
|
177
|
+
.megamenu.disabled > a:focus {
|
178
|
+
color: #999999;
|
179
|
+
}
|
180
|
+
|
181
|
+
.megamenu.disabled > a:hover,
|
182
|
+
.megamenu.disabled > a:focus {
|
183
|
+
text-decoration: none;
|
184
|
+
background-color: transparent;
|
185
|
+
background-image: none;
|
186
|
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
|
187
|
+
cursor: not-allowed;
|
188
|
+
}
|
189
|
+
|
190
|
+
.megamenu.dropdown-header {
|
191
|
+
color: #428bca;
|
192
|
+
font-size: 18px;
|
193
|
+
}
|
194
|
+
|
195
|
+
@media(max-width: 768px) {
|
196
|
+
.megamenu {
|
197
|
+
margin-left: 0;
|
198
|
+
margin-right: 0;
|
199
|
+
}
|
200
|
+
|
201
|
+
.megamenu > li {
|
202
|
+
margin-bottom: 30px;
|
203
|
+
}
|
204
|
+
|
205
|
+
.megamenu > li:last-child {
|
206
|
+
margin-bottom: 0;
|
207
|
+
}
|
208
|
+
|
209
|
+
.megamenu.dropdown-header {
|
210
|
+
padding: 3px 15px !important;
|
211
|
+
}
|
212
|
+
|
213
|
+
.navbar-nav .open .dropdown-menu .dropdown-header {
|
214
|
+
color: #fff;
|
215
|
+
}
|
216
|
+
}
|
217
|
+
}
|
218
|
+
|
219
|
+
// checkout-flow
|
220
|
+
.comable-checkout-flow {
|
221
|
+
$weight: 1px;
|
222
|
+
$size: 11px + $weight;
|
223
|
+
$border-darken: #aaa;
|
224
|
+
$border-lighten: #fff;
|
225
|
+
$color-darken: #aaa;
|
226
|
+
$color-lighten: $lighten-bg;
|
227
|
+
|
228
|
+
font-size: 75%;
|
229
|
+
color: $color-darken;
|
230
|
+
height: $navbar-height;
|
231
|
+
position: relative;
|
232
|
+
background: url('data:image/gif;base64,R0lGODdhAQABAIAAAKqqqgAAACwAAAAAAQABAAACAkQBADs=') repeat-x 0 34px; // #aaa
|
233
|
+
background-size: $weight;
|
234
|
+
overflow: hidden;
|
235
|
+
width: 60%;
|
236
|
+
|
237
|
+
& > li {
|
238
|
+
padding-top: 7px;
|
239
|
+
width: 25%;
|
240
|
+
text-align: center;
|
241
|
+
vertical-align: top;
|
242
|
+
|
243
|
+
&:before {
|
244
|
+
width: $weight;
|
245
|
+
height: $size;
|
246
|
+
display: block;
|
247
|
+
background-color: $border-darken;
|
248
|
+
position: absolute;
|
249
|
+
top: 28px;
|
250
|
+
}
|
251
|
+
|
252
|
+
&:first-child:before {
|
253
|
+
content: '';
|
254
|
+
left: 0px;
|
255
|
+
}
|
256
|
+
|
257
|
+
&:last-child:before {
|
258
|
+
content: '';
|
259
|
+
right: 0px;
|
260
|
+
}
|
261
|
+
|
262
|
+
&:after {
|
263
|
+
content: '';
|
264
|
+
display: block;
|
265
|
+
width: $size;
|
266
|
+
height: $size;
|
267
|
+
border-radius: $size;
|
268
|
+
background-color: $border-darken;
|
269
|
+
border: 2px solid $border-lighten;
|
270
|
+
position: absolute;
|
271
|
+
top: 22px + ($size / 2);
|
272
|
+
left: 50%;
|
273
|
+
margin-left: -($size / 2);
|
274
|
+
}
|
275
|
+
|
276
|
+
&.active {
|
277
|
+
color: $color-lighten;
|
278
|
+
|
279
|
+
&:after {
|
280
|
+
background-color: $border-lighten;
|
281
|
+
border-color: $color-lighten;
|
282
|
+
}
|
283
|
+
}
|
284
|
+
}
|
285
|
+
|
286
|
+
@media(max-width: 768px) {
|
287
|
+
margin: 0;
|
288
|
+
padding: 0;
|
289
|
+
width: 100%;
|
290
|
+
|
291
|
+
& > li {
|
292
|
+
float: left;
|
293
|
+
}
|
294
|
+
}
|
295
|
+
}
|
296
|
+
|
297
|
+
// main
|
298
|
+
main {
|
299
|
+
}
|
300
|
+
|
301
|
+
#comable-order {
|
302
|
+
input[type="submit"] {
|
303
|
+
@extend .btn-block;
|
304
|
+
}
|
305
|
+
.comable-bill_address,
|
306
|
+
.comable-ship_address {
|
307
|
+
form {
|
308
|
+
@extend .form-horizontal;
|
309
|
+
@extend .col-sm-6;
|
310
|
+
}
|
311
|
+
}
|
312
|
+
}
|
313
|
+
|
314
|
+
footer {
|
315
|
+
margin: 30px;
|
316
|
+
text-align: center;
|
317
|
+
}
|
318
|
+
|
319
|
+
.comable-mini-cart {
|
320
|
+
$width: 250px;
|
321
|
+
$image-size: 40px;
|
322
|
+
$padding: 10px;
|
323
|
+
|
324
|
+
width: $width + $padding * 3;
|
325
|
+
|
326
|
+
& > li > a {
|
327
|
+
display: block;
|
328
|
+
padding: $padding;
|
329
|
+
vertical-align: middle;
|
330
|
+
|
331
|
+
.comable-image {
|
332
|
+
float: left;
|
333
|
+
margin-right: $padding;
|
334
|
+
width: $image-size;
|
335
|
+
height: $image-size;
|
336
|
+
overflow: hidden;
|
337
|
+
}
|
338
|
+
|
339
|
+
.comable-name {
|
340
|
+
display: block;
|
341
|
+
color: $link-color;
|
342
|
+
white-space: nowrap;
|
343
|
+
overflow: hidden;
|
344
|
+
@include ellipsis;
|
345
|
+
}
|
346
|
+
}
|
347
|
+
|
348
|
+
.comable-show-cart {
|
349
|
+
margin: $padding;
|
350
|
+
text-align: center;
|
351
|
+
|
352
|
+
a {
|
353
|
+
@extend .btn;
|
354
|
+
@extend .btn-primary;
|
355
|
+
display: block;
|
356
|
+
color: $btn-primary-color;
|
357
|
+
}
|
358
|
+
}
|
359
|
+
}
|
360
|
+
|
361
|
+
.category {
|
362
|
+
& > ul:not(.category-path) {
|
363
|
+
list-style: none;
|
364
|
+
padding-left: 2em;
|
365
|
+
}
|
366
|
+
|
367
|
+
a {
|
368
|
+
display: block;
|
369
|
+
color: $text-color;
|
370
|
+
}
|
371
|
+
}
|
372
|
+
|
373
|
+
.category-path {
|
374
|
+
margin: 0;
|
375
|
+
padding: 0;
|
376
|
+
list-style: none;
|
377
|
+
|
378
|
+
& > li {
|
379
|
+
& > a:before {
|
380
|
+
@include inline-block;
|
381
|
+
content: '<';
|
382
|
+
width: 1em;
|
383
|
+
}
|
384
|
+
|
385
|
+
&.active {
|
386
|
+
font-weight: bold;
|
387
|
+
|
388
|
+
&:before {
|
389
|
+
@include inline-block;
|
390
|
+
content: ' ';
|
391
|
+
width: 1em;
|
392
|
+
}
|
393
|
+
}
|
394
|
+
}
|
395
|
+
}
|
396
|
+
|
397
|
+
.category-breadcrumb {
|
398
|
+
margin: 0;
|
399
|
+
padding: 0;
|
400
|
+
list-style: none;
|
401
|
+
|
402
|
+
& > li {
|
403
|
+
@include inline-block;
|
404
|
+
|
405
|
+
&:not(:last-child):after {
|
406
|
+
content: '>';
|
407
|
+
margin-left: 0.5em;
|
408
|
+
margin-right: 0.5em;
|
409
|
+
}
|
410
|
+
}
|
411
|
+
}
|
412
|
+
|
413
|
+
#comable-product {
|
414
|
+
.products > .row {
|
415
|
+
margin: 0;
|
416
|
+
padding: 0;
|
417
|
+
list-style: none;
|
418
|
+
margin-bottom: 20px;
|
419
|
+
padding-bottom: 20px;
|
420
|
+
|
421
|
+
&:not(:last-child) {
|
422
|
+
border-bottom: 1px solid $list-group-border;
|
423
|
+
}
|
424
|
+
}
|
425
|
+
}
|
426
|
+
|
427
|
+
.without-titlebar .ui-dialog-titlebar {
|
428
|
+
display: none;
|
429
|
+
}
|
430
|
+
|
431
|
+
.stop-scrolling {
|
432
|
+
height: 100%;
|
433
|
+
overflow: hidden;
|
434
|
+
}
|