Allow installs to add a custom corp/org header link
Summary: A bunch of installs are doing this to varying degrees of success anyway, make it easier and nudge them toward a more consistent approach. Test Plan: Set a custom logo, viewed normal and admin pages. Reviewers: btrahan Reviewed By: btrahan CC: aran, epriestley Maniphest Tasks: T700 Differential Revision: https://secure.phabricator.com/D2019
3
.gitignore
vendored
|
@ -14,3 +14,6 @@
|
|||
|
||||
# Arcanist scratch directory
|
||||
/.arc
|
||||
|
||||
# Custom Logo File
|
||||
/webroot/rsrc/image/custom/custom.png
|
||||
|
|
|
@ -60,6 +60,15 @@ return array(
|
|||
'security.hmac-key' => '[D\t~Y7eNmnQGJ;rnH6aF;m2!vJ8@v8C=Cs:aQS\.Qw',
|
||||
|
||||
|
||||
// -- Customization --------------------------------------------------------- //
|
||||
|
||||
// If you want to use a custom logo (e.g., for your company or organization),
|
||||
// copy 'webroot/rsrc/image/custom/example_template.png' to
|
||||
// 'webroot/rsrc/image/custom/custom.png' and set this to the URI you want it
|
||||
// to link to (like http://www.yourcompany.com/).
|
||||
'phabricator.custom.logo' => null,
|
||||
|
||||
|
||||
// -- DarkConsole ----------------------------------------------------------- //
|
||||
|
||||
// DarkConsole is a administrative debugging/profiling tool built into
|
||||
|
|
|
@ -356,13 +356,30 @@ final class PhabricatorStandardPageView extends AphrontPageView {
|
|||
$admin_class = 'phabricator-admin-page-view';
|
||||
}
|
||||
|
||||
$custom_logo = null;
|
||||
$with_custom = null;
|
||||
$custom_conf = PhabricatorEnv::getEnvConfig('phabricator.custom.logo');
|
||||
if ($custom_conf) {
|
||||
$with_custom = 'phabricator-logo-with-custom';
|
||||
$custom_logo = phutil_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'class' => 'logo-custom',
|
||||
'href' => $custom_conf,
|
||||
),
|
||||
' ');
|
||||
}
|
||||
|
||||
$header_chrome = null;
|
||||
$footer_chrome = null;
|
||||
if ($this->getShowChrome()) {
|
||||
$header_chrome =
|
||||
'<table class="phabricator-standard-header">'.
|
||||
'<tr>'.
|
||||
'<td class="phabricator-logo"><a href="/"> </a></td>'.
|
||||
'<td class="phabricator-logo '.$with_custom.'">'.
|
||||
$custom_logo.
|
||||
'<a class="logo-standard" href="/"> </a>'.
|
||||
'</td>'.
|
||||
'<td>'.
|
||||
'<table class="phabricator-primary-navigation">'.
|
||||
'<tr>'.
|
||||
|
|
|
@ -53,15 +53,38 @@
|
|||
width: 220px;
|
||||
}
|
||||
|
||||
.phabricator-logo-with-custom {
|
||||
width: 440px;
|
||||
}
|
||||
|
||||
.phabricator-logo a {
|
||||
display: block;
|
||||
width: 220px;
|
||||
height: 40px;
|
||||
background: url('/rsrc/image/phabricator_logo.png') no-repeat 0 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.phabricator-logo a.logo-custom {
|
||||
position: absolute;
|
||||
background: url(/rsrc/image/custom/custom.png) no-repeat 0 0;
|
||||
}
|
||||
|
||||
.phabricator-logo a.logo-standard {
|
||||
background: url(/rsrc/image/phabricator_logo.png) no-repeat 0 0;
|
||||
background-position-left: 220px;
|
||||
}
|
||||
|
||||
.phabricator-admin-page-view .phabricator-logo a.logo-standard {
|
||||
background-image: url(/rsrc/image/phabricator_logo_admin.png);
|
||||
}
|
||||
|
||||
.phabricator-logo-with-custom a.logo-standard {
|
||||
padding-left: 220px;
|
||||
background-position-left: 0;
|
||||
}
|
||||
|
||||
|
||||
.phabricator-logo a:hover {
|
||||
background-position: 0 -40px;
|
||||
}
|
||||
|
@ -108,10 +131,6 @@ td.phabricator-login-details {
|
|||
background: #cc3333;
|
||||
}
|
||||
|
||||
.phabricator-admin-page-view .phabricator-logo a {
|
||||
background-image: url('/rsrc/image/phabricator_logo_admin.png');
|
||||
}
|
||||
|
||||
.keyboard-shortcut-help td,
|
||||
.keyboard-shortcut-help th {
|
||||
padding: 8px;
|
||||
|
|
3
webroot/rsrc/image/custom/README
Normal file
|
@ -0,0 +1,3 @@
|
|||
To customize your Phabricator install's appearance, create a 240x80 PNG like
|
||||
the examples in this folder, name it "custom.png" in this folder, and then set
|
||||
'phabricator.custom.logo' to a link URI.
|
BIN
webroot/rsrc/image/custom/example_facebook.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
webroot/rsrc/image/custom/example_rainbow.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
webroot/rsrc/image/custom/example_template.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.9 KiB |