Page MenuHomePhabricator

D10466.diff
No OneTemporary

D10466.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -7,7 +7,7 @@
*/
return array(
'names' => array(
- 'core.pkg.css' => '974635bb',
+ 'core.pkg.css' => 'f4235a32',
'core.pkg.js' => 'cbdbd552',
'darkconsole.pkg.js' => 'df001cab',
'differential.pkg.css' => '36884139',
@@ -39,7 +39,7 @@
'rsrc/css/application/base/main-menu-view.css' => 'aceca0e9',
'rsrc/css/application/base/notification-menu.css' => '6aa0a74b',
'rsrc/css/application/base/phabricator-application-launch-view.css' => '8b7e271d',
- 'rsrc/css/application/base/standard-page-view.css' => '517cdfb1',
+ 'rsrc/css/application/base/standard-page-view.css' => 'dd860661',
'rsrc/css/application/chatlog/chatlog.css' => '852140ff',
'rsrc/css/application/config/config-options.css' => '7fedf08b',
'rsrc/css/application/config/config-template.css' => '25d446d6',
@@ -739,7 +739,7 @@
'phabricator-side-menu-view-css' => 'a2ccd7bd',
'phabricator-slowvote-css' => '266df6a1',
'phabricator-source-code-view-css' => '7d346aa4',
- 'phabricator-standard-page-view' => '517cdfb1',
+ 'phabricator-standard-page-view' => 'dd860661',
'phabricator-textareautils' => '5c93c52c',
'phabricator-title' => '5c1c758c',
'phabricator-tooltip' => '3915d490',
diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php
--- a/src/applications/base/controller/PhabricatorController.php
+++ b/src/applications/base/controller/PhabricatorController.php
@@ -296,6 +296,7 @@
$page->setDeviceReady(true);
}
+ $page->setShowFooter(idx($options, 'showFooter', true));
$page->setShowChrome(idx($options, 'chrome', true));
$application_menu = $this->buildApplicationMenu();
diff --git a/src/applications/config/option/PhabricatorUIConfigOptions.php b/src/applications/config/option/PhabricatorUIConfigOptions.php
--- a/src/applications/config/option/PhabricatorUIConfigOptions.php
+++ b/src/applications/config/option/PhabricatorUIConfigOptions.php
@@ -20,12 +20,44 @@
$options[$key] = $key;
}
+ $example = <<<EOJSON
+[
+ {
+ "name" : "Copyright 2199 Examplecorp"
+ },
+ {
+ "name" : "Privacy Policy",
+ "href" : "http://www.example.org/privacy/"
+ },
+ {
+ "name" : "Terms and Conditions",
+ "href" : "http://www.example.org/terms/"
+ }
+]
+EOJSON;
+
return array(
$this->newOption('ui.header-color', 'enum', 'dark')
->setDescription(
pht(
'Sets the color of the main header.'))
->setEnumOptions($options),
+ $this->newOption('ui.footer-items', 'list<wild>', array())
+ ->setSummary(
+ pht(
+ 'Allows you to add footer links on most pages.'))
+ ->setDescription(
+ pht(
+ "Allows you to add a footer with links in it to most ".
+ "pages. You might want to use these links to point at legal ".
+ "information or an about page.\n\n".
+ "Specify a list of dictionaries. Each dictionary describes ".
+ "a footer item. These keys are supported:\n\n".
+ " - `name` The name of the item.\n".
+ " - `href` Optionally, the link target of the item. You can ".
+ " omit this if you just want a piece of text, like a copyright ".
+ " notice."))
+ ->addExample($example, pht('Basic Example')),
);
}
diff --git a/src/applications/project/controller/PhabricatorProjectBoardViewController.php b/src/applications/project/controller/PhabricatorProjectBoardViewController.php
--- a/src/applications/project/controller/PhabricatorProjectBoardViewController.php
+++ b/src/applications/project/controller/PhabricatorProjectBoardViewController.php
@@ -326,6 +326,7 @@
),
array(
'title' => pht('%s Board', $project->getName()),
+ 'showFooter' => false,
));
}
diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php
--- a/src/view/page/PhabricatorStandardPageView.php
+++ b/src/view/page/PhabricatorStandardPageView.php
@@ -15,6 +15,16 @@
private $disableConsole;
private $pageObjects = array();
private $applicationMenu;
+ private $showFooter = true;
+
+ public function setShowFooter($show_footer) {
+ $this->showFooter = $show_footer;
+ return $this;
+ }
+
+ public function getShowFooter() {
+ return $this->showFooter;
+ }
public function setApplicationMenu(PHUIListView $application_menu) {
$this->applicationMenu = $application_menu;
@@ -329,23 +339,23 @@
}
}
- return
- phutil_tag(
- 'div',
- array(
- 'id' => 'base-page',
- 'class' => 'phabricator-standard-page',
- ),
- array(
- $developer_warning,
- $setup_warning,
- $header_chrome,
- phutil_tag_div('phabricator-standard-page-body', array(
- ($console ? hsprintf('<darkconsole />') : null),
- parent::getBody(),
- phutil_tag('div', array('style' => 'clear: both;')),
- )),
- ));
+ return phutil_tag(
+ 'div',
+ array(
+ 'id' => 'base-page',
+ 'class' => 'phabricator-standard-page',
+ ),
+ array(
+ $developer_warning,
+ $setup_warning,
+ $header_chrome,
+ phutil_tag_div('phabricator-standard-page-body', array(
+ ($console ? hsprintf('<darkconsole />') : null),
+ parent::getBody(),
+ phutil_tag('div', array('style' => 'clear: both;')),
+ $this->renderFooter(),
+ )),
+ ));
}
protected function getTail() {
@@ -457,4 +467,50 @@
return $this->getRequest()->getApplicationConfiguration()->getConsole();
}
+ private function renderFooter() {
+ if (!$this->getShowChrome()) {
+ return null;
+ }
+
+ if (!$this->getShowFooter()) {
+ return null;
+ }
+
+ $items = PhabricatorEnv::getEnvConfig('ui.footer-items');
+ if (!$items) {
+ return null;
+ }
+
+ $foot = array();
+ foreach ($items as $item) {
+ $name = idx($item, 'name', pht('Unnamed Footer Item'));
+
+ $href = idx($item, 'href');
+ if (!PhabricatorEnv::isValidWebResource($href)) {
+ $href = null;
+ }
+
+ if ($href !== null) {
+ $tag = 'a';
+ } else {
+ $tag = 'span';
+ }
+
+ $foot[] = phutil_tag(
+ $tag,
+ array(
+ 'href' => $href,
+ ),
+ $name);
+ }
+ $foot = phutil_implode_html(" \xC2\xB7 ", $foot);
+
+ return phutil_tag(
+ 'div',
+ array(
+ 'class' => 'phabricator-standard-page-footer',
+ ),
+ $foot);
+ }
+
}
diff --git a/webroot/rsrc/css/application/base/standard-page-view.css b/webroot/rsrc/css/application/base/standard-page-view.css
--- a/webroot/rsrc/css/application/base/standard-page-view.css
+++ b/webroot/rsrc/css/application/base/standard-page-view.css
@@ -13,6 +13,14 @@
border-width: 0px;
}
+.phabricator-standard-page-footer {
+ text-align: right;
+ margin: 0 16px;
+ padding: 8px 0;
+ border-top: 1px solid {$lightgreyborder};
+ color: {$lightgreytext};
+}
+
.keyboard-shortcut-help td,
.keyboard-shortcut-help th {
padding: 8px;

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 3:35 PM (1 h, 5 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6786256
Default Alt Text
D10466.diff (7 KB)

Event Timeline