Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bwinf
medal
Commits
6f86aa72
Commit
6f86aa72
authored
Mar 19, 2021
by
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
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
src/db_conn.base.rs
View file @
6f86aa72
...
...
@@ -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
())
...
...
src/db_conn_postgres.rs
View file @
6f86aa72
...
...
@@ -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
())
...
...
src/db_conn_sqlite_new.rs
View file @
6f86aa72
...
...
@@ -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
())
...
...
templates/default/admin.hbs
View file @
6f86aa72
...
...
@@ -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
}}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment