@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Restyle username/password login for reduced hideousness

Summary: Ref T1536. Error state is a bit gross but we need to sort that out in general.

Test Plan:
{F46549}

{F46550}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Maniphest Tasks: T1536

Differential Revision: https://secure.phabricator.com/D6208

+143 -85
+45 -45
src/__celerity_resource_map__.php
··· 796 796 ), 797 797 'aphront-dialog-view-css' => 798 798 array( 799 - 'uri' => '/res/71190d8c/rsrc/css/aphront/dialog-view.css', 799 + 'uri' => '/res/b5811686/rsrc/css/aphront/dialog-view.css', 800 800 'type' => 'css', 801 801 'requires' => 802 802 array( ··· 4048 4048 ), array( 4049 4049 'packages' => 4050 4050 array( 4051 - 'ab82f2c0' => 4051 + '1cdd0caf' => 4052 4052 array( 4053 4053 'name' => 'core.pkg.css', 4054 4054 'symbols' => ··· 4096 4096 40 => 'phabricator-property-list-view-css', 4097 4097 41 => 'phabricator-tag-view-css', 4098 4098 ), 4099 - 'uri' => '/res/pkg/ab82f2c0/core.pkg.css', 4099 + 'uri' => '/res/pkg/1cdd0caf/core.pkg.css', 4100 4100 'type' => 'css', 4101 4101 ), 4102 4102 'f2ad0683' => ··· 4290 4290 'reverse' => 4291 4291 array( 4292 4292 'aphront-attached-file-view-css' => 'a7ca34a9', 4293 - 'aphront-dialog-view-css' => 'ab82f2c0', 4294 - 'aphront-error-view-css' => 'ab82f2c0', 4295 - 'aphront-form-view-css' => 'ab82f2c0', 4296 - 'aphront-list-filter-view-css' => 'ab82f2c0', 4297 - 'aphront-pager-view-css' => 'ab82f2c0', 4298 - 'aphront-panel-view-css' => 'ab82f2c0', 4299 - 'aphront-table-view-css' => 'ab82f2c0', 4300 - 'aphront-tokenizer-control-css' => 'ab82f2c0', 4301 - 'aphront-tooltip-css' => 'ab82f2c0', 4302 - 'aphront-typeahead-control-css' => 'ab82f2c0', 4293 + 'aphront-dialog-view-css' => '1cdd0caf', 4294 + 'aphront-error-view-css' => '1cdd0caf', 4295 + 'aphront-form-view-css' => '1cdd0caf', 4296 + 'aphront-list-filter-view-css' => '1cdd0caf', 4297 + 'aphront-pager-view-css' => '1cdd0caf', 4298 + 'aphront-panel-view-css' => '1cdd0caf', 4299 + 'aphront-table-view-css' => '1cdd0caf', 4300 + 'aphront-tokenizer-control-css' => '1cdd0caf', 4301 + 'aphront-tooltip-css' => '1cdd0caf', 4302 + 'aphront-typeahead-control-css' => '1cdd0caf', 4303 4303 'differential-changeset-view-css' => 'dd27a69b', 4304 4304 'differential-core-view-css' => 'dd27a69b', 4305 4305 'differential-inline-comment-editor' => '9488bb69', ··· 4313 4313 'differential-table-of-contents-css' => 'dd27a69b', 4314 4314 'diffusion-commit-view-css' => 'c8ce2d88', 4315 4315 'diffusion-icons-css' => 'c8ce2d88', 4316 - 'global-drag-and-drop-css' => 'ab82f2c0', 4316 + 'global-drag-and-drop-css' => '1cdd0caf', 4317 4317 'inline-comment-summary-css' => 'dd27a69b', 4318 4318 'javelin-aphlict' => 'f2ad0683', 4319 4319 'javelin-behavior' => 'a9f14d76', ··· 4387 4387 'javelin-util' => 'a9f14d76', 4388 4388 'javelin-vector' => 'a9f14d76', 4389 4389 'javelin-workflow' => 'a9f14d76', 4390 - 'lightbox-attachment-css' => 'ab82f2c0', 4390 + 'lightbox-attachment-css' => '1cdd0caf', 4391 4391 'maniphest-task-summary-css' => 'a7ca34a9', 4392 4392 'maniphest-transaction-detail-css' => 'a7ca34a9', 4393 - 'phabricator-action-list-view-css' => 'ab82f2c0', 4394 - 'phabricator-application-launch-view-css' => 'ab82f2c0', 4393 + 'phabricator-action-list-view-css' => '1cdd0caf', 4394 + 'phabricator-application-launch-view-css' => '1cdd0caf', 4395 4395 'phabricator-busy' => 'f2ad0683', 4396 4396 'phabricator-content-source-view-css' => 'dd27a69b', 4397 - 'phabricator-core-css' => 'ab82f2c0', 4398 - 'phabricator-crumbs-view-css' => 'ab82f2c0', 4397 + 'phabricator-core-css' => '1cdd0caf', 4398 + 'phabricator-crumbs-view-css' => '1cdd0caf', 4399 4399 'phabricator-drag-and-drop-file-upload' => '9488bb69', 4400 4400 'phabricator-dropdown-menu' => 'f2ad0683', 4401 4401 'phabricator-file-upload' => 'f2ad0683', 4402 - 'phabricator-filetree-view-css' => 'ab82f2c0', 4403 - 'phabricator-flag-css' => 'ab82f2c0', 4404 - 'phabricator-form-view-css' => 'ab82f2c0', 4405 - 'phabricator-header-view-css' => 'ab82f2c0', 4402 + 'phabricator-filetree-view-css' => '1cdd0caf', 4403 + 'phabricator-flag-css' => '1cdd0caf', 4404 + 'phabricator-form-view-css' => '1cdd0caf', 4405 + 'phabricator-header-view-css' => '1cdd0caf', 4406 4406 'phabricator-hovercard' => 'f2ad0683', 4407 - 'phabricator-jump-nav' => 'ab82f2c0', 4407 + 'phabricator-jump-nav' => '1cdd0caf', 4408 4408 'phabricator-keyboard-shortcut' => 'f2ad0683', 4409 4409 'phabricator-keyboard-shortcut-manager' => 'f2ad0683', 4410 - 'phabricator-main-menu-view' => 'ab82f2c0', 4410 + 'phabricator-main-menu-view' => '1cdd0caf', 4411 4411 'phabricator-menu-item' => 'f2ad0683', 4412 - 'phabricator-nav-view-css' => 'ab82f2c0', 4412 + 'phabricator-nav-view-css' => '1cdd0caf', 4413 4413 'phabricator-notification' => 'f2ad0683', 4414 - 'phabricator-notification-css' => 'ab82f2c0', 4415 - 'phabricator-notification-menu-css' => 'ab82f2c0', 4416 - 'phabricator-object-item-list-view-css' => 'ab82f2c0', 4414 + 'phabricator-notification-css' => '1cdd0caf', 4415 + 'phabricator-notification-menu-css' => '1cdd0caf', 4416 + 'phabricator-object-item-list-view-css' => '1cdd0caf', 4417 4417 'phabricator-object-selector-css' => 'dd27a69b', 4418 4418 'phabricator-phtize' => 'f2ad0683', 4419 4419 'phabricator-prefab' => 'f2ad0683', 4420 4420 'phabricator-project-tag-css' => 'a7ca34a9', 4421 - 'phabricator-property-list-view-css' => 'ab82f2c0', 4422 - 'phabricator-remarkup-css' => 'ab82f2c0', 4421 + 'phabricator-property-list-view-css' => '1cdd0caf', 4422 + 'phabricator-remarkup-css' => '1cdd0caf', 4423 4423 'phabricator-shaped-request' => '9488bb69', 4424 - 'phabricator-side-menu-view-css' => 'ab82f2c0', 4425 - 'phabricator-standard-page-view' => 'ab82f2c0', 4426 - 'phabricator-tag-view-css' => 'ab82f2c0', 4424 + 'phabricator-side-menu-view-css' => '1cdd0caf', 4425 + 'phabricator-standard-page-view' => '1cdd0caf', 4426 + 'phabricator-tag-view-css' => '1cdd0caf', 4427 4427 'phabricator-textareautils' => 'f2ad0683', 4428 4428 'phabricator-tooltip' => 'f2ad0683', 4429 - 'phabricator-transaction-view-css' => 'ab82f2c0', 4430 - 'phabricator-zindex-css' => 'ab82f2c0', 4431 - 'phui-button-css' => 'ab82f2c0', 4432 - 'phui-form-css' => 'ab82f2c0', 4433 - 'phui-icon-view-css' => 'ab82f2c0', 4434 - 'phui-spacing-css' => 'ab82f2c0', 4435 - 'sprite-apps-large-css' => 'ab82f2c0', 4436 - 'sprite-gradient-css' => 'ab82f2c0', 4437 - 'sprite-icons-css' => 'ab82f2c0', 4438 - 'sprite-menu-css' => 'ab82f2c0', 4439 - 'syntax-highlighting-css' => 'ab82f2c0', 4429 + 'phabricator-transaction-view-css' => '1cdd0caf', 4430 + 'phabricator-zindex-css' => '1cdd0caf', 4431 + 'phui-button-css' => '1cdd0caf', 4432 + 'phui-form-css' => '1cdd0caf', 4433 + 'phui-icon-view-css' => '1cdd0caf', 4434 + 'phui-spacing-css' => '1cdd0caf', 4435 + 'sprite-apps-large-css' => '1cdd0caf', 4436 + 'sprite-gradient-css' => '1cdd0caf', 4437 + 'sprite-icons-css' => '1cdd0caf', 4438 + 'sprite-menu-css' => '1cdd0caf', 4439 + 'syntax-highlighting-css' => '1cdd0caf', 4440 4440 ), 4441 4441 ));
+4
src/aphront/response/AphrontDialogResponse.php
··· 12 12 return $this; 13 13 } 14 14 15 + public function getDialog() { 16 + return $this->dialog; 17 + } 18 + 15 19 public function buildResponseString() { 16 20 return $this->dialog->render(); 17 21 }
+24 -29
src/applications/auth/provider/PhabricatorAuthProviderPassword.php
··· 59 59 60 60 $viewer = $request->getUser(); 61 61 62 - $submit = id(new AphrontFormSubmitControl()) 63 - ->setValue(pht('Login')); 62 + $dialog = id(new AphrontDialogView()) 63 + ->setSubmitURI($this->getLoginURI()) 64 + ->setUser($viewer) 65 + ->setTitle(pht('Login to Phabricator')) 66 + ->addSubmitButton(pht('Login')); 64 67 65 68 if ($this->shouldAllowRegistration()) { 66 - $submit->addCancelButton( 69 + $dialog->addCancelButton( 67 70 '/auth/register/', 68 71 pht('Register New Account')); 69 72 } 70 73 71 - $header = id(new PhabricatorHeaderView()) 72 - ->setHeader(pht('Login to Phabricator')); 74 + $dialog->addFooter( 75 + phutil_tag( 76 + 'a', 77 + array( 78 + 'href' => '/login/email/', 79 + ), 80 + pht('Forgot your password?'))); 73 81 74 82 $v_user = nonempty( 75 83 $request->getStr('username'), ··· 97 105 $errors[] = pht('Username or password are incorrect.'); 98 106 } 99 107 100 - $form = id(new AphrontFormView()) 101 - ->setAction($this->getLoginURI()) 102 - ->setUser($viewer) 103 - ->setFlexible(true) 108 + if ($errors) { 109 + $errors = id(new AphrontErrorView())->setErrors($errors); 110 + } 111 + 112 + $form = id(new AphrontFormLayoutView()) 113 + ->setFullWidth(true) 114 + ->appendChild($errors) 104 115 ->appendChild( 105 116 id(new AphrontFormTextControl()) 106 - ->setLabel('Username/Email') 117 + ->setLabel('Username or Email') 107 118 ->setName('username') 108 119 ->setValue($v_user) 109 120 ->setError($e_user)) ··· 111 122 id(new AphrontFormPasswordControl()) 112 123 ->setLabel('Password') 113 124 ->setName('password') 114 - ->setError($e_pass) 115 - ->setCaption( 116 - phutil_tag( 117 - 'a', 118 - array( 119 - 'href' => '/login/email/', 120 - ), 121 - pht('Forgot your password?')))); 125 + ->setError($e_pass)); 122 126 123 127 if ($require_captcha) { 124 128 $form->appendChild( ··· 126 130 ->setError($e_captcha)); 127 131 } 128 132 129 - $form 130 - ->appendChild($submit); 133 + $dialog->appendChild($form); 131 134 132 - if ($errors) { 133 - $errors = id(new AphrontErrorView())->setErrors($errors); 134 - } 135 - 136 - return array( 137 - $errors, 138 - $header, 139 - $form, 140 - ); 135 + return $dialog; 141 136 } 142 137 143 138 public function processLoginRequest(
+2
src/applications/base/controller/PhabricatorController.php
··· 228 228 $response->setContent($view->render()); 229 229 return $response; 230 230 } else { 231 + $response->getDialog()->setIsStandalone(true); 232 + 231 233 return id(new AphrontAjaxResponse()) 232 234 ->setContent(array( 233 235 'dialog' => $response->buildResponseString(),
+51 -8
src/view/AphrontDialogView.php
··· 12 12 private $renderAsForm = true; 13 13 private $formID; 14 14 private $headerColor = PhabricatorActionHeaderView::HEADER_DARK_GREY; 15 + private $footers = array(); 16 + private $isStandalone; 17 + 18 + public function setIsStandalone($is_standalone) { 19 + $this->isStandalone = $is_standalone; 20 + return $this; 21 + } 22 + 23 + public function getIsStandalone() { 24 + return $this->isStandalone; 25 + } 15 26 16 27 private $width = 'default'; 17 28 const WIDTH_DEFAULT = 'default'; ··· 51 62 return $this; 52 63 } 53 64 65 + public function addFooter($footer) { 66 + $this->footers[] = $footer; 67 + return $this; 68 + } 69 + 54 70 public function addHiddenInput($key, $value) { 55 71 if (is_array($value)) { 56 72 foreach ($value as $hidden_key => $hidden_value) { ··· 132 148 throw new Exception("Unknown dialog width '{$this->width}'!"); 133 149 } 134 150 151 + if ($this->isStandalone) { 152 + $more .= ' aphront-dialog-view-standalone'; 153 + } 154 + 135 155 $attributes = array( 136 156 'class' => 'aphront-dialog-view '.$more, 137 157 'sigil' => 'jx-dialog', ··· 171 191 array_merge($hidden_inputs, $buttons))); 172 192 } 173 193 174 - $buttons[] = phutil_tag('div', array('style' => 'clear: both;'), ''); 175 194 $children = $this->renderChildren(); 176 195 177 196 $header = new PhabricatorActionHeaderView(); 178 197 $header->setHeaderTitle($this->title); 179 198 $header->setHeaderColor($this->headerColor); 180 199 181 - $content = hsprintf( 182 - '%s%s%s', 200 + $footer = null; 201 + if ($this->footers) { 202 + $footer = phutil_tag( 203 + 'div', 204 + array( 205 + 'class' => 'aphront-dialog-foot', 206 + ), 207 + $this->footers); 208 + } 209 + 210 + $content = array( 211 + phutil_tag( 212 + 'div', 213 + array( 214 + 'class' => 'aphront-dialog-head', 215 + ), 216 + $header), 183 217 phutil_tag('div', 184 - array('class' => 'aphront-dialog-head'), $header), 185 - phutil_tag('div', 186 - array('class' => 'aphront-dialog-body grouped'), $children), 187 - phutil_tag('div', 188 - array('class' => 'aphront-dialog-tail'), $buttons)); 218 + array( 219 + 'class' => 'aphront-dialog-body grouped', 220 + ), 221 + $children), 222 + phutil_tag( 223 + 'div', 224 + array( 225 + 'class' => 'aphront-dialog-tail grouped', 226 + ), 227 + array( 228 + $buttons, 229 + $footer, 230 + )), 231 + ); 189 232 190 233 if ($this->renderAsForm) { 191 234 return phabricator_form(
+17 -3
webroot/rsrc/css/aphront/dialog-view.css
··· 4 4 5 5 .aphront-dialog-view { 6 6 width: 480px; 7 + margin: 16px auto; 8 + border-radius: 6px; 9 + box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25), 10 + inset 0 1px 0 rgba(255, 255, 255, 0.5); 11 + } 12 + 13 + /* The "standalone" dialog (which is delivered over Ajax and appears above 14 + an existing page) has a more pronounced shadow than dialogs do when they 15 + are embedded in a page. */ 16 + .aphront-dialog-view-standalone { 17 + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 18 + inset 0 1px 0 rgba(255, 255, 255, 0.5); 7 19 margin: auto; 8 - border-radius: 6px; 9 - box-shadow: 0 4px 12px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.5); 10 20 } 21 + 11 22 12 23 .aphront-dialog-head .phabricator-action-header { 13 24 border-bottom: 1px solid #d4dadf; ··· 43 54 border-top: 1px solid #d4dadf; 44 55 border-bottom-left-radius: 6px; 45 56 border-bottom-right-radius: 6px; 46 - text-align: right; 57 + } 58 + 59 + .aphront-dialog-foot { 60 + padding: 6px; 47 61 } 48 62 49 63 .aphront-dialog-tail button,