-
-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3194 from HugsDaniel/3109-fix-orders-new
[Spree Upgrade] Fix admin new order page
- Loading branch information
Showing
10 changed files
with
159 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...errides/spree/admin/orders/customer_details/edit/replace_customer_search.html.haml.deface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
= render partial: "spree/admin/variants/autocomplete", formats: :js | ||
#add-line-item | ||
%fieldset | ||
%legend{align: "center"} | ||
= t(:add_product) | ||
.field.eight.columns.alpha | ||
= label_tag :add_product_name, t(:name_or_sku) | ||
= hidden_field_tag :add_variant_id, "", class: "variant_autocomplete fullwidth" | ||
.field.two.columns | ||
= label_tag :add_quantity, t(:qty) | ||
= number_field_tag :add_quantity, 1, min: 0 | ||
.actions.two.columns.omega | ||
= link_to_with_icon 'icon-plus', t(:add), admin_order_line_items_url(@order), | ||
method: :post, | ||
id: 'add_line_item_to_order', | ||
class: 'button fullwidth', | ||
'data-update' => 'order-form-wrapper' | ||
= render :partial => "spree/admin/variants/autocomplete", :formats => :js | ||
|
||
#add-line-item{"data-hook" => ""} | ||
%fieldset.no-border-bottom | ||
%legend{:align => "center"}= Spree.t(:add_product) | ||
.field.twelve.columns.alpha{"data-hook" => "add_product_name"} | ||
= label_tag :add_variant_id, Spree.t(:name_or_sku) | ||
= hidden_field_tag :add_variant_id, "", :class => "variant_autocomplete fullwidth" | ||
#stock_details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,44 @@ | ||
%div | ||
%div{"data-hook" => "admin_order_form_fields"} | ||
- if @line_item.try(:errors).present? | ||
= render partial: 'spree/shared/error_messages', locals: { target: @line_item } | ||
= form_for @order, url: admin_order_url(@order), method: :put do |f| | ||
%fieldset.no-border-top | ||
= f.hidden_field :number | ||
%table.index{"ng-show" => "distributionChosen()"} | ||
%colgroup | ||
%col{style: "width: 49%;"}/ | ||
%col{style: "width: 14%;"}/ | ||
%col{style: "width: 10%;"}/ | ||
%col{style: "width: 14%;"}/ | ||
%col{style: "width: 8%;"}/ | ||
%thead#line-items | ||
%tr | ||
%th | ||
= t(:item_description) | ||
%th.price | ||
= t(:price) | ||
%th.qty | ||
= t(:qty) | ||
%th.total | ||
%span | ||
= t(:total) | ||
%th.orders-actions.actions | ||
%tbody | ||
= f.fields_for :line_items do |li_form| | ||
= render partial: 'spree/admin/orders/line_item', locals: { f: li_form } | ||
%tbody#subtotal.no-border-top | ||
%tr#subtotal-row | ||
%td{colspan: "3"} | ||
%b | ||
= t(:subtotal) | ||
\: | ||
%td.total.align-center | ||
%span | ||
= @order.display_item_total.to_html | ||
%td.actions | ||
%tbody#order-charges.no-border-top | ||
- @order.adjustments.eligible.each do |adjustment| | ||
%tr | ||
%td{colspan: "3"} | ||
= render :partial => 'spree/shared/error_messages', :locals => { :target => @line_item } | ||
= render :partial => "spree/admin/orders/shipment", :collection => @order.shipments, :locals => { :order => order } | ||
- if order.adjustments.eligible.exists? | ||
%fieldset.no-border-bottom | ||
%legend= Spree.t('adjustments') | ||
%table | ||
%thead | ||
%th= Spree.t('name') | ||
%th= Spree.t('amount') | ||
%tbody#order-charges.with-border{"data-hook" => "order_details_adjustments"} | ||
- order.adjustments.eligible.each do |adjustment| | ||
- next if ((adjustment.originator_type == 'Spree::TaxRate') and (adjustment.amount == 0)) || adjustment.originator_type == 'Spree::ShippingMethod' | ||
%tr.total | ||
%td | ||
%strong | ||
= adjustment.label | ||
\: | ||
%td.total.align-center | ||
%span= adjustment.display_amount.to_html | ||
%td.actions | ||
%tbody#order-total.grand-total.no-border-top | ||
%tr | ||
%td{colspan: "3"} | ||
%b | ||
= t(:order_total) | ||
\: | ||
%td.total.align-center | ||
%span#order_total | ||
= @order.display_total.to_html | ||
%td.actions | ||
%span= adjustment.display_amount | ||
- if order.line_items.exists? | ||
%fieldset#order-total.no-border-bottom{"data-hook" => "order_details_total"} | ||
%legend= Spree.t(:order_total) | ||
%span.order-total= order.display_total | ||
= form_for @order, url: admin_order_url(@order), method: :put do |f| | ||
= render partial: 'spree/admin/orders/_form/distribution_fields' | ||
= render partial: 'spree/admin/orders/_form/distribution_fields' | ||
.filter-actions.actions{"ng-show" => "distributionChosen()"} | ||
= button t(:update_and_recalculate_fees), 'icon-refresh' | ||
%span.or | ||
= t(:or) | ||
= link_to_with_icon 'button icon-arrow-left', t(:back), admin_orders_url | ||
.filter-actions.actions{"ng-show" => "distributionChosen()"} | ||
= button t(:update_and_recalculate_fees), 'icon-refresh' | ||
%span.or | ||
= t(:or) | ||
= link_to_with_icon 'button icon-arrow-left', t(:back), admin_orders_url | ||
= javascript_tag do | ||
= render partial: 'spree/admin/shared/update_order_state', handlers: [:js] | ||
var order_number = '#{@order.number}'; | ||
var shipments = []; | ||
- @order.shipments.each do |shipment| | ||
shipments.push(#{shipment.to_json(:root => false, :include => [:inventory_units, :stock_location]).html_safe}); | ||
= render :partial => 'spree/admin/shared/update_order_state', :handlers => [:js] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
<script> | ||
Spree.routes = <%== { | ||
:variants_search => admin_search_variants_path(:format => 'json'), | ||
:variants_search => spree.admin_search_variants_path(:format => 'json'), | ||
:taxons_search => spree.api_taxons_path(:format => 'json'), | ||
:user_search => spree.admin_search_users_path(:format => 'json'), | ||
:product_search => spree.api_products_path(:format => 'json'), | ||
:option_type_search => spree.api_option_types_path(:format => 'json'), | ||
:states_search => spree.api_states_path(:format => 'json') | ||
:states_search => spree.api_states_path(:format => 'json'), | ||
:orders_api => spree.api_orders_path(:format => 'json'), | ||
:stock_locations_api => spree.api_stock_locations_path(:format => 'json'), | ||
:variants_api => spree.api_variants_path(:format => 'json') | ||
}.to_json %>; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.