backend/app/views/comable/admin/draft_orders/index.slim
.comable-page
.comable-page-heading
ul.pull-right.list-inline
li
.btn-group role="group"
= link_to_previous_page @orders, '<', class: 'btn btn-default' do
.btn.btn-default disabled="disabled"
| <
= link_to_next_page @orders, '>', class: 'btn btn-default' do
.btn.btn-default disabled="disabled"
| >
li
= link_to Comable.t('admin.actions.new'), comable.new_admin_draft_order_path, class: 'btn btn-default'
h1.page-header
= Comable.t('admin.nav.draft_order')
small<
| #{@orders.total_count} #{Comable.t('admin.results')}
.comable-page-body
.comable-search
= search_form_for @q, url: comable.admin_draft_orders_path do |f|
.input-group
span.input-group-btn
button.btn.btn-default.dropdown-toggle type="button" data-toggle="dropdown"
i.fa.fa-search
span.caret<
ul.dropdown-menu role="menu"
li
= link_to Comable.t('admin.advanced_search'), 'javascript:void(0)', 'data-toggle' => 'collapse', 'data-target' => '#comable-advanced-search'
li
= link_to Comable.t('admin.clear_search_conditions'), comable.admin_draft_orders_path
= f.text_field :code_cont, class: 'form-control'
span.input-group-btn
= f.submit Comable.t('admin.search'), class: 'btn btn-default'
.hidden
= f.label :user_id
= f.text_field :user_id_eq
= render 'comable/admin/shared/advanced_search', f: f
section
- if @orders.empty?
= Comable.t('admin.not_found')
- else
table.table.table-striped
thead
th
= sort_link [:comable, @q], :code
th
= sort_link [:comable, @q], :state
th
= @orders.klass.human_attribute_name(:payment_state)
th
= @orders.klass.human_attribute_name(:shipment_state)
th
= @orders.klass.human_attribute_name(:bill_full_name)
th
= @orders.klass.human_attribute_name(:order_items)
th
= sort_link [:comable, @q], :total_price
th
= sort_link [:comable, @q], :created_at
tbody
- @orders.each do |order|
tr
td
= link_to order.code, comable.admin_draft_order_path(order)
td
= order.human_state_name
td
= order.payment_human_state_name
td
= order.shipment_human_state_name
td
= order.bill_full_name
td
ul.list-unstyled
- order.order_items.each do |order_item|
li
| #{order_item.name_with_sku} x #{order_item.quantity}
td
= number_to_currency order.total_price
td
= l order.created_at
.text-center
= paginate @orders, theme: :comable_backend