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

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 {
AND lastname ILIKE $2
ORDER BY id DESC
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))
})
.unwrap())
......
......@@ -1607,7 +1607,7 @@ impl MedalConnection for Connection {
AND lastname ILIKE $2
ORDER BY id DESC
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))
})
.unwrap())
......
......@@ -1607,7 +1607,7 @@ impl MedalConnection for Connection {
AND lastname LIKE ?2
ORDER BY id DESC
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))
})
.unwrap())
......
......@@ -6,7 +6,7 @@
<p>
<form action="/admin/user/" method="post">
Vorname:<br>
<input type="text" name="firstname" value="%">
<input type="text" name="firstname">
<br>
Nachname:<br>
<input type="text" name="lastname" autofocus>
......@@ -52,7 +52,7 @@
</p>
<h2>Wettbewerbs-Export</h2>
<a href="/admin/contest/">Wettbewerbsübersicht</a>
<a href="/admin/contest/">Wettbewerbsübersicht und -export</a>
<h2>Datenbankstatus</h2>
{{#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