mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Show co-maintainers next to maintainers in details
Implements FS#45313. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
a2f79eb2e1
commit
fb42ec696c
3 changed files with 29 additions and 2 deletions
|
@ -196,6 +196,31 @@ function html_format_username($username) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format the maintainer and co-maintainers for inclusion in HTML data
|
||||||
|
*
|
||||||
|
* @param string $maintainer The user name of the maintainer
|
||||||
|
* @param array $comaintainers The list of co-maintainer user names
|
||||||
|
*
|
||||||
|
* @return string The generated HTML code for the account links
|
||||||
|
*/
|
||||||
|
function html_format_maintainers($maintainer, $comaintainers) {
|
||||||
|
$code = html_format_username($maintainer);
|
||||||
|
|
||||||
|
if (count($comaintainers) > 0) {
|
||||||
|
$code .= ' (';
|
||||||
|
foreach ($comaintainers as $comaintainer) {
|
||||||
|
$code .= html_format_username($comaintainer);
|
||||||
|
if ($comaintainer !== end($comaintainers)) {
|
||||||
|
$code .= ', ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$code .= ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $code;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine the user's e-mail address in the database using a session ID
|
* Determine the user's e-mail address in the database using a session ID
|
||||||
*
|
*
|
||||||
|
|
|
@ -15,6 +15,7 @@ $keywords = pkgbase_get_keywords($base_id);
|
||||||
|
|
||||||
$submitter = username_from_id($row["SubmitterUID"]);
|
$submitter = username_from_id($row["SubmitterUID"]);
|
||||||
$maintainer = username_from_id($row["MaintainerUID"]);
|
$maintainer = username_from_id($row["MaintainerUID"]);
|
||||||
|
$comaintainers = pkgbase_get_comaintainers($base_id);
|
||||||
$packager = username_from_id($row["PackagerUID"]);
|
$packager = username_from_id($row["PackagerUID"]);
|
||||||
|
|
||||||
$votes = $row['NumVotes'];
|
$votes = $row['NumVotes'];
|
||||||
|
@ -293,7 +294,7 @@ if (has_credential(CRED_PKGBASE_SET_KEYWORDS, array($row["MaintainerUID"]))):
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= __('Maintainer') .': ' ?></th>
|
<th><?= __('Maintainer') .': ' ?></th>
|
||||||
<td><?= html_format_username($maintainer) ?></td>
|
<td><?= html_format_maintainers($maintainer, $comaintainers) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= __('Last Packager') .': ' ?></th>
|
<th><?= __('Last Packager') .': ' ?></th>
|
||||||
|
|
|
@ -14,6 +14,7 @@ $keywords = pkgbase_get_keywords($base_id);
|
||||||
|
|
||||||
$submitter = username_from_id($row["SubmitterUID"]);
|
$submitter = username_from_id($row["SubmitterUID"]);
|
||||||
$maintainer = username_from_id($row["MaintainerUID"]);
|
$maintainer = username_from_id($row["MaintainerUID"]);
|
||||||
|
$comaintainers = pkgbase_get_comaintainers($base_id);
|
||||||
$packager = username_from_id($row["PackagerUID"]);
|
$packager = username_from_id($row["PackagerUID"]);
|
||||||
|
|
||||||
$votes = $row['NumVotes'];
|
$votes = $row['NumVotes'];
|
||||||
|
@ -152,7 +153,7 @@ if (has_credential(CRED_PKGBASE_SET_KEYWORDS, array($row["MaintainerUID"]))):
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= __('Maintainer') .': ' ?></th>
|
<th><?= __('Maintainer') .': ' ?></th>
|
||||||
<td><?= html_format_username($maintainer) ?></td>
|
<td><?= html_format_maintainers($maintainer, $comaintainers) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= __('Last Packager') .': ' ?></th>
|
<th><?= __('Last Packager') .': ' ?></th>
|
||||||
|
|
Loading…
Add table
Reference in a new issue