1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Reduce size of "Unbreak Now" and "Needs Triage" panels when no action is

required

Summary: Make these things like 1/4th the size if they aren't actionable.

Test Plan: Loaded home page with actionable, unactionable panels.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1613
This commit is contained in:
epriestley 2012-02-14 16:23:53 -08:00
parent 44b7b4bfc0
commit 6a11d8d0d1
7 changed files with 124 additions and 63 deletions

View file

@ -108,7 +108,7 @@ celerity_register_resource_map(array(
),
'aphront-panel-view-css' =>
array(
'uri' => '/res/f4157618/rsrc/css/aphront/panel-view.css',
'uri' => '/res/b7ba1078/rsrc/css/aphront/panel-view.css',
'type' => 'css',
'requires' =>
array(
@ -330,6 +330,17 @@ celerity_register_resource_map(array(
),
'disk' => '/rsrc/js/javelin/lib/behavior.js',
),
0 =>
array(
'uri' => '/res/b6096fdd/rsrc/js/javelin/lib/__tests__/URI.js',
'type' => 'js',
'requires' =>
array(
0 => 'javelin-uri',
1 => 'javelin-php-serializer',
),
'disk' => '/rsrc/js/javelin/lib/__tests__/URI.js',
),
'javelin-behavior-aphront-basic-tokenizer' =>
array(
'uri' => '/res/9be30797/rsrc/js/application/core/behavior-tokenizer.js',
@ -1479,17 +1490,6 @@ celerity_register_resource_map(array(
),
'disk' => '/rsrc/css/application/profile/profile-header-view.css',
),
0 =>
array(
'uri' => '/res/b6096fdd/rsrc/js/javelin/lib/__tests__/URI.js',
'type' => 'js',
'requires' =>
array(
0 => 'javelin-uri',
1 => 'javelin-php-serializer',
),
'disk' => '/rsrc/js/javelin/lib/__tests__/URI.js',
),
'phabricator-remarkup-css' =>
array(
'uri' => '/res/39f358b8/rsrc/css/core/remarkup.css',
@ -1729,6 +1729,30 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/03ef179e/diffusion.pkg.css',
'type' => 'css',
),
'2729c1c6' =>
array(
'name' => 'core.pkg.css',
'symbols' =>
array(
0 => 'phabricator-core-css',
1 => 'phabricator-core-buttons-css',
2 => 'phabricator-standard-page-view',
3 => 'aphront-dialog-view-css',
4 => 'aphront-form-view-css',
5 => 'aphront-panel-view-css',
6 => 'aphront-side-nav-view-css',
7 => 'aphront-table-view-css',
8 => 'aphront-crumbs-view-css',
9 => 'aphront-tokenizer-control-css',
10 => 'aphront-typeahead-control-css',
11 => 'aphront-list-filter-view-css',
12 => 'phabricator-directory-css',
13 => 'phabricator-remarkup-css',
14 => 'syntax-highlighting-css',
),
'uri' => '/res/pkg/2729c1c6/core.pkg.css',
'type' => 'css',
),
'46547a92' =>
array(
'name' => 'core.pkg.js',
@ -1763,30 +1787,6 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/540effd7/typeahead.pkg.js',
'type' => 'js',
),
'775f5bae' =>
array(
'name' => 'core.pkg.css',
'symbols' =>
array(
0 => 'phabricator-core-css',
1 => 'phabricator-core-buttons-css',
2 => 'phabricator-standard-page-view',
3 => 'aphront-dialog-view-css',
4 => 'aphront-form-view-css',
5 => 'aphront-panel-view-css',
6 => 'aphront-side-nav-view-css',
7 => 'aphront-table-view-css',
8 => 'aphront-crumbs-view-css',
9 => 'aphront-tokenizer-control-css',
10 => 'aphront-typeahead-control-css',
11 => 'aphront-list-filter-view-css',
12 => 'phabricator-directory-css',
13 => 'phabricator-remarkup-css',
14 => 'syntax-highlighting-css',
),
'uri' => '/res/pkg/775f5bae/core.pkg.css',
'type' => 'css',
),
'80580cea' =>
array(
'name' => 'differential.pkg.css',
@ -1854,16 +1854,16 @@ celerity_register_resource_map(array(
),
'reverse' =>
array(
'aphront-crumbs-view-css' => '775f5bae',
'aphront-dialog-view-css' => '775f5bae',
'aphront-form-view-css' => '775f5bae',
'aphront-crumbs-view-css' => '2729c1c6',
'aphront-dialog-view-css' => '2729c1c6',
'aphront-form-view-css' => '2729c1c6',
'aphront-headsup-action-list-view-css' => '80580cea',
'aphront-list-filter-view-css' => '775f5bae',
'aphront-panel-view-css' => '775f5bae',
'aphront-side-nav-view-css' => '775f5bae',
'aphront-table-view-css' => '775f5bae',
'aphront-tokenizer-control-css' => '775f5bae',
'aphront-typeahead-control-css' => '775f5bae',
'aphront-list-filter-view-css' => '2729c1c6',
'aphront-panel-view-css' => '2729c1c6',
'aphront-side-nav-view-css' => '2729c1c6',
'aphront-table-view-css' => '2729c1c6',
'aphront-tokenizer-control-css' => '2729c1c6',
'aphront-typeahead-control-css' => '2729c1c6',
'differential-changeset-view-css' => '80580cea',
'differential-core-view-css' => '80580cea',
'differential-inline-comment-editor' => 'ef420ead',
@ -1912,16 +1912,16 @@ celerity_register_resource_map(array(
'javelin-vector' => 'b164acea',
'javelin-workflow' => '46547a92',
'phabricator-content-source-view-css' => '80580cea',
'phabricator-core-buttons-css' => '775f5bae',
'phabricator-core-css' => '775f5bae',
'phabricator-directory-css' => '775f5bae',
'phabricator-core-buttons-css' => '2729c1c6',
'phabricator-core-css' => '2729c1c6',
'phabricator-directory-css' => '2729c1c6',
'phabricator-drag-and-drop-file-upload' => 'ef420ead',
'phabricator-keyboard-shortcut' => '46547a92',
'phabricator-keyboard-shortcut-manager' => '46547a92',
'phabricator-object-selector-css' => '80580cea',
'phabricator-remarkup-css' => '775f5bae',
'phabricator-remarkup-css' => '2729c1c6',
'phabricator-shaped-request' => 'ef420ead',
'phabricator-standard-page-view' => '775f5bae',
'syntax-highlighting-css' => '775f5bae',
'phabricator-standard-page-view' => '2729c1c6',
'syntax-highlighting-css' => '2729c1c6',
),
));

View file

@ -59,6 +59,7 @@ phutil_register_library_map(array(
'AphrontJavelinView' => 'view/javelin-view',
'AphrontKeyboardShortcutsAvailableView' => 'view/widget/keyboardshortcuts',
'AphrontListFilterView' => 'view/layout/listfilter',
'AphrontMiniPanelView' => 'view/layout/minipanel',
'AphrontMySQLDatabaseConnection' => 'storage/connection/mysql',
'AphrontMySQLDatabaseConnectionTestCase' => 'storage/connection/mysql/__tests__',
'AphrontNullView' => 'view/null',
@ -885,6 +886,7 @@ phutil_register_library_map(array(
'AphrontJavelinView' => 'AphrontView',
'AphrontKeyboardShortcutsAvailableView' => 'AphrontView',
'AphrontListFilterView' => 'AphrontView',
'AphrontMiniPanelView' => 'AphrontView',
'AphrontMySQLDatabaseConnection' => 'AphrontDatabaseConnection',
'AphrontMySQLDatabaseConnectionTestCase' => 'PhabricatorTestCase',
'AphrontNullView' => 'AphrontView',

View file

@ -65,10 +65,6 @@ class PhabricatorDirectoryMainController
$user = $this->getRequest()->getUser();
$user_phid = $user->getPHID();
$panel = new AphrontPanelView();
$panel->setHeader('Unbreak Now!');
$panel->setCaption('Open tasks with "Unbreak Now!" priority.');
$task_query = new ManiphestTaskQuery();
$task_query->withStatus(ManiphestTaskQuery::STATUS_OPEN);
$task_query->withPriority(ManiphestTaskPriority::PRIORITY_UNBREAK_NOW);
@ -78,6 +74,9 @@ class PhabricatorDirectoryMainController
$tasks = $task_query->execute();
if ($tasks) {
$panel = new AphrontPanelView();
$panel->setHeader('Unbreak Now!');
$panel->setCaption('Open tasks with "Unbreak Now!" priority.');
$panel->addButton(
phutil_render_tag(
'a',
@ -89,8 +88,11 @@ class PhabricatorDirectoryMainController
$panel->appendChild($this->buildTaskListView($tasks));
} else {
$panel = new AphrontMiniPanelView();
$panel->appendChild(
'<p>Nothing appears to be critically broken right now.</p>');
'<p><strong>No "Unbreak Now!" Tasks:</strong> '.
'Nothing appears to be critically broken right now.</p>');
$panel = '<br />'.$panel->render();
}
return $panel;
@ -100,12 +102,6 @@ class PhabricatorDirectoryMainController
$user = $this->getRequest()->getUser();
$user_phid = $user->getPHID();
$panel = new AphrontPanelView();
$panel->setHeader('Needs Triage');
$panel->setCaption(
'Open tasks with "Needs Triage" priority in '.
'<a href="/project/">projects you are a member of</a>.');
$task_query = new ManiphestTaskQuery();
$task_query->withStatus(ManiphestTaskQuery::STATUS_OPEN);
$task_query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
@ -116,6 +112,12 @@ class PhabricatorDirectoryMainController
$tasks = $task_query->execute();
if ($tasks) {
$panel = new AphrontPanelView();
$panel->setHeader('Needs Triage');
$panel->setCaption(
'Open tasks with "Needs Triage" priority in '.
'<a href="/project/">projects you are a member of</a>.');
$panel->addButton(
phutil_render_tag(
'a',
@ -128,7 +130,11 @@ class PhabricatorDirectoryMainController
'View All Triage ('.$task_query->getRowCount().") \xC2\xBB"));
$panel->appendChild($this->buildTaskListView($tasks));
} else {
$panel->appendChild('<p>No tasks in your projects need triage.</p>');
$panel = new AphrontMiniPanelView();
$panel->appendChild(
'<p><strong>No "Needs Triage" Tasks:</strong> '.
'No tasks in <a href="/project/">projects you are a member of</a> '.
'need triage.</p>');
}
return $panel;

View file

@ -17,6 +17,7 @@ phutil_require_module('phabricator', 'applications/maniphest/query');
phutil_require_module('phabricator', 'applications/maniphest/view/tasklist');
phutil_require_module('phabricator', 'applications/phid/handle/data');
phutil_require_module('phabricator', 'applications/project/query/project');
phutil_require_module('phabricator', 'view/layout/minipanel');
phutil_require_module('phabricator', 'view/layout/panel');
phutil_require_module('phutil', 'markup');

View file

@ -0,0 +1,28 @@
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
final class AphrontMiniPanelView extends AphrontView {
public function render() {
return
'<div class="aphront-mini-panel-view">'.
$this->renderChildren().
'</div>';
}
}

View file

@ -0,0 +1,12 @@
<?php
/**
* This file is automatically generated. Lint this module to rebuild it.
* @generated
*/
phutil_require_module('phabricator', 'view/base');
phutil_require_source('AphrontMiniPanelView.php');

View file

@ -87,3 +87,15 @@
background: #ccffcc;
border-color: #669966;
}
.aphront-mini-panel-view {
background: #f3f3f3;
padding: 4px 2em;
margin: 2px 2em;
border: 1px solid #e6e6e6;
}
.aphront-mini-panel-view p {
font-size: 11px;
color: #666666;
}