1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 14:30:56 +01:00

Replace context bar in Maniphest with PHUIInfoView

Summary: Removes AphrontContext bar and uses PHUIInfoView instead. This also attaches to the ObjectBox instead for cleaner UI. Also moved phui-error-view.css which was missed.

Test Plan: Test creating a subtask or a new task, see updated info bar and action buttons.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11920
This commit is contained in:
Chad Little 2015-03-01 16:07:04 -08:00
parent c038c643f4
commit 89dbe8a995
6 changed files with 31 additions and 110 deletions

View file

@ -7,7 +7,7 @@
*/ */
return array( return array(
'names' => array( 'names' => array(
'core.pkg.css' => '2e669d0e', 'core.pkg.css' => 'cb58febe',
'core.pkg.js' => '23d653bb', 'core.pkg.js' => '23d653bb',
'darkconsole.pkg.js' => '8ab24e01', 'darkconsole.pkg.js' => '8ab24e01',
'differential.pkg.css' => '4c3242f8', 'differential.pkg.css' => '4c3242f8',
@ -17,7 +17,6 @@ return array(
'maniphest.pkg.css' => '68d4dd3d', 'maniphest.pkg.css' => '68d4dd3d',
'maniphest.pkg.js' => 'df4aa49f', 'maniphest.pkg.js' => 'df4aa49f',
'rsrc/css/aphront/aphront-bars.css' => '231ac33c', 'rsrc/css/aphront/aphront-bars.css' => '231ac33c',
'rsrc/css/aphront/context-bar.css' => '1c3b0529',
'rsrc/css/aphront/dark-console.css' => '6378ef3d', 'rsrc/css/aphront/dark-console.css' => '6378ef3d',
'rsrc/css/aphront/dialog-view.css' => 'd2e76b88', 'rsrc/css/aphront/dialog-view.css' => 'd2e76b88',
'rsrc/css/aphront/lightbox-attachment.css' => '7acac05d', 'rsrc/css/aphront/lightbox-attachment.css' => '7acac05d',
@ -128,7 +127,6 @@ return array(
'rsrc/css/phui/phui-button.css' => '21cb97f9', 'rsrc/css/phui/phui-button.css' => '21cb97f9',
'rsrc/css/phui/phui-crumbs-view.css' => '594d719e', 'rsrc/css/phui/phui-crumbs-view.css' => '594d719e',
'rsrc/css/phui/phui-document.css' => '620b1eec', 'rsrc/css/phui/phui-document.css' => '620b1eec',
'rsrc/css/phui/phui-error-view.css' => 'ffc48131',
'rsrc/css/phui/phui-feed-story.css' => 'c9f3a0b5', 'rsrc/css/phui/phui-feed-story.css' => 'c9f3a0b5',
'rsrc/css/phui/phui-fontkit.css' => '4394f216', 'rsrc/css/phui/phui-fontkit.css' => '4394f216',
'rsrc/css/phui/phui-form-view.css' => '8b78a986', 'rsrc/css/phui/phui-form-view.css' => '8b78a986',
@ -137,6 +135,7 @@ return array(
'rsrc/css/phui/phui-icon.css' => 'd35aa857', 'rsrc/css/phui/phui-icon.css' => 'd35aa857',
'rsrc/css/phui/phui-image-mask.css' => '5a8b09c8', 'rsrc/css/phui/phui-image-mask.css' => '5a8b09c8',
'rsrc/css/phui/phui-info-panel.css' => '27ea50a1', 'rsrc/css/phui/phui-info-panel.css' => '27ea50a1',
'rsrc/css/phui/phui-info-view.css' => '0c8e5d50',
'rsrc/css/phui/phui-list.css' => '53deb25c', 'rsrc/css/phui/phui-list.css' => '53deb25c',
'rsrc/css/phui/phui-object-box.css' => 'd68ce5dc', 'rsrc/css/phui/phui-object-box.css' => 'd68ce5dc',
'rsrc/css/phui/phui-object-item-list-view.css' => '9db65899', 'rsrc/css/phui/phui-object-item-list-view.css' => '9db65899',
@ -500,7 +499,6 @@ return array(
'symbols' => array( 'symbols' => array(
'almanac-css' => 'dbb9b3af', 'almanac-css' => 'dbb9b3af',
'aphront-bars' => '231ac33c', 'aphront-bars' => '231ac33c',
'aphront-contextbar-view-css' => '1c3b0529',
'aphront-dark-console-css' => '6378ef3d', 'aphront-dark-console-css' => '6378ef3d',
'aphront-dialog-view-css' => 'd2e76b88', 'aphront-dialog-view-css' => 'd2e76b88',
'aphront-list-filter-view-css' => '2ae43867', 'aphront-list-filter-view-css' => '2ae43867',
@ -791,7 +789,7 @@ return array(
'phui-icon-view-css' => 'd35aa857', 'phui-icon-view-css' => 'd35aa857',
'phui-image-mask-css' => '5a8b09c8', 'phui-image-mask-css' => '5a8b09c8',
'phui-info-panel-css' => '27ea50a1', 'phui-info-panel-css' => '27ea50a1',
'phui-info-view-css' => 'ffc48131', 'phui-info-view-css' => '0c8e5d50',
'phui-list-view-css' => '53deb25c', 'phui-list-view-css' => '53deb25c',
'phui-object-box-css' => 'd68ce5dc', 'phui-object-box-css' => 'd68ce5dc',
'phui-object-item-list-view-css' => '9db65899', 'phui-object-item-list-view-css' => '9db65899',

View file

@ -102,7 +102,6 @@ phutil_register_library_map(array(
'AphrontBarView' => 'view/widget/bars/AphrontBarView.php', 'AphrontBarView' => 'view/widget/bars/AphrontBarView.php',
'AphrontCSRFException' => 'aphront/exception/AphrontCSRFException.php', 'AphrontCSRFException' => 'aphront/exception/AphrontCSRFException.php',
'AphrontCalendarEventView' => 'applications/calendar/view/AphrontCalendarEventView.php', 'AphrontCalendarEventView' => 'applications/calendar/view/AphrontCalendarEventView.php',
'AphrontContextBarView' => 'view/layout/AphrontContextBarView.php',
'AphrontController' => 'aphront/AphrontController.php', 'AphrontController' => 'aphront/AphrontController.php',
'AphrontCursorPagerView' => 'view/control/AphrontCursorPagerView.php', 'AphrontCursorPagerView' => 'view/control/AphrontCursorPagerView.php',
'AphrontDefaultApplicationConfiguration' => 'aphront/configuration/AphrontDefaultApplicationConfiguration.php', 'AphrontDefaultApplicationConfiguration' => 'aphront/configuration/AphrontDefaultApplicationConfiguration.php',
@ -3253,7 +3252,6 @@ phutil_register_library_map(array(
'AphrontBarView' => 'AphrontView', 'AphrontBarView' => 'AphrontView',
'AphrontCSRFException' => 'AphrontException', 'AphrontCSRFException' => 'AphrontException',
'AphrontCalendarEventView' => 'AphrontView', 'AphrontCalendarEventView' => 'AphrontView',
'AphrontContextBarView' => 'AphrontView',
'AphrontController' => 'Phobject', 'AphrontController' => 'Phobject',
'AphrontCursorPagerView' => 'AphrontView', 'AphrontCursorPagerView' => 'AphrontView',
'AphrontDefaultApplicationConfiguration' => 'AphrontApplicationConfiguration', 'AphrontDefaultApplicationConfiguration' => 'AphrontApplicationConfiguration',

View file

@ -88,38 +88,30 @@ final class ManiphestTaskDetailController extends ManiphestController {
$handles = $this->getLoadedHandles(); $handles = $this->getLoadedHandles();
$context_bar = null; $info_view = null;
if ($parent_task) { if ($parent_task) {
$context_bar = new AphrontContextBarView(); $info_view = new PHUIInfoView();
$context_bar->addButton(phutil_tag( $info_view->setSeverity(PHUIInfoView::SEVERITY_NOTICE);
'a', $info_view->addButton(
array( id(new PHUIButtonView())
'href' => '/maniphest/task/create/?parent='.$parent_task->getID(), ->setHref('/maniphest/task/create/?parent='.$parent_task->getID())
'class' => 'green button', ->setText(pht('Create Another Subtask')));
),
pht('Create Another Subtask'))); $info_view->appendChild(hsprintf(
$context_bar->appendChild(hsprintf(
'Created a subtask of <strong>%s</strong>', 'Created a subtask of <strong>%s</strong>',
$this->getHandle($parent_task->getPHID())->renderLink())); $this->getHandle($parent_task->getPHID())->renderLink()));
} else if ($workflow == 'create') { } else if ($workflow == 'create') {
$context_bar = new AphrontContextBarView(); $info_view = new PHUIInfoView();
$context_bar->addButton(phutil_tag('label', array(), 'Create Another')); $info_view->setSeverity(PHUIInfoView::SEVERITY_NOTICE);
$context_bar->addButton(phutil_tag( $info_view->addButton(
'a', id(new PHUIButtonView())
array( ->setHref('/maniphest/task/create/?template='.$task->getID())
'href' => '/maniphest/task/create/?template='.$task->getID(), ->setText(pht('Similar Task')));
'class' => 'green button', $info_view->addButton(
), id(new PHUIButtonView())
pht('Similar Task'))); ->setHref('/maniphest/task/create/')
$context_bar->addButton(phutil_tag( ->setText(pht('Empty Task')));
'a', $info_view->appendChild(pht('New task created. Create another?'));
array(
'href' => '/maniphest/task/create/',
'class' => 'green button',
),
pht('Empty Task')));
$context_bar->appendChild(pht('New task created.'));
} }
$engine = new PhabricatorMarkupEngine(); $engine = new PhabricatorMarkupEngine();
@ -355,6 +347,10 @@ final class ManiphestTaskDetailController extends ManiphestController {
->setHeader($header) ->setHeader($header)
->addPropertyList($properties); ->addPropertyList($properties);
if ($info_view) {
$object_box->setErrorView($info_view);
}
if ($description) { if ($description) {
$object_box->addPropertyList($description); $object_box->addPropertyList($description);
} }
@ -362,7 +358,6 @@ final class ManiphestTaskDetailController extends ManiphestController {
return $this->buildApplicationPage( return $this->buildApplicationPage(
array( array(
$crumbs, $crumbs,
$context_bar,
$object_box, $object_box,
$timeline, $timeline,
$comment_box, $comment_box,

View file

@ -1,29 +0,0 @@
<?php
final class AphrontContextBarView extends AphrontView {
protected $buttons = array();
public function addButton($button) {
$this->buttons[] = $button;
return $this;
}
public function render() {
$view = new AphrontNullView();
$view->appendChild($this->buttons);
require_celerity_resource('aphront-contextbar-view-css');
return phutil_tag_div(
'aphront-contextbar-view',
array(
phutil_tag_div('aphront-contextbar-core', array(
phutil_tag_div('aphront-contextbar-buttons', $view->render()),
phutil_tag_div('aphront-contextbar-content', $this->renderChildren()),
)),
phutil_tag('div', array('style' => 'clear: both;')),
));
}
}

View file

@ -1,45 +0,0 @@
/**
* @provides aphront-contextbar-view-css
*/
.aphront-contextbar-view {
background: #fff;
padding: 8px 16px;
border-bottom: 1px solid {$lightblueborder};
}
.device-phone .aphront-contextbar-view {
padding: 12px 8px;
}
.aphront-contextbar-content {
padding-top: 5px;
font-size: 13px;
color: {$bluetext};
}
.aphront-contextbar-buttons {
float: right;
}
.device-phone .aphront-contextbar-buttons {
float: none;
}
.aphront-contextbar-buttons label {
font-weight: bold;
color: {$bluetext};
}
.device-phone .aphront-contextbar-buttons label {
display: block;
margin-bottom: 4px;
}
.aphront-contextbar-buttons a {
margin: 0 0 0 8px;
}
.device-phone .aphront-contextbar-buttons a {
margin: 0 8px 0 0;
}

View file

@ -30,6 +30,10 @@
float: right; float: right;
} }
.phui-info-view-actions .button {
margin-left: 4px;
}
.phui-info-view-head + .phui-info-view-body { .phui-info-view-head + .phui-info-view-body {
padding-top: 4px; padding-top: 4px;
} }