mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +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:
parent
d401036bd8
commit
8426d1d2ab
5 changed files with 34 additions and 14 deletions
|
@ -135,7 +135,7 @@ return array(
|
|||
'rsrc/css/phui/phui-list.css' => '43ed2d93',
|
||||
'rsrc/css/phui/phui-object-box.css' => 'ce92d8ec',
|
||||
'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-remarkup-preview.css' => '19ad512b',
|
||||
'rsrc/css/phui/phui-spacing.css' => '042804d6',
|
||||
|
@ -764,7 +764,7 @@ return array(
|
|||
'phui-list-view-css' => '43ed2d93',
|
||||
'phui-object-box-css' => 'ce92d8ec',
|
||||
'phui-object-item-list-view-css' => '46e12abc',
|
||||
'phui-pinboard-view-css' => '874c22f9',
|
||||
'phui-pinboard-view-css' => '32e8e1a9',
|
||||
'phui-property-list-view-css' => '2f7199e8',
|
||||
'phui-remarkup-preview-css' => '19ad512b',
|
||||
'phui-spacing-css' => '042804d6',
|
||||
|
|
|
@ -209,12 +209,8 @@ final class PhabricatorMacroSearchEngine
|
|||
}
|
||||
|
||||
$item->setURI($this->getApplicationURI('/view/'.$macro->getID().'/'));
|
||||
|
||||
$name = $macro->getName();
|
||||
if ($macro->getIsDisabled()) {
|
||||
$name = pht('%s (Disabled)', $name);
|
||||
}
|
||||
$item->setHeader($name);
|
||||
$item->setDisabled($macro->getisDisabled());
|
||||
$item->setHeader($macro->getName());
|
||||
|
||||
$pinboard->addItem($item);
|
||||
}
|
||||
|
|
|
@ -123,15 +123,12 @@ final class PholioMockSearchEngine
|
|||
foreach ($mocks as $mock) {
|
||||
|
||||
$header = 'M'.$mock->getID().' '.$mock->getName();
|
||||
if ($mock->isClosed()) {
|
||||
$header = pht('%s (Closed)', $header);
|
||||
}
|
||||
|
||||
$item = id(new PHUIPinboardItemView())
|
||||
->setHeader($header)
|
||||
->setURI('/M'.$mock->getID())
|
||||
->setImageURI($mock->getCoverFile()->getThumb280x210URI())
|
||||
->setImageSize(280, 210)
|
||||
->setDisabled($mock->isClosed())
|
||||
->addIconCount('fa-picture-o', count($mock->getImages()))
|
||||
->addIconCount('fa-trophy', $mock->getTokenCount());
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ final class PHUIPinboardItemView extends AphrontView {
|
|||
private $uri;
|
||||
private $header;
|
||||
private $iconBlock = array();
|
||||
private $disabled;
|
||||
|
||||
private $imageWidth;
|
||||
private $imageHeight;
|
||||
|
@ -36,14 +37,24 @@ final class PHUIPinboardItemView extends AphrontView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setDisabled($disabled) {
|
||||
$this->disabled = $disabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function render() {
|
||||
$header = null;
|
||||
if ($this->header) {
|
||||
if ($this->disabled) {
|
||||
$header_color = 'gradient-lightgrey-header';
|
||||
} else {
|
||||
$header_color = 'gradient-lightblue-header';
|
||||
}
|
||||
$header = phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phui-pinboard-item-header '.
|
||||
'sprite-gradient gradient-lightblue-header',
|
||||
'sprite-gradient '.$header_color,
|
||||
),
|
||||
phutil_tag('a', array('href' => $this->uri), $this->header));
|
||||
}
|
||||
|
@ -96,10 +107,16 @@ final class PHUIPinboardItemView extends AphrontView {
|
|||
$content);
|
||||
}
|
||||
|
||||
$classes = array();
|
||||
$classes[] = 'phui-pinboard-item-view';
|
||||
if ($this->disabled) {
|
||||
$classes[] = 'phui-pinboard-item-disabled';
|
||||
}
|
||||
|
||||
return phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phui-pinboard-item-view',
|
||||
'class' => implode(' ', $classes),
|
||||
),
|
||||
array(
|
||||
$header,
|
||||
|
|
|
@ -76,3 +76,13 @@
|
|||
.phui-pinboard-icon {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue