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

Allow ObjectLists to be set to Dialogs

Summary: Better formatting for object lists when in a dialog (like subscribers).

Test Plan:
Test a subscription list.

{F911522}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14353
This commit is contained in:
Chad Little 2015-10-27 19:32:35 +00:00 committed by chad
parent 4b5de5135c
commit 218ab398b0
4 changed files with 34 additions and 11 deletions

View file

@ -7,7 +7,7 @@
*/
return array(
'names' => array(
'core.pkg.css' => 'd80f5c3e',
'core.pkg.css' => 'd25d16e4',
'core.pkg.js' => '47dc9ebb',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '2de124c9',
@ -18,7 +18,7 @@ return array(
'maniphest.pkg.js' => '3ec6a6d5',
'rsrc/css/aphront/aphront-bars.css' => '231ac33c',
'rsrc/css/aphront/dark-console.css' => '6378ef3d',
'rsrc/css/aphront/dialog-view.css' => 'fe58b18d',
'rsrc/css/aphront/dialog-view.css' => 'be0e3a46',
'rsrc/css/aphront/lightbox-attachment.css' => '7acac05d',
'rsrc/css/aphront/list-filter-view.css' => '5d6f0526',
'rsrc/css/aphront/multi-column.css' => 'fd18389d',
@ -489,7 +489,7 @@ return array(
'almanac-css' => 'dbb9b3af',
'aphront-bars' => '231ac33c',
'aphront-dark-console-css' => '6378ef3d',
'aphront-dialog-view-css' => 'fe58b18d',
'aphront-dialog-view-css' => 'be0e3a46',
'aphront-list-filter-view-css' => '5d6f0526',
'aphront-multi-column-view-css' => 'fd18389d',
'aphront-panel-view-css' => '8427b78d',

View file

@ -54,15 +54,14 @@ final class SubscriptionListDialogBuilder extends Phobject {
->setUser($this->getViewer())
->setWidth(AphrontDialogView::WIDTH_FORM)
->setTitle($this->getTitle())
->appendChild($this->buildBody($this->getViewer(), $handles))
->setObjectList($this->buildBody($this->getViewer(), $handles))
->addCancelButton($object_handle->getURI(), pht('Close'));
}
private function buildBody(PhabricatorUser $viewer, array $handles) {
$list = id(new PHUIObjectItemListView())
->setUser($viewer)
->setFlush(true);
->setUser($viewer);
foreach ($handles as $handle) {
$item = id(new PHUIObjectItemView())
->setHeader($handle->getFullName())

View file

@ -23,6 +23,7 @@ final class AphrontDialogView
private $errors = array();
private $flush;
private $validationException;
private $objectList;
const WIDTH_DEFAULT = 'default';
@ -132,6 +133,13 @@ final class AphrontDialogView
return $this;
}
public function setObjectList(PHUIObjectItemListView $list) {
$this->objectList = true;
$box = id(new PHUIObjectBoxView())
->setObjectList($list);
return $this->appendChild($box);
}
public function appendParagraph($paragraph) {
return $this->appendChild(
phutil_tag(
@ -236,15 +244,17 @@ final class AphrontDialogView
__CLASS__));
}
$more = $this->class;
$classes = array();
$classes[] = 'aphront-dialog-view';
$classes[] = $this->class;
if ($this->flush) {
$more .= ' aphront-dialog-flush';
$classes[] = 'aphront-dialog-flush';
}
switch ($this->width) {
case self::WIDTH_FORM:
case self::WIDTH_FULL:
$more .= ' aphront-dialog-view-width-'.$this->width;
$classes[] = 'aphront-dialog-view-width-'.$this->width;
break;
case self::WIDTH_DEFAULT:
break;
@ -256,11 +266,15 @@ final class AphrontDialogView
}
if ($this->isStandalone) {
$more .= ' aphront-dialog-view-standalone';
$classes[] = 'aphront-dialog-view-standalone';
}
if ($this->objectList) {
$classes[] = 'aphront-dialog-object-list';
}
$attributes = array(
'class' => 'aphront-dialog-view '.$more,
'class' => implode(' ', $classes),
'sigil' => 'jx-dialog',
);

View file

@ -128,3 +128,13 @@
border: 0;
border-top: 1px solid {$thinblueborder};
}
.aphront-dialog-object-list .phui-object-box {
border: none;
padding: 0;
margin: 0;
}
.aphront-dialog-object-list .aphront-dialog-body {
padding: 0 12px;
}