Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
archery
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
archery
Commits
21d75827
Commit
21d75827
authored
Nov 12, 2014
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added number of matches to users overview
parent
1d768fd2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
templates/user/list.latte
templates/user/list.latte
+3
-0
util.php
util.php
+4
-4
No files found.
templates/user/list.latte
View file @
21d75827
...
@@ -9,13 +9,16 @@
...
@@ -9,13 +9,16 @@
<th>#</th>
<th>#</th>
<th>{_'Username'}</th>
<th>{_'Username'}</th>
<th>{_'Role'}</th>
<th>{_'Role'}</th>
<th>{_'Matches'}</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr n:foreach="$users as $user" data-href="user/{$user->id}">
<tr n:foreach="$users as $user" data-href="user/{$user->id}">
{var $h = new UserHelper($user)}
<td>{$user->id}</td>
<td>{$user->id}</td>
<td>{$user->username}</td>
<td>{$user->username}</td>
<td>{_$user->role}</td>
<td>{_$user->role}</td>
<td>{$h->numberOfMatches()}</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
...
...
util.php
View file @
21d75827
...
@@ -112,10 +112,10 @@ class UserHelper {
...
@@ -112,10 +112,10 @@ class UserHelper {
$this
->
user
=
$dbuser
;
$this
->
user
=
$dbuser
;
}
}
public
function
numberOfMatches
(
$discipline
)
{
public
function
numberOfMatches
(
$discipline
=
null
)
{
return
$this
->
user
->
related
(
'match'
)
$q
=
$this
->
user
->
related
(
'match'
);
->
where
(
'discipline'
,
$discipline
)
$discipline
&&
$q
->
where
(
'discipline'
,
$discipline
);
->
count
();
return
$q
->
count
();
}
}
public
function
averageMatchScore
(
$discipline
)
{
public
function
averageMatchScore
(
$discipline
)
{
...
...
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