kkt_shoppe 1.1.2 → 1.2.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 +0 -0
- data/README.md +1 -0
- data/Rakefile +0 -0
- data/app/assets/images/kkt_shoppe/icons/edit.svg +0 -0
- data/app/assets/images/kkt_shoppe/kkt_shoppe.svg +0 -0
- data/app/assets/images/kkt_shoppe/logo.svg +0 -0
- data/app/assets/images/kkt_shoppe/square.svg +0 -0
- data/app/assets/images/kkt_shoppe/statuses/accepted.svg +0 -0
- data/app/assets/images/kkt_shoppe/statuses/paid.svg +0 -0
- data/app/assets/images/kkt_shoppe/statuses/received.svg +0 -0
- data/app/assets/images/kkt_shoppe/statuses/rejected.svg +0 -0
- data/app/assets/images/kkt_shoppe/statuses/shipped.svg +0 -0
- data/app/assets/images/kkt_shoppe/table-tear-off.png +0 -0
- data/app/assets/javascripts/kkt_shoppe/application.coffee +0 -5
- data/app/assets/javascripts/kkt_shoppe/mousetrap.js +0 -0
- data/app/assets/javascripts/kkt_shoppe/order_form.coffee +0 -0
- data/app/assets/stylesheets/kkt_shoppe/application.scss +1 -12
- data/app/assets/stylesheets/kkt_shoppe/dialog.scss +0 -0
- data/app/assets/stylesheets/kkt_shoppe/elements.scss +0 -0
- data/app/assets/stylesheets/kkt_shoppe/printable.scss +1 -1
- data/app/assets/stylesheets/kkt_shoppe/reset.scss +0 -0
- data/app/assets/stylesheets/kkt_shoppe/sub.scss +1 -1
- data/app/assets/stylesheets/kkt_shoppe/variables.scss +0 -0
- data/app/controllers/kkt_shoppe/addresses_controller.rb +1 -1
- data/app/controllers/kkt_shoppe/application_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/attachments_controller.rb +1 -1
- data/app/controllers/kkt_shoppe/countries_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/customers_controller.rb +1 -1
- data/app/controllers/kkt_shoppe/dashboard_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/delivery_service_prices_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/delivery_services_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/orders_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/payments_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/product_categories_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/product_category_localisations_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/product_localisations_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/products_controller.rb +2 -3
- data/app/controllers/kkt_shoppe/sessions_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/settings_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/stock_level_adjustments_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/tax_rates_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/users_controller.rb +0 -0
- data/app/controllers/kkt_shoppe/variants_controller.rb +0 -0
- data/app/helpers/kkt_shoppe/application_helper.rb +4 -4
- data/app/helpers/kkt_shoppe/product_category_helper.rb +1 -1
- data/app/mailers/kkt_shoppe/order_mailer.rb +0 -0
- data/app/mailers/kkt_shoppe/user_mailer.rb +0 -0
- data/app/models/kkt_shoppe/address.rb +0 -0
- data/app/models/kkt_shoppe/country.rb +0 -0
- data/app/models/kkt_shoppe/customer.rb +1 -1
- data/app/models/kkt_shoppe/delivery_service.rb +0 -0
- data/app/models/kkt_shoppe/delivery_service_price.rb +0 -0
- data/app/models/kkt_shoppe/order/actions.rb +2 -2
- data/app/models/kkt_shoppe/order/billing.rb +0 -0
- data/app/models/kkt_shoppe/order/delivery.rb +1 -1
- data/app/models/kkt_shoppe/order/states.rb +0 -0
- data/app/models/kkt_shoppe/order.rb +0 -0
- data/app/models/kkt_shoppe/order_item.rb +0 -0
- data/app/models/kkt_shoppe/payment.rb +0 -0
- data/app/models/kkt_shoppe/product/product_attributes.rb +0 -0
- data/app/models/kkt_shoppe/product/variants.rb +0 -0
- data/app/models/kkt_shoppe/product.rb +3 -23
- data/app/models/kkt_shoppe/product_attribute.rb +0 -0
- data/app/models/kkt_shoppe/product_categorization.rb +0 -0
- data/app/models/kkt_shoppe/product_category.rb +2 -9
- data/app/models/kkt_shoppe/setting.rb +0 -0
- data/app/models/kkt_shoppe/stock_level_adjustment.rb +0 -0
- data/app/models/kkt_shoppe/tax_rate.rb +0 -0
- data/app/models/kkt_shoppe/user.rb +0 -0
- data/app/validators/permalink_validator.rb +0 -0
- data/app/views/kkt_shoppe/addresses/_form.html.haml +0 -0
- data/app/views/kkt_shoppe/addresses/edit.html.haml +0 -0
- data/app/views/kkt_shoppe/addresses/new.html.haml +0 -0
- data/app/views/kkt_shoppe/countries/_form.html.haml +0 -0
- data/app/views/kkt_shoppe/countries/edit.html.haml +0 -0
- data/app/views/kkt_shoppe/countries/index.html.haml +0 -0
- data/app/views/kkt_shoppe/countries/new.html.haml +0 -0
- data/app/views/kkt_shoppe/customers/_addresses.html.haml +0 -0
- data/app/views/kkt_shoppe/customers/_form.html.haml +0 -0
- data/app/views/kkt_shoppe/customers/_search_form.html.haml +0 -0
- data/app/views/kkt_shoppe/customers/edit.html.haml +0 -0
- data/app/views/kkt_shoppe/customers/index.html.haml +0 -0
- data/app/views/kkt_shoppe/customers/new.html.haml +0 -0
- data/app/views/kkt_shoppe/customers/show.html.haml +1 -1
- data/app/views/kkt_shoppe/delivery_service_prices/_form.html.haml +0 -0
- data/app/views/kkt_shoppe/delivery_service_prices/edit.html.haml +0 -0
- data/app/views/kkt_shoppe/delivery_service_prices/index.html.haml +0 -0
- data/app/views/kkt_shoppe/delivery_service_prices/new.html.haml +0 -0
- data/app/views/kkt_shoppe/delivery_services/_form.html.haml +0 -0
- data/app/views/kkt_shoppe/delivery_services/edit.html.haml +0 -0
- data/app/views/kkt_shoppe/delivery_services/index.html.haml +0 -0
- data/app/views/kkt_shoppe/delivery_services/new.html.haml +0 -0
- data/app/views/kkt_shoppe/order_mailer/accepted.text.erb +0 -0
- data/app/views/kkt_shoppe/order_mailer/received.text.erb +5 -2
- data/app/views/kkt_shoppe/order_mailer/rejected.text.erb +0 -0
- data/app/views/kkt_shoppe/order_mailer/shipped.text.erb +0 -0
- data/app/views/kkt_shoppe/orders/_form.html.haml +0 -0
- data/app/views/kkt_shoppe/orders/_order_details.html.haml +0 -0
- data/app/views/kkt_shoppe/orders/_order_items.html.haml +0 -0
- data/app/views/kkt_shoppe/orders/_order_items_form.html.haml +0 -0
- data/app/views/kkt_shoppe/orders/_payments_form.html.haml +0 -0
- data/app/views/kkt_shoppe/orders/_payments_table.html.haml +0 -0
- data/app/views/kkt_shoppe/orders/_search_form.html.haml +0 -0
- data/app/views/kkt_shoppe/orders/_status_bar.html.haml +0 -0
- data/app/views/kkt_shoppe/orders/despatch_note.html.haml +0 -0
- data/app/views/kkt_shoppe/orders/edit.html.haml +0 -0
- data/app/views/kkt_shoppe/orders/index.html.haml +0 -0
- data/app/views/kkt_shoppe/orders/new.html.haml +0 -0
- data/app/views/kkt_shoppe/orders/show.html.haml +0 -0
- data/app/views/kkt_shoppe/payments/refund.html.haml +0 -0
- data/app/views/kkt_shoppe/product_categories/_form.html.haml +1 -1
- data/app/views/kkt_shoppe/product_categories/edit.html.haml +0 -0
- data/app/views/kkt_shoppe/product_categories/index.html.haml +0 -0
- data/app/views/kkt_shoppe/product_categories/new.html.haml +0 -0
- data/app/views/kkt_shoppe/product_category_localisations/form.html.haml +0 -0
- data/app/views/kkt_shoppe/product_category_localisations/index.html.haml +0 -0
- data/app/views/kkt_shoppe/product_localisations/form.html.haml +1 -1
- data/app/views/kkt_shoppe/product_localisations/index.html.haml +0 -0
- data/app/views/kkt_shoppe/products/_form.html.haml +4 -24
- data/app/views/kkt_shoppe/products/_table.html.haml +0 -0
- data/app/views/kkt_shoppe/products/edit.html.haml +0 -0
- data/app/views/kkt_shoppe/products/import.html.haml +0 -0
- data/app/views/kkt_shoppe/products/index.html.haml +0 -0
- data/app/views/kkt_shoppe/products/new.html.haml +0 -0
- data/app/views/kkt_shoppe/sessions/new.html.haml +0 -0
- data/app/views/kkt_shoppe/sessions/reset.html.haml +0 -0
- data/app/views/kkt_shoppe/settings/edit.html.haml +0 -0
- data/app/views/kkt_shoppe/shared/error.html.haml +0 -0
- data/app/views/kkt_shoppe/stock_level_adjustments/index.html.haml +0 -0
- data/app/views/kkt_shoppe/tax_rates/form.html.haml +0 -0
- data/app/views/kkt_shoppe/tax_rates/index.html.haml +0 -0
- data/app/views/kkt_shoppe/user_mailer/new_password.text.erb +0 -0
- data/app/views/kkt_shoppe/users/_form.html.haml +0 -0
- data/app/views/kkt_shoppe/users/edit.html.haml +0 -0
- data/app/views/kkt_shoppe/users/index.html.haml +0 -0
- data/app/views/kkt_shoppe/users/new.html.haml +0 -0
- data/app/views/kkt_shoppe/variants/form.html.haml +0 -0
- data/app/views/kkt_shoppe/variants/index.html.haml +0 -0
- data/app/views/layouts/kkt_shoppe/application.html.haml +0 -0
- data/app/views/layouts/kkt_shoppe/printable.html.haml +1 -1
- data/app/views/layouts/kkt_shoppe/sub.html.haml +0 -0
- data/config/locales/de.yml +0 -3
- data/config/locales/en.yml +0 -1
- data/config/locales/es.yml +0 -1
- data/config/locales/pl.yml +0 -1
- data/config/locales/pt-BR.yml +1 -2
- data/config/routes.rb +0 -0
- data/db/countries.txt +0 -0
- data/db/migrate/20130926094549_create_kkt_shoppe_initial_schema.rb +0 -0
- data/db/migrate/20131024201501_add_address_type_to_kkt_shoppe_tax_rates.rb +1 -1
- data/db/migrate/20131024204815_create_kkt_shoppe_payments.rb +1 -1
- data/db/migrate/20131102143930_remove_default_on_order_item_weight.rb +1 -1
- data/db/migrate/20141013192427_create_kkt_shoppe_customers.rb +0 -0
- data/db/migrate/20141026175622_add_indexes_to_kkt_shoppe_order_items.rb +0 -0
- data/db/migrate/20141026175943_add_indexes_to_kkt_shoppe_orders.rb +0 -0
- data/db/migrate/20141026180333_add_indexes_to_kkt_shoppe_payments.rb +0 -0
- data/db/migrate/20141026180835_add_indexes_to_kkt_shoppe_product_attributes.rb +0 -0
- data/db/migrate/20141026180952_add_indexes_to_kkt_shoppe_product_categories.rb +0 -0
- data/db/migrate/20141026181040_add_indexes_to_kkt_shoppe_products.rb +0 -0
- data/db/migrate/20141026181312_add_indexes_to_kkt_shoppe_settings.rb +0 -0
- data/db/migrate/20141026181354_add_indexes_to_kkt_shoppe_stock_level_adjustments.rb +0 -0
- data/db/migrate/20141026181559_add_indexes_to_kkt_shoppe_users.rb +0 -0
- data/db/migrate/20141026181716_add_indexes_to_kkt_shoppe_delivery_services.rb +0 -0
- data/db/migrate/20141026181717_allow_multiple_kkt_shoppe_products_per_kkt_shoppe_product_category.rb +0 -0
- data/db/migrate/20141026181718_add_nested_to_product_categories.rb +0 -0
- data/db/migrate/20141027215005_create_kkt_shoppe_addresses.rb +0 -0
- data/db/migrate/20150315215633_add_customer_to_kkt_shoppe_orders.rb +1 -1
- data/db/migrate/20150513171350_create_kkt_shoppe_product_category_translation_table.rb +0 -0
- data/db/migrate/20150519173350_create_kkt_shoppe_product_translation_table.rb +0 -0
- data/db/schema.rb +42 -56
- data/db/seeds.rb +0 -0
- data/db/seeds_data/poe400.jpg +0 -0
- data/db/seeds_data/snom-870-blk.jpg +0 -0
- data/db/seeds_data/snom-870-grey.jpg +0 -0
- data/db/seeds_data/snom-mm2.jpg +0 -0
- data/db/seeds_data/spa303.jpg +0 -0
- data/db/seeds_data/t18p.jpg +0 -0
- data/db/seeds_data/t20p.jpg +0 -0
- data/db/seeds_data/t22p.jpg +0 -0
- data/db/seeds_data/t26p.jpg +0 -0
- data/db/seeds_data/t41pn.jpg +0 -0
- data/db/seeds_data/t46gn.jpg +0 -0
- data/db/seeds_data/w52p.jpg +0 -0
- data/db/seeds_data/yhs32.jpg +0 -0
- data/lib/kkt_shoppe/associated_countries.rb +1 -1
- data/lib/kkt_shoppe/country_importer.rb +0 -0
- data/lib/kkt_shoppe/default_navigation.rb +0 -0
- data/lib/kkt_shoppe/engine.rb +11 -15
- data/lib/kkt_shoppe/error.rb +0 -0
- data/lib/kkt_shoppe/errors/inappropriate_delivery_service.rb +1 -1
- data/lib/kkt_shoppe/errors/insufficient_stock_to_fulfil.rb +1 -1
- data/lib/kkt_shoppe/errors/invalid_configuration.rb +1 -1
- data/lib/kkt_shoppe/errors/not_enough_stock.rb +1 -1
- data/lib/kkt_shoppe/errors/payment_declined.rb +1 -1
- data/lib/kkt_shoppe/errors/refund_failed.rb +1 -1
- data/lib/kkt_shoppe/errors/unorderable_item.rb +1 -1
- data/lib/kkt_shoppe/navigation_manager.rb +0 -0
- data/lib/kkt_shoppe/orderable_item.rb +0 -0
- data/lib/kkt_shoppe/settings.rb +0 -0
- data/lib/kkt_shoppe/settings_loader.rb +0 -0
- data/lib/kkt_shoppe/setup_generator.rb +0 -0
- data/lib/kkt_shoppe/version.rb +1 -1
- data/lib/kkt_shoppe/view_helpers.rb +0 -0
- data/lib/kkt_shoppe.rb +1 -1
- data/lib/tasks/{kylekthompson_shoppe.rake → kkt_shoppe.rake} +1 -1
- metadata +4 -9
- data/app/models/shoppe/attachment.rb +0 -48
- data/app/uploaders/shoppe/attachment_uploader.rb +0 -29
- data/db/migrate/20150315223628_create_kkt_shoppe_attachments.rb +0 -16
- data/lib/kkt_shoppe/model_extension.rb +0 -44
- data/lib/shoppe/model_extension.rb +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 719a80796260e15ea218d4a78869c737d6eceed4
|
4
|
+
data.tar.gz: 2189a7d3cdb909664b826bd1d0e6b1e11ce0b456
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47b89d3a16cf2a107ab4759b913e587d29d707d3ce27da1d131cf6cae0d7b2eca6bea5544903fa73f11e19dfeb648a93a60371b0931378cb1b959afa093859c5
|
7
|
+
data.tar.gz: 1b77c3b4d1e15fee2b434d101f9f7d6bfbd13fbe68ada0293c3d3c02f499fc2b5ae41704fc9509bc36aef3f75bd2b51286ca8b22ccea10c203fc77905a8ea949
|
data/MIT-LICENSE
CHANGED
File without changes
|
data/README.md
CHANGED
@@ -39,6 +39,7 @@ instructions below and you'll be up and running in minutes.
|
|
39
39
|
echo "gem 'kkt_shoppe', '~> 1.0'" >> Gemfile
|
40
40
|
bundle
|
41
41
|
rails generate kkt_shoppe:setup
|
42
|
+
rails generate nifty:attachments:migration
|
42
43
|
rails generate nifty:key_value_store:migration
|
43
44
|
rake db:migrate kkt_shoppe:setup
|
44
45
|
rails server
|
data/Rakefile
CHANGED
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
|
File without changes
|
@@ -42,11 +42,6 @@ $ ->
|
|
42
42
|
helper.children().each (index)->
|
43
43
|
$(this).width(originals.eq(index).width())
|
44
44
|
helper
|
45
|
-
|
46
|
-
$('a[data-behavior=addAttachmentToExtraAttachments]').on 'click', (event) ->
|
47
|
-
event.preventDefault();
|
48
|
-
$('div.extraAttachments').show();
|
49
|
-
$(this).hide();
|
50
45
|
|
51
46
|
# Chosen
|
52
47
|
$('select.chosen').chosen()
|
File without changes
|
File without changes
|
@@ -183,7 +183,7 @@ header.main {
|
|
183
183
|
width:49%;
|
184
184
|
margin:0;
|
185
185
|
float:left;
|
186
|
-
&:
|
186
|
+
&:last-child { float:right;}
|
187
187
|
}
|
188
188
|
|
189
189
|
&.third {
|
@@ -299,17 +299,6 @@ header.main {
|
|
299
299
|
}
|
300
300
|
}
|
301
301
|
|
302
|
-
div.extraAttachments{
|
303
|
-
display: none;
|
304
|
-
|
305
|
-
dl.half { margin-top: 15px; }
|
306
|
-
}
|
307
|
-
|
308
|
-
p.addAttachments {
|
309
|
-
float: right;
|
310
|
-
margin: 15px 25px 0 0;
|
311
|
-
}
|
312
|
-
|
313
302
|
//
|
314
303
|
// attachment preview
|
315
304
|
//
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -2,7 +2,7 @@ module KktShoppe
|
|
2
2
|
class AttachmentsController < KktShoppe::ApplicationController
|
3
3
|
|
4
4
|
def destroy
|
5
|
-
@attachment =
|
5
|
+
@attachment = Nifty::Attachments::Attachment.find(params[:id])
|
6
6
|
@attachment.destroy
|
7
7
|
respond_to do |wants|
|
8
8
|
wants.html { redirect_to request.referer, :notice => t('kkt_shoppe.attachments.remove_notice')}
|
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
|
@@ -5,7 +5,7 @@ module KktShoppe
|
|
5
5
|
before_filter { params[:id] && @product = KktShoppe::Product.root.find(params[:id]) }
|
6
6
|
|
7
7
|
def index
|
8
|
-
@products = KktShoppe::Product.root.includes(:translations, :stock_level_adjustments, :product_categories, :variants).order(:name).group_by(&:product_category).sort_by { |cat,pro| cat.name }
|
8
|
+
@products = KktShoppe::Product.root.includes(:translations, :stock_level_adjustments, :default_image, :product_categories, :variants).order(:name).group_by(&:product_category).sort_by { |cat,pro| cat.name }
|
9
9
|
end
|
10
10
|
|
11
11
|
def new
|
@@ -51,8 +51,7 @@ module KktShoppe
|
|
51
51
|
private
|
52
52
|
|
53
53
|
def safe_params
|
54
|
-
|
55
|
-
params[:product].permit(:name, :sku, :permalink, :description, :short_description, :weight, :price, :cost_price, :tax_rate_id, :stock_control, :active, :featured, :in_the_box, :attachments => [:default_image => file_params, :data_sheet => file_params, :extra => file_params], :product_attributes_array => [:key, :value, :searchable, :public], :product_category_ids => [])
|
54
|
+
params[:product].permit(:name, :sku, :permalink, :description, :short_description, :weight, :price, :cost_price, :tax_rate_id, :stock_control, :default_image_file, :data_sheet_file, :active, :featured, :in_the_box, :product_attributes_array => [:key, :value, :searchable, :public], :product_category_ids => [])
|
56
55
|
end
|
57
56
|
|
58
57
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -10,19 +10,19 @@ module KktShoppe
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def attachment_preview(attachment, options = {})
|
13
|
-
if attachment
|
13
|
+
if attachment
|
14
14
|
String.new.tap do |s|
|
15
15
|
if attachment.image?
|
16
|
-
style = "style='background-image:url(#{attachment.
|
16
|
+
style = "style='background-image:url(#{attachment.path})'"
|
17
17
|
else
|
18
18
|
style = ''
|
19
19
|
end
|
20
20
|
s << "<div class='attachmentPreview #{attachment.image? ? 'image' : 'doc'}'>"
|
21
21
|
s << "<div class='imgContainer'><div class='img' #{style}></div></div>"
|
22
22
|
s << "<div class='desc'>"
|
23
|
-
s << "<span class='filename'><a href='#{attachment
|
23
|
+
s << "<span class='filename'><a href='#{attachment_path(attachment)}'>#{attachment.file_name}</a></span>"
|
24
24
|
s << "<span class='delete'>"
|
25
|
-
s << link_to(t('helpers.attachment_preview.delete', :default => 'Delete this file?'), attachment_path(attachment
|
25
|
+
s << link_to(t('helpers.attachment_preview.delete', :default => 'Delete this file?'), attachment_path(attachment), :method => :delete, :data => {:confirm => t('helpers.attachment_preview.delete_confirm', :default => "Are you sure you wish to remove this attachment?")})
|
26
26
|
s << "</span>"
|
27
27
|
s << "</div>"
|
28
28
|
s << "</div>"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -60,7 +60,7 @@ module KktShoppe
|
|
60
60
|
self.status = 'accepted'
|
61
61
|
self.save!
|
62
62
|
self.order_items.each(&:accept!)
|
63
|
-
|
63
|
+
deliver_accepted_order_email
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
@@ -74,7 +74,7 @@ module KktShoppe
|
|
74
74
|
self.status = 'rejected'
|
75
75
|
self.save!
|
76
76
|
self.order_items.each(&:reject!)
|
77
|
-
|
77
|
+
deliver_rejected_order_email
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -10,8 +10,9 @@ module KktShoppe
|
|
10
10
|
require_dependency 'kkt_shoppe/product/product_attributes'
|
11
11
|
require_dependency 'kkt_shoppe/product/variants'
|
12
12
|
|
13
|
-
#
|
14
|
-
|
13
|
+
# Products have a default_image and a data_sheet
|
14
|
+
attachment :default_image
|
15
|
+
attachment :data_sheet
|
15
16
|
|
16
17
|
# The product's categorizations
|
17
18
|
#
|
@@ -62,13 +63,6 @@ module KktShoppe
|
|
62
63
|
translates :name, :permalink, :description, :short_description
|
63
64
|
scope :ordered, -> { includes(:translations).order(:name) }
|
64
65
|
|
65
|
-
def attachments=(attrs)
|
66
|
-
if attrs["default_image"]["file"].present? then self.attachments.build(attrs["default_image"]) end
|
67
|
-
if attrs["data_sheet"]["file"].present? then self.attachments.build(attrs["data_sheet"]) end
|
68
|
-
|
69
|
-
if attrs["extra"]["file"].present? then attrs["extra"]["file"].each { |attr| self.attachments.build(file: attr, parent_id: attrs["extra"]["parent_id"], parent_type: attrs["extra"]["parent_type"]) } end
|
70
|
-
end
|
71
|
-
|
72
66
|
# Return the name of the product
|
73
67
|
#
|
74
68
|
# @return [String]
|
@@ -114,20 +108,6 @@ module KktShoppe
|
|
114
108
|
self.product_categories.first rescue nil
|
115
109
|
end
|
116
110
|
|
117
|
-
# Return attachment for the default_image role
|
118
|
-
#
|
119
|
-
# @return [String]
|
120
|
-
def default_image
|
121
|
-
self.attachments.for("default_image")
|
122
|
-
end
|
123
|
-
|
124
|
-
# Return attachment for the data_sheet role
|
125
|
-
#
|
126
|
-
# @return [String]
|
127
|
-
def data_sheet
|
128
|
-
self.attachments.for("data_sheet")
|
129
|
-
end
|
130
|
-
|
131
111
|
# Search for products which include the given attributes and return an active record
|
132
112
|
# scope of these products. Chainable with other scopes and with_attributes methods.
|
133
113
|
# For example:
|
File without changes
|
File without changes
|
@@ -12,8 +12,8 @@ module KktShoppe
|
|
12
12
|
|
13
13
|
self.table_name = 'kkt_shoppe_product_categories'
|
14
14
|
|
15
|
-
#
|
16
|
-
|
15
|
+
# Categories have an image attachment
|
16
|
+
attachment :image
|
17
17
|
|
18
18
|
# All products within this category
|
19
19
|
has_many :product_categorizations, dependent: :restrict_with_exception, class_name: 'KktShoppe::ProductCategorization', inverse_of: :product_category
|
@@ -51,13 +51,6 @@ module KktShoppe
|
|
51
51
|
parent.hierarchy_array.concat [self]
|
52
52
|
end
|
53
53
|
|
54
|
-
# Attachment with the role image
|
55
|
-
#
|
56
|
-
# @return [String]
|
57
|
-
def image
|
58
|
-
self.attachments.for("image")
|
59
|
-
end
|
60
|
-
|
61
54
|
private
|
62
55
|
|
63
56
|
def set_permalink
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -50,4 +50,4 @@
|
|
50
50
|
- for item in order.order_items
|
51
51
|
%li #{item.quantity} x #{item.ordered_item.full_name}
|
52
52
|
%td= number_to_currency order.total
|
53
|
-
%td= boolean_tag order.paid_in_full?, nil, :true_text => number_to_currency(order.amount_paid), :false_text => number_to_currency(order.amount_paid)
|
53
|
+
%td= boolean_tag order.paid_in_full?, nil, :true_text => number_to_currency(order.amount_paid), :false_text => number_to_currency(order.amount_paid)
|
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
|
@@ -2,8 +2,11 @@ Hello <%=@order.first_name%>!
|
|
2
2
|
|
3
3
|
Re: Order #<%=@order.number%>
|
4
4
|
|
5
|
-
We're
|
5
|
+
We're pleased to let you know that we have received your order and one of our team will be accepting it shortly.
|
6
|
+
|
7
|
+
We will e-mail you again when your order has been accepted.
|
8
|
+
|
9
|
+
Many thanks,
|
6
10
|
|
7
|
-
Thanks,
|
8
11
|
<%=KktShoppe.settings.store_name%>
|
9
12
|
<%=KktShoppe.settings.email_address%>
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -47,4 +47,4 @@
|
|
47
47
|
%p.submit
|
48
48
|
- unless @product_category.new_record?
|
49
49
|
%span.right= link_to t('kkt_shoppe.delete') , @product_category, :class => 'button purple', :method => :delete, :data => {:confirm => t('kkt_shoppe.product_category.delete_confirmation') }
|
50
|
-
= f.submit t('kkt_shoppe.submit'), :class => 'button green'
|
50
|
+
= f.submit t('kkt_shoppe.submit'), :class => 'button green'
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -29,4 +29,4 @@
|
|
29
29
|
%p.submit
|
30
30
|
- unless @localisation.new_record?
|
31
31
|
%span.right= link_to t('kkt_shoppe.delete'), product_localisation_path(@product, @localisation), :class => 'button purple', :method => :delete, :data => {:confirm => t('kkt_shoppe.localisations.delete_confirmation')}
|
32
|
-
= f.submit t('kkt_shoppe.localisations.save_localisation'), :class => 'button green'
|
32
|
+
= f.submit t('kkt_shoppe.localisations.save_localisation'), :class => 'button green'
|
File without changes
|
@@ -57,35 +57,15 @@
|
|
57
57
|
= field_set_tag t('kkt_shoppe.products.attachments') do
|
58
58
|
.splitContainer
|
59
59
|
%dl.half
|
60
|
-
%dt= f.label
|
60
|
+
%dt= f.label :default_image_file, t('kkt_shoppe.products.default_image')
|
61
61
|
%dd
|
62
62
|
= attachment_preview @product.default_image
|
63
|
-
%p= f.file_field
|
64
|
-
= f.hidden_field "attachments[default_image][role]", value: "default_image"
|
65
|
-
= f.hidden_field "attachments[default_image][parent_id]", value: @product.id
|
63
|
+
%p= f.file_field :default_image_file
|
66
64
|
%dl.half
|
67
|
-
%dt= f.label
|
65
|
+
%dt= f.label :data_sheet_file, t('kkt_shoppe.products.datasheet')
|
68
66
|
%dd
|
69
67
|
= attachment_preview @product.data_sheet
|
70
|
-
%p= f.file_field
|
71
|
-
= f.hidden_field "attachments[data_sheet][role]", value: "data_sheet"
|
72
|
-
= f.hidden_field "attachments[data_sheet][parent_id]", value: @product.id
|
73
|
-
|
74
|
-
.splitContainer.extraAttachments
|
75
|
-
%dl.half
|
76
|
-
%dd
|
77
|
-
= attachment_preview nil, hide_if_blank: false
|
78
|
-
%p= f.file_field "attachments[extra][file]", :multiple => true
|
79
|
-
= f.hidden_field "attachments[extra][parent_type]", value: "KktShoppe::Product"
|
80
|
-
= f.hidden_field "attachments[extra][parent_id]", value: @product.id
|
81
|
-
|
82
|
-
- @product.attachments.each do |attachment|
|
83
|
-
- unless ["default_image", "data_sheet"].include?(attachment.role)
|
84
|
-
%dl.half
|
85
|
-
%dd
|
86
|
-
= attachment_preview attachment
|
87
|
-
|
88
|
-
%p.addAttachments= link_to t('kkt_shoppe.products.add_attachments') , '#', :data => {:behavior => 'addAttachmentToExtraAttachments'}, :class => 'button button-mini green'
|
68
|
+
%p= f.file_field :data_sheet_file
|
89
69
|
|
90
70
|
- unless @product.has_variants?
|
91
71
|
= field_set_tag t('kkt_shoppe.products.pricing') do
|
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
|