From 666f19e504916e8df6fb9949d660b86180a99132 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sat, 19 Sep 2015 11:29:01 -0700 Subject: [PATCH] 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 --- .../badges/controller/PhabricatorBadgesViewController.php | 3 ++- .../controller/PhabricatorConduitConsoleController.php | 3 ++- .../diffusion/controller/DiffusionBrowseController.php | 3 ++- .../diffusion/controller/DiffusionRepositoryController.php | 3 ++- .../controller/DiffusionRepositoryEditMainController.php | 3 ++- .../drydock/controller/DrydockLeaseViewController.php | 3 ++- .../drydock/controller/DrydockResourceViewController.php | 3 ++- .../fund/controller/FundInitiativeViewController.php | 6 ++++-- .../controller/HarbormasterBuildViewController.php | 3 ++- .../controller/LegalpadDocumentManageController.php | 3 ++- .../PhabricatorApplicationDetailViewController.php | 6 +++--- .../controller/PhabricatorMetaMTAMailViewController.php | 3 ++- .../nuance/source/NuancePhabricatorFormSourceDefinition.php | 3 ++- .../owners/controller/PhabricatorOwnersDetailController.php | 3 ++- .../phortune/controller/PhortuneMerchantViewController.php | 3 ++- src/view/phui/PHUIPropertyListView.php | 6 +++--- 16 files changed, 36 insertions(+), 21 deletions(-) diff --git a/src/applications/badges/controller/PhabricatorBadgesViewController.php b/src/applications/badges/controller/PhabricatorBadgesViewController.php index 387b5d1f98..abaafe6d0f 100644 --- a/src/applications/badges/controller/PhabricatorBadgesViewController.php +++ b/src/applications/badges/controller/PhabricatorBadgesViewController.php @@ -109,7 +109,8 @@ final class PhabricatorBadgesViewController 'default', $viewer); - $view->addSectionHeader(pht('Description')); + $view->addSectionHeader( + pht('Description'), PHUIPropertyListView::ICON_SUMMARY); $view->addTextContent($description); } diff --git a/src/applications/conduit/controller/PhabricatorConduitConsoleController.php b/src/applications/conduit/controller/PhabricatorConduitConsoleController.php index 04d2c6ee6d..79312b5480 100644 --- a/src/applications/conduit/controller/PhabricatorConduitConsoleController.php +++ b/src/applications/conduit/controller/PhabricatorConduitConsoleController.php @@ -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; diff --git a/src/applications/diffusion/controller/DiffusionBrowseController.php b/src/applications/diffusion/controller/DiffusionBrowseController.php index e8bd46b735..c924a9b0b3 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseController.php @@ -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())); } } diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php index 5b63f16d71..cfa4f8f0d6 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php @@ -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); } diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php index cd387537b0..6519a4380e 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php @@ -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 { diff --git a/src/applications/drydock/controller/DrydockLeaseViewController.php b/src/applications/drydock/controller/DrydockLeaseViewController.php index 92d215bcbb..562e466311 100644 --- a/src/applications/drydock/controller/DrydockLeaseViewController.php +++ b/src/applications/drydock/controller/DrydockLeaseViewController.php @@ -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); } diff --git a/src/applications/drydock/controller/DrydockResourceViewController.php b/src/applications/drydock/controller/DrydockResourceViewController.php index 4cc7349dac..afa0fb49fd 100644 --- a/src/applications/drydock/controller/DrydockResourceViewController.php +++ b/src/applications/drydock/controller/DrydockResourceViewController.php @@ -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); } diff --git a/src/applications/fund/controller/FundInitiativeViewController.php b/src/applications/fund/controller/FundInitiativeViewController.php index 3d12f1549c..71cebc842d 100644 --- a/src/applications/fund/controller/FundInitiativeViewController.php +++ b/src/applications/fund/controller/FundInitiativeViewController.php @@ -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); } diff --git a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php index 1a9832c588..b6f4473c5a 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php @@ -186,7 +186,8 @@ final class HarbormasterBuildViewController 'default', $viewer); - $properties->addSectionHeader(pht('Description')); + $properties->addSectionHeader( + pht('Description'), PHUIPropertyListView::ICON_SUMMARY); $properties->addTextContent($rendered); } } else { diff --git a/src/applications/legalpad/controller/LegalpadDocumentManageController.php b/src/applications/legalpad/controller/LegalpadDocumentManageController.php index 9fc773258f..1ca838258b 100644 --- a/src/applications/legalpad/controller/LegalpadDocumentManageController.php +++ b/src/applications/legalpad/controller/LegalpadDocumentManageController.php @@ -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)); diff --git a/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php b/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php index da23cc31ff..702d0b2130 100644 --- a/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php +++ b/src/applications/meta/controller/PhabricatorApplicationDetailViewController.php @@ -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( diff --git a/src/applications/metamta/controller/PhabricatorMetaMTAMailViewController.php b/src/applications/metamta/controller/PhabricatorMetaMTAMailViewController.php index 7cb1ad71d6..ec43312e23 100644 --- a/src/applications/metamta/controller/PhabricatorMetaMTAMailViewController.php +++ b/src/applications/metamta/controller/PhabricatorMetaMTAMailViewController.php @@ -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; diff --git a/src/applications/nuance/source/NuancePhabricatorFormSourceDefinition.php b/src/applications/nuance/source/NuancePhabricatorFormSourceDefinition.php index 607b0eda6c..675b2634a9 100644 --- a/src/applications/nuance/source/NuancePhabricatorFormSourceDefinition.php +++ b/src/applications/nuance/source/NuancePhabricatorFormSourceDefinition.php @@ -125,7 +125,8 @@ final class NuancePhabricatorFormSourceDefinition 'default', $viewer); - $view->addSectionHeader(pht('Complaint')); + $view->addSectionHeader( + pht('Complaint'), 'fa-exclamation-circle'); $view->addTextContent($complaint); } diff --git a/src/applications/owners/controller/PhabricatorOwnersDetailController.php b/src/applications/owners/controller/PhabricatorOwnersDetailController.php index 7edcf010b6..bb178cfbcb 100644 --- a/src/applications/owners/controller/PhabricatorOwnersDetailController.php +++ b/src/applications/owners/controller/PhabricatorOwnersDetailController.php @@ -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), diff --git a/src/applications/phortune/controller/PhortuneMerchantViewController.php b/src/applications/phortune/controller/PhortuneMerchantViewController.php index 4b515c44c5..4bedbd9e9c 100644 --- a/src/applications/phortune/controller/PhortuneMerchantViewController.php +++ b/src/applications/phortune/controller/PhortuneMerchantViewController.php @@ -141,7 +141,8 @@ final class PhortuneMerchantViewController 'default', $viewer); - $view->addSectionHeader(pht('Description')); + $view->addSectionHeader( + pht('Description'), PHUIPropertyListView::ICON_SUMMARY); $view->addTextContent($description); } diff --git a/src/view/phui/PHUIPropertyListView.php b/src/view/phui/PHUIPropertyListView.php index 96c249d866..8a44ecd941 100644 --- a/src/view/phui/PHUIPropertyListView.php +++ b/src/view/phui/PHUIPropertyListView.php @@ -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(