mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-09 16:32:39 +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:
parent
4cdfc6d1cb
commit
fbfb263cd9
5 changed files with 43 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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 = <<<EOBODY
|
||||
if ($is_serious) {
|
||||
$body = <<<EOBODY
|
||||
You can use this link to reset your Phabricator password:
|
||||
|
||||
{$uri}
|
||||
|
||||
EOBODY;
|
||||
} else {
|
||||
$body = <<<EOBODY
|
||||
Condolences on forgetting your password. You can use this link to reset it:
|
||||
|
||||
{$uri}
|
||||
|
@ -78,6 +88,7 @@ Best Wishes,
|
|||
Phabricator
|
||||
|
||||
EOBODY;
|
||||
}
|
||||
|
||||
$mail = new PhabricatorMetaMTAMail();
|
||||
$mail->setSubject('[Phabricator] Password Reset');
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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 =
|
||||
'<div class="aphront-panel-preview">
|
||||
|
|
|
@ -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 .= <<<EOBODY
|
||||
Love,
|
||||
Phabricator
|
||||
|
||||
EOBODY;
|
||||
}
|
||||
|
||||
$mail = id(new PhabricatorMetaMTAMail())
|
||||
->addTos(array($user->getPHID()))
|
||||
->setSubject('[Phabricator] Welcome to Phabricator')
|
||||
|
|
Loading…
Reference in a new issue