1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00

Move setLaunchButton to setSideColumn for ObjectItem

Summary: Makes this a bit more flexible and allow UI to take over `col-2` completely. Also cleaned up application search a little with tags

Test Plan: Review various pages, grep for callsites.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D18021
This commit is contained in:
Chad Little 2017-05-25 15:24:41 -07:00
parent 6b3d04683d
commit 9bbea869b3
6 changed files with 41 additions and 25 deletions

View file

@ -9,7 +9,7 @@ return array(
'names' => array(
'conpherence.pkg.css' => 'ff161f2d',
'conpherence.pkg.js' => 'b5b51108',
'core.pkg.css' => '2c6a5ba4',
'core.pkg.css' => 'b666574e',
'core.pkg.js' => '21d34805',
'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '7d4cfa59',
@ -132,7 +132,7 @@ return array(
'rsrc/css/phui/object-item/phui-oi-color.css' => 'cd2b9b77',
'rsrc/css/phui/object-item/phui-oi-drag-ui.css' => '08f4ccc3',
'rsrc/css/phui/object-item/phui-oi-flush-ui.css' => '9d9685d6',
'rsrc/css/phui/object-item/phui-oi-list-view.css' => '78fdc98e',
'rsrc/css/phui/object-item/phui-oi-list-view.css' => 'ed19241b',
'rsrc/css/phui/object-item/phui-oi-simple-ui.css' => 'a8beebea',
'rsrc/css/phui/phui-action-list.css' => 'c01858f4',
'rsrc/css/phui/phui-action-panel.css' => '91c7b835',
@ -875,7 +875,7 @@ return array(
'phui-oi-color-css' => 'cd2b9b77',
'phui-oi-drag-ui-css' => '08f4ccc3',
'phui-oi-flush-ui-css' => '9d9685d6',
'phui-oi-list-view-css' => '78fdc98e',
'phui-oi-list-view-css' => 'ed19241b',
'phui-oi-simple-ui-css' => 'a8beebea',
'phui-pager-css' => '77d8a794',
'phui-pinboard-view-css' => '2495140e',

View file

@ -30,8 +30,8 @@ final class PhabricatorGuideListView extends AphrontView {
->setText(pht('Skip'))
->setTag('a')
->setHref($skip_href)
->setColor(PHUIButtonView::GREY);
$list_item->setLaunchButton($skip);
->setColor(PHUIButtonView::SIMPLE);
$list_item->setSideColumn($skip);
}
$list->addItem($list_item);
}

View file

@ -218,20 +218,39 @@ final class PhabricatorAppSearchEngine
$configure = id(new PHUIButtonView())
->setTag('a')
->setIcon('fa-gears')
->setHref('/applications/view/'.get_class($application).'/')
->setText(pht('Configure'))
->setColor(PHUIButtonView::GREY);
$name = $application->getName();
if ($application->isPrototype()) {
$name = $name.' '.pht('(Prototype)');
}
$item = id(new PHUIObjectItemView())
->setHeader($name)
->setImageIcon($icon)
->setSubhead($description)
->setLaunchButton($configure);
->setSideColumn($configure);
if (!$application->isFirstParty()) {
$tag = id(new PHUITagView())
->setName(pht('Extension'))
->setIcon('fa-puzzle-piece')
->setColor(PHUITagView::COLOR_BLUE)
->setType(PHUITagView::TYPE_SHADE)
->setSlimShady(true);
$item->addAttribute($tag);
}
if ($application->isPrototype()) {
$prototype_tag = id(new PHUITagView())
->setName(pht('Prototype'))
->setIcon('fa-exclamation-circle')
->setColor(PHUITagView::COLOR_ORANGE)
->setType(PHUITagView::TYPE_SHADE)
->setSlimShady(true);
$item->addAttribute($prototype_tag);
}
$item->addAttribute($description);
if ($application->getBaseURI() && $application->isInstalled()) {
$item->setHref($application->getBaseURI());
@ -242,10 +261,6 @@ final class PhabricatorAppSearchEngine
$item->setDisabled(true);
}
if (!$application->isFirstParty()) {
$item->addAttribute(pht('Extension'));
}
$list->addItem($item);
}

View file

@ -97,8 +97,9 @@ final class PhameBlogSearchEngine
$button = id(new PHUIButtonView())
->setTag('a')
->setText('New Post')
->setHref($this->getApplicationURI('/post/edit/?blog='.$id));
$item->setLaunchButton($button);
->setHref($this->getApplicationURI('/post/edit/?blog='.$id))
->setColor(PHUIButtonView::SIMPLE);
$item->setSideColumn($button);
}
$list->addItem($item);

View file

@ -25,7 +25,7 @@ final class PHUIObjectItemView extends AphrontTagView {
private $badge;
private $countdownNum;
private $countdownNoun;
private $launchButton;
private $sideColumn;
private $coverImage;
private $description;
@ -229,9 +229,8 @@ final class PHUIObjectItemView extends AphrontTagView {
return $this;
}
public function setLaunchButton(PHUIButtonView $button) {
$button->setSize(PHUIButtonView::SMALL);
$this->launchButton = $button;
public function setSideColumn($column) {
$this->sideColumn = $column;
return $this;
}
@ -652,14 +651,15 @@ final class PHUIObjectItemView extends AphrontTagView {
));
}
if ($this->launchButton) {
/* Fixed width, right column container. */
if ($this->sideColumn) {
$column2 = phutil_tag(
'div',
array(
'class' => 'phui-oi-col2 phui-oi-launch-button',
'class' => 'phui-oi-col2 phui-oi-side-column',
),
array(
$this->launchButton,
$this->sideColumn,
));
}

View file

@ -650,13 +650,13 @@ ul.phui-oi-list-view .phui-oi-selected
/* - Launcher Button -------------------------------------------------------- */
.phui-oi-col2.phui-oi-launch-button {
.phui-oi-col2.phui-oi-side-column {
text-align: right;
vertical-align: middle;
padding-right: 4px;
}
.device-phone .phui-oi-col2.phui-oi-launch-button {
.device-phone .phui-oi-col2.phui-oi-side-column {
padding: 0 8px 8px;
text-align: left;
}