1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Added configurable welcome content for Phabricator home page.

Summary:
The welcome.enabled feature is turned on by default; unsure of
whether this is desired by upstream.

Test Plan:
Apply the patch and see the welcome content.  It's configurable
in the config.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5339
This commit is contained in:
James Rhodes 2013-03-21 16:02:35 -07:00 committed by epriestley
parent 489f9e7dfe
commit 4674b88ff6
3 changed files with 26 additions and 1 deletions

View file

@ -849,6 +849,11 @@ return array(
// Contains a list of uninstalled applications
'phabricator.uninstalled-applications' => array(),
// -- Welcome Screen -------------------------------------------------------- //
// The custom HTML content for the Phabricator welcome screen.
'welcome.html' => null,
// -- Files ----------------------------------------------------------------- //
// Lists which uploaded file types may be viewed in the browser. If a file

View file

@ -135,6 +135,10 @@ final class PhabricatorCoreConfigOptions
->setLocked(true)
->setDescription(
pht('Array containing list of Uninstalled applications.')),
$this->newOption('welcome.html', 'string', null)
->setLocked(true)
->setDescription(
pht('Custom HTML to show on the main Phabricator dashboard.')),
);
}

View file

@ -40,6 +40,11 @@ final class PhabricatorDirectoryMainController
$tasks_panel = null;
}
if (PhabricatorEnv::getEnvConfig('welcome.html') !== null) {
$welcome_panel = $this->buildWelcomePanel();
} else {
$welcome_panel = null;
}
$jump_panel = $this->buildJumpPanel();
$revision_panel = $this->buildRevisionPanel();
$audit_panel = $this->buildAuditPanel();
@ -47,6 +52,7 @@ final class PhabricatorDirectoryMainController
$content = array(
$jump_panel,
$welcome_panel,
$unbreak_panel,
$triage_panel,
$revision_panel,
@ -226,6 +232,16 @@ final class PhabricatorDirectoryMainController
return $panel;
}
private function buildWelcomePanel() {
$panel = new AphrontPanelView();
$panel->appendChild(
phutil_safe_html(
PhabricatorEnv::getEnvConfig('welcome.html')));
$panel->setNoBackground();
return $panel;
}
private function buildTasksPanel() {
$user = $this->getRequest()->getUser();
$user_phid = $user->getPHID();