From 5a460e4ea57df6c43a7b1cc953d74d4228dc19f3 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 24 Apr 2020 10:56:51 -0700 Subject: [PATCH] Stick the page footer in the right place on Formation View pages Summary: Ref T13516. This isn't terribly clean, but get the page footer into the bottom of the content page on FormationView pages so it doesn't overlap into the side panel. Test Plan: With and without a footer, viewed normal and FormationView pages. Saw footers in appropriate places at appropriate times. Maniphest Tasks: T13516 Differential Revision: https://secure.phabricator.com/D21166 --- resources/celerity/map.php | 6 ++--- src/view/formation/PHUIFormationView.php | 12 ++++++++++ src/view/page/PhabricatorStandardPageView.php | 23 +++++++++++++++---- webroot/rsrc/css/phui/phui-formation-view.css | 3 +++ 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index e380ccd732..a924b5c919 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -12,7 +12,7 @@ return array( 'core.pkg.css' => '589cd2fe', 'core.pkg.js' => '49814bac', 'dark-console.pkg.js' => '187792c2', - 'differential.pkg.css' => 'b3469b93', + 'differential.pkg.css' => '8e1a7922', 'differential.pkg.js' => 'c8f88d74', 'diffusion.pkg.css' => '42c75c37', 'diffusion.pkg.js' => 'a98c0bf7', @@ -156,7 +156,7 @@ return array( 'rsrc/css/phui/phui-fontkit.css' => '1ec937e5', 'rsrc/css/phui/phui-form-view.css' => '01b796c0', 'rsrc/css/phui/phui-form.css' => '1f177cb7', - 'rsrc/css/phui/phui-formation-view.css' => '1e6b744b', + 'rsrc/css/phui/phui-formation-view.css' => 'd2dec8ed', 'rsrc/css/phui/phui-head-thing.css' => 'd7f293df', 'rsrc/css/phui/phui-header-view.css' => '36c86a58', 'rsrc/css/phui/phui-hovercard.css' => '6ca90fa0', @@ -847,7 +847,7 @@ return array( 'phui-fontkit-css' => '1ec937e5', 'phui-form-css' => '1f177cb7', 'phui-form-view-css' => '01b796c0', - 'phui-formation-view-css' => '1e6b744b', + 'phui-formation-view-css' => 'd2dec8ed', 'phui-head-thing-view-css' => 'd7f293df', 'phui-header-view-css' => '36c86a58', 'phui-hovercard' => '074f0783', diff --git a/src/view/formation/PHUIFormationView.php b/src/view/formation/PHUIFormationView.php index feeaf6fb55..fc4e97c5c1 100644 --- a/src/view/formation/PHUIFormationView.php +++ b/src/view/formation/PHUIFormationView.php @@ -191,4 +191,16 @@ final class PHUIFormationView return $items; } + public function setFooter($footer) { + foreach ($this->items as $item) { + if ($item->getColumn() instanceof PHUIFormationContentView) { + $item->getColumn()->appendChild($footer); + return $this; + } + } + + throw new Exception( + pht('Unable to find a content column to place the footer inside.')); + } + } diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php index bebb13ad1e..ecb12bb81d 100644 --- a/src/view/page/PhabricatorStandardPageView.php +++ b/src/view/page/PhabricatorStandardPageView.php @@ -22,6 +22,7 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView private $tabs; private $crumbs; private $navigation; + private $footer; public function setShowFooter($show_footer) { $this->showFooter = $show_footer; @@ -196,6 +197,22 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView protected function willRenderPage() { + $footer = $this->renderFooter(); + + // NOTE: A cleaner solution would be to let body layout elements implement + // some kind of "LayoutInterface" so content can be embedded inside frames, + // but there's only really one use case for this for now. + $children = $this->renderChildren(); + if ($children) { + $layout = head($children); + if ($layout instanceof PHUIFormationView) { + $layout->setFooter($footer); + $footer = null; + } + } + + $this->footer = $footer; + parent::willRenderPage(); if (!$this->getRequest()) { @@ -501,8 +518,6 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView $body = parent::getBody(); - $footer = $this->renderFooter(); - $nav = $this->getNavigation(); $tabs = $this->getTabs(); if ($nav) { @@ -511,7 +526,7 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView $nav->setCrumbs($crumbs); } $nav->appendChild($body); - $nav->appendFooter($footer); + $nav->appendFooter($this->footer); $content = phutil_implode_html('', array($nav->render())); } else { $content = array(); @@ -530,7 +545,7 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView } $content[] = $body; - $content[] = $footer; + $content[] = $this->footer; $content = phutil_implode_html('', $content); } diff --git a/webroot/rsrc/css/phui/phui-formation-view.css b/webroot/rsrc/css/phui/phui-formation-view.css index eb92bfc82e..cc6748c35a 100644 --- a/webroot/rsrc/css/phui/phui-formation-view.css +++ b/webroot/rsrc/css/phui/phui-formation-view.css @@ -127,6 +127,7 @@ background-repeat: no-repeat; display: none; + z-index: 4; } .device-desktop .phui-formation-resizer { @@ -138,6 +139,8 @@ top: {$menu.main.height}; bottom: 0; overflow: hidden; + background: {$lightgreybackground}; + z-index: 4; } .phui-flank-view-fixed .phui-flank-view-body {