Page MenuHomePhabricator

D11638.diff
No OneTemporary

D11638.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -7,7 +7,7 @@
*/
return array(
'names' => array(
- 'core.pkg.css' => 'fabafbdb',
+ 'core.pkg.css' => '8be366b7',
'core.pkg.js' => '65e04767',
'darkconsole.pkg.js' => '8ab24e01',
'differential.pkg.css' => '8af45893',
@@ -129,7 +129,7 @@
'rsrc/css/phui/phui-error-view.css' => 'ad042fdd',
'rsrc/css/phui/phui-feed-story.css' => 'c9f3a0b5',
'rsrc/css/phui/phui-fontkit.css' => '9ae12677',
- 'rsrc/css/phui/phui-form-view.css' => 'aad06f2a',
+ 'rsrc/css/phui/phui-form-view.css' => '8b78a986',
'rsrc/css/phui/phui-form.css' => '9aecbda1',
'rsrc/css/phui/phui-header-view.css' => '083669db',
'rsrc/css/phui/phui-icon.css' => 'd35aa857',
@@ -778,7 +778,7 @@
'phui-font-icon-base-css' => '3dad2ae3',
'phui-fontkit-css' => '9ae12677',
'phui-form-css' => '9aecbda1',
- 'phui-form-view-css' => 'aad06f2a',
+ 'phui-form-view-css' => '8b78a986',
'phui-header-view-css' => '083669db',
'phui-icon-view-css' => 'd35aa857',
'phui-image-mask-css' => '5a8b09c8',
diff --git a/src/view/form/control/AphrontFormControl.php b/src/view/form/control/AphrontFormControl.php
--- a/src/view/form/control/AphrontFormControl.php
+++ b/src/view/form/control/AphrontFormControl.php
@@ -181,34 +181,35 @@
array('class' => 'aphront-form-input'),
$this->renderInput());
- if (strlen($this->getLabel())) {
- $label = phutil_tag(
- 'label',
- array(
- 'class' => 'aphront-form-label',
- 'for' => $this->getID(),
- ),
- $this->getLabel());
- } else {
- $label = null;
- $custom_class .= ' aphront-form-control-nolabel';
- }
-
+ $error = null;
if (strlen($this->getError())) {
$error = $this->getError();
if ($error === true) {
$error = phutil_tag(
- 'div',
+ 'span',
array('class' => 'aphront-form-error aphront-form-required'),
pht('Required'));
} else {
$error = phutil_tag(
- 'div',
+ 'span',
array('class' => 'aphront-form-error'),
$error);
}
+ }
+
+ if (strlen($this->getLabel())) {
+ $label = phutil_tag(
+ 'label',
+ array(
+ 'class' => 'aphront-form-label',
+ 'for' => $this->getID(),
+ ),
+ array(
+ $this->getLabel(),
+ $error,));
} else {
- $error = null;
+ $label = null;
+ $custom_class .= ' aphront-form-control-nolabel';
}
if (strlen($this->getCaption())) {
@@ -222,6 +223,7 @@
$classes = array();
$classes[] = 'aphront-form-control';
+ $classes[] = 'grouped';
$classes[] = $custom_class;
$style = $this->controlStyle;
@@ -241,7 +243,6 @@
$error,
$input,
$caption,
- phutil_tag('div', array('style' => 'clear: both;'), ''),
));
}
}
diff --git a/webroot/rsrc/css/phui/phui-form-view.css b/webroot/rsrc/css/phui/phui-form-view.css
--- a/webroot/rsrc/css/phui/phui-form-view.css
+++ b/webroot/rsrc/css/phui/phui-form-view.css
@@ -71,6 +71,10 @@
padding-top: 5px;
}
+.aphront-form-label .aphront-form-error {
+ display: none;
+}
+
.aphront-dialog-body .phui-form-full-width {
margin-top: -10px;
}
@@ -81,8 +85,15 @@
.device-phone .aphront-form-error,
.phui-form-full-width .aphront-form-error {
- float: none;
- width: 100%;
+ display: none;
+}
+
+.device-phone .aphront-form-label .aphront-form-error,
+.phui-form-full-width .aphront-form-label .aphront-form-error {
+ display: block;
+ float: right;
+ padding: 0;
+ width: auto;
}
.device-phone .aphront-form-drag-and-drop-upload {

File Metadata

Mime Type
text/plain
Expires
Oct 8 2025, 3:11 PM (13 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8637704
Default Alt Text
D11638.diff (3 KB)

Event Timeline