app/views/plugins/ecommerce/admin/orders/show.html.erb in camaleon_ecommerce-0.0.4 vs app/views/plugins/ecommerce/admin/orders/show.html.erb in camaleon_ecommerce-1.1

- old
+ new

@@ -1,173 +1,11 @@ -<div id="order_view" class="panel panel-default"> - <div class="panel-heading"> - <h4><%= t('plugin.ecommerce.details_order') %>: <%= @order.slug %></h4> - <%= link_to raw("<i class='fa fa-edit'></i> #{t('plugin.ecommerce.edit_order')}"), {action: :edit, id: @order.slug}, class: "btn btn-primary pull-right" %> - </div> - <div class="panel-body"> - - <div class="row"> - <div class="col-md-4"> - <h3><%= t('plugin.ecommerce.table.customer_info') %></h3> - <ul class="ec-list-orders-address"> - <li><strong><%= t('plugin.ecommerce.table.name') %>:</strong> <span> <%= @order.details.customer %></span></li> - <li><strong><%= t('plugin.ecommerce.table.email') %>:</strong> <span> <%= @order.details.email %></span></li> - <li><strong><%= t('plugin.ecommerce.table.phone') %>:</strong> <span> <%= @order.details.phone %></span></li> - </ul> - </div> - <div class="col-md-4"> - <h3><%= t('plugin.ecommerce.billing_address') %></h3> - - <% detail = @order.get_meta("billing_address") %> - <ul class="ec-list-orders-address"> - <li><strong><%= t('plugin.ecommerce.table.name') %>:</strong> <span><%= detail[:first_name] %> <%= detail[:last_name] %></span></li> - <li><strong><%= t('plugin.ecommerce.table.address') %>:</strong> <span><%= detail[:address1] %> <br/> <%= detail[:address2] %> <br/> <%= detail[:city] %> <br/> <%= detail[:state] %> <br/> <%= detail[:zip] %> <br/> <%= detail[:country] %></span></li> - </ul> - </div> - - <div class="col-md-4"> - <h3><%= t('plugin.ecommerce.shipping_address') %></h3> - <% detail = @order.get_meta("shipping_address") %> - <ul class="ec-list-orders-address"> - <li><strong><%= t('plugin.ecommerce.table.name') %>:</strong> <span><%= detail[:first_name] %> <%= detail[:last_name] %></span></li> - <li><strong><%= t('plugin.ecommerce.table.address') %>:</strong> <span><%= detail[:address1] %> <br/> <%= detail[:address2] %> <br/> <%= detail[:city] %> <br/> <%= detail[:state] %> <br/> <%= detail[:zip] %> <br/> <%= detail[:country] %></span></li> - </ul> - </div> - +<div class="panel panel-default"> + <div class="panel-heading"> + <h4><%= t('.title', default: 'Order Details') %>: <%= @order.slug %></h4> </div> - - - <div class="row"> - <div class="col-md-12"> - - <div class="status-bar"> - <div class="bg-bar"></div> - <ul> - <% - approved_accepted = @order.paid? - approved_shipped = false - %> - <li class="received"> - <div class="icon"><i class="fa fa-inbox"></i></div> - <h4><%= t('plugin.ecommerce.order_received') %> - <br/><%= raw @order.the_pay_status %> - </h4> - - <p> on <%= @order.details.received_at %></p> - </li> - <% if approved_accepted %> - <li class="accepted"> - <% - if @order.details.accepted_at.present? - approved_shipped = true - %> - <div class="icon"><i class="fa fa-thumbs-up"></i></div> - <h4><%= t('plugin.ecommerce.order_accepted') %></h4> - - <p> - on <%= @order.details.accepted_at %> - </p> - <% else %> - <%= form_tag(admin_plugins_ecommerce_order_accepted_path(order_id: @order.slug), :method => "post", :class => "form") do %> - <button class="btn btn-success" type="submit"><%= t('plugin.ecommerce.accepted') %> &nbsp;&nbsp; <i class="fa fa-arrow-right"></i></button> - <% end %> - <% end %> - </li> - <% end %> - <% if approved_shipped %> - <li class="shipped"> - <% if @order.details.shipped_at.present? %> - <div class="icon"><i class="fa fa-taxi"></i></div> - <h4><%= t('plugin.ecommerce.order_shipped') %></h4> - - <p>on <%= @order.details.shipped_at %></p> - - <p> - <a href="<%= @order.the_url_tracking %>"><%= t('plugin.ecommerce.url_tracking') %></a> - </p> - <% else %> - <%= form_tag(admin_plugins_ecommerce_order_shipped_path(order_id: @order.slug), :method => "post", :class => "form") do %> - <div class="form-group"> - <input type="text" class="form-control" name="payment[consignment_number]" placeholder="Consignment Number"/> - </div> - <button class="btn btn-info" type="submit"><%= t('plugin.ecommerce.mark_shipped') %></button> - <% end %> - <% end %> - </li> - <% end %> - </ul> - </div> - - </div> + <div class="panel-body"> + <%= render file: plugin_view('front/orders/show'), as_partial: true %> </div> - - <div class="row"> - <div class="col-md-12"> - <h3><%= t('plugin.ecommerce.table.products') %></h3> - <%= render partial: 'plugins/ecommerce/partials/table_order_products', locals: {order: @order} %> - </div> - + <div class="panel-footer"> + <button class="btn btn-default" onclick="history.back()"><%= t('camaleon_cms.admin.button.back') %></button> </div> - - - <div class="row"> - <div class="col-md-12"> - <h3><%= t('plugin.ecommerce.method_shipped') %></h3> - <table class="table"> - <tbody> - <tr> - <th id=""><%= t('plugin.ecommerce.order_shipped') %></th> - <th id=""><%= t('plugin.ecommerce.shipped_date') %></th> - <th id=""><%= t('plugin.ecommerce.table.url_tracking') %></th> - </tr> - <tr> - <td><%= @order.shipping_method.name rescue "#{t('plugin.ecommerce.message.not_shipped_assigned')}" %></td> - <td> <%= @order.details.shipped_at || "#{t('plugin.ecommerce.message.not_shipped')}" %> </td> - <td> <%= @order.the_url_tracking %> </td> - </tr> - </tbody> - </table> - <%#= debug payment %> - </div> - - </div> - - <div class="row"> - <div class="col-md-12"> - <h3><%= t('plugin.ecommerce.payments') %></h3> - <table class="table"> - <tbody> - <tr> - <th id=""><%= t('plugin.ecommerce.table.method') %></th> - <th id=""><%= t('plugin.ecommerce.table.amount') %></th> - <th id=""><%= t('plugin.ecommerce.table.details') %></th> - </tr> - <% payment = @order.get_meta("payment") - details = @order.get_meta("pay_#{payment[:type]}".to_sym) - %> - <tr> - <td><%= @order.payment_method.name rescue "" %></td> - <td><%= current_site.current_unit %> <%= payment[:amount] %></td> - <td><%= raw details.present? ? details.map { |key, value| "<strong>#{key}: </strong> #{value}" }.join("<br>") : "#{t('plugin.ecommerce.table.not_paid')}" %></td> - </tr> - <tr class="bg-primary"> - <td><%= t('plugin.ecommerce.table.total') %></td> - <td><%= current_site.current_unit %> <%= payment[:amount] %></td> - <td></td> - </tr> - </tbody> - </table> - <%#= debug payment %> - </div> - - </div> - - <%#= debug @order.meta %> - <% unless @order.closed? %> - <div class="row"> - <div class="col-md-12 text-center"> - <%= link_to raw('<i class="fa fa-lock"></i> Close order'), admin_plugins_ecommerce_order_closed_path(order_id: @order.slug), method: :post, data: {confirm: t('plugin.ecommerce.message.modal_close_order')}, class: "btn btn-danger cama_ajax_request", title: "#{t('plugin.ecommerce.buttons.close_order')}" unless @order.closed? %> - </div> - </div> - <% end %> - </div> </div>