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
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<h2>TaxZones</h2>
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
<%= header_with_links("Overview",
|
|
5
|
+
link_to("New", new_admin_tax_zone_path) ) %>
|
|
6
|
+
|
|
7
|
+
<div id="tax_zone_content_div">
|
|
8
|
+
<%= render :partial => "tax_zones", :object => @tax_zones, :locals => { :id => "tax_zones_content" } %>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<% content_for( :admin_sidebar2 ) do %>
|
|
14
|
+
<%= render :partial => "admin/filters/filter", :locals => { :id => "tax_zone_filter", :model => "TaxZone" } %>
|
|
15
|
+
<% end %>
|
|
16
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<% content_for :admin_sidebar do %>
|
|
2
|
+
<%= link_to "Tax Zones", admin_tax_zones_path %>
|
|
3
|
+
<% end %>
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
<h2>Create TaxZone</h2>
|
|
7
|
+
|
|
8
|
+
<%= error_messages_for :tax_zone %>
|
|
9
|
+
|
|
10
|
+
<% form_for :tax_zone, @tax_zone, :url => { :controller => "admin/tax_zones", :action => 'create' } do |f| %>
|
|
11
|
+
|
|
12
|
+
<%= render :partial => "attributes", :locals => { :f => f, :button => "Create" } %>
|
|
13
|
+
|
|
14
|
+
<% end %>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<h2>Tax Zone #<%= @tax_zone.id %></h2>
|
|
2
|
+
|
|
3
|
+
<%= header_with_links("Show",
|
|
4
|
+
link_to("Edit", edit_admin_tax_zone_path( @tax_zone ) ),
|
|
5
|
+
link_to("Delete", admin_tax_zone_path( @tax_one), :method => :delete, :confirm => "Are your sure?" )) %>
|
|
6
|
+
|
|
7
|
+
<p>
|
|
8
|
+
<b>Country:</b> <%= @tax_zone.country %>
|
|
9
|
+
</p>
|
|
10
|
+
<p>
|
|
11
|
+
<b>State</b> <%= @tax_zone.state %>
|
|
12
|
+
</p>
|
|
13
|
+
<p>
|
|
14
|
+
<b>Rate</b> <%= @tax_zone.rate %>
|
|
15
|
+
</p>
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
<% content_for(:admin_sidebar) do %>
|
|
2
|
+
<%= link_to "Users", admin_users_path %>
|
|
3
|
+
<br />
|
|
4
|
+
<%= link_to "New User", new_admin_user_path %>
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
<% end %>
|
|
9
|
+
|
|
10
|
+
|
|
1
11
|
<h3><%=h @user.profile.name %> Info # <%=h @user.id %> </h3>
|
|
2
12
|
<br />
|
|
3
13
|
<b>Email:</b> <%= @user.email %><br /><br />
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<%% if ! @cart.items.empty? %>
|
|
2
|
+
<div id="cart_content">
|
|
3
|
+
<%%= render :partial => "carts/cart_content" %>
|
|
4
|
+
</div>
|
|
5
|
+
<%%= button_to "checkout" , { :controller => '<%= file_name %>', :action => :start_checkout }, :confirm => "checkout?" %>
|
|
6
|
+
<%%= button_to "empty cart" , { :controller => 'carts', :action => :destroy }, :method => :delete, :confirm => "empty cart?" %>
|
|
7
|
+
<%% end %>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<% form_remote_tag :url => { :controller => 'carts', :action => :update }, :html => { :method => :put } do %>
|
|
2
|
+
<table class="cart">
|
|
3
|
+
<thead>
|
|
4
|
+
<tr>
|
|
5
|
+
<th>Name</th>
|
|
6
|
+
<th>Qnty</th>
|
|
7
|
+
<th>Price</th>
|
|
8
|
+
<th>Tax (incl)</th>
|
|
9
|
+
<th>Price (netto)</th>
|
|
10
|
+
<th>Total</th>
|
|
11
|
+
<th></th>
|
|
12
|
+
</tr>
|
|
13
|
+
</thead>
|
|
14
|
+
<tbody>
|
|
15
|
+
<% @cart.items.each_with_index do |i,k| %>
|
|
16
|
+
<tr class="cart_item" id="cart_item_<%=h k %>">
|
|
17
|
+
|
|
18
|
+
<td><%= i.product.class.to_s %><br /><%= link_to i.product.name, :controller => 'carts', :action => :show, :id => k %></td>
|
|
19
|
+
<td><%= text_field_tag "quantity[#{k}]", i.quantity.to_s, :id => "quantity", :size => 1 %> : <%=h i.quantity %></td>
|
|
20
|
+
<td><%= i.price %></td>
|
|
21
|
+
<td><%= calculate_tax_for i %> (<%= get_rate_for(i) %> %) <%= Opensteam::Config[:default_country] %> </td>
|
|
22
|
+
<td><%= i.price - calculate_tax_for( i ) %>
|
|
23
|
+
<td><%= i.total_price %></td>
|
|
24
|
+
<td>
|
|
25
|
+
<%= link_to_remote image_tag( "/images/plus.png", :border => "0" ), :url => { :controller => 'carts', :action => :update, :id => k, :incr => 1 } -%>
|
|
26
|
+
<%= link_to_remote image_tag( "/images/minus.png", :border => "0"), :url => { :controller => 'carts', :action => :update, :id => k, :decr => 1 } -%>
|
|
27
|
+
<%= link_to_remote image_tag( "/images/cancel.png", :border => "0"), :url => { :controller => 'carts', :action => :destroy, :id => k } -%>
|
|
28
|
+
</td>
|
|
29
|
+
</tr>
|
|
30
|
+
<% end %>
|
|
31
|
+
</tbody>
|
|
32
|
+
</table>
|
|
33
|
+
<div id="cart_actions">
|
|
34
|
+
<%- if !@cart.items.empty? -%>
|
|
35
|
+
<%= submit_tag "Update" %>
|
|
36
|
+
<br /><br />
|
|
37
|
+
<b>Total Price:</b> <%= @cart.total_price %>
|
|
38
|
+
<% end %>
|
|
39
|
+
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<% end %>
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
page.replace_html :cart, :partial => "carts/cart"
|
|
2
|
+
page.replace_html :header, :partial => "common/header"
|
|
3
|
+
if params[:quantity]
|
|
4
|
+
Hash[params[:quantity]].keys.each { |k|
|
|
5
|
+
page.select("#cart_item_#{k}").each { |e| e.visual_effect :highlight, :duration => 1, :startcolor => '#cccccc' }
|
|
6
|
+
}
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
if params[:id]
|
|
10
|
+
page.select("#cart_item_#{params[:id]}").each { |e| e.visual_effect :highlight, :duration => 1, :startcolor => '#cccccc' }
|
|
11
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
<%- unless @addresses.empty? -%>
|
|
3
|
+
<b>Select saved <%= type %> address:</b>
|
|
4
|
+
<ul>
|
|
5
|
+
<% for address in @addresses %>
|
|
6
|
+
<li>
|
|
7
|
+
<%= fill_address_link "order_#{type}_address", address %>
|
|
8
|
+
</li>
|
|
9
|
+
<% end %>
|
|
10
|
+
</ul>
|
|
11
|
+
<%- end -%>
|
|
12
|
+
|
|
13
|
+
<b>Enter <%= type.to_s.humanize %> Address </b>
|
|
14
|
+
<% f.fields_for "#{type}_address", @order.send( "#{type}_address" ) do |a| %>
|
|
15
|
+
<% field_set_tag do %>
|
|
16
|
+
<p>
|
|
17
|
+
<%= a.label :firstname %>
|
|
18
|
+
<%= a.text_field :firstname %>
|
|
19
|
+
</p>
|
|
20
|
+
<p>
|
|
21
|
+
<%= a.label :lastname %>
|
|
22
|
+
<%= a.text_field :lastname %>
|
|
23
|
+
</p>
|
|
24
|
+
<p>
|
|
25
|
+
<%= a.label :country %>
|
|
26
|
+
<%= a.select :country, @countries %>
|
|
27
|
+
</p>
|
|
28
|
+
<p>
|
|
29
|
+
<%= a.label :postal %>
|
|
30
|
+
<%= a.text_field :postal %>
|
|
31
|
+
</p>
|
|
32
|
+
<p>
|
|
33
|
+
<%= a.label :city %>
|
|
34
|
+
<%= a.text_field :city %>
|
|
35
|
+
</p>
|
|
36
|
+
<p>
|
|
37
|
+
<%= a.label :street %>
|
|
38
|
+
<%= a.text_field :street %>
|
|
39
|
+
</p>
|
|
40
|
+
<% end %>
|
|
41
|
+
<% end %>
|
|
42
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<h3>Customer</h3>
|
|
2
|
+
|
|
3
|
+
<%- if @customer.new_record? || @customer.is_guest? -%>
|
|
4
|
+
<% fields_for "guest_customer", @customer do |c| %>
|
|
5
|
+
<% field_set_tag do %>
|
|
6
|
+
<p>
|
|
7
|
+
<%= c.label :email %>
|
|
8
|
+
<%= c.text_field :email %>
|
|
9
|
+
</p>
|
|
10
|
+
<% end %>
|
|
11
|
+
<% end %>
|
|
12
|
+
<%- else -%>
|
|
13
|
+
<% field_set_tag do %>
|
|
14
|
+
<p>
|
|
15
|
+
<%= label_tag "id" %>
|
|
16
|
+
<%= @customer.id %>
|
|
17
|
+
</p>
|
|
18
|
+
<p>
|
|
19
|
+
<%= label_tag "email" %>
|
|
20
|
+
<%= @customer.email %>
|
|
21
|
+
</p>
|
|
22
|
+
<p>
|
|
23
|
+
<%= label_tag "firstname" %>
|
|
24
|
+
<%= @customer.firstname %>
|
|
25
|
+
</p>
|
|
26
|
+
<p>
|
|
27
|
+
<%= label_tag "lastname" %>
|
|
28
|
+
<%= @customer.lastname %>
|
|
29
|
+
</p>
|
|
30
|
+
<% end %>
|
|
31
|
+
<%- end -%>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<%= error_messages_for :order %>
|
|
2
|
+
<%= error_messages_for :customer %>
|
|
3
|
+
<%= error_messages_for :shipping_address %>
|
|
4
|
+
<%= error_messages_for :payment_address %>
|
|
5
|
+
<%= error_messages_for :payment %>
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
<% form_for :order, @order, :url => { :action => :update }, :html => { :method => :put } do |f| %>
|
|
9
|
+
|
|
10
|
+
<div id="customer">
|
|
11
|
+
<%= render :partial => "customer", :object => @customer, :locals => { :f => f } %>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div class="addresses">
|
|
15
|
+
<h3>Addresses</h3>
|
|
16
|
+
<div id="shipping">
|
|
17
|
+
<%= render :partial => "address", :locals => { :type => :shipping, :f => f } %>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div id=="payment">
|
|
21
|
+
<%= render :partial => "address", :locals => { :type => :payment, :f => f } %>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<h3>Payment Method</h3>
|
|
26
|
+
<%= payment_types_radio_buttons f %>
|
|
27
|
+
<div id="payment_type">
|
|
28
|
+
<%- if @order.payment_type -%>
|
|
29
|
+
<%= render :partial => "payment/#{@order.payment_type}_payment", :object => Opensteam::Payment::Base[ @order.payment_type ].new %>
|
|
30
|
+
<%- end -%>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<h3>Shipping Metthod</h3>
|
|
34
|
+
<div id="shipping_types_buttons">
|
|
35
|
+
<%= render :partial => "shipping_buttons", :object => @order,
|
|
36
|
+
:locals => { :payment_type => nil, :country => Opensteam::Config[:default_country] } %>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<%= submit_tag "Continue" %>
|
|
41
|
+
|
|
42
|
+
<% end %>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<%= error_messages_for :order %>
|
|
2
|
+
<%= error_messages_for :customer %>
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
<% form_for :order, @order, :url => { :action => :create }, :html => { :id => "order", :method => :post } do |f| %>
|
|
6
|
+
|
|
7
|
+
<div id="customer">
|
|
8
|
+
<%= render :partial => "customer", :object => @customer, :locals => { :f => f } %>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="addresses">
|
|
12
|
+
<h3>Addresses</h3>
|
|
13
|
+
<div id="shipping">
|
|
14
|
+
<%= error_messages_for :shipping_address, :object => @order.shipping_address %>
|
|
15
|
+
<%= render :partial => "address", :locals => { :type => :shipping, :f => f } %>
|
|
16
|
+
</div>
|
|
17
|
+
<div id="payment">
|
|
18
|
+
<%= error_messages_for :payment_address, :object => @order.payment_address %>
|
|
19
|
+
<%= render :partial => "address", :locals => { :type => :payment, :f => f } %>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<h3>Payment Method</h3>
|
|
23
|
+
<%= payment_types_radio_buttons f %>
|
|
24
|
+
<div id="payment_type">
|
|
25
|
+
<%- if @order.payment_type -%>
|
|
26
|
+
<%= render :partial => "payment/#{@order.payment_type}_payment", :object => @payment %>
|
|
27
|
+
<%- end -%>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<h3>Shipping Metthod</h3>
|
|
31
|
+
|
|
32
|
+
<div id="shipping_types_buttons">
|
|
33
|
+
<%= render :partial => "shipping_buttons", :object => @order,
|
|
34
|
+
:locals => { :f => f, :payment_type => nil, :country => Opensteam::Config[:default_country] } %>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div id="shipping_types">
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<%= submit_tag "Continue" %>
|
|
43
|
+
|
|
44
|
+
<% end %>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<% for st in Opensteam::ShipmentBase::RegionShippingRate.all.collect(&:shipping_method ).uniq %>
|
|
2
|
+
<%= f.radio_button :shipping_type, st %>
|
|
3
|
+
<%= label "order_shipping_type_#{st}", st %>
|
|
4
|
+
<span id="shipping_type_rate_<%= st.underscore %>">
|
|
5
|
+
<%= shipping_buttons.calculate_shipping_rate( :shipping_method => st, :country => country, :payment_type => payment_type ) %>
|
|
6
|
+
</span>
|
|
7
|
+
<br />
|
|
8
|
+
<% end %>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<% form_for :payment, @payment, :url => { :action => :place_order }, :html => { :method => :post } do |f| %>
|
|
2
|
+
|
|
3
|
+
<h1>Order - #<%= @order.id %></h1>
|
|
4
|
+
<%= @order.state %>
|
|
5
|
+
<div>
|
|
6
|
+
<b>Created At:</b> <%= @order.created_at %>
|
|
7
|
+
<br />
|
|
8
|
+
<b>Updated At:</b> <%= @order.updated_at %>
|
|
9
|
+
<br />
|
|
10
|
+
|
|
11
|
+
<h2>Customer</h2>
|
|
12
|
+
<div class="order_show" id="customer">
|
|
13
|
+
<%= @order.customer.email %><br />
|
|
14
|
+
<%= @order.customer.full_name %>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<br />
|
|
18
|
+
|
|
19
|
+
<h2>Shipping Information</h2>
|
|
20
|
+
<div class="order_show">
|
|
21
|
+
<b>Shipping Type:</b> <%= @order.shipping_type %><br />
|
|
22
|
+
<b>Shipping Rate:</b> <%= @order.shipping_rate %><br />
|
|
23
|
+
|
|
24
|
+
<h3>Shipping Address</h3>
|
|
25
|
+
<%= @order.shipping_address.to_a.join("<br />") %>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<br />
|
|
29
|
+
|
|
30
|
+
<h2>Payment Information</h2>
|
|
31
|
+
<div class="order_show">
|
|
32
|
+
<b>Payment Type:</b> <%= Opensteam::Payment::Base[ @order.payment_type ].display_name %><br />
|
|
33
|
+
<%= render :partial => "payment/#{@order.payment_type}_payment_confirmation", :object => @payment, :locals => { :f => f } %>
|
|
34
|
+
<br />
|
|
35
|
+
<h3>Billing Address</h3>
|
|
36
|
+
<%= @order.payment_address.to_a.join("<br />") %>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<h2>Order Items</h2>
|
|
40
|
+
<div class="order_show" id="items">
|
|
41
|
+
<%= render :partial => "admin/order_items/items_table", :object => @order %>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<h2> Total Price</h2>
|
|
45
|
+
<div class="order_show" id="price_info">
|
|
46
|
+
<% total_tax = @order.items.collect(&:tax).sum
|
|
47
|
+
total_price = @order.items.collect(&:total_price).sum %>
|
|
48
|
+
<table>
|
|
49
|
+
<tr><td style="font-weight:bold;">Items Netto Price</td><td><%= total_price - total_tax %></td></tr>
|
|
50
|
+
<tr><td style="font-weight:bold;">Items Tax</td><td><%= total_tax %></td></tr>
|
|
51
|
+
<tr><td style="font-weight:bold;">Shipping Rate</td><td><%= @order.shipping_rate %></td></tr>
|
|
52
|
+
|
|
53
|
+
<tr />
|
|
54
|
+
<tr style="font-weight:bold;"><td>Total Price</td><td><%= @order.total_price %></td></tr>
|
|
55
|
+
</table>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<%= submit_tag "Place Order", :disable_with => "Sending Order..." %>
|
|
61
|
+
|
|
62
|
+
<% end %>
|
|
63
|
+
<%= button_to "Edit Order Information", :action => :edit %>
|
|
@@ -8,33 +8,36 @@
|
|
|
8
8
|
|
|
9
9
|
<%= javascript_include_tag :defaults %>
|
|
10
10
|
<%= javascript_include_tag "opensteam" %>
|
|
11
|
-
<%= stylesheet_link_tag '
|
|
12
|
-
|
|
11
|
+
<%= stylesheet_link_tag 'opensteam_admin' %>
|
|
12
|
+
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="top"></div>
|
|
16
16
|
<div id="page">
|
|
17
17
|
|
|
18
18
|
<div id="header">
|
|
19
|
-
<%= render :partial => 'common/
|
|
19
|
+
<%= render :partial => 'common/header_admin', :locals => { :top_link => admin_path } %>
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
|
-
<div id="menu">
|
|
23
|
-
<%= render :partial => "common/header_flash" %>
|
|
24
|
-
<%= render :partial => 'admin/nav' %>
|
|
25
|
-
</div>
|
|
26
22
|
|
|
27
23
|
<div id="content_box">
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
|
|
26
|
+
<div class="sub_content" id="sidebar">
|
|
27
|
+
<%= render :partial => "admin/menu" %>
|
|
31
28
|
</div>
|
|
32
29
|
|
|
33
|
-
<div id="content">
|
|
34
|
-
|
|
30
|
+
<div class="sub_content" id="content">
|
|
31
|
+
<div id="sub_menu">
|
|
32
|
+
<%= yield(:admin_sidebar) || "" %>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div id="page_sub_content">
|
|
36
|
+
<%= yield %>
|
|
37
|
+
</div>
|
|
35
38
|
</div>
|
|
36
39
|
|
|
37
|
-
<div id="sidebar2">
|
|
40
|
+
<div class="sub_content" id="sidebar2">
|
|
38
41
|
<%= yield(:admin_sidebar2) || "" %>
|
|
39
42
|
</div>
|
|
40
43
|
</div>
|
|
@@ -44,6 +47,19 @@
|
|
|
44
47
|
</div>
|
|
45
48
|
|
|
46
49
|
</div>
|
|
50
|
+
|
|
51
|
+
<%- if flash[:error] -%>
|
|
52
|
+
<div class="flash_error">
|
|
53
|
+
<div id="flash_error_box" style="text-align:center;color:black;background:red;padding:10px;position:absolute;top:30%;left:30%;border:1px solid black;">
|
|
54
|
+
<%= flash[:error] %><br />
|
|
55
|
+
<%= link_to_function "Close", "$(this).up('.flash_error').remove()" %>
|
|
56
|
+
</div>
|
|
57
|
+
<%= draggable_element :flash_error_box %>
|
|
58
|
+
</div>
|
|
59
|
+
<%- end -%>
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
47
63
|
</body>
|
|
48
64
|
|
|
49
65
|
</html>
|