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

Modernize Owners a bit

Summary: Update Owners per current UI standards, add crumbs at each level, removed AphrontPanels, check spacing.

Test Plan: Tested a list of owner packages, editing a package, creating a package, and various filters.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11961
This commit is contained in:
Chad Little 2015-03-03 13:51:28 -08:00
parent 972c363a21
commit 1e5f96e773
4 changed files with 55 additions and 46 deletions

View file

@ -44,8 +44,11 @@ abstract class PhabricatorOwnersController extends PhabricatorController {
break;
}
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($title);
return $nav;
}
protected function buildApplicationCrumbs() {
$crumbs = parent::buildApplicationCrumbs();
$crumbs->addAction(
id(new PHUIListItemView())
@ -53,9 +56,7 @@ abstract class PhabricatorOwnersController extends PhabricatorController {
->setHref('/owners/new/')
->setIcon('fa-plus-square'));
$nav->setCrumbs($crumbs);
return $nav;
return $crumbs;
}
public function buildApplicationMenu() {

View file

@ -111,27 +111,24 @@ final class PhabricatorOwnersDetailController
'wide',
));
$panel = new AphrontPanelView();
$panel->setNoBackground();
$panel->setHeader(
$panel = new PHUIObjectBoxView();
$header = new PHUIHeaderView();
$header->setHeader(
pht('Package Details for "%s"', $package->getName()));
$panel->addButton(
javelin_tag(
'a',
array(
'href' => '/owners/delete/'.$package->getID().'/',
'class' => 'button grey',
'sigil' => 'workflow',
),
pht('Delete Package')));
$panel->addButton(
phutil_tag(
'a',
array(
'href' => '/owners/edit/'.$package->getID().'/',
'class' => 'button',
),
pht('Edit Package')));
$header->addActionLink(
id(new PHUIButtonView())
->setTag('a')
->setHref('/owners/delete/'.$package->getID().'/')
->addSigil('workflow')
->setText(pht('Delete Package')));
$header->addActionLink(
id(new PHUIButtonView())
->setTag('a')
->setHref('/owners/edit/'.$package->getID().'/')
->setText(pht('Edit Package')));
$panel->setHeader($header);
$panel->appendChild($table);
$key = 'package/'.$package->getID();
@ -185,13 +182,10 @@ final class PhabricatorOwnersDetailController
$commit_views[] = array(
'view' => $view,
'header' => pht('Recent Commits in Package'),
'button' => phutil_tag(
'a',
array(
'href' => $commit_uri,
'class' => 'button grey',
),
pht('View All Package Commits')),
'button' => id(new PHUIButtonView())
->setTag('a')
->setHref($commit_uri)
->setText(pht('View All Package Commits')),
);
$phids = array();
@ -203,26 +197,29 @@ final class PhabricatorOwnersDetailController
$commit_panels = array();
foreach ($commit_views as $commit_view) {
$commit_panel = new AphrontPanelView();
$commit_panel->setNoBackground();
$commit_panel->setHeader($commit_view['header']);
$commit_panel = new PHUIObjectBoxView();
$header = new PHUIHeaderView();
$header->setHeader($commit_view['header']);
if (isset($commit_view['button'])) {
$commit_panel->addButton($commit_view['button']);
$header->addActionLink($commit_view['button']);
}
$commit_view['view']->setHandles($handles);
$commit_panel->setHeader($header);
$commit_panel->appendChild($commit_view['view']);
$commit_panels[] = $commit_panel;
}
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($package->getName());
$nav = $this->buildSideNavView();
$nav->appendChild($crumbs);
$nav->appendChild($panel);
$nav->appendChild($commit_panels);
return $this->buildApplicationPage(
array(
$nav,
),
$nav,
array(
'title' => pht('Package %s', $package->getName()),
));

View file

@ -251,7 +251,15 @@ final class PhabricatorOwnersEditController
->setFormErrors($errors)
->setForm($form);
$crumbs = $this->buildApplicationCrumbs();
if ($package->getID()) {
$crumbs->addTextCrumb(pht('Edit %s', $package->getName()));
} else {
$crumbs->addTextCrumb(pht('New Package'));
}
$nav = $this->buildSideNavView();
$nav->appendChild($crumbs);
$nav->appendChild($form_box);
return $this->buildApplicationPage(

View file

@ -130,7 +130,7 @@ final class PhabricatorOwnersListController
}
$packages = $package->loadAllFromArray($data);
$header = pht('Owned Packages');
$header = pht('Project Packages');
$nodata = pht('No owned packages');
break;
case 'all':
@ -198,15 +198,19 @@ final class PhabricatorOwnersListController
->setValue(pht('Search for Packages')));
$filter->appendChild($form);
$title = pht('Package Index');
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($header);
$crumbs->setBorder(true);
$nav = $this->buildSideNavView();
$nav->appendChild($crumbs);
$nav->appendChild($filter);
$nav->appendChild($content);
return $this->buildApplicationPage(
array(
$nav,
),
$nav,
array(
'title' => pht('Package Index'),
));
@ -330,10 +334,9 @@ final class PhabricatorOwnersListController
'narrow',
));
$panel = new AphrontPanelView();
$panel->setHeader($header);
$panel = new PHUIObjectBoxView();
$panel->setHeaderText($header);
$panel->appendChild($table);
$panel->setNoBackground();
return $panel;
}