]> git.openstreetmap.org Git - rails.git/commitdiff
Add found users count to users page
authorAnton Khorev <tony29@yandex.ru>
Tue, 26 Mar 2024 02:19:46 +0000 (05:19 +0300)
committerAnton Khorev <tony29@yandex.ru>
Tue, 26 Mar 2024 02:44:35 +0000 (05:44 +0300)
app/controllers/users_controller.rb
app/views/users/index.html.erb
config/locales/en.yml

index b9f1af807f7e09ede8fc1eeea3865cf8736a6f52..c55a177b48bdb0529f08c4d174da56d64ca5ce81 100644 (file)
@@ -36,6 +36,7 @@ class UsersController < ApplicationController
       users = users.where(:status => @params[:status]) if @params[:status]
       users = users.where(:creation_ip => @params[:ip]) if @params[:ip]
 
+      @users_count = users.count
       @users, @newer_users_id, @older_users_id = get_page_items(users, :limit => 50)
     end
   end
index 22a916c8bb0b0a793ceb1287bb9d63a4ed80dd8b..e8031900f8a1f12201e2a3c143fcd901c0bc2176 100644 (file)
 
 <% unless @users.empty? %>
   <%= form_tag do %>
-    <%= render "shared/pagination",
-               :newer_key => "users.index.newer",
-               :older_key => "users.index.older",
-               :newer_id => @newer_users_id,
-               :older_id => @older_users_id %>
+    <div class="row">
+      <div class="col">
+        <%= render "shared/pagination",
+                   :newer_key => "users.index.newer",
+                   :older_key => "users.index.older",
+                   :newer_id => @newer_users_id,
+                   :older_id => @older_users_id %>
+      </div>
+      <div class="col col-auto">
+        <%= t ".found_users", :count => @users_count %>
+      </div>
+    <div>
 
     <%= hidden_field_tag :status, params[:status] if params[:status] %>
     <%= hidden_field_tag :ip, params[:ip] if params[:ip] %>
       <%= render @users %>
     </table>
 
-    <%= render "shared/pagination",
-               :newer_key => "users.index.newer",
-               :older_key => "users.index.older",
-               :newer_id => @newer_users_id,
-               :older_id => @older_users_id %>
+    <div class="row">
+      <div class="col">
+        <%= render "shared/pagination",
+                   :newer_key => "users.index.newer",
+                   :older_key => "users.index.older",
+                   :newer_id => @newer_users_id,
+                   :older_id => @older_users_id %>
+      </div>
+      <div class="col col-auto">
+        <%= t ".found_users", :count => @users_count %>
+      </div>
+    <div>
 
     <div>
       <%= submit_tag t(".confirm"), :name => "confirm", :class => "btn btn-primary" %>
index a173a7e4f5ae714e8d929c9c154cf2a763fd73d1..ec5e544425e28081f322c0fb8337386537fedc9e 100644 (file)
@@ -2834,6 +2834,9 @@ en:
       heading: Users
       older: "Older Users"
       newer: "Newer Users"
+      found_users:
+        one: "%{count} user found"
+        other: "%{count} users found"
       summary_html: "%{name} created from %{ip_address} on %{date}"
       summary_no_ip_html: "%{name} created on %{date}"
       confirm: Confirm Selected Users