Page MenuHomePhabricator

D17505.id42097.diff
No OneTemporary

D17505.id42097.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -9,7 +9,7 @@
'names' => array(
'conpherence.pkg.css' => '32f2c040',
'conpherence.pkg.js' => '6249a1cf',
- 'core.pkg.css' => 'c0c87dac',
+ 'core.pkg.css' => '0c1c70c8',
'core.pkg.js' => '1fa7c0c5',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '90b30783',
@@ -158,7 +158,7 @@
'rsrc/css/phui/phui-info-view.css' => 'ec92802a',
'rsrc/css/phui/phui-invisible-character-view.css' => '6993d9f0',
'rsrc/css/phui/phui-lightbox.css' => '0a035e40',
- 'rsrc/css/phui/phui-list.css' => '9da2aa00',
+ 'rsrc/css/phui/phui-list.css' => '8f807696',
'rsrc/css/phui/phui-object-box.css' => '8b289e3d',
'rsrc/css/phui/phui-pager.css' => '77d8a794',
'rsrc/css/phui/phui-pinboard-view.css' => '2495140e',
@@ -872,7 +872,7 @@
'phui-inline-comment-view-css' => 'be663c95',
'phui-invisible-character-view-css' => '6993d9f0',
'phui-lightbox-css' => '0a035e40',
- 'phui-list-view-css' => '9da2aa00',
+ 'phui-list-view-css' => '8f807696',
'phui-object-box-css' => '8b289e3d',
'phui-oi-big-ui-css' => '19f9369b',
'phui-oi-color-css' => 'cd2b9b77',
diff --git a/src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php b/src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php
--- a/src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php
+++ b/src/applications/search/menuitem/PhabricatorDashboardProfileMenuItem.php
@@ -133,11 +133,13 @@
$icon = $dashboard->getIcon();
$name = $this->getDisplayName($config);
$href = $this->getItemViewURI($config);
+ $action_href = '/dashboard/arrange/'.$dashboard->getID().'/';
$item = $this->newItem()
->setHref($href)
->setName($name)
- ->setIcon($icon);
+ ->setIcon($icon)
+ ->setActionIcon('fa-pencil', $action_href);
return array(
$item,
diff --git a/src/view/phui/PHUIListItemView.php b/src/view/phui/PHUIListItemView.php
--- a/src/view/phui/PHUIListItemView.php
+++ b/src/view/phui/PHUIListItemView.php
@@ -31,6 +31,8 @@
private $icons = array();
private $openInNewWindow = false;
private $tooltip;
+ private $actionIcon;
+ private $actionIconHref;
public function setOpenInNewWindow($open_in_new_window) {
$this->openInNewWindow = $open_in_new_window;
@@ -154,6 +156,12 @@
return $this->name;
}
+ public function setActionIcon($icon, $href) {
+ $this->actionIcon = $icon;
+ $this->actionIconHref = $href;
+ return $this;
+ }
+
public function setIsExternal($is_external) {
$this->isExternal = $is_external;
return $this;
@@ -207,6 +215,10 @@
$classes[] = $this->statusColor;
}
+ if ($this->actionIcon) {
+ $classes[] = 'phui-list-item-has-action-icon';
+ }
+
return array(
'class' => implode(' ', $classes),
);
@@ -311,9 +323,23 @@
$classes[] = 'phui-list-item-indented';
}
+ $action_link = null;
+ if ($this->actionIcon) {
+ $action_icon = id(new PHUIIconView())
+ ->setIcon($this->actionIcon)
+ ->addClass('phui-list-item-action-icon');
+ $action_link = phutil_tag(
+ 'a',
+ array(
+ 'href' => $this->actionIconHref,
+ 'class' => 'phui-list-item-action-href',
+ ),
+ $action_icon);
+ }
+
$icons = $this->getIcons();
- return javelin_tag(
+ $list_item = javelin_tag(
$this->href ? 'a' : 'div',
array(
'href' => $this->href,
@@ -329,6 +355,8 @@
$this->renderChildren(),
$name,
));
+
+ return array($list_item, $action_link);
}
}
diff --git a/webroot/rsrc/css/phui/phui-list.css b/webroot/rsrc/css/phui/phui-list.css
--- a/webroot/rsrc/css/phui/phui-list.css
+++ b/webroot/rsrc/css/phui/phui-list.css
@@ -2,6 +2,10 @@
* @provides phui-list-view-css
*/
+.phui-list-item-view {
+ position: relative;
+}
+
.phui-list-item-header,
.phui-list-item-header a {
color: {$bluetext};
@@ -188,3 +192,40 @@
margin-top: 16px;
border-top: 1px solid {$thinblueborder};
}
+
+/* - Action Icon ----------------------------------------------------------- */
+
+.phui-list-item-has-action-icon .phui-list-item-action-href {
+ position: absolute;
+ width: 28px;
+ top: 0;
+ right: 0;
+ background: #ECEEF4;
+ bottom: 0;
+ text-align: center;
+ line-height: 28px;
+ background-color: transparent;
+ display: none;
+}
+
+.phui-list-item-has-action-icon.phui-list-item-selected .phui-list-item-href {
+ padding-right: 32px;
+}
+
+.phui-list-item-has-action-icon.phui-list-item-selected
+ .phui-list-item-action-href {
+ display: block;
+}
+
+.phui-list-item-has-action-icon .phui-list-item-action-href:hover {
+ background-color: rgba({$alphablack},.05);
+}
+
+.phui-list-item-has-action-icon .phui-list-item-action-icon {
+ opacity: 0.5;
+}
+
+.phui-list-item-has-action-icon .phui-list-item-action-href:hover
+ .phui-list-item-action-icon {
+ opacity: 1;
+}

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 29, 7:15 AM (9 h, 12 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6941767
Default Alt Text
D17505.id42097.diff (5 KB)

Event Timeline