2011-01-16 13:51:39 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/*
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
* Copyright 2012 Facebook, Inc.
|
2011-01-16 13:51:39 -08:00
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
*
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
|
* limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
|
2012-03-09 15:46:25 -08:00
|
|
|
final class PhabricatorDirectoryMainController
|
2011-01-22 17:48:55 -08:00
|
|
|
extends PhabricatorDirectoryController {
|
2011-01-16 13:51:39 -08:00
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
private $filter;
|
2012-02-21 15:10:11 -08:00
|
|
|
private $subfilter;
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
2012-02-15 17:48:14 -08:00
|
|
|
public function willProcessRequest(array $data) {
|
|
|
|
|
$this->filter = idx($data, 'filter');
|
2012-02-21 15:10:11 -08:00
|
|
|
$this->subfilter = idx($data, 'subfilter');
|
2012-02-15 17:48:14 -08:00
|
|
|
}
|
|
|
|
|
|
2011-01-16 13:51:39 -08:00
|
|
|
public function processRequest() {
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
|
2012-02-15 17:48:14 -08:00
|
|
|
$nav = $this->buildNav();
|
|
|
|
|
$this->filter = $nav->selectFilter($this->filter, 'home');
|
|
|
|
|
|
2012-02-15 17:49:23 -08:00
|
|
|
switch ($this->filter) {
|
|
|
|
|
case 'jump':
|
Hard-code and unify "more applications" in Phabricator
Summary:
This is mostly intended to simplify D2323.
We currently allow users to edit and customize the links on the homepage, but as far as I know no one actually does this (no one complained when we redid the homepage earlier this year) and it creates a lot of mess in the database patches and quickstart dump. After D2331, this is the only data we load in the patch files. The patch files are also a mess with respect to this data and have various different versions of it.
Also the current UI is just kind of bad, it stretches stuff across too many screens and is generally ungood. Nuking this lets us nuke a lot of code in general.
(In the long term, I think we'll move toward an "application" model anyway, and this stuff will go away sooner or later.)
I'll add a drop-database patch some time later, just in case anyone does actually use this, so they can get their data out of MySQL.
Test Plan: Looked at home page, clicked "More Stuff", got a single list of other apps/things.
Reviewers: btrahan, vrana, edward, jungejason
Reviewed By: jungejason
CC: aran
Maniphest Tasks: T345
Differential Revision: https://secure.phabricator.com/D2332
2012-04-28 07:17:38 -07:00
|
|
|
case 'apps':
|
2012-02-15 17:49:23 -08:00
|
|
|
break;
|
|
|
|
|
case 'home':
|
|
|
|
|
case 'feed':
|
|
|
|
|
$project_query = new PhabricatorProjectQuery();
|
2012-08-08 17:10:10 -07:00
|
|
|
$project_query->setViewer($user);
|
2012-08-07 11:54:24 -07:00
|
|
|
$project_query->withMemberPHIDs(array($user->getPHID()));
|
2012-02-15 17:49:23 -08:00
|
|
|
$projects = $project_query->execute();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
throw new Exception("Unknown filter '{$this->filter}'!");
|
|
|
|
|
}
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
2012-02-15 17:48:14 -08:00
|
|
|
switch ($this->filter) {
|
|
|
|
|
case 'feed':
|
|
|
|
|
return $this->buildFeedResponse($nav, $projects);
|
2012-02-15 17:49:23 -08:00
|
|
|
case 'jump':
|
|
|
|
|
return $this->buildJumpResponse($nav);
|
Hard-code and unify "more applications" in Phabricator
Summary:
This is mostly intended to simplify D2323.
We currently allow users to edit and customize the links on the homepage, but as far as I know no one actually does this (no one complained when we redid the homepage earlier this year) and it creates a lot of mess in the database patches and quickstart dump. After D2331, this is the only data we load in the patch files. The patch files are also a mess with respect to this data and have various different versions of it.
Also the current UI is just kind of bad, it stretches stuff across too many screens and is generally ungood. Nuking this lets us nuke a lot of code in general.
(In the long term, I think we'll move toward an "application" model anyway, and this stuff will go away sooner or later.)
I'll add a drop-database patch some time later, just in case anyone does actually use this, so they can get their data out of MySQL.
Test Plan: Looked at home page, clicked "More Stuff", got a single list of other apps/things.
Reviewers: btrahan, vrana, edward, jungejason
Reviewed By: jungejason
CC: aran
Maniphest Tasks: T345
Differential Revision: https://secure.phabricator.com/D2332
2012-04-28 07:17:38 -07:00
|
|
|
case 'apps':
|
|
|
|
|
return $this->buildAppsResponse($nav);
|
2012-02-15 17:48:14 -08:00
|
|
|
default:
|
|
|
|
|
return $this->buildMainResponse($nav, $projects);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2012-04-03 12:10:45 -07:00
|
|
|
private function buildMainResponse($nav, array $projects) {
|
|
|
|
|
assert_instances_of($projects, 'PhabricatorProject');
|
|
|
|
|
|
2012-02-17 16:08:35 -08:00
|
|
|
if (PhabricatorEnv::getEnvConfig('maniphest.enabled')) {
|
|
|
|
|
$unbreak_panel = $this->buildUnbreakNowPanel();
|
|
|
|
|
$triage_panel = $this->buildNeedsTriagePanel($projects);
|
|
|
|
|
$tasks_panel = $this->buildTasksPanel();
|
|
|
|
|
} else {
|
|
|
|
|
$unbreak_panel = null;
|
|
|
|
|
$triage_panel = null;
|
|
|
|
|
$tasks_panel = null;
|
|
|
|
|
}
|
2012-02-27 09:48:18 -08:00
|
|
|
|
2012-03-27 16:22:40 -07:00
|
|
|
$flagged_panel = $this->buildFlaggedPanel();
|
|
|
|
|
|
2012-02-15 17:49:23 -08:00
|
|
|
$jump_panel = $this->buildJumpPanel();
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$revision_panel = $this->buildRevisionPanel();
|
2012-02-27 13:14:32 -08:00
|
|
|
$app_panel = $this->buildAppPanel();
|
2012-02-27 09:48:18 -08:00
|
|
|
$audit_panel = $this->buildAuditPanel();
|
2012-02-28 21:10:39 -08:00
|
|
|
$commit_panel = $this->buildCommitPanel();
|
2011-01-25 11:31:40 -08:00
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$content = array(
|
2012-02-27 13:14:32 -08:00
|
|
|
$app_panel,
|
|
|
|
|
$jump_panel,
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$unbreak_panel,
|
|
|
|
|
$triage_panel,
|
|
|
|
|
$revision_panel,
|
|
|
|
|
$tasks_panel,
|
2012-03-27 16:22:40 -07:00
|
|
|
$flagged_panel,
|
2012-02-27 09:48:18 -08:00
|
|
|
$audit_panel,
|
2012-02-28 21:10:39 -08:00
|
|
|
$commit_panel,
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$nav->appendChild($content);
|
|
|
|
|
|
|
|
|
|
return $this->buildStandardPageResponse(
|
|
|
|
|
$nav,
|
|
|
|
|
array(
|
2012-02-15 17:48:14 -08:00
|
|
|
'title' => 'Phabricator',
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-15 17:49:23 -08:00
|
|
|
private function buildJumpResponse($nav) {
|
|
|
|
|
$request = $this->getRequest();
|
|
|
|
|
|
2012-07-23 17:41:46 -07:00
|
|
|
$jump = $request->getStr('jump');
|
|
|
|
|
|
|
|
|
|
$response = PhabricatorJumpNavHandler::jumpPostResponse($jump);
|
|
|
|
|
if ($response) {
|
|
|
|
|
return $response;
|
|
|
|
|
} else if ($request->isFormPost()) {
|
|
|
|
|
$query = new PhabricatorSearchQuery();
|
|
|
|
|
$query->setQuery($jump);
|
|
|
|
|
$query->save();
|
|
|
|
|
|
|
|
|
|
return id(new AphrontRedirectResponse())
|
|
|
|
|
->setURI('/search/'.$query->getQueryKey().'/');
|
2012-02-15 17:49:23 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2012-07-23 17:41:46 -07:00
|
|
|
$nav->appendChild($this->buildJumpPanel($jump));
|
2012-02-15 17:49:23 -08:00
|
|
|
return $this->buildStandardPageResponse(
|
|
|
|
|
$nav,
|
|
|
|
|
array(
|
|
|
|
|
'title' => 'Jump Nav',
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
2012-04-03 12:10:45 -07:00
|
|
|
private function buildFeedResponse($nav, array $projects) {
|
|
|
|
|
assert_instances_of($projects, 'PhabricatorProject');
|
2012-02-21 15:10:11 -08:00
|
|
|
|
|
|
|
|
$subnav = new AphrontSideNavFilterView();
|
|
|
|
|
$subnav->setBaseURI(new PhutilURI('/feed/'));
|
|
|
|
|
|
|
|
|
|
$subnav->addFilter('all', 'All Activity', '/feed/');
|
|
|
|
|
$subnav->addFilter('projects', 'My Projects');
|
|
|
|
|
|
2012-04-07 17:25:24 -07:00
|
|
|
$nav->appendChild($subnav);
|
|
|
|
|
|
2012-02-21 15:10:11 -08:00
|
|
|
$filter = $subnav->selectFilter($this->subfilter, 'all');
|
|
|
|
|
|
|
|
|
|
switch ($filter) {
|
|
|
|
|
case 'all':
|
2012-04-07 17:25:24 -07:00
|
|
|
$view = $this->buildFeedView(array());
|
2012-02-21 15:10:11 -08:00
|
|
|
break;
|
|
|
|
|
case 'projects':
|
2012-04-07 17:25:24 -07:00
|
|
|
if ($projects) {
|
|
|
|
|
$phids = mpull($projects, 'getPHID');
|
|
|
|
|
$view = $this->buildFeedView($phids);
|
|
|
|
|
} else {
|
|
|
|
|
$view = new AphrontErrorView();
|
|
|
|
|
$view->setSeverity(AphrontErrorView::SEVERITY_NODATA);
|
|
|
|
|
$view->setTitle('No Projects');
|
|
|
|
|
$view->appendChild('You have not joined any projects.');
|
|
|
|
|
}
|
2012-02-21 15:10:11 -08:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$subnav->appendChild($view);
|
|
|
|
|
|
2012-02-15 17:48:14 -08:00
|
|
|
return $this->buildStandardPageResponse(
|
|
|
|
|
$nav,
|
|
|
|
|
array(
|
|
|
|
|
'title' => 'Feed',
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
));
|
|
|
|
|
}
|
2011-01-25 11:31:40 -08:00
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
private function buildUnbreakNowPanel() {
|
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
$user_phid = $user->getPHID();
|
|
|
|
|
|
|
|
|
|
$task_query = new ManiphestTaskQuery();
|
|
|
|
|
$task_query->withStatus(ManiphestTaskQuery::STATUS_OPEN);
|
|
|
|
|
$task_query->withPriority(ManiphestTaskPriority::PRIORITY_UNBREAK_NOW);
|
|
|
|
|
$task_query->setLimit(10);
|
|
|
|
|
|
|
|
|
|
$tasks = $task_query->execute();
|
|
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
if (!$tasks) {
|
|
|
|
|
return $this->renderMiniPanel(
|
|
|
|
|
'No "Unbreak Now!" Tasks',
|
|
|
|
|
'Nothing appears to be critically broken right now.');
|
2011-01-16 13:51:39 -08:00
|
|
|
}
|
|
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$panel = new AphrontPanelView();
|
|
|
|
|
$panel->setHeader('Unbreak Now!');
|
|
|
|
|
$panel->setCaption('Open tasks with "Unbreak Now!" priority.');
|
|
|
|
|
$panel->addButton(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => '/maniphest/view/all/',
|
|
|
|
|
'class' => 'grey button',
|
|
|
|
|
),
|
|
|
|
|
"View All Unbreak Now \xC2\xBB"));
|
|
|
|
|
|
|
|
|
|
$panel->appendChild($this->buildTaskListView($tasks));
|
|
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
2012-03-27 16:22:40 -07:00
|
|
|
private function buildFlaggedPanel() {
|
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
|
|
|
|
|
$flag_query = id(new PhabricatorFlagQuery())
|
|
|
|
|
->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;
|
|
|
|
|
}
|
|
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
private function buildNeedsTriagePanel(array $projects) {
|
2012-04-03 12:10:45 -07:00
|
|
|
assert_instances_of($projects, 'PhabricatorProject');
|
|
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
$user_phid = $user->getPHID();
|
|
|
|
|
|
2012-02-15 13:06:10 -08:00
|
|
|
if ($projects) {
|
|
|
|
|
$task_query = new ManiphestTaskQuery();
|
|
|
|
|
$task_query->withStatus(ManiphestTaskQuery::STATUS_OPEN);
|
|
|
|
|
$task_query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
|
|
|
|
|
$task_query->withProjects(mpull($projects, 'getPHID'));
|
|
|
|
|
$task_query->withAnyProject(true);
|
|
|
|
|
$task_query->setLimit(10);
|
|
|
|
|
$tasks = $task_query->execute();
|
|
|
|
|
} else {
|
|
|
|
|
$tasks = array();
|
|
|
|
|
}
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
if (!$tasks) {
|
|
|
|
|
return $this->renderMiniPanel(
|
|
|
|
|
'No "Needs Triage" Tasks',
|
2012-02-14 16:23:53 -08:00
|
|
|
'No tasks in <a href="/project/">projects you are a member of</a> '.
|
2012-04-06 14:09:24 -07:00
|
|
|
'need triage.');
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
}
|
|
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$panel = new AphrontPanelView();
|
|
|
|
|
$panel->setHeader('Needs Triage');
|
|
|
|
|
$panel->setCaption(
|
|
|
|
|
'Open tasks with "Needs Triage" priority in '.
|
|
|
|
|
'<a href="/project/">projects you are a member of</a>.');
|
|
|
|
|
|
|
|
|
|
$panel->addButton(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
// TODO: This should filter to just your projects' need-triage
|
|
|
|
|
// tasks?
|
2012-03-14 18:01:14 -07:00
|
|
|
'href' => '/maniphest/view/projecttriage/',
|
2012-02-27 13:14:32 -08:00
|
|
|
'class' => 'grey button',
|
|
|
|
|
),
|
|
|
|
|
"View All Triage \xC2\xBB"));
|
|
|
|
|
$panel->appendChild($this->buildTaskListView($tasks));
|
|
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function buildRevisionPanel() {
|
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
$user_phid = $user->getPHID();
|
|
|
|
|
|
|
|
|
|
$revision_query = new DifferentialRevisionQuery();
|
|
|
|
|
$revision_query->withStatus(DifferentialRevisionQuery::STATUS_OPEN);
|
|
|
|
|
$revision_query->withResponsibleUsers(array($user_phid));
|
|
|
|
|
$revision_query->needRelationships(true);
|
|
|
|
|
|
|
|
|
|
// NOTE: We need to unlimit this query to hit the responsible user
|
|
|
|
|
// fast-path.
|
|
|
|
|
$revision_query->setLimit(null);
|
|
|
|
|
$revisions = $revision_query->execute();
|
|
|
|
|
|
|
|
|
|
list($active, $waiting) = DifferentialRevisionQuery::splitResponsible(
|
|
|
|
|
$revisions,
|
|
|
|
|
$user_phid);
|
|
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
if (!$active) {
|
|
|
|
|
return $this->renderMiniPanel(
|
|
|
|
|
'No Waiting Revisions',
|
|
|
|
|
'No revisions are waiting on you.');
|
|
|
|
|
}
|
|
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$panel = new AphrontPanelView();
|
|
|
|
|
$panel->setHeader('Revisions Waiting on You');
|
|
|
|
|
$panel->setCaption('Revisions waiting for you for review or commit.');
|
2011-01-16 13:51:39 -08:00
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$panel->addButton(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => '/differential/',
|
|
|
|
|
'class' => 'button grey',
|
|
|
|
|
),
|
|
|
|
|
"View Active Revisions \xC2\xBB"));
|
|
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$revision_view = id(new DifferentialRevisionListView())
|
2012-08-20 14:05:46 -07:00
|
|
|
->setHighlightAge(true)
|
2012-02-27 13:14:32 -08:00
|
|
|
->setRevisions($active)
|
|
|
|
|
->setFields(DifferentialRevisionListView::getDefaultFields())
|
|
|
|
|
->setUser($user);
|
|
|
|
|
$phids = array_merge(
|
|
|
|
|
array($user_phid),
|
|
|
|
|
$revision_view->getRequiredHandlePHIDs());
|
|
|
|
|
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$revision_view->setHandles($handles);
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$panel->appendChild($revision_view);
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
|
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function buildTasksPanel() {
|
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
$user_phid = $user->getPHID();
|
|
|
|
|
|
|
|
|
|
$task_query = new ManiphestTaskQuery();
|
|
|
|
|
$task_query->withStatus(ManiphestTaskQuery::STATUS_OPEN);
|
2012-02-15 13:57:50 -08:00
|
|
|
$task_query->setGroupBy(ManiphestTaskQuery::GROUP_PRIORITY);
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$task_query->withOwners(array($user_phid));
|
|
|
|
|
$task_query->setLimit(10);
|
|
|
|
|
|
|
|
|
|
$tasks = $task_query->execute();
|
|
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
|
|
|
|
|
if (!$tasks) {
|
|
|
|
|
return $this->renderMiniPanel(
|
|
|
|
|
'No Assigned Tasks',
|
|
|
|
|
'You have no assigned tasks.');
|
|
|
|
|
}
|
|
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$panel = new AphrontPanelView();
|
|
|
|
|
$panel->setHeader('Assigned Tasks');
|
|
|
|
|
$panel->setCaption('Tasks assigned to you.');
|
|
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$panel->addButton(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => '/maniphest/',
|
|
|
|
|
'class' => 'button grey',
|
|
|
|
|
),
|
|
|
|
|
"View Active Tasks \xC2\xBB"));
|
|
|
|
|
$panel->appendChild($this->buildTaskListView($tasks));
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
|
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function buildTaskListView(array $tasks) {
|
2012-04-03 12:10:45 -07:00
|
|
|
assert_instances_of($tasks, 'ManiphestTask');
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
|
2012-04-02 10:27:31 -07:00
|
|
|
$phids = array_merge(
|
|
|
|
|
array_filter(mpull($tasks, 'getOwnerPHID')),
|
|
|
|
|
array_mergev(mpull($tasks, 'getProjectPHIDs')));
|
|
|
|
|
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
|
|
|
|
|
|
|
|
|
|
$view = new ManiphestTaskListView();
|
|
|
|
|
$view->setTasks($tasks);
|
|
|
|
|
$view->setUser($user);
|
|
|
|
|
$view->setHandles($handles);
|
|
|
|
|
|
|
|
|
|
return $view;
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-21 15:10:11 -08:00
|
|
|
private function buildFeedView(array $phids) {
|
2012-02-15 17:48:14 -08:00
|
|
|
$request = $this->getRequest();
|
|
|
|
|
$user = $request->getUser();
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$user_phid = $user->getPHID();
|
|
|
|
|
|
|
|
|
|
$feed_query = new PhabricatorFeedQuery();
|
2012-07-02 15:41:19 -07:00
|
|
|
$feed_query->setViewer($user);
|
2012-02-21 15:10:11 -08:00
|
|
|
if ($phids) {
|
|
|
|
|
$feed_query->setFilterPHIDs($phids);
|
|
|
|
|
}
|
2012-02-15 17:48:14 -08:00
|
|
|
|
Rename "IDPaged" to "CursorPaged", "executeWithPager" to "executeWith[Cursor|Offset]Pager"
Summary:
I'm trying to make progress on the policy/visibility stuff since it's a blocker for Wikimedia.
First, I want to improve Projects so they can serve as policy groups (e.g., an object can have a visibility policy like "Visible to: members of project 'security'"). However, doing this without breaking anything or snowballing into a bigger change is a bit awkward because Projects are name-ordered and we have a Conduit API which does offset paging. Rather than breaking or rewriting this stuff, I want to just continue offset paging them for now.
So I'm going to make PhabricatorPolicyQuery extend PhabricatorOffsetPagedQuery, but can't currently since the `executeWithPager` methods would clash. These methods do different things anyway and are probably better with different names.
This also generally improves the names of these classes, since cursors are not necessarily IDs (in the feed case, they're "chronlogicalKeys", for example). I did leave some of the interals as "ID" since calling them "Cursor"s (e.g., `setAfterCursor()`) seemed a little wrong -- it should maybe be `setAfterCursorPosition()`. These APIs have very limited use and can easily be made more consistent later.
Test Plan: Browsed around various affected tools; any issues here should throw/fail in a loud/obvious way.
Reviewers: vrana, btrahan
Reviewed By: vrana
CC: aran
Maniphest Tasks: T603
Differential Revision: https://secure.phabricator.com/D3177
2012-08-07 11:54:06 -07:00
|
|
|
$pager = new AphrontCursorPagerView();
|
2012-07-02 15:41:19 -07:00
|
|
|
$pager->readFromRequest($request);
|
|
|
|
|
$pager->setPageSize(200);
|
2012-02-15 17:48:14 -08:00
|
|
|
|
Rename "IDPaged" to "CursorPaged", "executeWithPager" to "executeWith[Cursor|Offset]Pager"
Summary:
I'm trying to make progress on the policy/visibility stuff since it's a blocker for Wikimedia.
First, I want to improve Projects so they can serve as policy groups (e.g., an object can have a visibility policy like "Visible to: members of project 'security'"). However, doing this without breaking anything or snowballing into a bigger change is a bit awkward because Projects are name-ordered and we have a Conduit API which does offset paging. Rather than breaking or rewriting this stuff, I want to just continue offset paging them for now.
So I'm going to make PhabricatorPolicyQuery extend PhabricatorOffsetPagedQuery, but can't currently since the `executeWithPager` methods would clash. These methods do different things anyway and are probably better with different names.
This also generally improves the names of these classes, since cursors are not necessarily IDs (in the feed case, they're "chronlogicalKeys", for example). I did leave some of the interals as "ID" since calling them "Cursor"s (e.g., `setAfterCursor()`) seemed a little wrong -- it should maybe be `setAfterCursorPosition()`. These APIs have very limited use and can easily be made more consistent later.
Test Plan: Browsed around various affected tools; any issues here should throw/fail in a loud/obvious way.
Reviewers: vrana, btrahan
Reviewed By: vrana
CC: aran
Maniphest Tasks: T603
Differential Revision: https://secure.phabricator.com/D3177
2012-08-07 11:54:06 -07:00
|
|
|
$feed = $feed_query->executeWithCursorPager($pager);
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
|
|
|
|
|
$builder = new PhabricatorFeedBuilder($feed);
|
|
|
|
|
$builder->setUser($user);
|
|
|
|
|
$feed_view = $builder->buildView();
|
|
|
|
|
|
|
|
|
|
return
|
2012-02-15 17:48:14 -08:00
|
|
|
'<div style="padding: 1em 3em;">'.
|
|
|
|
|
'<div style="margin: 0 1em;">'.
|
|
|
|
|
'<h1 style="font-size: 18px; '.
|
|
|
|
|
'border-bottom: 1px solid #aaaaaa; '.
|
|
|
|
|
'padding: 0;">Feed</h1>'.
|
|
|
|
|
'</div>'.
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
$feed_view->render().
|
2012-02-15 17:48:14 -08:00
|
|
|
'<div class="phabricator-feed-frame">'.
|
2012-07-02 15:41:19 -07:00
|
|
|
$pager->render().
|
2012-02-15 17:48:14 -08:00
|
|
|
'</div>'.
|
Replace home directory list with a dashboard
Summary:
Rough cut that still needs a lot of polish, but replace the directory list with
more of a dashboard type thing:
- Show "Unbreak Now", triage-in-your-projects, and other stuff that you're
supposed to deal with, then feed.
- Move tools a click a way behind nav -- this also lets us put more stuff
there and subtools, etc., later.
- Remove tabs.
- Merge the category/item editing views.
- I also added a light blue wash to the side nav, not sure if I like that or
not.
Test Plan:
- Viewed all elements in empty and nonempty states.
- Viewed applications, edited items/categories.
Reviewers: btrahan, aran
Reviewed By: btrahan
CC: aran, epriestley, davidreuss
Maniphest Tasks: T21, T631
Differential Revision: https://secure.phabricator.com/D1574
2012-02-07 16:04:48 -08:00
|
|
|
'</div>';
|
2011-01-16 13:51:39 -08:00
|
|
|
}
|
|
|
|
|
|
2012-07-23 17:41:46 -07:00
|
|
|
private function buildJumpPanel($query=null) {
|
2012-02-15 17:49:23 -08:00
|
|
|
$request = $this->getRequest();
|
|
|
|
|
$user = $request->getUser();
|
|
|
|
|
|
|
|
|
|
$uniq_id = celerity_generate_unique_node_id();
|
|
|
|
|
|
|
|
|
|
Javelin::initBehavior(
|
|
|
|
|
'phabricator-autofocus',
|
|
|
|
|
array(
|
|
|
|
|
'id' => $uniq_id,
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
require_celerity_resource('phabricator-jump-nav');
|
|
|
|
|
|
2012-02-15 17:52:47 -08:00
|
|
|
$doc_href = PhabricatorEnv::getDocLink('article/Jump_Nav_User_Guide.html');
|
2012-02-15 17:49:23 -08:00
|
|
|
$doc_link = phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => $doc_href,
|
|
|
|
|
),
|
2012-02-21 15:10:11 -08:00
|
|
|
'Jump Nav User Guide');
|
2012-02-15 17:49:23 -08:00
|
|
|
|
|
|
|
|
$jump_input = phutil_render_tag(
|
|
|
|
|
'input',
|
|
|
|
|
array(
|
|
|
|
|
'type' => 'text',
|
|
|
|
|
'class' => 'phabricator-jump-nav',
|
|
|
|
|
'name' => 'jump',
|
|
|
|
|
'id' => $uniq_id,
|
2012-07-23 17:41:46 -07:00
|
|
|
'value' => $query,
|
2012-02-27 13:14:32 -08:00
|
|
|
));
|
|
|
|
|
$jump_caption = phutil_render_tag(
|
|
|
|
|
'p',
|
|
|
|
|
array(
|
|
|
|
|
'class' => 'phabricator-jump-nav-caption',
|
|
|
|
|
),
|
|
|
|
|
'Enter the name of an object like <tt>D123</tt> to quickly jump to '.
|
|
|
|
|
'it. See '.$doc_link.' or type <tt>help</tt>.');
|
2012-02-15 17:49:23 -08:00
|
|
|
|
|
|
|
|
$panel = new AphrontPanelView();
|
2012-02-27 13:14:32 -08:00
|
|
|
$panel->addClass('aphront-unpadded-panel-view');
|
2012-02-15 17:49:23 -08:00
|
|
|
$panel->appendChild(
|
|
|
|
|
phabricator_render_form(
|
|
|
|
|
$user,
|
|
|
|
|
array(
|
|
|
|
|
'action' => '/jump/',
|
|
|
|
|
'method' => 'POST',
|
2012-02-27 13:14:32 -08:00
|
|
|
'class' => 'phabricator-jump-nav-form',
|
2012-02-15 17:49:23 -08:00
|
|
|
),
|
2012-02-27 13:14:32 -08:00
|
|
|
$jump_input.
|
|
|
|
|
$jump_caption));
|
|
|
|
|
|
|
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function buildAppPanel() {
|
|
|
|
|
require_celerity_resource('phabricator-app-buttons-css');
|
2012-02-15 17:49:23 -08:00
|
|
|
|
2012-02-17 16:08:35 -08:00
|
|
|
$nav_buttons = array();
|
|
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$nav_buttons[] = array(
|
|
|
|
|
'Differential',
|
|
|
|
|
'/differential/',
|
2012-04-02 15:21:02 -07:00
|
|
|
'differential',
|
|
|
|
|
'Code Reviews');
|
2012-02-27 13:14:32 -08:00
|
|
|
|
2012-02-17 16:08:35 -08:00
|
|
|
if (PhabricatorEnv::getEnvConfig('maniphest.enabled')) {
|
2012-02-27 13:14:32 -08:00
|
|
|
$nav_buttons[] = array(
|
|
|
|
|
'Maniphest',
|
|
|
|
|
'/maniphest/',
|
2012-04-02 15:21:02 -07:00
|
|
|
'maniphest',
|
|
|
|
|
'Tasks');
|
2012-02-27 13:14:32 -08:00
|
|
|
$nav_buttons[] = array(
|
|
|
|
|
'Create Task',
|
|
|
|
|
'/maniphest/task/create/',
|
|
|
|
|
'create-task');
|
2012-02-17 16:08:35 -08:00
|
|
|
}
|
2012-02-27 13:14:32 -08:00
|
|
|
|
|
|
|
|
$nav_buttons[] = array(
|
|
|
|
|
'Upload File',
|
|
|
|
|
'/file/',
|
2012-04-02 15:21:02 -07:00
|
|
|
'upload-file',
|
|
|
|
|
'Share Files');
|
2012-02-27 13:14:32 -08:00
|
|
|
$nav_buttons[] = array(
|
|
|
|
|
'Create Paste',
|
|
|
|
|
'/paste/',
|
2012-04-02 15:21:02 -07:00
|
|
|
'create-paste',
|
|
|
|
|
'Share Text');
|
2012-02-27 13:14:32 -08:00
|
|
|
|
|
|
|
|
|
2012-02-17 16:08:35 -08:00
|
|
|
if (PhabricatorEnv::getEnvConfig('phriction.enabled')) {
|
2012-02-27 13:14:32 -08:00
|
|
|
$nav_buttons[] = array(
|
2012-04-02 15:21:02 -07:00
|
|
|
'Phriction',
|
2012-02-27 13:14:32 -08:00
|
|
|
'/w/',
|
2012-04-02 15:21:02 -07:00
|
|
|
'phriction',
|
|
|
|
|
'Browse Wiki');
|
2012-02-17 16:08:35 -08:00
|
|
|
}
|
2012-02-15 17:49:23 -08:00
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$nav_buttons[] = array(
|
2012-04-02 15:21:02 -07:00
|
|
|
'Diffusion',
|
2012-02-27 13:14:32 -08:00
|
|
|
'/diffusion/',
|
2012-04-02 15:21:02 -07:00
|
|
|
'diffusion',
|
|
|
|
|
'Browse Code');
|
2012-02-27 13:14:32 -08:00
|
|
|
|
2012-02-28 21:10:39 -08:00
|
|
|
$nav_buttons[] = array(
|
2012-04-02 15:21:02 -07:00
|
|
|
'Audit',
|
2012-02-28 21:10:39 -08:00
|
|
|
'/audit/',
|
2012-04-02 15:21:02 -07:00
|
|
|
'audit',
|
|
|
|
|
'Audit Code');
|
2012-02-28 21:10:39 -08:00
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
$view = new AphrontNullView();
|
|
|
|
|
$view->appendChild('<div class="phabricator-app-buttons">');
|
|
|
|
|
foreach ($nav_buttons as $info) {
|
2012-04-02 15:21:02 -07:00
|
|
|
// Subtitle is optional.
|
|
|
|
|
list($name, $uri, $icon, $subtitle) = array_merge($info, array(null));
|
|
|
|
|
|
|
|
|
|
if ($subtitle) {
|
|
|
|
|
$subtitle =
|
|
|
|
|
'<div class="phabricator-app-subtitle">'.
|
|
|
|
|
phutil_escape_html($subtitle).
|
|
|
|
|
'</div>';
|
|
|
|
|
}
|
2012-02-27 13:14:32 -08:00
|
|
|
|
|
|
|
|
$button = phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => $uri,
|
|
|
|
|
'class' => 'app-button icon-'.$icon,
|
|
|
|
|
),
|
2012-02-15 17:49:23 -08:00
|
|
|
phutil_render_tag(
|
2012-02-27 13:14:32 -08:00
|
|
|
'div',
|
2012-02-15 17:49:23 -08:00
|
|
|
array(
|
2012-02-27 13:14:32 -08:00
|
|
|
'class' => 'app-icon icon-'.$icon,
|
2012-02-15 17:49:23 -08:00
|
|
|
),
|
2012-02-27 13:14:32 -08:00
|
|
|
''));
|
|
|
|
|
$caption = phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => $uri,
|
|
|
|
|
'class' => 'phabricator-button-caption',
|
|
|
|
|
),
|
2012-04-02 15:21:02 -07:00
|
|
|
phutil_escape_html($name).$subtitle);
|
2012-02-27 13:14:32 -08:00
|
|
|
|
|
|
|
|
$view->appendChild(
|
|
|
|
|
'<div class="phabricator-app-button">'.
|
|
|
|
|
$button.
|
|
|
|
|
$caption.
|
|
|
|
|
'</div>');
|
2012-02-15 17:49:23 -08:00
|
|
|
}
|
2012-02-27 13:14:32 -08:00
|
|
|
$view->appendChild('<div style="clear: both;"></div></div>');
|
|
|
|
|
|
|
|
|
|
return $view;
|
|
|
|
|
}
|
2012-02-15 17:49:23 -08:00
|
|
|
|
2012-02-27 13:14:32 -08:00
|
|
|
private function renderMiniPanel($title, $body) {
|
|
|
|
|
$panel = new AphrontMiniPanelView();
|
|
|
|
|
$panel->appendChild(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'p',
|
|
|
|
|
array(
|
|
|
|
|
),
|
|
|
|
|
'<strong>'.$title.':</strong> '.$body));
|
2012-02-15 17:49:23 -08:00
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-27 09:48:18 -08:00
|
|
|
public function buildAuditPanel() {
|
|
|
|
|
$request = $this->getRequest();
|
|
|
|
|
$user = $request->getUser();
|
|
|
|
|
|
|
|
|
|
$phids = PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($user);
|
|
|
|
|
|
|
|
|
|
$query = new PhabricatorAuditQuery();
|
|
|
|
|
$query->withAuditorPHIDs($phids);
|
|
|
|
|
$query->withStatus(PhabricatorAuditQuery::STATUS_OPEN);
|
2012-03-26 09:44:06 -07:00
|
|
|
$query->withAwaitingUser($user);
|
2012-03-13 11:18:01 -07:00
|
|
|
$query->needCommitData(true);
|
2012-02-27 09:48:18 -08:00
|
|
|
$query->setLimit(10);
|
|
|
|
|
|
|
|
|
|
$audits = $query->execute();
|
2012-03-13 11:18:01 -07:00
|
|
|
$commits = $query->getCommits();
|
2012-02-27 09:48:18 -08:00
|
|
|
|
|
|
|
|
if (!$audits) {
|
2012-02-28 21:10:39 -08:00
|
|
|
return $this->renderMinipanel(
|
|
|
|
|
'No Audits',
|
|
|
|
|
'No commits are waiting for you to audit them.');
|
2012-02-27 09:48:18 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$view = new PhabricatorAuditListView();
|
|
|
|
|
$view->setAudits($audits);
|
2012-03-13 11:18:01 -07:00
|
|
|
$view->setCommits($commits);
|
2012-07-23 16:11:35 -07:00
|
|
|
$view->setUser($user);
|
2012-02-27 09:48:18 -08:00
|
|
|
|
|
|
|
|
$phids = $view->getRequiredHandlePHIDs();
|
|
|
|
|
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
|
|
|
|
|
$view->setHandles($handles);
|
|
|
|
|
|
|
|
|
|
$panel = new AphrontPanelView();
|
|
|
|
|
$panel->setHeader('Audits');
|
|
|
|
|
$panel->setCaption('Commits awaiting your audit.');
|
|
|
|
|
$panel->appendChild($view);
|
|
|
|
|
$panel->addButton(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => '/audit/',
|
|
|
|
|
'class' => 'button grey',
|
|
|
|
|
),
|
|
|
|
|
"View Active Audits \xC2\xBB"));
|
|
|
|
|
|
|
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-28 21:10:39 -08:00
|
|
|
public function buildCommitPanel() {
|
|
|
|
|
$request = $this->getRequest();
|
|
|
|
|
$user = $request->getUser();
|
|
|
|
|
|
|
|
|
|
$phids = array($user->getPHID());
|
|
|
|
|
|
|
|
|
|
$query = new PhabricatorAuditCommitQuery();
|
|
|
|
|
$query->withAuthorPHIDs($phids);
|
|
|
|
|
$query->withStatus(PhabricatorAuditQuery::STATUS_OPEN);
|
|
|
|
|
$query->needCommitData(true);
|
|
|
|
|
$query->setLimit(10);
|
|
|
|
|
|
|
|
|
|
$commits = $query->execute();
|
|
|
|
|
|
|
|
|
|
if (!$commits) {
|
|
|
|
|
return $this->renderMinipanel(
|
|
|
|
|
'No Problem Commits',
|
|
|
|
|
'No one has raised concerns with your commits.');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$view = new PhabricatorAuditCommitListView();
|
|
|
|
|
$view->setCommits($commits);
|
|
|
|
|
$view->setUser($user);
|
|
|
|
|
|
|
|
|
|
$phids = $view->getRequiredHandlePHIDs();
|
|
|
|
|
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
|
|
|
|
|
$view->setHandles($handles);
|
|
|
|
|
|
|
|
|
|
$panel = new AphrontPanelView();
|
|
|
|
|
$panel->setHeader('Problem Commits');
|
|
|
|
|
$panel->setCaption('Commits which auditors have raised concerns about.');
|
|
|
|
|
$panel->appendChild($view);
|
|
|
|
|
$panel->addButton(
|
|
|
|
|
phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => '/audit/',
|
|
|
|
|
'class' => 'button grey',
|
|
|
|
|
),
|
|
|
|
|
"View Problem Commits \xC2\xBB"));
|
|
|
|
|
|
|
|
|
|
return $panel;
|
|
|
|
|
}
|
|
|
|
|
|
Hard-code and unify "more applications" in Phabricator
Summary:
This is mostly intended to simplify D2323.
We currently allow users to edit and customize the links on the homepage, but as far as I know no one actually does this (no one complained when we redid the homepage earlier this year) and it creates a lot of mess in the database patches and quickstart dump. After D2331, this is the only data we load in the patch files. The patch files are also a mess with respect to this data and have various different versions of it.
Also the current UI is just kind of bad, it stretches stuff across too many screens and is generally ungood. Nuking this lets us nuke a lot of code in general.
(In the long term, I think we'll move toward an "application" model anyway, and this stuff will go away sooner or later.)
I'll add a drop-database patch some time later, just in case anyone does actually use this, so they can get their data out of MySQL.
Test Plan: Looked at home page, clicked "More Stuff", got a single list of other apps/things.
Reviewers: btrahan, vrana, edward, jungejason
Reviewed By: jungejason
CC: aran
Maniphest Tasks: T345
Differential Revision: https://secure.phabricator.com/D2332
2012-04-28 07:17:38 -07:00
|
|
|
public function buildAppsResponse(AphrontSideNavFilterView $nav) {
|
|
|
|
|
$user = $this->getRequest()->getUser();
|
|
|
|
|
|
|
|
|
|
$apps = array(
|
|
|
|
|
array(
|
|
|
|
|
'/repository/',
|
|
|
|
|
'Repositories',
|
|
|
|
|
'Configure tracked source code repositories.',
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'/herald/',
|
|
|
|
|
'Herald',
|
|
|
|
|
'Create notification rules. Watch for danger!',
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'/file/',
|
|
|
|
|
'Files',
|
|
|
|
|
'Upload and download files. Blob store for Pokemon pictures.',
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'/project/',
|
|
|
|
|
'Projects',
|
|
|
|
|
'Group stuff into big piles.',
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'/vote/',
|
|
|
|
|
'Slowvote',
|
|
|
|
|
'Create polls. Design by committee.',
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'/countdown/',
|
|
|
|
|
'Countdown',
|
|
|
|
|
'Count down to events. Utilize the full capabilities of your ALU.',
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'/people/',
|
|
|
|
|
'People',
|
|
|
|
|
'User directory. Sort of a social utility.',
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'/owners/',
|
|
|
|
|
'Owners',
|
|
|
|
|
'Keep track of who owns code. Adopt today!',
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'/conduit/',
|
|
|
|
|
'Conduit API Console',
|
|
|
|
|
'Web console for Conduit API.',
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'/daemon/',
|
|
|
|
|
'Daemon Console',
|
|
|
|
|
'Offline process management.',
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'/mail/',
|
|
|
|
|
'MetaMTA',
|
|
|
|
|
'Manage mail delivery. Yo dawg, we heard you like MTAs.',
|
|
|
|
|
array(
|
|
|
|
|
'admin' => true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'/phid/',
|
|
|
|
|
'PHID Manager',
|
|
|
|
|
'Debugging tool for PHIDs.',
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'/xhpast/',
|
|
|
|
|
'XHPAST',
|
|
|
|
|
'Web interface to PHP AST tool. Lex XHP AST & CTS FYI, LOL.',
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'http://www.phabricator.com/docs/phabricator/',
|
|
|
|
|
'Phabricator Ducks',
|
|
|
|
|
'Oops, that should say "Docs".',
|
|
|
|
|
array(
|
|
|
|
|
'new' => true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'http://www.phabricator.com/docs/arcanist/',
|
|
|
|
|
'Arcanist Docs',
|
|
|
|
|
'Words have never been so finely crafted.',
|
|
|
|
|
array(
|
|
|
|
|
'new' => true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'http://www.phabricator.com/docs/libphutil/',
|
|
|
|
|
'libphutil Docs',
|
|
|
|
|
'Soothing prose; seductive poetry.',
|
|
|
|
|
array(
|
|
|
|
|
'new' => true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'http://www.phabricator.com/docs/javelin/',
|
|
|
|
|
'Javelin Docs',
|
|
|
|
|
'O, what noble scribe hath penned these words?',
|
|
|
|
|
array(
|
|
|
|
|
'new' => true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
array(
|
|
|
|
|
'/uiexample/',
|
|
|
|
|
'UI Examples',
|
|
|
|
|
'Phabricator UI elements. A gallery of modern art.',
|
|
|
|
|
array(
|
|
|
|
|
'new' => true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$out = array();
|
|
|
|
|
foreach ($apps as $app) {
|
|
|
|
|
if (empty($app[3])) {
|
|
|
|
|
$app[3] = array();
|
|
|
|
|
}
|
|
|
|
|
$app[3] += array(
|
|
|
|
|
'admin' => false,
|
|
|
|
|
'new' => false,
|
|
|
|
|
);
|
|
|
|
|
list($href, $name, $desc, $options) = $app;
|
|
|
|
|
|
|
|
|
|
if ($options['admin'] && !$user->getIsAdmin()) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$link = phutil_render_tag(
|
|
|
|
|
'a',
|
|
|
|
|
array(
|
|
|
|
|
'href' => $href,
|
|
|
|
|
'target' => $options['new'] ? '_blank' : null,
|
|
|
|
|
),
|
|
|
|
|
phutil_escape_html($name));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$out[] =
|
|
|
|
|
'<div class="aphront-directory-item">'.
|
|
|
|
|
'<h1>'.$link.'</h1>'.
|
|
|
|
|
'<p>'.phutil_escape_html($desc).'</p>'.
|
|
|
|
|
'</div>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
require_celerity_resource('phabricator-directory-css');
|
|
|
|
|
|
|
|
|
|
$out =
|
|
|
|
|
'<div class="aphront-directory-list">'.
|
|
|
|
|
implode("\n", $out).
|
|
|
|
|
'</div>';
|
|
|
|
|
|
|
|
|
|
$nav->appendChild($out);
|
|
|
|
|
|
|
|
|
|
return $this->buildStandardPageResponse(
|
|
|
|
|
$nav,
|
|
|
|
|
array(
|
|
|
|
|
'title' => 'More Stuff',
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-16 13:51:39 -08:00
|
|
|
}
|