Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move users search form above table #2094

Merged
merged 1 commit into from
Jul 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions backend/app/views/spree/admin/users/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<% admin_breadcrumb(plural_resource_name(Spree::LegacyUser)) %>


<% content_for :page_actions do %>
<% if can?(:admin, Spree.user_class) && can?(:create, Spree.user_class) %>
<li>
Expand All @@ -9,10 +8,29 @@
<% end %>
<% end %>

<% content_for :table_filter_title do %>
<%= Spree.t(:search) %>
<% end %>

<% content_for :table_filter do %>
<div data-hook="admin_users_index_search">
<%= search_form_for [:admin, @search], url: admin_users_url do |f| %>
<div class="form-group">
<%= f.label :email_cont, Spree.t(:email) %>
<%= f.text_field :email_cont, class: "form-control" %>
</div>

<div class="actions filter-actions" data-hook="admin_users_index_search_buttons">
<%= button Spree.t(:search) %>
</div>
<% end %>
</div>
<% end %>

<table class="index" id="listing_users" data-hook>
<colgroup>
<col style="width: 85%">
<col style="width: 15%">
<col style="width: 90%">
<col style="width: 10%">
</colgroup>
<thead>
<tr data-hook="admin_users_index_headers">
Expand All @@ -38,21 +56,3 @@
</table>

<%= paginate @users, theme: "solidus_admin" %>

<% content_for :sidebar_title do %>
<%= Spree.t(:search) %>
<% end %>

<% content_for :sidebar do %>
<div class="box align-center" data-hook="admin_users_index_search">
<%= search_form_for [:admin, @search], url: admin_users_url do |f| %>
<div class="field">
<%= f.label :email_cont, Spree.t(:email) %> <br>
<%= f.text_field :email_cont, class: 'fullwidth' %>
</div>
<div data-hook="admin_users_index_search_buttons">
<%= button Spree.t(:search) %>
</div>
<% end %>
</div>
<% end %>