1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

In PHUIInfoView, only show list UI if more than 1 item

Summary: We often just setError as an array even if it's only one error. This just makes the UI a little cleaner in these cases.

Test Plan: Remove all reviewers from a diff, see status error without list styling.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14308
This commit is contained in:
Chad Little 2015-10-19 20:08:30 -07:00
parent 4cb2ec1120
commit bbbda23678

View file

@ -50,7 +50,7 @@ final class PHUIInfoView extends AphrontView {
require_celerity_resource('phui-info-view-css');
$errors = $this->errors;
if ($errors) {
if (count($errors) > 1) {
$list = array();
foreach ($errors as $error) {
$list[] = phutil_tag(
@ -64,6 +64,8 @@ final class PHUIInfoView extends AphrontView {
'class' => 'phui-info-view-list',
),
$list);
} else if (count($errors) == 1) {
$list = $this->errors[0];
} else {
$list = null;
}