- @page_title = t('workarea.admin.legacy_orders.index.title') .view .view__header .grid.grid--center .grid__cell.grid__cell--50 .view__heading = link_to "↑ #{t('workarea.admin.orders.index.dashboard_link')}", orders_dashboards_path, class: 'view__dashboard-button' %h1= t('workarea.admin.legacy_orders.index.title') .view__container .browsing-controls.browsing-controls--with-divider.browsing-controls--center{ class: ('browsing-controls--filters-displayed' unless @search.toggle_facets?) } = form_tag legacy_orders_path, method: 'get', class: 'browsing-controls__form' do = facet_hidden_inputs(@search.facets) .browsing-controls__sort .property.property--inline = label_tag 'sort', t('workarea.admin.search.sort_by'), class: 'property__name' = select_tag :sort, options_for_select(@search.sorts, selected: @search.sort), data: { form_submitting_control: '' } .browsing-controls__search .search-form = text_field_tag :q, params[:q], class: 'search-form__input', id: 'search_legacy_orders', title: t('workarea.admin.search.keywords'), placeholder: t('workarea.admin.search.keywords') = submit_tag 'search_legacy_orders', class: 'search-form__button' .browsing-controls__filter.browsing-controls__filter--date %button.browsing-controls__filter-button{ type: 'button', data: { filter_dropdown: "#filters-dropdown-date-placed" } } = t('workarea.admin.orders.index.filters.order_placed') = inline_svg('workarea/admin/icons/calendar.svg', class: 'browsing-controls__filter-button-icon svg-icon svg-icon--small') #filters-dropdown-date.browsing-controls__filter-dropdown.tooltip-content .grid .grid__cell.grid__cell--50 .property.property--inline -# TODO v4 rename to placed_at_starts_at, unify globally with partial = label_tag 'placed_at_greater_than', t('workarea.admin.orders.index.filters.placed_date'), class: 'property__name' = datetime_picker_tag 'placed_at_greater_than', params[:placed_at_greater_than], class: 'text-box', placeholder: 'Start Date', data: { datepicker_field: { inline: true }, datepicker_field_starts_at: '' } .grid__cell.grid__cell--50 .property.property--inline -# TODO v4 rename to placed_at_ends_at = datetime_picker_tag 'placed_at_less_than', params[:placed_at_less_than], class: 'text-box', placeholder: 'End Date', data: { datepicker_field: { inline: true }, datepicker_field_ends_at: '' } .browsing-controls__filter-dropdown-submit .grid.grid--auto.grid--middle.grid--center .grid__cell= label_tag 'quick_range', t('workarea.admin.date_selector.or_choose') .grid__cell= select_tag 'quick_range', options_for_select(date_selector_quick_range_options) .grid__cell= t('workarea.admin.date_selector.and') .grid__cell= submit_tag t('workarea.admin.search.submit'), name: 'filter_by_creation_date', class: 'button button--small' .browsing-controls__filter.browsing-controls__filter--price %button.browsing-controls__filter-button{ type: 'button', data: { filter_dropdown: "#filters-dropdown-price" } } = t('workarea.admin.orders.index.filters.price_range') = inline_svg('workarea/admin/icons/prices.svg', class: 'browsing-controls__filter-button-icon svg-icon svg-icon--small') #filters-dropdown-price.browsing-controls__filter-dropdown .grid.grid--auto .grid__cell .property .grid.grid--auto.grid--middle .grid__cell= label_tag 'total_price_greater_than', currency_symbol, class: 'property__name' .grid__cell= text_field_tag 'total_price_greater_than', params[:total_price_greater_than], class: 'text-box text-box--small', title: 'Total Price Min', placeholder: 'Min', pattern: '\d*\.?\d*' .grid__cell .property .grid.grid--auto.grid--middle .grid__cell= label_tag 'total_price_less_than', currency_symbol, class: 'property__name' .grid__cell= text_field_tag 'total_price_less_than', params[:total_price_less_than], class: 'text-box text-box--small', title: 'Total Price Max', placeholder: 'Max', pattern: '\d*\.?\d*' .grid_cell = button_tag t('workarea.admin.search.submit'), value: 'search', class: 'button' - if @search.facets.present? - @search.facets.each do |facet| = render "workarea/admin/facets/#{facet.type}", facet: facet - if @search.toggle_facets? .browsing-controls__toggle-filters %button.text-button{ type: 'button', data: { toggle_filters: '' } }= t('workarea.admin.search.show_filters') = render 'workarea/admin/facets/applied', search: @search, reset_path: legacy_orders_path .browsing-controls__count= pluralize(@search.total, t('workarea.admin.orders.index.summary.results')) - if @search.results.any? %table.index-table %thead %tr %th.index-table__control-cell .checkbox = check_box_tag 'select_all', nil, false, id: 'select_all', class: 'checkbox__input', data: { bulk_action_select_all: '' } = label_tag 'select_all', t('workarea.admin.bulk_actions.select_all'), class: 'checkbox__label' %th= t('workarea.admin.fields.id') %th= t('workarea.admin.fields.email') %th= t('workarea.admin.fields.total_price') %th= t('workarea.admin.fields.status') %th.align-right= t('workarea.admin.fields.placed_at') %th= t('workarea.admin.fields.updated_at') %tbody - @search.results.each do |result| %tr %td.index-table__control-cell .checkbox = check_box_tag 'global_id', result.to_gid_param, false, class: 'checkbox__input', id: dom_id(result), data: { bulk_action_item: '' } = label_tag dom_id(result), '', class: 'checkbox__label', title: t('workarea.admin.bulk_actions.add_summary_button') %td= link_to result.id, legacy_order_path(result) %td= result.email %td= number_to_currency result.total_price %td= result.status.to_s.titleize %td.align-right - if result.placed? = local_time_ago(result.placed_at) - else \- %td= local_time_ago(result.updated_at) - if @search.results.total_pages > 1 = render 'workarea/admin/shared/pagination', collection: @search.results .workflow-bar .grid .grid__cell = render 'workarea/admin/shared/bulk_actions', klass: Workarea::LegacyOrder, search: @search, bulk_delete: false