1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +01:00

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
This commit is contained in:
epriestley 2011-11-04 15:16:34 -07:00
parent 4cdfc6d1cb
commit fbfb263cd9
5 changed files with 43 additions and 5 deletions

View file

@ -444,6 +444,14 @@ return array(
// seeing which setting loads faster and feels better. // seeing which setting loads faster and feels better.
'tokenizer.ondemand' => false, '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 ----------------------------------------------------------------- // // -- Files ----------------------------------------------------------------- //
// Lists which uploaded file types may be viewed in the browser. If a file // Lists which uploaded file types may be viewed in the browser. If a file

View file

@ -33,6 +33,8 @@ class PhabricatorEmailLoginController extends PhabricatorAuthController {
$e_captcha = true; $e_captcha = true;
$errors = array(); $errors = array();
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
if ($request->isFormPost()) { if ($request->isFormPost()) {
$e_email = null; $e_email = null;
$e_captcha = 'Again'; $e_captcha = 'Again';
@ -65,6 +67,14 @@ class PhabricatorEmailLoginController extends PhabricatorAuthController {
if (!$errors) { if (!$errors) {
$uri = $target_user->getEmailLoginURI(); $uri = $target_user->getEmailLoginURI();
if ($is_serious) {
$body = <<<EOBODY
You can use this link to reset your Phabricator password:
{$uri}
EOBODY;
} else {
$body = <<<EOBODY $body = <<<EOBODY
Condolences on forgetting your password. You can use this link to reset it: Condolences on forgetting your password. You can use this link to reset it:
@ -78,6 +88,7 @@ Best Wishes,
Phabricator Phabricator
EOBODY; EOBODY;
}
$mail = new PhabricatorMetaMTAMail(); $mail = new PhabricatorMetaMTAMail();
$mail->setSubject('[Phabricator] Password Reset'); $mail->setSubject('[Phabricator] Password Reset');

View file

@ -67,6 +67,8 @@ final class DifferentialAddCommentView extends AphrontView {
require_celerity_resource('differential-revision-add-comment-css'); require_celerity_resource('differential-revision-add-comment-css');
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
$revision = $this->revision; $revision = $this->revision;
$form = new AphrontFormView(); $form = new AphrontFormView();
@ -105,7 +107,7 @@ final class DifferentialAddCommentView extends AphrontView {
->setValue($this->draft)) ->setValue($this->draft))
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue('Clowncopterize')); ->setValue($is_serious ? 'Submit' : 'Clowncopterize'));
Javelin::initBehavior( Javelin::initBehavior(
'differential-add-reviewers-and-ccs', 'differential-add-reviewers-and-ccs',
@ -202,7 +204,9 @@ final class DifferentialAddCommentView extends AphrontView {
if ($unit_warning) { if ($unit_warning) {
$panel_view->appendChild($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-accent');
$panel_view->addClass('aphront-panel-flush'); $panel_view->addClass('aphront-panel-flush');

View file

@ -334,6 +334,14 @@ class ManiphestTaskDetailController extends ManiphestController {
$panel_id = celerity_generate_unique_node_id(); $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 = new AphrontFormView();
$comment_form $comment_form
->setUser($user) ->setUser($user)
@ -405,7 +413,7 @@ class ManiphestTaskDetailController extends ManiphestController {
->setActivatedClass('aphront-panel-view-drag-and-drop')) ->setActivatedClass('aphront-panel-view-drag-and-drop'))
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue('Avast!')); ->setValue($is_serious ? 'Submit' : 'Avast!'));
$control_map = array( $control_map = array(
ManiphestTransactionType::TYPE_STATUS => 'resolution', ManiphestTransactionType::TYPE_STATUS => 'resolution',
@ -453,7 +461,7 @@ class ManiphestTaskDetailController extends ManiphestController {
$comment_panel->appendChild($comment_form); $comment_panel->appendChild($comment_form);
$comment_panel->setID($panel_id); $comment_panel->setID($panel_id);
$comment_panel->addClass('aphront-panel-accent'); $comment_panel->addClass('aphront-panel-accent');
$comment_panel->setHeader('Weigh In'); $comment_panel->setHeader($is_serious ? 'Add Comment' : 'Weigh In');
$preview_panel = $preview_panel =
'<div class="aphront-panel-preview"> '<div class="aphront-panel-preview">

View file

@ -121,6 +121,7 @@ class PhabricatorPeopleEditController extends PhabricatorPeopleController {
$errors = array(); $errors = array();
$welcome_checked = true; $welcome_checked = true;
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
$request = $this->getRequest(); $request = $this->getRequest();
if ($request->isFormPost()) { if ($request->isFormPost()) {
@ -196,10 +197,16 @@ After you have set a password, you can login in the future by going here:
{$base_uri} {$base_uri}
EOBODY;
if (!$is_serious) {
$body .= <<<EOBODY
Love, Love,
Phabricator Phabricator
EOBODY; EOBODY;
}
$mail = id(new PhabricatorMetaMTAMail()) $mail = id(new PhabricatorMetaMTAMail())
->addTos(array($user->getPHID())) ->addTos(array($user->getPHID()))
->setSubject('[Phabricator] Welcome to Phabricator') ->setSubject('[Phabricator] Welcome to Phabricator')