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' => 'phabricator-workpanel-view-css' =>
array( array(
'uri' => '/res/96a4b5cd/rsrc/css/layout/phabricator-workpanel-view.css', 'uri' => '/res/db76713b/rsrc/css/layout/phabricator-workpanel-view.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(

View file

@ -101,15 +101,20 @@ final class PhabricatorWorkboardExample extends PhabricatorUIExample {
$panel = id(new PhabricatorWorkpanelView) $panel = id(new PhabricatorWorkpanelView)
->setCards($list) ->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) $panel2 = id(new PhabricatorWorkpanelView)
->setCards($list2) ->setCards($list2)
->setHeader('Under Duress'); ->setHeader('Under Duress');
$panel3 = id(new PhabricatorWorkpanelView) $panel3 = id(new PhabricatorWorkpanelView)
->setCards($list3) ->setCards($list3)
->setHeader('Spicy Thai Chicken'); ->setHeader('Spicy Thai Chicken');
$board = id(new PhabricatorWorkboardView) $board = id(new PhabricatorWorkboardView)
->addPanel($panel) ->addPanel($panel)
@ -122,7 +127,7 @@ final class PhabricatorWorkboardExample extends PhabricatorUIExample {
->addPanel($panel) ->addPanel($panel)
->addPanel($panel2) ->addPanel($panel2)
->addPanel($panel2) ->addPanel($panel2)
->addPanel($panel2) ->addPanel($panel)
->addPanel($panel2) ->addPanel($panel2)
->addPanel($panel3); ->addPanel($panel3);

View file

@ -104,11 +104,26 @@ final class PhabricatorMenuItemView extends AphrontTagView {
protected function getTagContent() { protected function getTagContent() {
$name = null; $name = null;
$icon = null;
if ($this->name) { if ($this->name) {
$external = null; $external = null;
if ($this->isExternal) { if ($this->isExternal) {
$external = " \xE2\x86\x97"; $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( $name = phutil_tag(
'span', 'span',
array( array(
@ -121,6 +136,7 @@ final class PhabricatorMenuItemView extends AphrontTagView {
} }
return array( return array(
$icon,
$this->renderChildren(), $this->renderChildren(),
$name, $name,
); );

View file

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

View file

@ -63,8 +63,24 @@
box-shadow: inset 0 0px 5px rgba(0,0,0,.4); box-shadow: inset 0 0px 5px rgba(0,0,0,.4);
} }
.phabricator-workpanel-view .phabricator-workpanel-footer { .phabricator-workpanel-view .phabricator-workpanel-footer-action a {
padding: 8px 5px; 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 */ /* fluid/flex styles */