1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 13:30:55 +01:00

Remove "Flags" from homepage

Summary: Flags have a large red count on the homepage now, which I think is a sufficient reminder of flagged stuff. This element was nice at first to raise awareness of the app, but it's fairly well integrated now and enjoys moderate use. This is also a sort of feeler for how much people use it / the homepage in general.

Test Plan: Looked at homepage, no flags.

Reviewers: chad, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4479
This commit is contained in:
epriestley 2013-01-16 15:06:19 -08:00
parent 99847da3aa
commit 482f6ea56b

View file

@ -39,8 +39,6 @@ final class PhabricatorDirectoryMainController
$tasks_panel = null;
}
$flagged_panel = $this->buildFlaggedPanel();
$jump_panel = $this->buildJumpPanel();
$revision_panel = $this->buildRevisionPanel();
$audit_panel = $this->buildAuditPanel();
@ -52,7 +50,6 @@ final class PhabricatorDirectoryMainController
$triage_panel,
$revision_panel,
$tasks_panel,
$flagged_panel,
$audit_panel,
$commit_panel,
);
@ -121,44 +118,6 @@ final class PhabricatorDirectoryMainController
return $panel;
}
private function buildFlaggedPanel() {
$user = $this->getRequest()->getUser();
$flag_query = id(new PhabricatorFlagQuery())
->setViewer($user)
->withOwnerPHIDs(array($user->getPHID()))
->needHandles(true)
->setLimit(10);
$flags = $flag_query->execute();
if (!$flags) {
return $this->renderMiniPanel(
'No Flags',
"You haven't flagged anything.");
}
$panel = new AphrontPanelView();
$panel->setHeader('Flagged Objects');
$panel->setCaption("Objects you've flagged.");
$flag_view = new PhabricatorFlagListView();
$flag_view->setFlags($flags);
$flag_view->setUser($user);
$panel->appendChild($flag_view);
$panel->addButton(
phutil_render_tag(
'a',
array(
'href' => '/flag/',
'class' => 'grey button',
),
"View All Flags \xC2\xBB"));
return $panel;
}
private function buildNeedsTriagePanel(array $projects) {
assert_instances_of($projects, 'PhabricatorProject');