From 99ad978e909233a7f31b1d6fd43568d24ad6eb47 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 7 Dec 2013 10:46:09 -0800 Subject: [PATCH] Add UI for choosing header color Summary: See D7731. Fixes T4194. Test Plan: {F88020} Reviewers: chad, btrahan Reviewed By: chad CC: aran, mbishopim3 Maniphest Tasks: T4194 Differential Revision: https://secure.phabricator.com/D7740 --- src/__celerity_resource_map__.php | 14 ++++++++ src/__phutil_library_map__.php | 2 ++ .../option/PhabricatorUIConfigOptions.php | 32 +++++++++++++++++++ .../page/menu/PhabricatorMainMenuView.php | 3 +- 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 src/applications/config/option/PhabricatorUIConfigOptions.php diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index 0f9aef6637..018cd7d882 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -1790,6 +1790,20 @@ celerity_register_resource_map(array( ), 'disk' => '/rsrc/js/core/behavior-global-drag-and-drop.js', ), + 'javelin-behavior-harbormaster-reorder-steps' => + array( + 'uri' => '/res/035fe63d/rsrc/js/application/harbormaster/behavior-reorder-steps.js', + 'type' => 'js', + 'requires' => + array( + 0 => 'javelin-behavior', + 1 => 'javelin-stratcom', + 2 => 'javelin-workflow', + 3 => 'javelin-dom', + 4 => 'phabricator-draggable-list', + ), + 'disk' => '/rsrc/js/application/harbormaster/behavior-reorder-steps.js', + ), 'javelin-behavior-herald-rule-editor' => array( 'uri' => '/res/77a0c945/rsrc/js/application/herald/herald-rule-editor.js', diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index b5107ee6ae..0af987871e 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1984,6 +1984,7 @@ phutil_register_library_map(array( 'PhabricatorTypeaheadCommonDatasourceController' => 'applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php', 'PhabricatorTypeaheadDatasourceController' => 'applications/typeahead/controller/PhabricatorTypeaheadDatasourceController.php', 'PhabricatorTypeaheadResult' => 'applications/typeahead/storage/PhabricatorTypeaheadResult.php', + 'PhabricatorUIConfigOptions' => 'applications/config/option/PhabricatorUIConfigOptions.php', 'PhabricatorUIExample' => 'applications/uiexample/examples/PhabricatorUIExample.php', 'PhabricatorUIExampleRenderController' => 'applications/uiexample/controller/PhabricatorUIExampleRenderController.php', 'PhabricatorUIListFilterExample' => 'applications/uiexample/examples/PhabricatorUIListFilterExample.php', @@ -4527,6 +4528,7 @@ phutil_register_library_map(array( 'PhabricatorTwoColumnExample' => 'PhabricatorUIExample', 'PhabricatorTypeaheadCommonDatasourceController' => 'PhabricatorTypeaheadDatasourceController', 'PhabricatorTypeaheadDatasourceController' => 'PhabricatorController', + 'PhabricatorUIConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorUIExampleRenderController' => 'PhabricatorController', 'PhabricatorUIListFilterExample' => 'PhabricatorUIExample', 'PhabricatorUINotificationExample' => 'PhabricatorUIExample', diff --git a/src/applications/config/option/PhabricatorUIConfigOptions.php b/src/applications/config/option/PhabricatorUIConfigOptions.php new file mode 100644 index 0000000000..83c9f054c3 --- /dev/null +++ b/src/applications/config/option/PhabricatorUIConfigOptions.php @@ -0,0 +1,32 @@ +newOption('ui.header-color', 'enum', 'dark') + ->setDescription( + pht( + 'Sets the color of the main header.')) + ->setEnumOptions($options), + ); + } + +} diff --git a/src/view/page/menu/PhabricatorMainMenuView.php b/src/view/page/menu/PhabricatorMainMenuView.php index 930660b80b..62f68f2a25 100644 --- a/src/view/page/menu/PhabricatorMainMenuView.php +++ b/src/view/page/menu/PhabricatorMainMenuView.php @@ -68,8 +68,7 @@ final class PhabricatorMainMenuView extends AphrontView { $classes = array(); $classes[] = 'phabricator-main-menu'; $classes[] = 'sprite-main-header'; - // TODO: Let admins or users set header - $classes[] = 'main-header-dark'; + $classes[] = 'main-header-'.PhabricatorEnv::getEnvConfig('ui.header-color'); return phutil_tag( 'div',