From fbfb263cd9ef87ad6686b22c86471a5e1301713a Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 4 Nov 2011 15:16:34 -0700 Subject: [PATCH] Provide a configuration flag to disable silliness in the UI Summary: See comments. A few installs have remarked that their organizations would prefer buttons labled "Submit" to buttons labeled "Clowncopterize". Test Plan: - In "serious" mode, verified Differential and Maniphest have serious strings, tasks can not be closed out of spite, and reset/welcome emails are extremely serious. - In unserious mode, verified Differential and Maniphest have normal strings, tasks can be closed out of spite, and reset/welcome emails are silly. - This does not disable the "fax these changes" message in Arcanist (no reasonable way for it to read the config value) or the rainbow syntax highlighter (already removable though configuration). Reviewers: moskov, jungejason, nh, tuomaspelkonen, aran Reviewed By: moskov CC: aran, moskov Differential Revision: 1081 --- conf/default.conf.php | 8 ++++++++ .../email/PhabricatorEmailLoginController.php | 13 ++++++++++++- .../view/addcomment/DifferentialAddCommentView.php | 8 ++++++-- .../taskdetail/ManiphestTaskDetailController.php | 12 ++++++++++-- .../edit/PhabricatorPeopleEditController.php | 7 +++++++ 5 files changed, 43 insertions(+), 5 deletions(-) diff --git a/conf/default.conf.php b/conf/default.conf.php index 892e395046..4e88b69d10 100644 --- a/conf/default.conf.php +++ b/conf/default.conf.php @@ -444,6 +444,14 @@ return array( // seeing which setting loads faster and feels better. 'tokenizer.ondemand' => false, + // By default, Phabricator includes some silly nonsense in the UI, such as + // a submit button called "Clowncopterize" in Differential and a call to + // "Leap Into Action". If you'd prefer more traditional UI strings like + // "Submit", you can set this flag to disable most of the jokes and easter + // eggs. + 'phabricator.serious-business' => false, + + // -- Files ----------------------------------------------------------------- // // Lists which uploaded file types may be viewed in the browser. If a file diff --git a/src/applications/auth/controller/email/PhabricatorEmailLoginController.php b/src/applications/auth/controller/email/PhabricatorEmailLoginController.php index 4c32a5a4f7..cba43f31b9 100644 --- a/src/applications/auth/controller/email/PhabricatorEmailLoginController.php +++ b/src/applications/auth/controller/email/PhabricatorEmailLoginController.php @@ -33,6 +33,8 @@ class PhabricatorEmailLoginController extends PhabricatorAuthController { $e_captcha = true; $errors = array(); + $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); + if ($request->isFormPost()) { $e_email = null; $e_captcha = 'Again'; @@ -65,7 +67,15 @@ class PhabricatorEmailLoginController extends PhabricatorAuthController { if (!$errors) { $uri = $target_user->getEmailLoginURI(); - $body = <<setSubject('[Phabricator] Password Reset'); diff --git a/src/applications/differential/view/addcomment/DifferentialAddCommentView.php b/src/applications/differential/view/addcomment/DifferentialAddCommentView.php index bce8ea5a93..b3305debe4 100644 --- a/src/applications/differential/view/addcomment/DifferentialAddCommentView.php +++ b/src/applications/differential/view/addcomment/DifferentialAddCommentView.php @@ -67,6 +67,8 @@ final class DifferentialAddCommentView extends AphrontView { require_celerity_resource('differential-revision-add-comment-css'); + $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); + $revision = $this->revision; $form = new AphrontFormView(); @@ -105,7 +107,7 @@ final class DifferentialAddCommentView extends AphrontView { ->setValue($this->draft)) ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue('Clowncopterize')); + ->setValue($is_serious ? 'Submit' : 'Clowncopterize')); Javelin::initBehavior( 'differential-add-reviewers-and-ccs', @@ -202,7 +204,9 @@ final class DifferentialAddCommentView extends AphrontView { if ($unit_warning) { $panel_view->appendChild($unit_warning); } - $panel_view->setHeader('Leap Into Action'); + + $panel_view->setHeader($is_serious ? 'Add Comment' : 'Leap Into Action'); + $panel_view->addClass('aphront-panel-accent'); $panel_view->addClass('aphront-panel-flush'); diff --git a/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php index 96ec82b2ea..ef21669a2f 100644 --- a/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php +++ b/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php @@ -334,6 +334,14 @@ class ManiphestTaskDetailController extends ManiphestController { $panel_id = celerity_generate_unique_node_id(); + $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); + + if ($is_serious) { + // Prevent tasks from being closed "out of spite" in serious business + // installs. + unset($resolution_types[ManiphestTaskStatus::STATUS_CLOSED_SPITE]); + } + $comment_form = new AphrontFormView(); $comment_form ->setUser($user) @@ -405,7 +413,7 @@ class ManiphestTaskDetailController extends ManiphestController { ->setActivatedClass('aphront-panel-view-drag-and-drop')) ->appendChild( id(new AphrontFormSubmitControl()) - ->setValue('Avast!')); + ->setValue($is_serious ? 'Submit' : 'Avast!')); $control_map = array( ManiphestTransactionType::TYPE_STATUS => 'resolution', @@ -453,7 +461,7 @@ class ManiphestTaskDetailController extends ManiphestController { $comment_panel->appendChild($comment_form); $comment_panel->setID($panel_id); $comment_panel->addClass('aphront-panel-accent'); - $comment_panel->setHeader('Weigh In'); + $comment_panel->setHeader($is_serious ? 'Add Comment' : 'Weigh In'); $preview_panel = '
diff --git a/src/applications/people/controller/edit/PhabricatorPeopleEditController.php b/src/applications/people/controller/edit/PhabricatorPeopleEditController.php index 4503c15737..3642677633 100644 --- a/src/applications/people/controller/edit/PhabricatorPeopleEditController.php +++ b/src/applications/people/controller/edit/PhabricatorPeopleEditController.php @@ -121,6 +121,7 @@ class PhabricatorPeopleEditController extends PhabricatorPeopleController { $errors = array(); $welcome_checked = true; + $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); $request = $this->getRequest(); if ($request->isFormPost()) { @@ -196,10 +197,16 @@ After you have set a password, you can login in the future by going here: {$base_uri} +EOBODY; + + if (!$is_serious) { + $body .= <<addTos(array($user->getPHID())) ->setSubject('[Phabricator] Welcome to Phabricator')