shoppe 1.0.2 → 1.0.3
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 +4 -4
- data/app/assets/images/shoppe/table-tear-off.png +0 -0
- data/app/assets/javascripts/shoppe/application.coffee +2 -2
- data/app/assets/stylesheets/shoppe/application.scss +80 -37
- data/app/assets/stylesheets/shoppe/elements.scss +1 -2
- data/app/controllers/shoppe/attachments_controller.rb +3 -3
- data/app/controllers/shoppe/countries_controller.rb +13 -13
- data/app/controllers/shoppe/delivery_service_prices_controller.rb +11 -11
- data/app/controllers/shoppe/delivery_services_controller.rb +13 -13
- data/app/controllers/shoppe/orders_controller.rb +20 -20
- data/app/controllers/shoppe/payments_controller.rb +8 -8
- data/app/controllers/shoppe/product_categories_controller.rb +13 -13
- data/app/controllers/shoppe/products_controller.rb +24 -13
- data/app/controllers/shoppe/sessions_controller.rb +7 -7
- data/app/controllers/shoppe/settings_controller.rb +6 -6
- data/app/controllers/shoppe/stock_level_adjustments_controller.rb +5 -5
- data/app/controllers/shoppe/tax_rates_controller.rb +13 -13
- data/app/controllers/shoppe/users_controller.rb +15 -15
- data/app/controllers/shoppe/variants_controller.rb +13 -13
- data/app/helpers/shoppe/application_helper.rb +12 -12
- data/app/models/shoppe/order/actions.rb +17 -3
- data/app/models/shoppe/order/billing.rb +18 -18
- data/app/models/shoppe/order/delivery.rb +30 -31
- data/app/models/shoppe/order_item.rb +33 -34
- data/app/models/shoppe/payment.rb +15 -15
- data/app/models/shoppe/product.rb +82 -21
- data/app/models/shoppe/product/variants.rb +10 -10
- data/app/models/shoppe/product_category.rb +7 -7
- data/app/models/shoppe/stock_level_adjustment.rb +6 -6
- data/app/validators/permalink_validator.rb +7 -0
- data/app/views/layouts/shoppe/application.html.haml +10 -20
- data/app/views/shoppe/countries/_form.html.haml +15 -11
- data/app/views/shoppe/countries/edit.html.haml +5 -4
- data/app/views/shoppe/countries/index.html.haml +9 -9
- data/app/views/shoppe/countries/new.html.haml +6 -4
- data/app/views/shoppe/delivery_service_prices/_form.html.haml +16 -16
- data/app/views/shoppe/delivery_service_prices/edit.html.haml +5 -4
- data/app/views/shoppe/delivery_service_prices/index.html.haml +8 -9
- data/app/views/shoppe/delivery_service_prices/new.html.haml +5 -4
- data/app/views/shoppe/delivery_services/_form.html.haml +15 -14
- data/app/views/shoppe/delivery_services/edit.html.haml +7 -5
- data/app/views/shoppe/delivery_services/index.html.haml +11 -12
- data/app/views/shoppe/delivery_services/new.html.haml +5 -4
- data/app/views/shoppe/orders/_form.html.haml +19 -19
- data/app/views/shoppe/orders/_order_details.html.haml +20 -15
- data/app/views/shoppe/orders/_order_items.html.haml +6 -6
- data/app/views/shoppe/orders/_order_items_form.html.haml +11 -11
- data/app/views/shoppe/orders/_payments_form.html.haml +4 -4
- data/app/views/shoppe/orders/_payments_table.html.haml +12 -12
- data/app/views/shoppe/orders/_search_form.html.haml +10 -10
- data/app/views/shoppe/orders/_status_bar.html.haml +17 -13
- data/app/views/shoppe/orders/despatch_note.html.haml +15 -15
- data/app/views/shoppe/orders/edit.html.haml +8 -8
- data/app/views/shoppe/orders/index.html.haml +12 -12
- data/app/views/shoppe/orders/new.html.haml +7 -7
- data/app/views/shoppe/orders/show.html.haml +9 -12
- data/app/views/shoppe/payments/refund.html.haml +6 -7
- data/app/views/shoppe/product_categories/_form.html.haml +9 -9
- data/app/views/shoppe/product_categories/edit.html.haml +4 -4
- data/app/views/shoppe/product_categories/index.html.haml +5 -5
- data/app/views/shoppe/product_categories/new.html.haml +4 -3
- data/app/views/shoppe/products/_form.html.haml +49 -50
- data/app/views/shoppe/products/_table.html.haml +10 -10
- data/app/views/shoppe/products/edit.html.haml +6 -6
- data/app/views/shoppe/products/import.html.haml +63 -0
- data/app/views/shoppe/products/index.html.haml +6 -4
- data/app/views/shoppe/products/new.html.haml +6 -4
- data/app/views/shoppe/sessions/new.html.haml +5 -5
- data/app/views/shoppe/sessions/reset.html.haml +6 -5
- data/app/views/shoppe/settings/edit.html.haml +5 -5
- data/app/views/shoppe/shared/error.html.haml +3 -3
- data/app/views/shoppe/stock_level_adjustments/index.html.haml +13 -12
- data/app/views/shoppe/tax_rates/form.html.haml +13 -13
- data/app/views/shoppe/tax_rates/index.html.haml +5 -5
- data/app/views/shoppe/users/_form.html.haml +10 -11
- data/app/views/shoppe/users/edit.html.haml +4 -4
- data/app/views/shoppe/users/index.html.haml +5 -5
- data/app/views/shoppe/users/new.html.haml +6 -4
- data/app/views/shoppe/variants/form.html.haml +27 -29
- data/app/views/shoppe/variants/index.html.haml +11 -11
- data/config/locales/en.yml +619 -14
- data/config/locales/es.yml +650 -0
- data/config/locales/pl.yml +650 -0
- data/config/locales/pt-BR.yml +643 -0
- data/config/routes.rb +16 -8
- data/db/migrate/20141026175622_add_indexes_to_shoppe_order_items.rb +6 -0
- data/db/migrate/20141026175943_add_indexes_to_shoppe_orders.rb +7 -0
- data/db/migrate/20141026180333_add_indexes_to_shoppe_payments.rb +6 -0
- data/db/migrate/20141026180835_add_indexes_to_shoppe_product_attributes.rb +7 -0
- data/db/migrate/20141026180952_add_indexes_to_shoppe_product_categories.rb +5 -0
- data/db/migrate/20141026181040_add_indexes_to_shoppe_products.rb +8 -0
- data/db/migrate/20141026181312_add_indexes_to_shoppe_settings.rb +5 -0
- data/db/migrate/20141026181354_add_indexes_to_shoppe_stock_level_adjustments.rb +6 -0
- data/db/migrate/20141026181559_add_indexes_to_shoppe_users.rb +5 -0
- data/db/migrate/20141026181716_add_indexes_to_shoppe_delivery_services.rb +9 -0
- data/db/schema.rb +36 -1
- data/lib/shoppe/engine.rb +6 -0
- data/lib/shoppe/navigation_manager.rb +1 -1
- data/lib/shoppe/version.rb +1 -1
- metadata +67 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 94d4e04493d5264dbdab6f5cbe61f31cb2d8b0a2
|
|
4
|
+
data.tar.gz: 505d1cf11f0e0ef6d96cc1d6bb0175c55084ceb7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff6a2d5f80a7390b150808b5c67f2b3f7321315b2f41a6b2fd117c3cfa81dbc183f04724a98543a9fc225353062ba97bbb0396d638f63056393624c4390c3f7d
|
|
7
|
+
data.tar.gz: 54dcd6b512c401ae38aa43cd8e3a4590e1495ccbd0539f2591a8a13ddf125ae822cc26cda9012758f9c900e88a14f452b65417acd1f7cca3ce90ba89fba606f8
|
|
Binary file
|
|
@@ -72,7 +72,7 @@ $ ->
|
|
|
72
72
|
# Format money values to 2 decimal places
|
|
73
73
|
#
|
|
74
74
|
window.formatMoneyField = ->
|
|
75
|
-
value = $(this).val()
|
|
75
|
+
value = $(this).val().replace /,/, ""
|
|
76
76
|
$(this).val(parseFloat(value).toFixed(2)) if value.length
|
|
77
77
|
|
|
78
78
|
#
|
|
@@ -116,4 +116,4 @@ Mousetrap.stopCallback = -> false
|
|
|
116
116
|
Mousetrap.bind 'escape', ->
|
|
117
117
|
Nifty.Dialog.closeTopDialog()
|
|
118
118
|
false
|
|
119
|
-
|
|
119
|
+
|
|
@@ -33,14 +33,14 @@ nav.sidebar {
|
|
|
33
33
|
}
|
|
34
34
|
p { color:#fff; font-size:0.9em; margin-top:4px; }
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
p.logged {
|
|
38
38
|
background:#5B6270;
|
|
39
39
|
padding:12px 20px;
|
|
40
40
|
color:#fff;
|
|
41
41
|
font-size:0.9em;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
ul {
|
|
45
45
|
li {
|
|
46
46
|
span.pending { float:right; font-size:0.9em; font-weight:bold;background:#5B6270; color:#fff; padding:2px 10px; border-radius:16px; margin-top:9px; margin-right:10px;}
|
|
@@ -71,6 +71,7 @@ header.main {
|
|
|
71
71
|
height:85px;
|
|
72
72
|
background:#fff;
|
|
73
73
|
box-shadow: 0 0px 15px -2px rgba(0,0,0,0.2);
|
|
74
|
+
z-index: 1;
|
|
74
75
|
p.buttons { float:right; margin-top:27px; margin-right:35px;}
|
|
75
76
|
p.buttons a { margin-left:10px;}
|
|
76
77
|
h2 { margin-top:28px; margin-left:35px; font-size:2.0em; font-weight:300; color:#333; background-repeat:no-repeat; background-size:22px; background-position:0 5px; padding-left:32px;}
|
|
@@ -89,17 +90,17 @@ header.main {
|
|
|
89
90
|
#content {
|
|
90
91
|
padding-left:200px;
|
|
91
92
|
padding-top:85px;
|
|
92
|
-
|
|
93
|
+
|
|
93
94
|
section.main {
|
|
94
95
|
padding:35px;
|
|
95
96
|
}
|
|
96
|
-
|
|
97
|
+
|
|
97
98
|
//
|
|
98
99
|
// flashes
|
|
99
100
|
//
|
|
100
101
|
#flash-notice { background:#21a3e0; padding:15px 35px; color:#fff; font-size:1.2em; font-weight:bold;}
|
|
101
102
|
#flash-alert { background:#e04e21; padding:15px 35px; color:#fff; font-size:1.2em; font-weight:bold;}
|
|
102
|
-
|
|
103
|
+
|
|
103
104
|
//
|
|
104
105
|
// sub title
|
|
105
106
|
//
|
|
@@ -110,8 +111,8 @@ header.main {
|
|
|
110
111
|
padding:15px;
|
|
111
112
|
h3 { font-size:2.0em; font-weight:500;}
|
|
112
113
|
}
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
|
|
115
|
+
|
|
115
116
|
//
|
|
116
117
|
// Status tags
|
|
117
118
|
//
|
|
@@ -129,7 +130,7 @@ header.main {
|
|
|
129
130
|
&.rejected { color:#E33127; background-image:image-url('shoppe/statuses/rejected.svg'); }
|
|
130
131
|
&.received { color:#909091; background-image:image-url('shoppe/statuses/received.svg'); }
|
|
131
132
|
}
|
|
132
|
-
|
|
133
|
+
|
|
133
134
|
//
|
|
134
135
|
// fieldset
|
|
135
136
|
//
|
|
@@ -143,7 +144,7 @@ header.main {
|
|
|
143
144
|
&.padded { padding:15px 25px 25px 25px;}
|
|
144
145
|
&.padded legend { margin:0;}
|
|
145
146
|
}
|
|
146
|
-
|
|
147
|
+
|
|
147
148
|
//
|
|
148
149
|
// forms
|
|
149
150
|
//
|
|
@@ -152,8 +153,8 @@ header.main {
|
|
|
152
153
|
|
|
153
154
|
.splitContainer { margin:0 25px; margin-bottom:15px; height:50px;}
|
|
154
155
|
.splitContainer:last-child { margin-bottom:0;}
|
|
155
|
-
|
|
156
|
-
dl {
|
|
156
|
+
|
|
157
|
+
dl {
|
|
157
158
|
margin:0 25px;
|
|
158
159
|
margin-bottom:15px;
|
|
159
160
|
&:last-child { margin-bottom:0;}
|
|
@@ -179,7 +180,7 @@ header.main {
|
|
|
179
180
|
float:left;
|
|
180
181
|
&:last-child { float:right;}
|
|
181
182
|
}
|
|
182
|
-
|
|
183
|
+
|
|
183
184
|
&.third {
|
|
184
185
|
width:31%;
|
|
185
186
|
margin:0;
|
|
@@ -187,8 +188,23 @@ header.main {
|
|
|
187
188
|
&:nth-child(2) { margin-left:2%; width:32%;}
|
|
188
189
|
&:last-child { float:right; width:33%;}
|
|
189
190
|
}
|
|
191
|
+
|
|
192
|
+
&.quarter {
|
|
193
|
+
width:23%;
|
|
194
|
+
margin:0;
|
|
195
|
+
margin-left:2%;
|
|
196
|
+
float:left;
|
|
197
|
+
&:last-child { float:right; width:25%;}
|
|
198
|
+
&:first-child { margin:0;}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&.three-quarter {
|
|
202
|
+
width:75%;
|
|
203
|
+
margin:0;
|
|
204
|
+
float:right;
|
|
205
|
+
}
|
|
190
206
|
}
|
|
191
|
-
|
|
207
|
+
|
|
192
208
|
dl.sided {
|
|
193
209
|
clear:both;
|
|
194
210
|
dt { float:left; width:25%; text-align:right; padding-top:4px;}
|
|
@@ -196,13 +212,13 @@ header.main {
|
|
|
196
212
|
dd p.help { margin-top:10px;}
|
|
197
213
|
dd div.checkbox { padding-top:5px;}
|
|
198
214
|
}
|
|
199
|
-
|
|
200
|
-
|
|
215
|
+
|
|
216
|
+
|
|
201
217
|
//
|
|
202
218
|
// margined container
|
|
203
219
|
//
|
|
204
220
|
div.margin { margin: 0 25px;}
|
|
205
|
-
|
|
221
|
+
|
|
206
222
|
//
|
|
207
223
|
// attributes table
|
|
208
224
|
//
|
|
@@ -210,7 +226,10 @@ header.main {
|
|
|
210
226
|
width:100%;
|
|
211
227
|
margin-bottom:10px;
|
|
212
228
|
line-height:1.0;
|
|
213
|
-
thead td { background:#f7f7f7; color:#999; font-size:0.9em;}
|
|
229
|
+
thead td, thead th { text-align:left; border:1px solid #ccc; background:#f7f7f7; color:#999; font-size:0.9em; padding:10px; }
|
|
230
|
+
tr:nth-child(even) td {
|
|
231
|
+
background:#fbfbfb;
|
|
232
|
+
}
|
|
214
233
|
td {
|
|
215
234
|
border:1px solid #ccc;
|
|
216
235
|
padding:10px;
|
|
@@ -222,11 +241,35 @@ header.main {
|
|
|
222
241
|
&.handle { width:4%; background:image-url('shoppe/move.svg') no-repeat center; background-size:16px;}
|
|
223
242
|
}
|
|
224
243
|
}
|
|
244
|
+
|
|
245
|
+
//
|
|
246
|
+
// imports example table
|
|
247
|
+
//
|
|
248
|
+
table.importExample {
|
|
249
|
+
@extend table.productAttributes;
|
|
250
|
+
tr:nth-last-child(2) td {
|
|
251
|
+
border-bottom: none;
|
|
252
|
+
}
|
|
253
|
+
tr.tear-off td {
|
|
254
|
+
border:none;
|
|
255
|
+
background:image-url('shoppe/table-tear-off.png') repeat-x 0 0;
|
|
256
|
+
height:5px;
|
|
257
|
+
padding:0;
|
|
258
|
+
}
|
|
259
|
+
td {
|
|
260
|
+
border:1px solid #ddd;
|
|
261
|
+
font-size:0.9em;
|
|
262
|
+
width:auto;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
225
265
|
}
|
|
226
266
|
p.submit {margin:0; background:#fff; border:1px solid #dce2eb; padding:25px; }
|
|
227
|
-
p.submit .button {
|
|
267
|
+
p.submit .button {
|
|
268
|
+
margin-right:5px;
|
|
269
|
+
vertical-align: middle;
|
|
270
|
+
}
|
|
228
271
|
p.submit .right .button {margin-left:5px; margin-right:0;}
|
|
229
|
-
p.submit span.right {
|
|
272
|
+
p.submit span.right {float:right;}
|
|
230
273
|
p.submit.sided { padding-left:30%;}
|
|
231
274
|
.errorExplanation {
|
|
232
275
|
margin-bottom:25px;
|
|
@@ -239,7 +282,7 @@ header.main {
|
|
|
239
282
|
ul li { list-style:disc; margin-left:25px; font-size:1.2em;}
|
|
240
283
|
}
|
|
241
284
|
}
|
|
242
|
-
|
|
285
|
+
|
|
243
286
|
//
|
|
244
287
|
// attachment preview
|
|
245
288
|
//
|
|
@@ -260,7 +303,7 @@ header.main {
|
|
|
260
303
|
div.desc a { color:#000;}
|
|
261
304
|
div.desc.none { color:#999; font-style:italic;}
|
|
262
305
|
}
|
|
263
|
-
|
|
306
|
+
|
|
264
307
|
//
|
|
265
308
|
// order summary page
|
|
266
309
|
//
|
|
@@ -279,22 +322,22 @@ header.main {
|
|
|
279
322
|
p.ship { text-align:center; margin-top:22px;}
|
|
280
323
|
p.ship input[type=text] { }
|
|
281
324
|
}
|
|
282
|
-
|
|
325
|
+
|
|
283
326
|
dl {
|
|
284
327
|
dt { float:left; width:30%; text-align:right; color:#888;white-space:nowrap}
|
|
285
328
|
dd { font-weight:bold; margin-left:35%; margin-bottom:6px; white-space:nowrap}
|
|
286
329
|
dd a { color:inherit;}
|
|
287
330
|
dt.padding { padding-top:6px;}
|
|
288
331
|
}
|
|
289
|
-
|
|
332
|
+
|
|
290
333
|
dl.form {
|
|
291
334
|
margin-top:15px;
|
|
292
335
|
input.text { width:70%;}
|
|
293
336
|
a.button { margin-right:5px;}
|
|
294
337
|
}
|
|
295
|
-
|
|
338
|
+
|
|
296
339
|
}
|
|
297
|
-
|
|
340
|
+
|
|
298
341
|
.status-bar {
|
|
299
342
|
background:image-url('shoppe/square.svg') repeat-x 0 15px;
|
|
300
343
|
background-size:8px;
|
|
@@ -315,7 +358,7 @@ header.main {
|
|
|
315
358
|
li.rejected h4 { color: #E33127}
|
|
316
359
|
}
|
|
317
360
|
}
|
|
318
|
-
|
|
361
|
+
|
|
319
362
|
.order_items {
|
|
320
363
|
table.data {
|
|
321
364
|
.money { text-align:right; width:8%}
|
|
@@ -325,7 +368,7 @@ header.main {
|
|
|
325
368
|
}
|
|
326
369
|
}
|
|
327
370
|
}
|
|
328
|
-
|
|
371
|
+
|
|
329
372
|
//
|
|
330
373
|
// warning message
|
|
331
374
|
//
|
|
@@ -338,7 +381,7 @@ header.main {
|
|
|
338
381
|
margin-bottom:25px;
|
|
339
382
|
padding:15px;
|
|
340
383
|
}
|
|
341
|
-
|
|
384
|
+
|
|
342
385
|
//
|
|
343
386
|
// payments
|
|
344
387
|
//
|
|
@@ -370,7 +413,7 @@ header.main {
|
|
|
370
413
|
margin-bottom:15px;
|
|
371
414
|
}
|
|
372
415
|
}
|
|
373
|
-
|
|
416
|
+
|
|
374
417
|
//
|
|
375
418
|
// order search
|
|
376
419
|
//
|
|
@@ -378,7 +421,7 @@ header.main {
|
|
|
378
421
|
overflow:hidden;
|
|
379
422
|
display:none;
|
|
380
423
|
dl.left, dl.right {
|
|
381
|
-
float:left;
|
|
424
|
+
float:left;
|
|
382
425
|
width:50%;
|
|
383
426
|
dt { float:left; width:40%; text-align:right; padding-top:3px; color:#888;}
|
|
384
427
|
dd { margin-left:44%; margin-bottom:15px;}
|
|
@@ -396,7 +439,7 @@ header.main {
|
|
|
396
439
|
input[type=text].disabled { background:#f7f7f7; color:#888}
|
|
397
440
|
p.slaWarning {
|
|
398
441
|
background:#e5eaf4;
|
|
399
|
-
padding:15px;
|
|
442
|
+
padding:15px;
|
|
400
443
|
border:1px solid #abb4c6;
|
|
401
444
|
border-top:0;
|
|
402
445
|
text-align:center;
|
|
@@ -419,11 +462,11 @@ header.main {
|
|
|
419
462
|
tfoot {
|
|
420
463
|
td input { width:100%;padding:3px; background:transparent; border:0; font-size:1.0em; color:#fff;}
|
|
421
464
|
}
|
|
422
|
-
|
|
465
|
+
|
|
423
466
|
}
|
|
424
467
|
}
|
|
425
|
-
|
|
426
|
-
|
|
468
|
+
|
|
469
|
+
|
|
427
470
|
}
|
|
428
471
|
|
|
429
472
|
footer {
|
|
@@ -431,7 +474,7 @@ footer {
|
|
|
431
474
|
bottom:0;
|
|
432
475
|
width:200px;
|
|
433
476
|
background:rgba(0,0,0,0.05);
|
|
434
|
-
|
|
477
|
+
|
|
435
478
|
p.store {
|
|
436
479
|
a {
|
|
437
480
|
display:block;
|
|
@@ -506,7 +549,7 @@ table.data {
|
|
|
506
549
|
td:last-child { border-right-width:0;}
|
|
507
550
|
tr:last-child td { border-bottom-width:0;}
|
|
508
551
|
}
|
|
509
|
-
}
|
|
552
|
+
}
|
|
510
553
|
tbody tr.form {
|
|
511
554
|
td { background:#f2f6fb;}
|
|
512
555
|
input[type=text] { border:1px solid #CFD4DD; padding:5px;}
|
|
@@ -539,4 +582,4 @@ nav.pagination {
|
|
|
539
582
|
text-decoration:none;
|
|
540
583
|
}
|
|
541
584
|
}
|
|
542
|
-
}
|
|
585
|
+
}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
border-bottom-color:#86a350;
|
|
28
28
|
&:active { background-color:#A8D750}
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
&.loading {
|
|
32
32
|
background-image:url(/images/spinners/button-green.gif);
|
|
33
33
|
background-repeat:no-repeat;
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
&:active { background:#888}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
60
59
|
&.white {
|
|
61
60
|
background-color:#fff;
|
|
62
61
|
color:#333 !important;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
module Shoppe
|
|
2
2
|
class AttachmentsController < Shoppe::ApplicationController
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
def destroy
|
|
5
5
|
@attachment = Nifty::Attachments::Attachment.find(params[:id])
|
|
6
6
|
@attachment.destroy
|
|
7
7
|
respond_to do |wants|
|
|
8
|
-
wants.html { redirect_to request.referer, :notice =>
|
|
8
|
+
wants.html { redirect_to request.referer, :notice => t('shoppe.attachments.remove_notice')}
|
|
9
9
|
wants.json { render :status => 'complete' }
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
end
|
|
14
14
|
end
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
module Shoppe
|
|
2
2
|
class CountriesController < Shoppe::ApplicationController
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
before_filter { @active_nav = :countries }
|
|
5
5
|
before_filter { params[:id] && @country = Shoppe::Country.find(params[:id]) }
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
def index
|
|
8
8
|
@countries = Shoppe::Country.ordered
|
|
9
9
|
end
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
def new
|
|
12
12
|
@country = Shoppe::Country.new
|
|
13
13
|
end
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
def create
|
|
16
16
|
@country = Shoppe::Country.new(safe_params)
|
|
17
17
|
if @country.save
|
|
18
|
-
redirect_to :countries, :flash => {:notice =>
|
|
18
|
+
redirect_to :countries, :flash => {:notice => t('shoppe.countries.create_notice')}
|
|
19
19
|
else
|
|
20
20
|
render :action => "new"
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
def edit
|
|
25
25
|
end
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
def update
|
|
28
28
|
if @country.update(safe_params)
|
|
29
|
-
redirect_to [:edit, @country], :flash => {:notice =>
|
|
29
|
+
redirect_to [:edit, @country], :flash => {:notice => t('shoppe.countries.update_notice') }
|
|
30
30
|
else
|
|
31
31
|
render :action => "edit"
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
def destroy
|
|
36
36
|
@country.destroy
|
|
37
|
-
redirect_to :countries, :flash => {:notice =>
|
|
37
|
+
redirect_to :countries, :flash => {:notice => t('shoppe.countries.destroy_notice')}
|
|
38
38
|
end
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
private
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
def safe_params
|
|
43
43
|
params[:country].permit(:name, :code2, :code3, :continent, :tld, :currency, :eu_member)
|
|
44
44
|
end
|
|
45
|
-
|
|
45
|
+
|
|
46
46
|
end
|
|
47
47
|
end
|
|
@@ -4,42 +4,42 @@ module Shoppe
|
|
|
4
4
|
before_filter { @active_nav = :delivery_services }
|
|
5
5
|
before_filter { @delivery_service = Shoppe::DeliveryService.find(params[:delivery_service_id])}
|
|
6
6
|
before_filter { params[:id] && @delivery_service_price = @delivery_service.delivery_service_prices.find(params[:id])}
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
def index
|
|
9
9
|
@delivery_service_prices = @delivery_service.delivery_service_prices.ordered
|
|
10
10
|
end
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
def new
|
|
13
13
|
@delivery_service_price = @delivery_service.delivery_service_prices.build
|
|
14
14
|
end
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
def create
|
|
17
17
|
@delivery_service_price = @delivery_service.delivery_service_prices.build(safe_params)
|
|
18
18
|
if @delivery_service_price.save
|
|
19
|
-
redirect_to [@delivery_service, :delivery_service_prices], :notice =>
|
|
19
|
+
redirect_to [@delivery_service, :delivery_service_prices], :notice => t('shoppe.delivery_service_prices.create_notice')
|
|
20
20
|
else
|
|
21
21
|
render :action => "new"
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
def update
|
|
26
26
|
if @delivery_service_price.update(safe_params)
|
|
27
|
-
redirect_to [@delivery_service, :delivery_service_prices], :notice =>
|
|
27
|
+
redirect_to [@delivery_service, :delivery_service_prices], :notice => t('shoppe.delivery_service_prices.update_notice')
|
|
28
28
|
else
|
|
29
29
|
render :action => "edit"
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
def destroy
|
|
34
34
|
@delivery_service_price.destroy
|
|
35
|
-
redirect_to [@delivery_service, :delivery_service_prices], :notice =>
|
|
35
|
+
redirect_to [@delivery_service, :delivery_service_prices], :notice => t('shoppe.delivery_service_prices.destroy_notice')
|
|
36
36
|
end
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
private
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
def safe_params
|
|
41
41
|
params[:delivery_service_price].permit(:price, :cost_price, :tax_rate_id, :min_weight, :max_weight, :code, :country_ids => [])
|
|
42
42
|
end
|
|
43
|
-
|
|
43
|
+
|
|
44
44
|
end
|
|
45
45
|
end
|