1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-05 12:21:02 +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', 'default',
$viewer); $viewer);
$view->addSectionHeader(pht('Description')); $view->addSectionHeader(
pht('Description'), PHUIPropertyListView::ICON_SUMMARY);
$view->addTextContent($description); $view->addTextContent($description);
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -218,7 +218,8 @@ final class PhabricatorMetaMTAMailViewController
'Delivery reasons are listed from weakest to strongest.'))); '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(); $map = $mail->getDeliveredRoutingMap();
$routing_detail = null; $routing_detail = null;

View file

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

View file

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

View file

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

View file

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