1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-20 13:52:40 +01:00

Footer actions for work panels.

Summary: Adds action items in the footer of workpanels.

Test Plan: UIExamples on Chrome.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5492
This commit is contained in:
Chad Little 2013-03-30 14:46:02 -07:00
parent 4741b6cefc
commit a2ebfefaad
5 changed files with 50 additions and 15 deletions

View file

@ -3396,7 +3396,7 @@ celerity_register_resource_map(array(
),
'phabricator-workpanel-view-css' =>
array(
'uri' => '/res/96a4b5cd/rsrc/css/layout/phabricator-workpanel-view.css',
'uri' => '/res/db76713b/rsrc/css/layout/phabricator-workpanel-view.css',
'type' => 'css',
'requires' =>
array(

View file

@ -101,15 +101,20 @@ final class PhabricatorWorkboardExample extends PhabricatorUIExample {
$panel = id(new PhabricatorWorkpanelView)
->setCards($list)
->setHeader('Business Stuff');
->setHeader('Business Stuff')
->setFooterAction(
id(new PhabricatorMenuItemView())
->setName(pht('Add Task'))
->setIcon('new')
->setHref('/maniphest/task/create/'));
$panel2 = id(new PhabricatorWorkpanelView)
->setCards($list2)
->setHeader('Under Duress');
$panel3 = id(new PhabricatorWorkpanelView)
->setCards($list3)
->setHeader('Spicy Thai Chicken');
->setCards($list3)
->setHeader('Spicy Thai Chicken');
$board = id(new PhabricatorWorkboardView)
->addPanel($panel)
@ -122,7 +127,7 @@ final class PhabricatorWorkboardExample extends PhabricatorUIExample {
->addPanel($panel)
->addPanel($panel2)
->addPanel($panel2)
->addPanel($panel2)
->addPanel($panel)
->addPanel($panel2)
->addPanel($panel3);

View file

@ -104,11 +104,26 @@ final class PhabricatorMenuItemView extends AphrontTagView {
protected function getTagContent() {
$name = null;
$icon = null;
if ($this->name) {
$external = null;
if ($this->isExternal) {
$external = " \xE2\x86\x97";
}
if ($this->icon) {
require_celerity_resource('sprite-icon-css');
$icon = phutil_tag(
'span',
array(
'class' => 'phabricator-menu-item-icon sprite-icon '.
'action-'.$this->icon,
),
'');
}
$name = phutil_tag(
'span',
array(
@ -121,6 +136,7 @@ final class PhabricatorMenuItemView extends AphrontTagView {
}
return array(
$icon,
$this->renderChildren(),
$name,
);

View file

@ -22,7 +22,7 @@ final class PhabricatorWorkpanelView extends AphrontView {
return $this;
}
public function setFooterAction($footer_action) {
public function setFooterAction(PhabricatorMenuItemView $footer_action) {
$this->footerAction = $footer_action;
return $this;
}
@ -32,15 +32,13 @@ final class PhabricatorWorkpanelView extends AphrontView {
$footer = '';
if ($this->footerAction) {
$action = $this->footerAction;
$footer = javelin_tag(
'a',
$footer_tag = $this->footerAction;
$footer = phutil_tag(
'div',
array(
'href' => $action->getHref(),
'class' => 'phabricator-workpanel-footer-action',
'sigil' => $action->getWorkflow() ? 'workflow' : null,
'class' => 'phabricator-workpanel-footer-action mst ps'
),
$action->getName());
$footer_tag);
}
$header = phutil_tag(

View file

@ -63,8 +63,24 @@
box-shadow: inset 0 0px 5px rgba(0,0,0,.4);
}
.phabricator-workpanel-view .phabricator-workpanel-footer {
padding: 8px 5px;
.phabricator-workpanel-view .phabricator-workpanel-footer-action a {
color: #333;
font-weight: bold;
}
.device-desktop .phabricator-workpanel-view .phabricator-workpanel-footer-action:hover {
background-color: rgba(100,100,100,.1);
}
.phabricator-workpanel-view .phabricator-menu-item-icon {
height: 12px;
width: 12px;
display: inline-block;
}
.phabricator-workpanel-view .phabricator-menu-item-name {
padding-left: 5px;
display: inline-block;
}
/* fluid/flex styles */