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

Add setDisabled to pinboard view

Summary: Adds setDisabled state to PHUIPinboardItemView, implements in Pholio, Macro

Test Plan:
Pholio, Macro, disabled and closed items.

{F166109}

{F166110}

Reviewers: lpriestley, epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5074

Differential Revision: https://secure.phabricator.com/D9514
This commit is contained in:
Chad Little 2014-06-13 09:14:12 -07:00
parent d401036bd8
commit 8426d1d2ab
5 changed files with 34 additions and 14 deletions

View file

@ -135,7 +135,7 @@ return array(
'rsrc/css/phui/phui-list.css' => '43ed2d93', 'rsrc/css/phui/phui-list.css' => '43ed2d93',
'rsrc/css/phui/phui-object-box.css' => 'ce92d8ec', 'rsrc/css/phui/phui-object-box.css' => 'ce92d8ec',
'rsrc/css/phui/phui-object-item-list-view.css' => '46e12abc', 'rsrc/css/phui/phui-object-item-list-view.css' => '46e12abc',
'rsrc/css/phui/phui-pinboard-view.css' => '874c22f9', 'rsrc/css/phui/phui-pinboard-view.css' => '32e8e1a9',
'rsrc/css/phui/phui-property-list-view.css' => '2f7199e8', 'rsrc/css/phui/phui-property-list-view.css' => '2f7199e8',
'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b', 'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b',
'rsrc/css/phui/phui-spacing.css' => '042804d6', 'rsrc/css/phui/phui-spacing.css' => '042804d6',
@ -764,7 +764,7 @@ return array(
'phui-list-view-css' => '43ed2d93', 'phui-list-view-css' => '43ed2d93',
'phui-object-box-css' => 'ce92d8ec', 'phui-object-box-css' => 'ce92d8ec',
'phui-object-item-list-view-css' => '46e12abc', 'phui-object-item-list-view-css' => '46e12abc',
'phui-pinboard-view-css' => '874c22f9', 'phui-pinboard-view-css' => '32e8e1a9',
'phui-property-list-view-css' => '2f7199e8', 'phui-property-list-view-css' => '2f7199e8',
'phui-remarkup-preview-css' => '19ad512b', 'phui-remarkup-preview-css' => '19ad512b',
'phui-spacing-css' => '042804d6', 'phui-spacing-css' => '042804d6',

View file

@ -209,12 +209,8 @@ final class PhabricatorMacroSearchEngine
} }
$item->setURI($this->getApplicationURI('/view/'.$macro->getID().'/')); $item->setURI($this->getApplicationURI('/view/'.$macro->getID().'/'));
$item->setDisabled($macro->getisDisabled());
$name = $macro->getName(); $item->setHeader($macro->getName());
if ($macro->getIsDisabled()) {
$name = pht('%s (Disabled)', $name);
}
$item->setHeader($name);
$pinboard->addItem($item); $pinboard->addItem($item);
} }

View file

@ -123,15 +123,12 @@ final class PholioMockSearchEngine
foreach ($mocks as $mock) { foreach ($mocks as $mock) {
$header = 'M'.$mock->getID().' '.$mock->getName(); $header = 'M'.$mock->getID().' '.$mock->getName();
if ($mock->isClosed()) {
$header = pht('%s (Closed)', $header);
}
$item = id(new PHUIPinboardItemView()) $item = id(new PHUIPinboardItemView())
->setHeader($header) ->setHeader($header)
->setURI('/M'.$mock->getID()) ->setURI('/M'.$mock->getID())
->setImageURI($mock->getCoverFile()->getThumb280x210URI()) ->setImageURI($mock->getCoverFile()->getThumb280x210URI())
->setImageSize(280, 210) ->setImageSize(280, 210)
->setDisabled($mock->isClosed())
->addIconCount('fa-picture-o', count($mock->getImages())) ->addIconCount('fa-picture-o', count($mock->getImages()))
->addIconCount('fa-trophy', $mock->getTokenCount()); ->addIconCount('fa-trophy', $mock->getTokenCount());

View file

@ -6,6 +6,7 @@ final class PHUIPinboardItemView extends AphrontView {
private $uri; private $uri;
private $header; private $header;
private $iconBlock = array(); private $iconBlock = array();
private $disabled;
private $imageWidth; private $imageWidth;
private $imageHeight; private $imageHeight;
@ -36,14 +37,24 @@ final class PHUIPinboardItemView extends AphrontView {
return $this; return $this;
} }
public function setDisabled($disabled) {
$this->disabled = $disabled;
return $this;
}
public function render() { public function render() {
$header = null; $header = null;
if ($this->header) { if ($this->header) {
if ($this->disabled) {
$header_color = 'gradient-lightgrey-header';
} else {
$header_color = 'gradient-lightblue-header';
}
$header = phutil_tag( $header = phutil_tag(
'div', 'div',
array( array(
'class' => 'phui-pinboard-item-header '. 'class' => 'phui-pinboard-item-header '.
'sprite-gradient gradient-lightblue-header', 'sprite-gradient '.$header_color,
), ),
phutil_tag('a', array('href' => $this->uri), $this->header)); phutil_tag('a', array('href' => $this->uri), $this->header));
} }
@ -96,10 +107,16 @@ final class PHUIPinboardItemView extends AphrontView {
$content); $content);
} }
$classes = array();
$classes[] = 'phui-pinboard-item-view';
if ($this->disabled) {
$classes[] = 'phui-pinboard-item-disabled';
}
return phutil_tag( return phutil_tag(
'div', 'div',
array( array(
'class' => 'phui-pinboard-item-view', 'class' => implode(' ', $classes),
), ),
array( array(
$header, $header,

View file

@ -76,3 +76,13 @@
.phui-pinboard-icon { .phui-pinboard-icon {
margin-right: 4px; margin-right: 4px;
} }
.phui-pinboard-item-disabled .phui-pinboard-item-image-link img {
opacity: 0.25;
}
.phui-pinboard-item-disabled .phui-pinboard-item-header a {
color: {$greytext};
text-decoration: line-through;
}