Commit 6f86aa72 authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Admin user search: Add wildcards to name search automatically and in the background

parent 1b0e306b
Pipeline #1176 passed with stages
in 23 minutes and 50 seconds
...@@ -1488,7 +1488,7 @@ impl MedalConnection for Connection { ...@@ -1488,7 +1488,7 @@ impl MedalConnection for Connection {
AND lastname ILIKE $2 AND lastname ILIKE $2
ORDER BY id DESC ORDER BY id DESC
LIMIT 30"; LIMIT 30";
Ok(self.query_map_many(query, &[&firstname, &lastname], |row| { Ok(self.query_map_many(query, &[&format!("%{}%", firstname), &format!("%{}%", lastname)], |row| {
(row.get(0), row.get(1), row.get(2), row.get(3), row.get(4), row.get(5)) (row.get(0), row.get(1), row.get(2), row.get(3), row.get(4), row.get(5))
}) })
.unwrap()) .unwrap())
......
...@@ -1607,7 +1607,7 @@ impl MedalConnection for Connection { ...@@ -1607,7 +1607,7 @@ impl MedalConnection for Connection {
AND lastname ILIKE $2 AND lastname ILIKE $2
ORDER BY id DESC ORDER BY id DESC
LIMIT 30"; LIMIT 30";
Ok(self.query_map_many(query, &[&firstname, &lastname], |row| { Ok(self.query_map_many(query, &[&format!("%{}%", firstname), &format!("%{}%", lastname)], |row| {
(row.get(0), row.get(1), row.get(2), row.get(3), row.get(4), row.get(5)) (row.get(0), row.get(1), row.get(2), row.get(3), row.get(4), row.get(5))
}) })
.unwrap()) .unwrap())
......
...@@ -1607,7 +1607,7 @@ impl MedalConnection for Connection { ...@@ -1607,7 +1607,7 @@ impl MedalConnection for Connection {
AND lastname LIKE ?2 AND lastname LIKE ?2
ORDER BY id DESC ORDER BY id DESC
LIMIT 30"; LIMIT 30";
Ok(self.query_map_many(query, &[&firstname, &lastname], |row| { Ok(self.query_map_many(query, &[&format!("%{}%", firstname), &format!("%{}%", lastname)], |row| {
(row.get(0), row.get(1), row.get(2), row.get(3), row.get(4), row.get(5)) (row.get(0), row.get(1), row.get(2), row.get(3), row.get(4), row.get(5))
}) })
.unwrap()) .unwrap())
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<p> <p>
<form action="/admin/user/" method="post"> <form action="/admin/user/" method="post">
Vorname:<br> Vorname:<br>
<input type="text" name="firstname" value="%"> <input type="text" name="firstname">
<br> <br>
Nachname:<br> Nachname:<br>
<input type="text" name="lastname" autofocus> <input type="text" name="lastname" autofocus>
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</p> </p>
<h2>Wettbewerbs-Export</h2> <h2>Wettbewerbs-Export</h2>
<a href="/admin/contest/">Wettbewerbsübersicht</a> <a href="/admin/contest/">Wettbewerbsübersicht und -export</a>
<h2>Datenbankstatus</h2> <h2>Datenbankstatus</h2>
{{#if dbstatus_secret}} {{#if dbstatus_secret}}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment