Files
phabricator/src/applications/diffusion/management/DiffusionRepositorySymbolsManagementPanel.php
Chad Little e1fd74ddb5 Update Repository Management pages to new fixed UI
Summary: Simplifies the Repository Management pages to the new fixed column layout. I've also moved "Status" into the Basics page, which feels better, and moved "Documentation" as a nav item to a button in the header. This removed "action list" and "curtain view" from the management panels and uses the new bits from Config/Phacility. Undecided if the icons should stay or go for the nav. Left them in for Diffusion. I want to update the EditEngine pages to display in this UI and not leave the portal, but I haven't dug into that this page. I'm a bit worried it will not easily be possible.

Test Plan:
Generate a svn, git, hg repository, test each of the new pages and each of the new buttons. Activate, deactivate, etc.

{F5164674}

Reviewers: epriestley

Reviewed By: epriestley

Spies: Korvin

Differential Revision: https://secure.phabricator.com/D18523
2017-09-05 19:01:27 -07:00

69 lines
1.6 KiB
PHP

<?php
final class DiffusionRepositorySymbolsManagementPanel
extends DiffusionRepositoryManagementPanel {
const PANELKEY = 'symbols';
public function getManagementPanelLabel() {
return pht('Symbols');
}
public function getManagementPanelOrder() {
return 900;
}
public function getManagementPanelIcon() {
return 'fa-bullseye';
}
protected function getEditEngineFieldKeys() {
return array(
'symbolLanguages',
'symbolRepositoryPHIDs',
);
}
public function buildManagementPanelContent() {
$repository = $this->getRepository();
$viewer = $this->getViewer();
$view = id(new PHUIPropertyListView())
->setViewer($viewer);
$languages = $repository->getSymbolLanguages();
if ($languages) {
$languages = implode(', ', $languages);
} else {
$languages = phutil_tag('em', array(), pht('Any'));
}
$view->addProperty(pht('Languages'), $languages);
$sources = $repository->getSymbolSources();
if ($sources) {
$sources = $viewer->renderHandleList($sources);
} else {
$sources = phutil_tag('em', array(), pht('This Repository Only'));
}
$view->addProperty(pht('Uses Symbols From'), $sources);
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
$repository,
PhabricatorPolicyCapability::CAN_EDIT);
$symbols_uri = $this->getEditPageURI();
$button = id(new PHUIButtonView())
->setTag('a')
->setIcon('fa-pencil')
->setText(pht('Edit'))
->setHref($symbols_uri)
->setDisabled(!$can_edit)
->setWorkflow(!$can_edit);
return $this->newBox(pht('Symbols'), $view, array($button));
}
}