1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02: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(
'names' => array(
'core.pkg.css' => '2e669d0e',
'core.pkg.css' => 'cb58febe',
'core.pkg.js' => '23d653bb',
'darkconsole.pkg.js' => '8ab24e01',
'differential.pkg.css' => '4c3242f8',
@ -17,7 +17,6 @@ return array(
'maniphest.pkg.css' => '68d4dd3d',
'maniphest.pkg.js' => 'df4aa49f',
'rsrc/css/aphront/aphront-bars.css' => '231ac33c',
'rsrc/css/aphront/context-bar.css' => '1c3b0529',
'rsrc/css/aphront/dark-console.css' => '6378ef3d',
'rsrc/css/aphront/dialog-view.css' => 'd2e76b88',
'rsrc/css/aphront/lightbox-attachment.css' => '7acac05d',
@ -128,7 +127,6 @@ return array(
'rsrc/css/phui/phui-button.css' => '21cb97f9',
'rsrc/css/phui/phui-crumbs-view.css' => '594d719e',
'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-fontkit.css' => '4394f216',
'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-image-mask.css' => '5a8b09c8',
'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-object-box.css' => 'd68ce5dc',
'rsrc/css/phui/phui-object-item-list-view.css' => '9db65899',
@ -500,7 +499,6 @@ return array(
'symbols' => array(
'almanac-css' => 'dbb9b3af',
'aphront-bars' => '231ac33c',
'aphront-contextbar-view-css' => '1c3b0529',
'aphront-dark-console-css' => '6378ef3d',
'aphront-dialog-view-css' => 'd2e76b88',
'aphront-list-filter-view-css' => '2ae43867',
@ -791,7 +789,7 @@ return array(
'phui-icon-view-css' => 'd35aa857',
'phui-image-mask-css' => '5a8b09c8',
'phui-info-panel-css' => '27ea50a1',
'phui-info-view-css' => 'ffc48131',
'phui-info-view-css' => '0c8e5d50',
'phui-list-view-css' => '53deb25c',
'phui-object-box-css' => 'd68ce5dc',
'phui-object-item-list-view-css' => '9db65899',

View file

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

View file

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