- @page_title = t('workarea.admin.users.index.title') .view .view__header .grid.grid--middle.grid--center .grid__cell.grid__cell--50 .view__heading = link_to "↑ #{t('workarea.admin.users.index.dashboard_link')}", people_dashboards_path, class: 'view__dashboard-button' %h1= t('workarea.admin.users.index.title') .view__container .browsing-controls.browsing-controls--with-divider.browsing-controls--center{ class: ('browsing-controls--filters-displayed' unless @search.toggle_facets?) } = form_tag users_path, method: 'get', id: 'user_search_form', 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_products', title: t('workarea.admin.search.keywords'), placeholder: t('workarea.admin.search.keywords') = submit_tag 'search_users', class: 'search-form__button' = render 'workarea/admin/shared/creation_date', search: @search, form_path: users_path - 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: users_path %p.browsing-controls__count{ data: { browsing_controls_count: @search.total } } = t('workarea.admin.users.index.user_pluralize', count: @search.total) - 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.avatar') %th= t('workarea.admin.fields.email') %th= t('workarea.admin.fields.name') %th.align-center= t('workarea.admin.fields.orders') %th.align-right= t('workarea.admin.fields.spent') %th= t('workarea.admin.fields.created_at') = append_partials('admin.user_table_columns') %tbody - @search.results.each do |result| %tr.index-table__row %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.index-table__image-cell = link_to user_path(result), class: 'index-table__image-link' do = avatar_for result, 'index-table__image avatar--large' %td = link_to result.email, user_path(result) = upcoming_changesets_icon_for(result) = comments_icon_for(result) = admin_icon_for(result) %td #{result.first_name} #{result.last_name} %td.align-center= number_with_delimiter result.insights.orders %td.align-right= number_to_currency(result.insights.revenue) %td= local_time_ago(result.created_at) = append_partials('admin.user_table_values', user: result) - if @search.results.total_pages > 1 = render 'workarea/admin/shared/pagination', collection: @search.results .workflow-bar .grid .grid__cell.grid__cell--50 = render 'workarea/admin/shared/bulk_actions', klass: Workarea::User, search: @search, bulk_delete: false .grid__cell.grid__cell--50 .grid.grid--auto.grid--right - if admin_browsing_as_guest? .grid__cell = form_tag guest_browsing_path, method: 'delete', data: { disable_delete_confirmation: '' } do = button_tag t('workarea.admin.users.index.stop_guest_browsing'), class: 'workflow-bar__button workflow-bar__button--delete' - else .grid__cell= link_to t('workarea.admin.users.index.browse_as_guest'), guest_browsing_path, class: 'workflow-bar__button', data: { method: :post } .grid__cell = link_to t('workarea.admin.users.index.add_new'), create_users_path, class: 'workflow-bar__button workflow-bar__button--create'