From 45ae9cf340c7c888669d70b344fe6a894d429746 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Fri, 23 Jan 2015 11:35:09 -0800 Subject: [PATCH] Move PhabricatorCrumbs to PHUICrumbs Summary: Ref T7014, laying the groundwork for redesigning crumbs. Test Plan: Tested numberous pages, grep'd locations. Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7014 Differential Revision: https://secure.phabricator.com/D11478 --- resources/celerity/map.php | 16 +++---- resources/celerity/packages.php | 2 +- src/__phutil_library_map__.php | 8 ++-- .../base/controller/PhabricatorController.php | 4 +- .../celerity/CeleritySpriteGenerator.php | 2 +- .../controller/ConpherenceController.php | 2 +- .../controller/DiffusionController.php | 12 ++--- .../controller/PhrictionController.php | 2 +- src/view/layout/AphrontSideNavFilterView.php | 2 +- .../PHUICrumbView.php} | 12 ++--- .../PHUICrumbsView.php} | 18 ++++---- webroot/rsrc/css/core/z-index.css | 2 +- .../phui-crumbs-view.css} | 44 +++++++++---------- webroot/rsrc/css/sprite-menu.css | 2 +- 14 files changed, 64 insertions(+), 64 deletions(-) rename src/view/{layout/PhabricatorCrumbView.php => phui/PHUICrumbView.php} (86%) rename src/view/{layout/PhabricatorCrumbsView.php => phui/PHUICrumbsView.php} (81%) rename webroot/rsrc/css/{layout/phabricator-crumbs-view.css => phui/phui-crumbs-view.css} (56%) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index eda9f3aef5..a34d232c88 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'core.pkg.css' => '8d1c0f87', + 'core.pkg.css' => 'd7209022', 'core.pkg.js' => '2d9bfc06', 'darkconsole.pkg.js' => '8ab24e01', 'differential.pkg.css' => '8af45893', @@ -107,12 +107,11 @@ return array( 'rsrc/css/core/core.css' => 'ca42b69f', 'rsrc/css/core/remarkup.css' => '0ee3d256', 'rsrc/css/core/syntax.css' => '56c1ba38', - 'rsrc/css/core/z-index.css' => '44e1d311', + 'rsrc/css/core/z-index.css' => '27a9a1be', 'rsrc/css/diviner/diviner-shared.css' => '38813222', 'rsrc/css/font/font-awesome.css' => '0c10d96b', 'rsrc/css/font/font-source-sans-pro.css' => '91d53463', 'rsrc/css/font/phui-font-icon-base.css' => '3dad2ae3', - 'rsrc/css/layout/phabricator-crumbs-view.css' => 'd5aa87e4', 'rsrc/css/layout/phabricator-filetree-view.css' => 'fccf9f82', 'rsrc/css/layout/phabricator-hovercard-view.css' => '893f4783', 'rsrc/css/layout/phabricator-side-menu-view.css' => '7e8c6341', @@ -125,6 +124,7 @@ return array( 'rsrc/css/phui/phui-action-list.css' => '9ee9910a', 'rsrc/css/phui/phui-box.css' => '7b3a2eed', 'rsrc/css/phui/phui-button.css' => '008ba5e2', + 'rsrc/css/phui/phui-crumbs-view.css' => '1705bce6', 'rsrc/css/phui/phui-document.css' => 'bbeb1890', 'rsrc/css/phui/phui-feed-story.css' => '582f0ec9', 'rsrc/css/phui/phui-fontkit.css' => '9c3d2dce', @@ -152,7 +152,7 @@ return array( 'rsrc/css/sprite-gradient.css' => '4bdb98a7', 'rsrc/css/sprite-login.css' => 'a355d921', 'rsrc/css/sprite-main-header.css' => '92720ee2', - 'rsrc/css/sprite-menu.css' => '0ca5a908', + 'rsrc/css/sprite-menu.css' => '661b879f', 'rsrc/css/sprite-projects.css' => 'b0d9e24f', 'rsrc/css/sprite-tokens.css' => '1706b943', 'rsrc/externals/font/fontawesome/fontawesome-webfont.eot' => '579d3140', @@ -707,7 +707,6 @@ return array( 'phabricator-content-source-view-css' => '4b8b05d4', 'phabricator-core-css' => 'ca42b69f', 'phabricator-countdown-css' => '86b7b0a0', - 'phabricator-crumbs-view-css' => 'd5aa87e4', 'phabricator-dashboard-css' => 'a2bfdcbf', 'phabricator-drag-and-drop-file-upload' => '8c49f386', 'phabricator-draggable-list' => 'a16ec1c6', @@ -751,7 +750,7 @@ return array( 'phabricator-uiexample-reactor-select' => 'a155550f', 'phabricator-uiexample-reactor-sendclass' => '1def2711', 'phabricator-uiexample-reactor-sendproperties' => 'b1f0ccee', - 'phabricator-zindex-css' => '44e1d311', + 'phabricator-zindex-css' => '27a9a1be', 'phame-css' => '19ecc703', 'pholio-css' => '95174bdd', 'pholio-edit-css' => '3ad9d1ee', @@ -768,6 +767,7 @@ return array( 'phui-calendar-day-css' => 'de035c8a', 'phui-calendar-list-css' => 'c1d0ca59', 'phui-calendar-month-css' => 'a92e47d2', + 'phui-crumbs-view-css' => '1705bce6', 'phui-document-view-css' => 'bbeb1890', 'phui-feed-story-css' => '582f0ec9', 'phui-font-icon-base-css' => '3dad2ae3', @@ -815,7 +815,7 @@ return array( 'sprite-gradient-css' => '4bdb98a7', 'sprite-login-css' => 'a355d921', 'sprite-main-header-css' => '92720ee2', - 'sprite-menu-css' => '0ca5a908', + 'sprite-menu-css' => '661b879f', 'sprite-projects-css' => 'b0d9e24f', 'sprite-tokens-css' => '1706b943', 'syntax-highlighting-css' => '56c1ba38', @@ -2007,7 +2007,7 @@ return array( 'phabricator-filetree-view-css', 'phabricator-nav-view-css', 'phabricator-side-menu-view-css', - 'phabricator-crumbs-view-css', + 'phui-crumbs-view-css', 'phui-object-item-list-view-css', 'global-drag-and-drop-css', 'phui-spacing-css', diff --git a/resources/celerity/packages.php b/resources/celerity/packages.php index 507a4dc645..cf0e69c5cb 100644 --- a/resources/celerity/packages.php +++ b/resources/celerity/packages.php @@ -109,7 +109,7 @@ return array( 'phabricator-filetree-view-css', 'phabricator-nav-view-css', 'phabricator-side-menu-view-css', - 'phabricator-crumbs-view-css', + 'phui-crumbs-view-css', 'phui-object-item-list-view-css', 'global-drag-and-drop-css', 'phui-spacing-css', diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 30ed8e65d7..210088b9a3 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1132,6 +1132,8 @@ phutil_register_library_map(array( 'PHUICalendarMonthView' => 'view/phui/calendar/PHUICalendarMonthView.php', 'PHUICalendarWidgetView' => 'view/phui/calendar/PHUICalendarWidgetView.php', 'PHUIColorPalletteExample' => 'applications/uiexample/examples/PHUIColorPalletteExample.php', + 'PHUICrumbView' => 'view/phui/PHUICrumbView.php', + 'PHUICrumbsView' => 'view/phui/PHUICrumbsView.php', 'PHUIDocumentExample' => 'applications/uiexample/examples/PHUIDocumentExample.php', 'PHUIDocumentView' => 'view/phui/PHUIDocumentView.php', 'PHUIFeedStoryExample' => 'applications/uiexample/examples/PHUIFeedStoryExample.php', @@ -1551,8 +1553,6 @@ phutil_register_library_map(array( 'PhabricatorCountdownView' => 'applications/countdown/view/PhabricatorCountdownView.php', 'PhabricatorCountdownViewController' => 'applications/countdown/controller/PhabricatorCountdownViewController.php', 'PhabricatorCredentialsUsedByObjectEdgeType' => 'applications/passphrase/edge/PhabricatorCredentialsUsedByObjectEdgeType.php', - 'PhabricatorCrumbView' => 'view/layout/PhabricatorCrumbView.php', - 'PhabricatorCrumbsView' => 'view/layout/PhabricatorCrumbsView.php', 'PhabricatorCursorPagedPolicyAwareQuery' => 'infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php', 'PhabricatorCustomField' => 'infrastructure/customfield/field/PhabricatorCustomField.php', 'PhabricatorCustomFieldAttachment' => 'infrastructure/customfield/field/PhabricatorCustomFieldAttachment.php', @@ -4309,6 +4309,8 @@ phutil_register_library_map(array( 'PHUICalendarMonthView' => 'AphrontView', 'PHUICalendarWidgetView' => 'AphrontTagView', 'PHUIColorPalletteExample' => 'PhabricatorUIExample', + 'PHUICrumbView' => 'AphrontView', + 'PHUICrumbsView' => 'AphrontView', 'PHUIDocumentExample' => 'PhabricatorUIExample', 'PHUIDocumentView' => 'AphrontTagView', 'PHUIFeedStoryExample' => 'PhabricatorUIExample', @@ -4762,8 +4764,6 @@ phutil_register_library_map(array( 'PhabricatorCountdownView' => 'AphrontTagView', 'PhabricatorCountdownViewController' => 'PhabricatorCountdownController', 'PhabricatorCredentialsUsedByObjectEdgeType' => 'PhabricatorEdgeType', - 'PhabricatorCrumbView' => 'AphrontView', - 'PhabricatorCrumbsView' => 'AphrontView', 'PhabricatorCursorPagedPolicyAwareQuery' => 'PhabricatorPolicyAwareQuery', 'PhabricatorCustomFieldConfigOptionType' => 'PhabricatorConfigOptionType', 'PhabricatorCustomFieldDataNotAvailableException' => 'Exception', diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php index 16a92f2b16..6597ae7709 100644 --- a/src/applications/base/controller/PhabricatorController.php +++ b/src/applications/base/controller/PhabricatorController.php @@ -439,13 +439,13 @@ abstract class PhabricatorController extends AphrontController { $sprite = 'application'; } - $crumbs[] = id(new PhabricatorCrumbView()) + $crumbs[] = id(new PHUICrumbView()) ->setHref($this->getApplicationURI()) ->setAural($application->getName()) ->setIcon($sprite); } - $view = new PhabricatorCrumbsView(); + $view = new PHUICrumbsView(); foreach ($crumbs as $crumb) { $view->addCrumb($crumb); } diff --git a/src/applications/celerity/CeleritySpriteGenerator.php b/src/applications/celerity/CeleritySpriteGenerator.php index 4592d6584c..87c703dae6 100644 --- a/src/applications/celerity/CeleritySpriteGenerator.php +++ b/src/applications/celerity/CeleritySpriteGenerator.php @@ -9,7 +9,7 @@ final class CeleritySpriteGenerator { 'arrow-right' => array( 'x' => 9, 'y' => 31, - 'css' => '.phabricator-crumb-divider', + 'css' => '.phui-crumb-divider', ), 'logo' => array( 'x' => 96, diff --git a/src/applications/conpherence/controller/ConpherenceController.php b/src/applications/conpherence/controller/ConpherenceController.php index deef52267d..864f23dadf 100644 --- a/src/applications/conpherence/controller/ConpherenceController.php +++ b/src/applications/conpherence/controller/ConpherenceController.php @@ -59,7 +59,7 @@ abstract class ConpherenceController extends PhabricatorController { $title = pht('[No Title]'); } $crumbs->addCrumb( - id(new PhabricatorCrumbView()) + id(new PHUICrumbView()) ->setName($title) ->setHref($this->getApplicationURI('update/'.$conpherence->getID().'/')) ->setWorkflow(true)); diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php index a8f61115ae..a65ef58d65 100644 --- a/src/applications/diffusion/controller/DiffusionController.php +++ b/src/applications/diffusion/controller/DiffusionController.php @@ -96,7 +96,7 @@ abstract class DiffusionController extends PhabricatorController { } } - $crumb = id(new PhabricatorCrumbView()) + $crumb = id(new PHUICrumbView()) ->setName($repository_name); if (!$spec['view'] && !$spec['commit'] && !$spec['tags'] && !$spec['branches']) { @@ -114,7 +114,7 @@ abstract class DiffusionController extends PhabricatorController { $stable_commit = $drequest->getStableCommit(); if ($spec['tags']) { - $crumb = new PhabricatorCrumbView(); + $crumb = new PHUICrumbView(); if ($spec['commit']) { $crumb->setName( pht('Tags for %s', 'r'.$callsign.$stable_commit)); @@ -131,21 +131,21 @@ abstract class DiffusionController extends PhabricatorController { } if ($spec['branches']) { - $crumb = id(new PhabricatorCrumbView()) + $crumb = id(new PHUICrumbView()) ->setName(pht('Branches')); $crumb_list[] = $crumb; return $crumb_list; } if ($spec['commit']) { - $crumb = id(new PhabricatorCrumbView()) + $crumb = id(new PHUICrumbView()) ->setName("r{$callsign}{$stable_commit}") ->setHref("r{$callsign}{$stable_commit}"); $crumb_list[] = $crumb; return $crumb_list; } - $crumb = new PhabricatorCrumbView(); + $crumb = new PHUICrumbView(); $view = $spec['view']; switch ($view) { @@ -163,7 +163,7 @@ abstract class DiffusionController extends PhabricatorController { break; } - $crumb = id(new PhabricatorCrumbView()) + $crumb = id(new PHUICrumbView()) ->setName($view_name); $crumb_list[] = $crumb; diff --git a/src/applications/phriction/controller/PhrictionController.php b/src/applications/phriction/controller/PhrictionController.php index fcd49aae22..277692334f 100644 --- a/src/applications/phriction/controller/PhrictionController.php +++ b/src/applications/phriction/controller/PhrictionController.php @@ -80,7 +80,7 @@ abstract class PhrictionController extends PhabricatorController { $breadcrumbs = array(); foreach ($ancestor_handles as $ancestor_handle) { - $breadcrumbs[] = id(new PhabricatorCrumbView()) + $breadcrumbs[] = id(new PHUICrumbView()) ->setName($ancestor_handle->getName()) ->setHref($ancestor_handle->getUri()); } diff --git a/src/view/layout/AphrontSideNavFilterView.php b/src/view/layout/AphrontSideNavFilterView.php index 744d5b78e8..29f1d649ad 100644 --- a/src/view/layout/AphrontSideNavFilterView.php +++ b/src/view/layout/AphrontSideNavFilterView.php @@ -53,7 +53,7 @@ final class AphrontSideNavFilterView extends AphrontView { return $object; } - public function setCrumbs(PhabricatorCrumbsView $crumbs) { + public function setCrumbs(PHUICrumbsView $crumbs) { $this->crumbs = $crumbs; return $this; } diff --git a/src/view/layout/PhabricatorCrumbView.php b/src/view/phui/PHUICrumbView.php similarity index 86% rename from src/view/layout/PhabricatorCrumbView.php rename to src/view/phui/PHUICrumbView.php index 2b6db81a47..b4e69a479f 100644 --- a/src/view/layout/PhabricatorCrumbView.php +++ b/src/view/phui/PHUICrumbView.php @@ -1,6 +1,6 @@ icon) { - $classes[] = 'phabricator-crumb-has-icon'; + $classes[] = 'phui-crumb-has-icon'; $icon = phutil_tag( 'span', array( - 'class' => 'phabricator-crumb-icon '. + 'class' => 'phui-crumb-icon '. 'sprite-apps-large apps-'.$this->icon.'-dark-large', ), ''); @@ -81,7 +81,7 @@ final class PhabricatorCrumbView extends AphrontView { $name = phutil_tag( 'span', array( - 'class' => 'phabricator-crumb-name', + 'class' => 'phui-crumb-name', ), $this->name); @@ -90,7 +90,7 @@ final class PhabricatorCrumbView extends AphrontView { $divider = phutil_tag( 'span', array( - 'class' => 'sprite-menu phabricator-crumb-divider', + 'class' => 'sprite-menu phui-crumb-divider', ), ''); } else { diff --git a/src/view/layout/PhabricatorCrumbsView.php b/src/view/phui/PHUICrumbsView.php similarity index 81% rename from src/view/layout/PhabricatorCrumbsView.php rename to src/view/phui/PHUICrumbsView.php index a2ae8dc4ae..185e869246 100644 --- a/src/view/layout/PhabricatorCrumbsView.php +++ b/src/view/phui/PHUICrumbsView.php @@ -1,6 +1,6 @@ addCrumb( - id(new PhabricatorCrumbView()) + id(new PHUICrumbView()) ->setName($text) ->setHref($href)); } - public function addCrumb(PhabricatorCrumbView $crumb) { + public function addCrumb(PHUICrumbView $crumb) { $this->crumbs[] = $crumb; return $this; } @@ -36,7 +36,7 @@ final class PhabricatorCrumbsView extends AphrontView { } public function render() { - require_celerity_resource('phabricator-crumbs-view-css'); + require_celerity_resource('phui-crumbs-view-css'); $action_view = null; if ($this->actions) { @@ -56,7 +56,7 @@ final class PhabricatorCrumbsView extends AphrontView { $name = phutil_tag( 'span', array( - 'class' => 'phabricator-crumbs-action-name', + 'class' => 'phui-crumbs-action-name', ), $action->getName()); @@ -65,10 +65,10 @@ final class PhabricatorCrumbsView extends AphrontView { $action_sigils[] = 'workflow'; } $action_classes = $action->getClasses(); - $action_classes[] = 'phabricator-crumbs-action'; + $action_classes[] = 'phui-crumbs-action'; if ($action->getDisabled()) { - $action_classes[] = 'phabricator-crumbs-action-disabled'; + $action_classes[] = 'phui-crumbs-action-disabled'; } $actions[] = javelin_tag( @@ -88,7 +88,7 @@ final class PhabricatorCrumbsView extends AphrontView { $action_view = phutil_tag( 'div', array( - 'class' => 'phabricator-crumbs-actions', + 'class' => 'phui-crumbs-actions', ), $actions); } @@ -100,7 +100,7 @@ final class PhabricatorCrumbsView extends AphrontView { return phutil_tag( 'div', array( - 'class' => 'phabricator-crumbs-view '. + 'class' => 'phui-crumbs-view '. 'sprite-gradient gradient-breadcrumbs', ), array( diff --git a/webroot/rsrc/css/core/z-index.css b/webroot/rsrc/css/core/z-index.css index c406fad132..f46f972935 100644 --- a/webroot/rsrc/css/core/z-index.css +++ b/webroot/rsrc/css/core/z-index.css @@ -38,7 +38,7 @@ z-index: 3; } -.phabricator-crumbs-view { +.phui-crumbs-view { z-index: 3; } diff --git a/webroot/rsrc/css/layout/phabricator-crumbs-view.css b/webroot/rsrc/css/phui/phui-crumbs-view.css similarity index 56% rename from webroot/rsrc/css/layout/phabricator-crumbs-view.css rename to webroot/rsrc/css/phui/phui-crumbs-view.css index 4637382a4f..f916622824 100644 --- a/webroot/rsrc/css/layout/phabricator-crumbs-view.css +++ b/webroot/rsrc/css/phui/phui-crumbs-view.css @@ -1,8 +1,8 @@ /** - * @provides phabricator-crumbs-view-css + * @provides phui-crumbs-view-css */ -.phabricator-crumbs-view { +.phui-crumbs-view { background-color: #ebecee; background-image: none !important; height: 31px; @@ -15,43 +15,43 @@ -webkit-font-smoothing: antialiased; } -.phabricator-crumbs-view, -.phabricator-crumbs-view a.phabricator-crumb-view, -.phabricator-crumbs-view a.phabricator-crumbs-action { +.phui-crumbs-view, +.phui-crumbs-view a.phui-crumb-view, +.phui-crumbs-view a.phui-crumbs-action { color: {$darkbluetext}; font-weight: bold; text-decoration: none; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.9); } -.phabricator-crumbs-view a.phabricator-crumbs-action-disabled { +.phui-crumbs-view a.phui-crumbs-action-disabled { color: {$lightgreytext}; } -.phabricator-crumbs-view + .phui-header-shell { +.phui-crumbs-view + .phui-header-shell { border-top: none; } -.device-desktop .phabricator-crumbs-view a:hover { +.device-desktop .phui-crumbs-view a:hover { text-decoration: underline; } -.phabricator-crumb-view { +.phui-crumb-view { float: left; height: 31px; line-height: 31px; } -.device-phone .phabricator-crumb-view { +.device-phone .phui-crumb-view { display: none; } -.device-phone .phabricator-crumb-view.phabricator-last-crumb, -.device-phone .phabricator-crumb-view.phabricator-crumb-has-icon { +.device-phone .phui-crumb-view.phabricator-last-crumb, +.device-phone .phui-crumb-view.phui-crumb-has-icon { display: inline-block; } -.phabricator-crumb-icon { +.phui-crumb-icon { display: inline-block; width: 28px; height: 28px; @@ -59,46 +59,46 @@ vertical-align: top; } -.device-phone .phabricator-crumb-icon { +.device-phone .phui-crumb-icon { margin-left: 7px; } -.phabricator-crumbs-actions { +.phui-crumbs-actions { float: right; white-space: nowrap; } -.phabricator-crumbs-action { +.phui-crumbs-action { display: inline-block; height: 17px; padding: 8px 12px; position: relative; } -.device-phone a.phabricator-crumbs-action { +.device-phone a.phui-crumbs-action { padding: 7px; border-left: 1px solid {$hovergrey}; } -.device-desktop a.phabricator-crumbs-action:hover { +.device-desktop a.phui-crumbs-action:hover { background: rgba(205, 207, 211, .5); text-decoration: none; } -.device-phone .phabricator-crumbs-action-name { +.device-phone .phui-crumbs-action-name { display: none; } -a.phabricator-crumbs-action .phui-icon-view { +a.phui-crumbs-action .phui-icon-view { margin-right: 5px; color: {$darkbluetext}; } -.device-phone a.phabricator-crumbs-action .phui-icon-view { +.device-phone a.phui-crumbs-action .phui-icon-view { margin-left: 5px; } -.phabricator-crumb-divider { +.phui-crumb-divider { display: inline-block; width: 9px; height: 31px; diff --git a/webroot/rsrc/css/sprite-menu.css b/webroot/rsrc/css/sprite-menu.css index b9330ceacc..b7ac768670 100644 --- a/webroot/rsrc/css/sprite-menu.css +++ b/webroot/rsrc/css/sprite-menu.css @@ -18,7 +18,7 @@ only screen and (-webkit-min-device-pixel-ratio: 1.5) { } -.phabricator-crumb-divider { +.phui-crumb-divider { background-position: 0px -27px; }