1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Make icon setting in Section Headers easier/consistent

Summary: You can already pass other icons, but this makes it a bit simpler.

Test Plan: Test Maniphest, Badges

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14131
This commit is contained in:
Chad Little 2015-09-19 11:29:01 -07:00
parent 9c43853815
commit 666f19e504
16 changed files with 36 additions and 21 deletions

View file

@ -109,7 +109,8 @@ final class PhabricatorBadgesViewController
'default',
$viewer);
$view->addSectionHeader(pht('Description'));
$view->addSectionHeader(
pht('Description'), PHUIPropertyListView::ICON_SUMMARY);
$view->addTextContent($description);
}

View file

@ -201,7 +201,8 @@ final class PhabricatorConduitConsoleController
id(new PhabricatorMarkupOneOff())->setContent($description),
'default',
$viewer);
$view->addSectionHeader(pht('Description'));
$view->addSectionHeader(
pht('Description'), PHUIPropertyListView::ICON_SUMMARY);
$view->addTextContent($description);
return $view;

View file

@ -156,7 +156,8 @@ abstract class DiffusionBrowseController extends DiffusionController {
$tag = idx($tags, $symbolic);
if ($tag && strlen($tag->getMessage())) {
$view->addSectionHeader(pht('Tag Content'));
$view->addSectionHeader(
pht('Tag Content'), 'fa-tag');
$view->addTextContent($this->markupText($tag->getMessage()));
}
}

View file

@ -289,7 +289,8 @@ final class DiffusionRepositoryController extends DiffusionController {
$repository,
'description',
$user);
$view->addSectionHeader(pht('Description'));
$view->addSectionHeader(
pht('Description'), PHUIPropertyListView::ICON_SUMMARY);
$view->addTextContent($description);
}

View file

@ -294,7 +294,8 @@ final class DiffusionRepositoryEditMainController
$this->buildRepositoryUpdateInterval($repository));
$description = $repository->getDetail('description');
$view->addSectionHeader(pht('Description'));
$view->addSectionHeader(
pht('Description'), PHUIPropertyListView::ICON_SUMMARY);
if (!strlen($description)) {
$description = phutil_tag('em', array(), pht('No description provided.'));
} else {

View file

@ -121,7 +121,8 @@ final class DrydockLeaseViewController extends DrydockLeaseController {
$attributes = $lease->getAttributes();
if ($attributes) {
$view->addSectionHeader(pht('Attributes'));
$view->addSectionHeader(
pht('Attributes'), 'fa-list-ul');
foreach ($attributes as $key => $value) {
$view->addProperty($key, $value);
}

View file

@ -117,7 +117,8 @@ final class DrydockResourceViewController extends DrydockResourceController {
$attributes = $resource->getAttributes();
if ($attributes) {
$view->addSectionHeader(pht('Attributes'));
$view->addSectionHeader(
pht('Attributes'), 'fa-list-ul');
foreach ($attributes as $key => $value) {
$view->addProperty($key, $value);
}

View file

@ -103,7 +103,8 @@ final class FundInitiativeViewController
'default',
$viewer);
$view->addSectionHeader(pht('Description'));
$view->addSectionHeader(
pht('Description'), PHUIPropertyListView::ICON_SUMMARY);
$view->addTextContent($description);
}
@ -114,7 +115,8 @@ final class FundInitiativeViewController
'default',
$viewer);
$view->addSectionHeader(pht('Risks/Challenges'));
$view->addSectionHeader(
pht('Risks/Challenges'), 'fa-ambulance');
$view->addTextContent($risks);
}

View file

@ -186,7 +186,8 @@ final class HarbormasterBuildViewController
'default',
$viewer);
$properties->addSectionHeader(pht('Description'));
$properties->addSectionHeader(
pht('Description'), PHUIPropertyListView::ICON_SUMMARY);
$properties->addTextContent($rendered);
}
} else {

View file

@ -84,7 +84,8 @@ final class LegalpadDocumentManageController extends LegalpadController {
$view = new PHUIPropertyListView();
$view->addClass('legalpad');
$view->addSectionHeader(pht('Document'));
$view->addSectionHeader(
pht('Document'), 'fa-file-text-o');
$view->addTextContent(
$engine->getOutput($body, LegalpadDocumentBody::MARKUP_FIELD_TEXT));

View file

@ -106,8 +106,7 @@ final class PhabricatorApplicationDetailViewController
$overview = $application->getOverview();
if ($overview) {
$properties->addSectionHeader(
pht('Overview'),
PHUIPropertyListView::ICON_SUMMARY);
pht('Overview'), PHUIPropertyListView::ICON_SUMMARY);
$properties->addTextContent(
PhabricatorMarkupEngine::renderOneObject(
id(new PhabricatorMarkupOneOff())->setContent($overview),
@ -119,7 +118,8 @@ final class PhabricatorApplicationDetailViewController
$viewer,
$application);
$properties->addSectionHeader(pht('Policies'));
$properties->addSectionHeader(
pht('Policies'), 'fa-lock');
foreach ($application->getCapabilities() as $capability) {
$properties->addProperty(

View file

@ -218,7 +218,8 @@ final class PhabricatorMetaMTAMailViewController
'Delivery reasons are listed from weakest to strongest.')));
}
$properties->addSectionHeader(pht('Routing Rules'));
$properties->addSectionHeader(
pht('Routing Rules'), 'fa-paper-plane-o');
$map = $mail->getDeliveredRoutingMap();
$routing_detail = null;

View file

@ -125,7 +125,8 @@ final class NuancePhabricatorFormSourceDefinition
'default',
$viewer);
$view->addSectionHeader(pht('Complaint'));
$view->addSectionHeader(
pht('Complaint'), 'fa-exclamation-circle');
$view->addTextContent($complaint);
}

View file

@ -189,7 +189,8 @@ final class PhabricatorOwnersDetailController
$description = $package->getDescription();
if (strlen($description)) {
$view->addSectionHeader(pht('Description'));
$view->addSectionHeader(
pht('Description'), PHUIPropertyListView::ICON_SUMMARY);
$view->addTextContent(
$output = PhabricatorMarkupEngine::renderOneObject(
id(new PhabricatorMarkupOneOff())->setContent($description),

View file

@ -141,7 +141,8 @@ final class PhortuneMerchantViewController
'default',
$viewer);
$view->addSectionHeader(pht('Description'));
$view->addSectionHeader(
pht('Description'), PHUIPropertyListView::ICON_SUMMARY);
$view->addTextContent($description);
}

View file

@ -10,8 +10,8 @@ final class PHUIPropertyListView extends AphrontView {
private $classes = array();
private $stacked;
const ICON_SUMMARY = 'fa-align-left bluegrey';
const ICON_TESTPLAN = 'fa-file-text-o bluegrey';
const ICON_SUMMARY = 'fa-align-left';
const ICON_TESTPLAN = 'fa-file-text-o';
protected function canAppendChild() {
return false;
@ -247,7 +247,7 @@ final class PHUIPropertyListView extends AphrontView {
$name = $part['name'];
if ($part['icon']) {
$icon = id(new PHUIIconView())
->setIconFont($part['icon']);
->setIconFont($part['icon'].' bluegrey');
$name = phutil_tag(
'span',
array(