app/views/spree/admin/reimbursements/edit.html.erb in spree_backend-2.4.10 vs app/views/spree/admin/reimbursements/edit.html.erb in spree_backend-3.0.0.rc1

- old
+ new

@@ -1,21 +1,17 @@ <%= render :partial => 'spree/admin/shared/order_tabs', :locals => { :current => 'Customer Returns' } %> <% content_for :page_title do %> - <i class="fa fa-arrow-right"></i> <%= Spree.t(:editing_reimbursement) %> #<%= @reimbursement.number %> + / <%= Spree.t(:editing_resource, resource: Spree::Reimbursement.model_name.human) %> #<%= @reimbursement.number %> <% end %> -<% content_for :page_actions do %> - <li><%= button_link_to Spree.t(:back_to_customer_return), url_for([:edit, :admin, @order, @reimbursement.customer_return]), :icon => 'arrow-left' %></li> -<% end %> +<%= render :partial => 'spree/admin/shared/error_messages', :locals => { :target => @reimbursement } %> -<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @reimbursement } %> - <%= form_for [:admin, @order, @reimbursement] do |f| %> <fieldset class='no-border-bottom'> - <legend align='center'><%= Spree.t(:items_to_be_reimbursed) %></legend> - <table class="index reimbursement-return-items-table"> + <legend><%= Spree.t(:items_to_be_reimbursed) %></legend> + <table class="table table-condensed table-bordered reimbursement-return-items-table"> <thead> <tr> <th><%= Spree.t(:product) %></th> <th><%= Spree.t(:preferred_reimbursement_type) %></th> <th><%= Spree.t(:reimbursement_type_override) %></th> @@ -25,84 +21,82 @@ </tr> </thead> <tbody> <%= f.fields_for :return_items, @reimbursement.return_items.sort_by(&:id) do |item_fields| %> <% return_item = item_fields.object %> - <tr> <td> <div class="variant-name"><%= return_item.inventory_unit.variant.name %></div> <div class="variant-options"><%= return_item.inventory_unit.variant.options_text %></div> </td> - <td class="align-center"> + <td> <%= reimbursement_type_name(return_item.preferred_reimbursement_type) %> </td> - <td class='align-center'> + <td> <%= item_fields.select(:override_reimbursement_type_id, reimbursement_types.collect { |r| [r.name.humanize, r.id] }, {include_blank: true}, - {class: 'select2 fullwidth'} + {class: 'select2'} ) %> </td> - <td class="align-center"> - <%= item_fields.text_field :pre_tax_amount, { class: 'refund-amount-input' } %> + <td> + <%= item_fields.text_field :pre_tax_amount, { class: 'refund-amount-input form-control' } %> </td> - <td class="align-center"> + <td> <%= return_item.display_total %> </td> - <td class="align-center"> + <td> <% if return_item.exchange_processed? %> <%= return_item.exchange_variant.exchange_name %> <% else %> - <%= item_fields.collection_select :exchange_variant_id, return_item.eligible_exchange_variants, :id, :exchange_name, { include_blank: true }, { class: "select2 fullwidth return-item-exchange-selection" } %> + <%= item_fields.collection_select :exchange_variant_id, return_item.eligible_exchange_variants, :id, :exchange_name, { include_blank: true }, { class: "select2 return-item-exchange-selection" } %> <% end %> </td> </tr> - <% end %> </tbody> </table> </fieldset> - <div class="form-buttons filter-actions actions" data-hook="buttons"> - <%= f.button do %> - <%= Spree.t(:update) %> - <% end %> + <div class="form-actions filter-actions actions" data-hook="buttons"> + <%= button Spree.t('actions.update'), 'update' %> </div> - <br/> <% end %> -<fieldset> - <legend align='center'><%= Spree.t(:calculated_reimbursements) %></legend> - <table class="index"> +<fieldset class="margint"> + <legend><%= Spree.t(:calculated_reimbursements) %></legend> + <table class="table table-condensed table-bordered"> <thead data-hook="customer_return_header"> <tr> <th><%= Spree.t(:reimbursement_type) %></th> <th><%= Spree.t(:description) %></th> <th><%= Spree.t(:amount) %></th> </tr> </thead> <tbody> <% @reimbursement_objects.each do |reimbursement_object| %> - <tr id="<%= spree_dom_id(reimbursement_object) %>" data-hook="reimbursement_reimbursement_object_row" class="<%= cycle('odd', 'even')%>"> + <tr id="<%= spree_dom_id(reimbursement_object) %>" data-hook="reimbursement_reimbursement_object_row"> <td><%= reimbursement_object.class.name.demodulize %></td> <td><%= reimbursement_object.description %></td> <td><%= reimbursement_object.display_amount %></td> </tr> <% end %> </tbody> </table> + <% if @order.has_non_reimbursement_related_refunds? %> - <span class="red"> + <span class="alert alert-danger"> <%= "#{Spree.t('note')}: #{Spree.t('this_order_has_already_received_a_refund')}. #{Spree.t('make_sure_the_above_reimbursement_amount_is_correct')}." %> </span> <% end %> - <div class="form-buttons filter-actions actions" data-hook="reimburse-buttons"> + + <div class="form-actions" data-hook="reimburse-buttons"> <% if !@reimbursement.reimbursed? %> - <%= button_to [:perform, :admin, @order, @reimbursement], {class: 'button fa fa-reply', method: 'post'} do %> + <%= button_to [:perform, :admin, @order, @reimbursement], { class: 'btn btn-primary', method: 'post' } do %> + <span class="icon icon-save"></span> <%= Spree.t(:reimburse) %> <% end %> <span class="or"><%= Spree.t(:or) %></span> - <%= button_link_to Spree.t('actions.cancel'), url_for([:admin, @order, @reimbursement.customer_return]), :icon => 'remove' %> + <%= button_link_to Spree.t('actions.cancel'), url_for([:admin, @order, @reimbursement.customer_return]), :icon => 'remove-sign' %> <% end %> </div> </fieldset>