opensteam 0.9.2 → 0.9.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.
- data/CHANGELOG +53 -0
- data/README.rdoc +19 -10
- data/generators/opensteam/opensteam_generator.rb +27 -3
- data/generators/opensteam/templates/app/controllers/admin/configurations_controller.rb +85 -0
- data/generators/opensteam/templates/app/controllers/admin/inventories_controller.rb +1 -1
- data/generators/opensteam/templates/app/controllers/admin/invoices_controller.rb +35 -4
- data/generators/opensteam/templates/app/controllers/admin/orders_controller.rb +5 -4
- data/generators/opensteam/templates/app/controllers/admin/shipments_controller.rb +6 -3
- data/generators/opensteam/templates/app/controllers/admin/shipping_rate_groups_controller.rb +76 -0
- data/generators/opensteam/templates/app/controllers/admin/tax_groups_controller.rb +124 -0
- data/generators/opensteam/templates/app/controllers/admin/tax_rules_controller.rb +19 -0
- data/generators/opensteam/templates/app/controllers/admin/tax_zones_controller.rb +118 -0
- data/generators/opensteam/templates/app/controllers/admin/users_controller.rb +1 -1
- data/generators/opensteam/templates/app/controllers/admin_controller.rb +20 -0
- data/generators/opensteam/templates/app/controllers/carts_controller.rb +118 -0
- data/generators/opensteam/templates/app/controllers/checkout_controller.rb +119 -79
- data/generators/opensteam/templates/app/controllers/profile_controller.rb +2 -4
- data/generators/opensteam/templates/app/controllers/searches_controller.rb +1 -1
- data/generators/opensteam/templates/app/controllers/user_sessions_controller.rb +2 -1
- data/generators/opensteam/templates/app/controllers/users_controller.rb +10 -3
- data/generators/opensteam/templates/app/helpers/admin_helper.rb +15 -1
- data/generators/opensteam/templates/app/helpers/checkout_helper.rb +38 -0
- data/generators/opensteam/templates/app/helpers/webshop_helper.rb +6 -1
- data/generators/opensteam/templates/app/models/zone.rb +18 -0
- data/generators/opensteam/templates/app/views/admin/_menu.html.erb +18 -0
- data/generators/opensteam/templates/app/views/admin/catalog.html.erb +2 -3
- data/generators/opensteam/templates/app/views/admin/configurations/edit.html.erb +20 -0
- data/generators/opensteam/templates/app/views/admin/configurations/index.html.erb +22 -0
- data/generators/opensteam/templates/app/views/admin/configurations/new.html.erb +19 -0
- data/generators/opensteam/templates/app/views/admin/configurations/show.html.erb +13 -0
- data/generators/opensteam/templates/app/views/admin/filters/_filter.html.erb +1 -1
- data/generators/opensteam/templates/app/views/admin/index.html.erb +0 -19
- data/generators/opensteam/templates/app/views/admin/inventories/edit.html.erb +10 -6
- data/generators/opensteam/templates/app/views/admin/inventories/new.html.erb +5 -0
- data/generators/opensteam/templates/app/views/admin/inventories/show.html.erb +10 -6
- data/generators/opensteam/templates/app/views/admin/invoices/_invoice.html.erb +1 -0
- data/generators/opensteam/templates/app/views/admin/invoices/_invoice_fields.html.erb +52 -0
- data/generators/opensteam/templates/app/views/admin/invoices/new.html.erb +9 -37
- data/generators/opensteam/templates/app/views/admin/invoices/show.html.erb +10 -36
- data/generators/opensteam/templates/app/views/admin/invoices/show.pdf.prawn +59 -0
- data/generators/opensteam/templates/app/views/admin/order_config.html.erb +5 -0
- data/generators/opensteam/templates/app/views/admin/order_items/_item_entry.html.erb +9 -0
- data/generators/opensteam/templates/app/views/admin/order_items/_items_table.html.erb +16 -0
- data/generators/opensteam/templates/app/views/admin/orders/_order.html.erb +9 -9
- data/generators/opensteam/templates/app/views/admin/orders/_orders.html.erb +1 -1
- data/generators/opensteam/templates/app/views/admin/orders/show.html.erb +25 -9
- data/generators/opensteam/templates/app/views/admin/payment_types.html.erb +27 -0
- data/generators/opensteam/templates/app/views/admin/payments/_credit_card_payment.html.erb +26 -0
- data/generators/opensteam/templates/app/views/admin/payments/_credit_card_payment_info.html.erb +15 -0
- data/generators/opensteam/templates/app/views/admin/payments/_direct_debit_payment.html.erb +5 -0
- data/generators/opensteam/templates/app/views/admin/shipments/new.html.erb +45 -30
- data/generators/opensteam/templates/app/views/admin/shipments/show.html.erb +3 -3
- data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/_payment_addition.html.erb +12 -0
- data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/_rate.html.erb +16 -0
- data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/edit.html.erb +63 -0
- data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/index.html.erb +28 -0
- data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/new.html.erb +60 -0
- data/generators/opensteam/templates/app/views/admin/shipping_rate_groups/show.html.erb +13 -0
- data/generators/opensteam/templates/app/views/admin/system.html.erb +5 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/_attributes.html.erb +11 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/_tax_groups.html.erb +17 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/_tax_groups_row.html.erb +12 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/_tax_rule.html.erb +14 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/edit.html.erb +26 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/index.html.erb +8 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/new.html.erb +27 -0
- data/generators/opensteam/templates/app/views/admin/tax_groups/show.html.erb +28 -0
- data/generators/opensteam/templates/app/views/admin/tax_zones/_attributes.html.erb +18 -0
- data/generators/opensteam/templates/app/views/admin/tax_zones/_tax_zone_row.html.erb +13 -0
- data/generators/opensteam/templates/app/views/admin/tax_zones/_tax_zones.html.erb +11 -0
- data/generators/opensteam/templates/app/views/admin/tax_zones/edit.html.erb +16 -0
- data/generators/opensteam/templates/app/views/admin/tax_zones/index.html.erb +16 -0
- data/generators/opensteam/templates/app/views/admin/tax_zones/new.html.erb +14 -0
- data/generators/opensteam/templates/app/views/admin/tax_zones/show.html.erb +15 -0
- data/generators/opensteam/templates/app/views/admin/users.html.erb +0 -1
- data/generators/opensteam/templates/app/views/admin/users/show.html.erb +10 -0
- data/generators/opensteam/templates/app/views/administration_mailer/order_customer.erb +1 -1
- data/generators/opensteam/templates/app/views/carts/_cart.html.erb +7 -0
- data/generators/opensteam/templates/app/views/carts/_cart_content.html.erb +45 -0
- data/generators/opensteam/templates/app/views/carts/create.rjs +3 -0
- data/generators/opensteam/templates/app/views/{cart → carts}/index.html.erb +0 -0
- data/generators/opensteam/templates/app/views/carts/update.rjs +11 -0
- data/generators/opensteam/templates/app/views/checkout/_address.html.erb +42 -0
- data/generators/opensteam/templates/app/views/checkout/_customer.html.erb +31 -0
- data/generators/opensteam/templates/app/views/checkout/_edit_checkout.html.erb +42 -0
- data/generators/opensteam/templates/app/views/checkout/_new_checkout.html.erb +44 -0
- data/generators/opensteam/templates/app/views/checkout/_shipping_buttons.html.erb +8 -0
- data/generators/opensteam/templates/app/views/checkout/edit.html.erb +7 -0
- data/generators/opensteam/templates/app/views/checkout/new.html.erb +11 -0
- data/generators/opensteam/templates/app/views/checkout/outro.html.erb +1 -4
- data/generators/opensteam/templates/app/views/checkout/show.html.erb +63 -0
- data/generators/opensteam/templates/app/views/common/_header_admin.html.erb +5 -0
- data/generators/opensteam/templates/app/views/layouts/admin.html.erb +28 -12
- data/generators/opensteam/templates/app/views/layouts/profile.html.erb +2 -2
- data/generators/opensteam/templates/app/views/layouts/webshop.html.erb +5 -4
- data/generators/opensteam/templates/app/views/payment/_advance_payment_payment.html.erb +1 -0
- data/generators/opensteam/templates/app/views/payment/_credit_card_payment.html.erb +37 -0
- data/generators/opensteam/templates/app/views/payment/_credit_card_payment_confirmation.html.erb +20 -0
- data/generators/opensteam/templates/app/views/payment/_direct_debit_payment.html.erb +5 -0
- data/generators/opensteam/templates/app/views/payment/_direct_debit_payment_confirmation.html.erb +5 -0
- data/generators/opensteam/templates/app/views/profile/index.html.erb +1 -1
- data/generators/opensteam/templates/app/views/profile/infos/edit.html.erb +20 -12
- data/generators/opensteam/templates/app/views/profile/infos/edit_password.html.erb +16 -12
- data/generators/opensteam/templates/app/views/profile/orders/_order.html.erb +1 -1
- data/generators/opensteam/templates/app/views/profile/orders/show.html.erb +10 -7
- data/generators/opensteam/templates/app/views/webshop/_inventory_content.html.erb +1 -0
- data/generators/opensteam/templates/app/views/webshop/show.html.erb +3 -1
- data/generators/opensteam/templates/config/initializers/init_states.rb +13 -24
- data/generators/opensteam/templates/config/initializers/opensteam.rb +41 -0
- data/generators/opensteam/templates/config/initializers/opensteam_model_tables.rb +49 -10
- data/generators/opensteam/templates/config/initializers/opensteam_security.rb +8 -0
- data/generators/opensteam/templates/config/initializers/payment_process.rb +37 -0
- data/generators/opensteam/templates/db/migrate/20080609095723_create_addresses.rb +8 -2
- data/generators/opensteam/templates/db/migrate/20080609095726_create_inventories.rb +6 -3
- data/generators/opensteam/templates/db/migrate/20080609095728_create_order_items.rb +12 -1
- data/generators/opensteam/templates/db/migrate/20080609095729_create_orders.rb +8 -12
- data/generators/opensteam/templates/db/migrate/20080609095730_create_payment_types.rb +2 -0
- data/generators/opensteam/templates/db/migrate/20080714131513_create_invoices.rb +2 -1
- data/generators/opensteam/templates/db/migrate/20080714131650_create_shipments.rb +3 -1
- data/generators/opensteam/templates/db/migrate/20080808075247_create_containers.rb +30 -0
- data/generators/opensteam/templates/db/migrate/20080808083011_create_container_items.rb +25 -0
- data/generators/opensteam/templates/db/migrate/20080812102727_create_tax_zones.rb +16 -0
- data/generators/opensteam/templates/db/migrate/20080812102858_create_tax_rules.rb +15 -0
- data/generators/opensteam/templates/db/migrate/20080812102956_create_tax_groups.rb +14 -0
- data/generators/opensteam/templates/db/migrate/20080831181436_create_configurations.rb +15 -0
- data/generators/opensteam/templates/db/migrate/20080903131506_create_payments.rb +22 -0
- data/generators/opensteam/templates/db/migrate/20080904133625_create_payment_transactions.rb +24 -0
- data/generators/opensteam/templates/db/migrate/20080916102341_create_zones.rb +19 -0
- data/generators/opensteam/templates/db/migrate/20080916134340_create_region_shipping_rates.rb +18 -0
- data/generators/opensteam/templates/db/migrate/20080916134523_create_shipping_rate_groups.rb +18 -0
- data/generators/opensteam/templates/db/migrate/20080916135226_create_shipping_payment_additions.rb +20 -0
- data/generators/opensteam/templates/db/migrate/20080916135228_init_opensteam_config.rb +60 -0
- data/generators/opensteam/templates/public/images/opensteam_black.jpg +0 -0
- data/generators/opensteam/templates/public/images/pdf.png +0 -0
- data/generators/opensteam/templates/public/images/shader.png +0 -0
- data/generators/opensteam/templates/public/index.html +1 -0
- data/generators/opensteam/templates/public/javascripts/opensteam.js +21 -21
- data/generators/opensteam/templates/public/stylesheets/opensteam_admin.css +291 -0
- data/generators/opensteam/templates/public/stylesheets/opensteam_white.css +47 -11
- data/generators/opensteam/templates/tasks/opensteam.rake +2 -12
- data/generators/opensteam/templates/test/fixtures/addresses.yml +26 -0
- data/generators/opensteam/templates/test/fixtures/configurations.yml +29 -0
- data/generators/opensteam/templates/test/fixtures/inventories.yml +32 -15
- data/generators/opensteam/templates/test/fixtures/profiles.yml +21 -0
- data/generators/opensteam/templates/test/fixtures/region_shipping_rates.yml +33 -0
- data/generators/opensteam/templates/test/fixtures/shipping_payment_additions.yml +91 -0
- data/generators/opensteam/templates/test/fixtures/shipping_rate_groups.yml +25 -0
- data/generators/opensteam/templates/test/fixtures/tax_groups.yml +13 -0
- data/generators/opensteam/templates/test/fixtures/tax_rules.yml +29 -0
- data/generators/opensteam/templates/test/fixtures/tax_zones.yml +33 -0
- data/generators/opensteam/templates/test/fixtures/users.yml +26 -0
- data/generators/opensteam/templates/test/fixtures/zones.yml +2707 -0
- data/generators/opensteam/templates/test/functional/carts_controller_test.rb +103 -0
- data/generators/opensteam/templates/test/test_helper.rb +38 -0
- data/generators/opensteam/templates/test/unit/container_test.rb +71 -0
- data/generators/opensteam/templates/test/unit/order_test.rb +93 -0
- data/generators/opensteam/templates/test/unit/payment_test.rb +220 -0
- data/generators/opensteam/templates/test/unit/product_test.rb +158 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/.gitignore +3 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/MIT-LICENSE +20 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/README +12 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/Rakefile +22 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/init.rb +6 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/lib/prawnto.rb +13 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/lib/prawnto/action_controller.rb +47 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/lib/prawnto/template_handler/base.rb +75 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/lib/prawnto/template_handler/raw.rb +54 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/tasks/prawnto_tasks.rake +4 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/test/action_controller_test.rb +36 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/test/base_template_handler_test.rb +58 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/test/raw_template_handler_test.rb +163 -0
- data/generators/opensteam/templates/vendor/plugins/prawnto/test/template_handler_test_mocks.rb +83 -0
- data/generators/opensteam_product/templates/views/admin/_attributes.html.erb +8 -3
- data/generators/opensteam_product/templates/views/admin/_inventories.html.erb +2 -0
- data/lib/opensteam.rb +0 -1
- data/lib/opensteam/base.rb +2 -1
- data/lib/opensteam/checkout.rb +3 -12
- data/lib/opensteam/config.rb +50 -2
- data/lib/opensteam/container.rb +196 -0
- data/lib/opensteam/extension_base.rb +19 -1
- data/lib/opensteam/finder.rb +1 -1
- data/lib/opensteam/helpers/config_table_helper.rb +18 -6
- data/lib/opensteam/initializer.rb +24 -4
- data/lib/opensteam/inventory_base.rb +6 -1
- data/lib/opensteam/invoice_base.rb +12 -13
- data/lib/opensteam/money.rb +230 -0
- data/lib/opensteam/order_base.rb +122 -48
- data/lib/opensteam/payment.rb +225 -0
- data/lib/opensteam/payment/advance_payment.rb +34 -0
- data/lib/opensteam/payment/credit_card_payment.rb +217 -0
- data/lib/opensteam/payment/direct_debit_payment.rb +53 -0
- data/lib/opensteam/product_base.rb +48 -12
- data/lib/opensteam/security.rb +54 -0
- data/lib/opensteam/shipment_base.rb +214 -6
- data/lib/opensteam/shopping_cart.rb +20 -300
- data/lib/opensteam/state_logic.rb +5 -3
- data/lib/opensteam/state_machine.rb +8 -3
- data/lib/opensteam/user_base.rb +48 -6
- data/lib/opensteam/version.rb +1 -1
- metadata +122 -16
- data/generators/opensteam/templates/app/controllers/cart_controller.rb +0 -94
- data/generators/opensteam/templates/app/views/admin/orders/_event.html.erb +0 -5
- data/generators/opensteam/templates/app/views/admin/orders/_order_item.html.erb +0 -10
- data/generators/opensteam/templates/app/views/cart/_cart.html.erb +0 -8
- data/generators/opensteam/templates/app/views/cart/_cart_content.html.erb +0 -20
- data/generators/opensteam/templates/app/views/cart/update.rjs +0 -1
- data/generators/opensteam/templates/app/views/checkout/payment.html.erb +0 -8
- data/generators/opensteam/templates/app/views/checkout/shipping.html.erb +0 -45
- data/generators/opensteam/templates/app/views/checkout/show_cart.html.erb +0 -13
- data/generators/opensteam/templates/app/views/checkout/update_cart_content.rjs +0 -2
- data/generators/opensteam/templates/app/views/profile/orders/_order_item.html.erb +0 -10
- data/generators/opensteam/templates/db/migrate/20080609095725_create_dummy_users.rb +0 -21
- data/lib/opensteam/cart_base.rb +0 -227
|
@@ -8,8 +8,9 @@ class UserSessionsController < ApplicationController
|
|
|
8
8
|
|
|
9
9
|
def create
|
|
10
10
|
logout_keeping_session!
|
|
11
|
+
params[:email] = "admin@host.com" if params[:email] == "admin"
|
|
11
12
|
user = User.authenticate(params[:email], params[:password])
|
|
12
|
-
if user
|
|
13
|
+
if user && !user.is_guest?
|
|
13
14
|
self.current_user = user
|
|
14
15
|
new_cookie_flag = (params[:remember_me] == "1")
|
|
15
16
|
handle_remember_cookie! new_cookie_flag
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
class UsersController < ApplicationController
|
|
2
|
+
layout 'profile'
|
|
2
3
|
|
|
3
4
|
# render new.rhtml
|
|
4
5
|
def new
|
|
@@ -8,9 +9,15 @@ class UsersController < ApplicationController
|
|
|
8
9
|
|
|
9
10
|
def create
|
|
10
11
|
logout_keeping_session!
|
|
11
|
-
|
|
12
|
-
@customer = Opensteam::UserBase::User.
|
|
13
|
-
|
|
12
|
+
|
|
13
|
+
@customer = Opensteam::UserBase::User.find_by_email( params[:user][:email] )
|
|
14
|
+
if @customer && @customer.is_guest?
|
|
15
|
+
@customer.set_profile :customer
|
|
16
|
+
success = @customer.update_attributes( params[:user] )
|
|
17
|
+
else
|
|
18
|
+
@customer = Opensteam::UserBase::User.new( params[:user] )
|
|
19
|
+
success = @customer && @customer.save
|
|
20
|
+
end
|
|
14
21
|
|
|
15
22
|
if success && @customer.errors.empty?
|
|
16
23
|
|
|
@@ -17,7 +17,7 @@ module AdminHelper
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
def admin_sidebar_links(opts = { :html => {} }, &block )
|
|
20
|
+
def admin_sidebar_links(opts = { :html => { :class => "sub_menu" } }, &block )
|
|
21
21
|
html_options = opts[:html]
|
|
22
22
|
content = capture( &block )
|
|
23
23
|
concat(
|
|
@@ -30,11 +30,25 @@ module AdminHelper
|
|
|
30
30
|
|
|
31
31
|
def admin_sidebar_link( name, path, opts = {} )
|
|
32
32
|
html_options = opts[:html]
|
|
33
|
+
|
|
33
34
|
content_tag(:li, html_options ) do
|
|
34
35
|
opts[:function] ? link_to_function(name, opts[:function] ) : link_to( name, path )
|
|
35
36
|
end
|
|
36
37
|
|
|
37
38
|
end
|
|
38
39
|
|
|
40
|
+
def add_tax_rule_link(name)
|
|
41
|
+
link_to_function name do |page|
|
|
42
|
+
page.insert_html :bottom, :tax_rules, :partial => 'tax_rule', :object => Opensteam::Money::Tax::TaxRule.new
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def header_with_links( name, *links )
|
|
47
|
+
content_tag( :div, { :class => "header_with_links" } ) do
|
|
48
|
+
content_tag( :h3, name, {} ) + links.join("")
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
|
|
39
53
|
|
|
40
54
|
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
module CheckoutHelper
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# def shipping_types_radio_buttons country = nil
|
|
6
|
+
# RegionShippingRate.all.collect(&:shipping_method).uniq.collect do |t|
|
|
7
|
+
# radio_button_tag( :order_shipping_type, t ) +
|
|
8
|
+
# label( "order_shipping_type_#{t}", t ) + " - " +
|
|
9
|
+
# ShippingRateGroup.find_by_name( Opensteam::Config[:shipping_rate_group_default] ).rate_for(
|
|
10
|
+
# :shipping_method => t ).to_s
|
|
11
|
+
# end.join('<br />')
|
|
12
|
+
# end
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def fill_address_link id, address
|
|
16
|
+
fields = [:firstname, :lastname, :postal, :city, :street, :country ]
|
|
17
|
+
link_to_function address.full_address do |page|
|
|
18
|
+
fields.each do |f|
|
|
19
|
+
page["#{id}_#{f}"].value = address.send( f ).to_s
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def payment_types_radio_buttons f
|
|
27
|
+
Opensteam::Payment::Types.active.collect do |t|
|
|
28
|
+
p = Opensteam::Payment::Base[ t.name ]
|
|
29
|
+
|
|
30
|
+
f.radio_button( :payment_type, p.payment_id, :onclick => update_page do |page|
|
|
31
|
+
page.replace_html :payment_type, :partial => "payment/#{p.payment_id}_payment", :object => p.new
|
|
32
|
+
end ) +
|
|
33
|
+
f.label("payment_type_#{p.payment_id}", p.display_name)
|
|
34
|
+
end.join("<br />")
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module <%= file_name.classify %>Helper
|
|
4
4
|
|
|
5
5
|
include Opensteam::Helpers::ConfigTableHelper::HelperMethods
|
|
6
|
-
|
|
6
|
+
include Opensteam::Money::Helper
|
|
7
7
|
|
|
8
8
|
# return first partial-file that exist in *a
|
|
9
9
|
def existing_partial( *a )
|
|
@@ -80,7 +80,12 @@ module <%= file_name.classify %>Helper
|
|
|
80
80
|
|
|
81
81
|
end
|
|
82
82
|
|
|
83
|
+
|
|
84
|
+
|
|
83
85
|
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
84
89
|
def render_configured_table_content( *opts )
|
|
85
90
|
opts = opts.first unless opts.is_a?(Hash)
|
|
86
91
|
if opts[:partial]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class Zone < ActiveRecord::Base
|
|
2
|
+
|
|
3
|
+
named_scope :name_ordered, { :order => 'zones.country_name ASC' }
|
|
4
|
+
|
|
5
|
+
class << self ;
|
|
6
|
+
|
|
7
|
+
def for_select(*args)
|
|
8
|
+
return [] unless args
|
|
9
|
+
name_ordered.map do |m|
|
|
10
|
+
args.map { |a| m.__send__( a ) }
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<ul>
|
|
2
|
+
<li class="menu_item">Catalog
|
|
3
|
+
<%= render "admin/catalog" %>
|
|
4
|
+
</li>
|
|
5
|
+
<li class="menu_item">Sales
|
|
6
|
+
<%= render "admin/sales" %>
|
|
7
|
+
</li>
|
|
8
|
+
<li class="menu_item">Users
|
|
9
|
+
<%= render "admin/users" %>
|
|
10
|
+
</li>
|
|
11
|
+
<li class="menu_item">Order Config
|
|
12
|
+
<%= render "admin/order_config" %>
|
|
13
|
+
</li>
|
|
14
|
+
<li class="menu_item">System
|
|
15
|
+
<%= render "admin/system" %>
|
|
16
|
+
</li>
|
|
17
|
+
|
|
18
|
+
</ul>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<ul>
|
|
2
|
-
<li><%= link_to "Products",
|
|
3
|
-
<li><%= link_to "Properties",
|
|
4
|
-
<li><%= link_to "Inventories", admin_inventories_path %></li>
|
|
2
|
+
<li><%= link_to "Products", admin_products_path %>
|
|
3
|
+
<li><%= link_to "Properties", admin_properties_path %>
|
|
5
4
|
</ul>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<h1>Editing configuration</h1>
|
|
2
|
+
|
|
3
|
+
<% form_for( :configuration, @configuration, :url => { :action => :update }, :html => { :method => :put } ) do |f| %>
|
|
4
|
+
<%= f.error_messages %>
|
|
5
|
+
|
|
6
|
+
<p>
|
|
7
|
+
<%= f.label :key %><br />
|
|
8
|
+
<%= f.text_field :key %>
|
|
9
|
+
</p>
|
|
10
|
+
<p>
|
|
11
|
+
<%= f.label :value %><br />
|
|
12
|
+
<%= f.text_field :value %>
|
|
13
|
+
</p>
|
|
14
|
+
<p>
|
|
15
|
+
<%= f.submit "Update" %>
|
|
16
|
+
</p>
|
|
17
|
+
<% end %>
|
|
18
|
+
|
|
19
|
+
<%= link_to 'Show', admin_configuration_path( @configuration ) %> |
|
|
20
|
+
<%= link_to 'Back', admin_configurations_path %>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<h1>Listing configurations</h1>
|
|
2
|
+
|
|
3
|
+
<table>
|
|
4
|
+
<tr>
|
|
5
|
+
<th>Key</th>
|
|
6
|
+
<th>Value</th>
|
|
7
|
+
</tr>
|
|
8
|
+
|
|
9
|
+
<% for configuration in @configurations %>
|
|
10
|
+
<tr>
|
|
11
|
+
<td><%=h configuration.key %></td>
|
|
12
|
+
<td><%=h configuration.value %></td>
|
|
13
|
+
<td><%= link_to 'Show', admin_configuration_path( configuration ) %></td>
|
|
14
|
+
<td><%= link_to 'Edit', edit_admin_configuration_path(configuration) %></td>
|
|
15
|
+
<td><%= link_to 'Destroy', admin_configuration_path( configuration ), :confirm => 'Are you sure?', :method => :delete %></td>
|
|
16
|
+
</tr>
|
|
17
|
+
<% end %>
|
|
18
|
+
</table>
|
|
19
|
+
|
|
20
|
+
<br />
|
|
21
|
+
|
|
22
|
+
<%= link_to 'New configuration', new_admin_configuration_path %>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<h1>New configuration</h1>
|
|
2
|
+
|
|
3
|
+
<% form_for( :configuration, @configuration, :url => { :action => :create }, :html => { :method => :post } ) do |f| %>
|
|
4
|
+
<%= f.error_messages %>
|
|
5
|
+
|
|
6
|
+
<p>
|
|
7
|
+
<%= f.label :key %><br />
|
|
8
|
+
<%= f.text_field :key %>
|
|
9
|
+
</p>
|
|
10
|
+
<p>
|
|
11
|
+
<%= f.label :value %><br />
|
|
12
|
+
<%= f.text_field :value %>
|
|
13
|
+
</p>
|
|
14
|
+
<p>
|
|
15
|
+
<%= f.submit "Create" %>
|
|
16
|
+
</p>
|
|
17
|
+
<% end %>
|
|
18
|
+
|
|
19
|
+
<%= link_to 'Back', admin_configurations_path %>
|
|
@@ -6,7 +6,7 @@ end %>
|
|
|
6
6
|
<ul>
|
|
7
7
|
<%= render :partial => "admin/filters/filter_entry", :collection => @filter_entries %>
|
|
8
8
|
</ul>
|
|
9
|
-
<% form_tag( { :controller => "admin/#{model.tableize}", :action => '
|
|
9
|
+
<% form_tag( { :controller => "admin/#{model.tableize}", :action => 'filter' } ) do %>
|
|
10
10
|
<div id="filter_fields"></div>
|
|
11
11
|
<br />
|
|
12
12
|
<%= submit_tag "find" %>
|
|
@@ -1,21 +1,2 @@
|
|
|
1
1
|
<b>Administration - Section</b><br />
|
|
2
2
|
<br />
|
|
3
|
-
<ul>
|
|
4
|
-
<li>Catalog
|
|
5
|
-
<%= render "admin/catalog" %>
|
|
6
|
-
</li>
|
|
7
|
-
<li>Sales
|
|
8
|
-
<%= render "admin/sales" %>
|
|
9
|
-
</li>
|
|
10
|
-
<li>Users
|
|
11
|
-
<%= render "admin/users" %>
|
|
12
|
-
</li>
|
|
13
|
-
<% for ext in @extensions %>
|
|
14
|
-
<li><%= link_to ext.name.capitalize, :controller => "admin/#{ext.name}", :action => 'index' %>
|
|
15
|
-
<%= render "admin/#{ext.name}/index" %>
|
|
16
|
-
</li>
|
|
17
|
-
<% end %>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
</ul>
|
|
21
|
-
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
<% content_for :admin_sidebar do %>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
<% admin_sidebar_links do %>
|
|
4
|
+
<%= admin_sidebar_link "#{@inventory.product.class.to_s.pluralize} Index", :controller => @inventory.product.class.to_s.tableize, :action => :index %>
|
|
5
|
+
<%= admin_sidebar_link "Show Product", [:admin, @inventory.product ] %>
|
|
6
|
+
<%= admin_sidebar_link "Edit Product", [:edit, :admin, @inventory.product ] %>
|
|
7
|
+
<%= admin_sidebar_link "Show Inventory", admin_inventory_path( @inventory ) %>
|
|
8
|
+
<% end %>
|
|
9
9
|
<% end %>
|
|
10
10
|
|
|
11
11
|
|
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
<b>Back ordered</b><br />
|
|
39
39
|
<%= f.select :back_ordered, [["true",1],["false",0]] %>
|
|
40
40
|
</p>
|
|
41
|
+
<p>
|
|
42
|
+
<%= f.label :tax_group %>
|
|
43
|
+
<%= f.select :tax_group_id, TaxGroup.all.collect { |t| [t.name, t.id] }, { :include_blank => true } %>
|
|
44
|
+
</p>
|
|
41
45
|
|
|
42
46
|
<p>
|
|
43
47
|
<%= f.submit "Update" %>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
<% content_for :admin_sidebar do %>
|
|
3
|
-
<% admin_sidebar_links do %>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<% end %>
|
|
3
|
+
<% admin_sidebar_links do %>
|
|
4
|
+
<%= admin_sidebar_link "#{@inventory.product.class.to_s.pluralize} Index", :controller => @inventory.product.class.to_s.tableize, :action => :index %> <br />
|
|
5
|
+
<%= admin_sidebar_link "Show Product", [:admin, @inventory.product ] %> <br />
|
|
6
|
+
<%= admin_sidebar_link "Edit Product", [:edit, :admin, @inventory.product ] %> <br />
|
|
7
|
+
<%= admin_sidebar_link "Edit Inventory", edit_admin_inventory_path( @inventory ) %>
|
|
8
|
+
<% end %>
|
|
9
9
|
<% end %>
|
|
10
10
|
|
|
11
11
|
|
|
@@ -37,6 +37,10 @@
|
|
|
37
37
|
<b>Description:</b>
|
|
38
38
|
<%=h @inventory.description %>
|
|
39
39
|
</p>
|
|
40
|
+
<p>
|
|
41
|
+
<b>Tax Group:</b>
|
|
42
|
+
<%=h @inventory.tax_group ? @inventory.tax_group.name : '' %>
|
|
43
|
+
</p>
|
|
40
44
|
|
|
41
45
|
|
|
42
46
|
|
|
@@ -9,4 +9,5 @@
|
|
|
9
9
|
<td><%=h ordinalized_time( invoice.created_at) %></td>
|
|
10
10
|
<td><%=h ordinalized_time( invoice.updated_at ) %></td>
|
|
11
11
|
<td><%= link_to "show", admin_order_invoice_path( invoice.order, invoice ) %></td>
|
|
12
|
+
<td><%= link_to image_tag("pdf.png", :border => 0), formatted_admin_order_invoice_path( invoice.order, invoice, :pdf ) %>
|
|
12
13
|
</tr>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<% f = invoice_fields %>
|
|
2
|
+
<% fields_for :address, @invoice.address do |a| %>
|
|
3
|
+
<% field_set_tag do %>
|
|
4
|
+
<p>
|
|
5
|
+
<%= a.label :street %>
|
|
6
|
+
<%= a.text_field :street %>
|
|
7
|
+
</p>
|
|
8
|
+
<p>
|
|
9
|
+
<%= a.label :postal %>
|
|
10
|
+
<%= a.text_field :postal %>
|
|
11
|
+
</p>
|
|
12
|
+
<p>
|
|
13
|
+
<%= a.label :city %>
|
|
14
|
+
<%= a.text_field :city %>
|
|
15
|
+
</p>
|
|
16
|
+
<p>
|
|
17
|
+
<%= a.label :country %>
|
|
18
|
+
<%= a.text_field :country %>
|
|
19
|
+
</p>
|
|
20
|
+
<% end %>
|
|
21
|
+
<% end %>
|
|
22
|
+
|
|
23
|
+
<% field_set_tag do %>
|
|
24
|
+
<p>
|
|
25
|
+
<%= f.label :comment %>
|
|
26
|
+
<%= f.text_area :comment, :rows => 5%>
|
|
27
|
+
</p>
|
|
28
|
+
<p>
|
|
29
|
+
<%= f.label :discount %>
|
|
30
|
+
<%= f.text_field :discount %>
|
|
31
|
+
</p>
|
|
32
|
+
<p>
|
|
33
|
+
<%= f.label :price %>
|
|
34
|
+
<%= f.text_field :price %>
|
|
35
|
+
</p>
|
|
36
|
+
<% end %>
|
|
37
|
+
<p>Select Order Items
|
|
38
|
+
<ul>
|
|
39
|
+
<% for oi in @order.items.select { |s| s.invoice == nil } %>
|
|
40
|
+
<li>
|
|
41
|
+
<%= check_box_tag "order_items[]", oi.id %>
|
|
42
|
+
<%= label_tag "order_items[]", oi.product.name + " (#{oi.product.class})" %>
|
|
43
|
+
<%- unless oi.properties.empty? -%> | <b>Configuration:</b> <%=h oi.properties.collect(&:name).join(",") %><%- end -%>
|
|
44
|
+
| <%=h oi.quantity %> | <%=h oi.quantity * oi.price %>
|
|
45
|
+
</li>
|
|
46
|
+
<% end %>
|
|
47
|
+
<li>
|
|
48
|
+
<%= check_box_tag "shipping_rate", 1 %> <%= label_tag "shipping_rate", "Shipping Rate: #{@order.shipping_rate}" %>
|
|
49
|
+
</li>
|
|
50
|
+
</ul>
|
|
51
|
+
</p>
|
|
52
|
+
<%# end %>
|