mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-03 19:31:02 +01:00
Restore Maniphest to use comma-style lists for subscribers, projects
Summary: D4153 made these render with newlines between items; use commas instead. Test Plan: {F26950} Reviewers: btrahan, chad, vrana Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D4162
This commit is contained in:
parent
a4d2af4ab3
commit
03a1148480
2 changed files with 23 additions and 4 deletions
|
@ -235,12 +235,31 @@ abstract class PhabricatorController extends AphrontController {
|
|||
->loadHandles();
|
||||
}
|
||||
|
||||
protected function renderHandlesForPHIDs(array $phids) {
|
||||
|
||||
/**
|
||||
* Render a list of links to handles, identified by PHIDs. The handles must
|
||||
* already be loaded.
|
||||
*
|
||||
* @param list<phid> List of PHIDs to render links to.
|
||||
* @param string Style, one of "\n" (to put each item on its own line)
|
||||
* or "," (to list items inline, separated by commas).
|
||||
* @return string Rendered list of handle links.
|
||||
*/
|
||||
protected function renderHandlesForPHIDs(array $phids, $style = "\n") {
|
||||
$style_map = array(
|
||||
"\n" => '<br />',
|
||||
',' => ', ',
|
||||
);
|
||||
|
||||
if (empty($style_map[$style])) {
|
||||
throw new Exception("Unknown handle list style '{$style}'!");
|
||||
}
|
||||
|
||||
$items = array();
|
||||
foreach ($phids as $phid) {
|
||||
$items[] = $this->getHandle($phid)->renderLink();
|
||||
}
|
||||
return implode('<br />', $items);
|
||||
return implode($style_map[$style], $items);
|
||||
}
|
||||
|
||||
protected function buildApplicationMenu() {
|
||||
|
|
|
@ -445,7 +445,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
|
|||
$view->addProperty(
|
||||
pht('Subscribers'),
|
||||
$task->getCCPHIDs()
|
||||
? $this->renderHandlesForPHIDs($task->getCCPHIDs())
|
||||
? $this->renderHandlesForPHIDs($task->getCCPHIDs(), ',')
|
||||
: '<em>'.pht('None').'</em>');
|
||||
|
||||
$view->addProperty(
|
||||
|
@ -468,7 +468,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
|
|||
$view->addProperty(
|
||||
pht('Projects'),
|
||||
$task->getProjectPHIDs()
|
||||
? $this->renderHandlesForPHIDs($task->getProjectPHIDs())
|
||||
? $this->renderHandlesForPHIDs($task->getProjectPHIDs(), ',')
|
||||
: '<em>'.pht('None').'</em>');
|
||||
|
||||
foreach ($aux_fields as $aux_field) {
|
||||
|
|
Loading…
Reference in a new issue