mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 21:32:43 +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:
parent
972c363a21
commit
1e5f96e773
4 changed files with 55 additions and 46 deletions
|
@ -44,8 +44,11 @@ abstract class PhabricatorOwnersController extends PhabricatorController {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$crumbs = $this->buildApplicationCrumbs();
|
return $nav;
|
||||||
$crumbs->addTextCrumb($title);
|
}
|
||||||
|
|
||||||
|
protected function buildApplicationCrumbs() {
|
||||||
|
$crumbs = parent::buildApplicationCrumbs();
|
||||||
|
|
||||||
$crumbs->addAction(
|
$crumbs->addAction(
|
||||||
id(new PHUIListItemView())
|
id(new PHUIListItemView())
|
||||||
|
@ -53,9 +56,7 @@ abstract class PhabricatorOwnersController extends PhabricatorController {
|
||||||
->setHref('/owners/new/')
|
->setHref('/owners/new/')
|
||||||
->setIcon('fa-plus-square'));
|
->setIcon('fa-plus-square'));
|
||||||
|
|
||||||
$nav->setCrumbs($crumbs);
|
return $crumbs;
|
||||||
|
|
||||||
return $nav;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildApplicationMenu() {
|
public function buildApplicationMenu() {
|
||||||
|
|
|
@ -111,27 +111,24 @@ final class PhabricatorOwnersDetailController
|
||||||
'wide',
|
'wide',
|
||||||
));
|
));
|
||||||
|
|
||||||
$panel = new AphrontPanelView();
|
$panel = new PHUIObjectBoxView();
|
||||||
$panel->setNoBackground();
|
$header = new PHUIHeaderView();
|
||||||
$panel->setHeader(
|
$header->setHeader(
|
||||||
pht('Package Details for "%s"', $package->getName()));
|
pht('Package Details for "%s"', $package->getName()));
|
||||||
$panel->addButton(
|
$header->addActionLink(
|
||||||
javelin_tag(
|
id(new PHUIButtonView())
|
||||||
'a',
|
->setTag('a')
|
||||||
array(
|
->setHref('/owners/delete/'.$package->getID().'/')
|
||||||
'href' => '/owners/delete/'.$package->getID().'/',
|
->addSigil('workflow')
|
||||||
'class' => 'button grey',
|
->setText(pht('Delete Package')));
|
||||||
'sigil' => 'workflow',
|
|
||||||
),
|
$header->addActionLink(
|
||||||
pht('Delete Package')));
|
id(new PHUIButtonView())
|
||||||
$panel->addButton(
|
->setTag('a')
|
||||||
phutil_tag(
|
->setHref('/owners/edit/'.$package->getID().'/')
|
||||||
'a',
|
->setText(pht('Edit Package')));
|
||||||
array(
|
|
||||||
'href' => '/owners/edit/'.$package->getID().'/',
|
$panel->setHeader($header);
|
||||||
'class' => 'button',
|
|
||||||
),
|
|
||||||
pht('Edit Package')));
|
|
||||||
$panel->appendChild($table);
|
$panel->appendChild($table);
|
||||||
|
|
||||||
$key = 'package/'.$package->getID();
|
$key = 'package/'.$package->getID();
|
||||||
|
@ -185,13 +182,10 @@ final class PhabricatorOwnersDetailController
|
||||||
$commit_views[] = array(
|
$commit_views[] = array(
|
||||||
'view' => $view,
|
'view' => $view,
|
||||||
'header' => pht('Recent Commits in Package'),
|
'header' => pht('Recent Commits in Package'),
|
||||||
'button' => phutil_tag(
|
'button' => id(new PHUIButtonView())
|
||||||
'a',
|
->setTag('a')
|
||||||
array(
|
->setHref($commit_uri)
|
||||||
'href' => $commit_uri,
|
->setText(pht('View All Package Commits')),
|
||||||
'class' => 'button grey',
|
|
||||||
),
|
|
||||||
pht('View All Package Commits')),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$phids = array();
|
$phids = array();
|
||||||
|
@ -203,26 +197,29 @@ final class PhabricatorOwnersDetailController
|
||||||
|
|
||||||
$commit_panels = array();
|
$commit_panels = array();
|
||||||
foreach ($commit_views as $commit_view) {
|
foreach ($commit_views as $commit_view) {
|
||||||
$commit_panel = new AphrontPanelView();
|
$commit_panel = new PHUIObjectBoxView();
|
||||||
$commit_panel->setNoBackground();
|
$header = new PHUIHeaderView();
|
||||||
$commit_panel->setHeader($commit_view['header']);
|
$header->setHeader($commit_view['header']);
|
||||||
if (isset($commit_view['button'])) {
|
if (isset($commit_view['button'])) {
|
||||||
$commit_panel->addButton($commit_view['button']);
|
$header->addActionLink($commit_view['button']);
|
||||||
}
|
}
|
||||||
$commit_view['view']->setHandles($handles);
|
$commit_view['view']->setHandles($handles);
|
||||||
|
$commit_panel->setHeader($header);
|
||||||
$commit_panel->appendChild($commit_view['view']);
|
$commit_panel->appendChild($commit_view['view']);
|
||||||
|
|
||||||
$commit_panels[] = $commit_panel;
|
$commit_panels[] = $commit_panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
|
$crumbs->addTextCrumb($package->getName());
|
||||||
|
|
||||||
$nav = $this->buildSideNavView();
|
$nav = $this->buildSideNavView();
|
||||||
|
$nav->appendChild($crumbs);
|
||||||
$nav->appendChild($panel);
|
$nav->appendChild($panel);
|
||||||
$nav->appendChild($commit_panels);
|
$nav->appendChild($commit_panels);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->buildApplicationPage(
|
||||||
array(
|
$nav,
|
||||||
$nav,
|
|
||||||
),
|
|
||||||
array(
|
array(
|
||||||
'title' => pht('Package %s', $package->getName()),
|
'title' => pht('Package %s', $package->getName()),
|
||||||
));
|
));
|
||||||
|
|
|
@ -251,7 +251,15 @@ final class PhabricatorOwnersEditController
|
||||||
->setFormErrors($errors)
|
->setFormErrors($errors)
|
||||||
->setForm($form);
|
->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 = $this->buildSideNavView();
|
||||||
|
$nav->appendChild($crumbs);
|
||||||
$nav->appendChild($form_box);
|
$nav->appendChild($form_box);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->buildApplicationPage(
|
||||||
|
|
|
@ -130,7 +130,7 @@ final class PhabricatorOwnersListController
|
||||||
}
|
}
|
||||||
$packages = $package->loadAllFromArray($data);
|
$packages = $package->loadAllFromArray($data);
|
||||||
|
|
||||||
$header = pht('Owned Packages');
|
$header = pht('Project Packages');
|
||||||
$nodata = pht('No owned packages');
|
$nodata = pht('No owned packages');
|
||||||
break;
|
break;
|
||||||
case 'all':
|
case 'all':
|
||||||
|
@ -198,15 +198,19 @@ final class PhabricatorOwnersListController
|
||||||
->setValue(pht('Search for Packages')));
|
->setValue(pht('Search for Packages')));
|
||||||
|
|
||||||
$filter->appendChild($form);
|
$filter->appendChild($form);
|
||||||
|
$title = pht('Package Index');
|
||||||
|
|
||||||
|
$crumbs = $this->buildApplicationCrumbs();
|
||||||
|
$crumbs->addTextCrumb($header);
|
||||||
|
$crumbs->setBorder(true);
|
||||||
|
|
||||||
$nav = $this->buildSideNavView();
|
$nav = $this->buildSideNavView();
|
||||||
|
$nav->appendChild($crumbs);
|
||||||
$nav->appendChild($filter);
|
$nav->appendChild($filter);
|
||||||
$nav->appendChild($content);
|
$nav->appendChild($content);
|
||||||
|
|
||||||
return $this->buildApplicationPage(
|
return $this->buildApplicationPage(
|
||||||
array(
|
$nav,
|
||||||
$nav,
|
|
||||||
),
|
|
||||||
array(
|
array(
|
||||||
'title' => pht('Package Index'),
|
'title' => pht('Package Index'),
|
||||||
));
|
));
|
||||||
|
@ -330,10 +334,9 @@ final class PhabricatorOwnersListController
|
||||||
'narrow',
|
'narrow',
|
||||||
));
|
));
|
||||||
|
|
||||||
$panel = new AphrontPanelView();
|
$panel = new PHUIObjectBoxView();
|
||||||
$panel->setHeader($header);
|
$panel->setHeaderText($header);
|
||||||
$panel->appendChild($table);
|
$panel->appendChild($table);
|
||||||
$panel->setNoBackground();
|
|
||||||
|
|
||||||
return $panel;
|
return $panel;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue