Project revamp part 2: Edit

Summary:
Taking a pass at revamping the edit pages in Projects. Specifically:

 - Remove EditMainController
 - Move actions from EditMain to Profile
 - Move properties from EditMain to Profile
 - Move timeline from EditMain to Profile
 - Move Open Tasks from Profile to sidenavicon
 - Add custom icons and colors to timeline

Feel free to bang on this a bit and give feedback, feels generally correct to me.

Test Plan: Edit everything I could on various projects. Check links, timelines, actions.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11421
This commit is contained in:
Chad Little
2015-01-19 10:14:27 -08:00
parent 9a7ad972cd
commit 3bc54c2041
12 changed files with 128 additions and 266 deletions

View File

@@ -7,28 +7,27 @@ abstract class PhabricatorProjectController extends PhabricatorController {
}
public function buildSideNavView($for_app = false) {
$user = $this->getRequest()->getUser();
$viewer = $this->getViewer();
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$id = null;
if ($for_app) {
$user = $this->getRequest()->getUser();
$id = $this->getRequest()->getURIData('id');
if ($id) {
$nav->addFilter("profile/{$id}/", pht('Profile'));
$nav->addFilter("board/{$id}/", pht('Workboard'));
$nav->addFilter("members/{$id}/", pht('Members'));
$nav->addFilter("feed/{$id}/", pht('Feed'));
$nav->addFilter("edit/{$id}/", pht('Edit'));
$nav->addFilter("details/{$id}/", pht('Edit Details'));
}
$nav->addFilter('create', pht('Create Project'));
}
if (!$id) {
id(new PhabricatorProjectSearchEngine())
->setViewer($user)
->setViewer($viewer)
->addNavigationItems($nav->getMenu());
}
@@ -38,13 +37,13 @@ abstract class PhabricatorProjectController extends PhabricatorController {
}
public function buildIconNavView(PhabricatorProject $project) {
$user = $this->getRequest()->getUser();
$viewer = $this->getViewer();
$id = $project->getID();
$picture = $project->getProfileImageURI();
$name = $project->getName();
$columns = id(new PhabricatorProjectColumnQuery())
->setViewer($user)
->setViewer($viewer)
->withProjectPHIDs(array($project->getPHID()))
->execute();
if ($columns) {
@@ -58,9 +57,20 @@ abstract class PhabricatorProjectController extends PhabricatorController {
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addIcon("profile/{$id}/", $name, null, $picture);
$nav->addIcon("board/{$id}/", pht('Workboard'), $board_icon);
$class = 'PhabricatorManiphestApplication';
if (PhabricatorApplication::isClassInstalledForViewer($class, $viewer)) {
$phid = $project->getPHID();
$query_uri = urisprintf(
'/maniphest/?statuses=%s&allProjects=%s#R',
implode(',', ManiphestTaskStatus::getOpenStatusConstants()),
$phid);
$nav->addIcon(null, pht('Open Tasks'), 'fa-anchor', null, $query_uri);
}
$nav->addIcon("feed/{$id}/", pht('Feed'), 'fa-newspaper-o');
$nav->addIcon("members/{$id}/", pht('Members'), 'fa-group');
$nav->addIcon("edit/{$id}/", pht('Edit'), 'fa-pencil');
$nav->addIcon("details/{$id}/", pht('Edit Details'), 'fa-pencil');
return $nav;
}