1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-26 07:20:57 +01:00

Ability to "Create X" from wide sidebar buttons

Summary: Shorten home to 240, 3 items wide, add create button for certain wide apps.

Test Plan: Test in FF, Chrome, IE8/9

Reviewers: epriestley, btrahan, codeblock

Reviewed By: epriestley

CC: aran, Korvin, vrana

Differential Revision: https://secure.phabricator.com/D4555
This commit is contained in:
Chad Little 2013-01-22 09:06:57 -08:00
parent d30cc73847
commit 849dc086e4
9 changed files with 162 additions and 60 deletions

View file

@ -2400,7 +2400,7 @@ celerity_register_resource_map(array(
), ),
'phabricator-application-launch-view-css' => 'phabricator-application-launch-view-css' =>
array( array(
'uri' => '/res/d6b6235b/rsrc/css/application/base/phabricator-application-launch-view.css', 'uri' => '/res/8aee0702/rsrc/css/application/base/phabricator-application-launch-view.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(
@ -2625,7 +2625,7 @@ celerity_register_resource_map(array(
), ),
'phabricator-nav-view-css' => 'phabricator-nav-view-css' =>
array( array(
'uri' => '/res/28580773/rsrc/css/aphront/phabricator-nav-view.css', 'uri' => '/res/df20ec17/rsrc/css/aphront/phabricator-nav-view.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(
@ -3238,7 +3238,7 @@ celerity_register_resource_map(array(
), array( ), array(
'packages' => 'packages' =>
array( array(
'b4c8105f' => 'f95d7445' =>
array( array(
'name' => 'core.pkg.css', 'name' => 'core.pkg.css',
'symbols' => 'symbols' =>
@ -3282,7 +3282,7 @@ celerity_register_resource_map(array(
36 => 'phabricator-object-item-list-view-css', 36 => 'phabricator-object-item-list-view-css',
37 => 'global-drag-and-drop-css', 37 => 'global-drag-and-drop-css',
), ),
'uri' => '/res/pkg/b4c8105f/core.pkg.css', 'uri' => '/res/pkg/f95d7445/core.pkg.css',
'type' => 'css', 'type' => 'css',
), ),
'c90b892e' => 'c90b892e' =>
@ -3472,19 +3472,19 @@ celerity_register_resource_map(array(
'reverse' => 'reverse' =>
array( array(
'aphront-attached-file-view-css' => '83f07678', 'aphront-attached-file-view-css' => '83f07678',
'aphront-crumbs-view-css' => 'b4c8105f', 'aphront-crumbs-view-css' => 'f95d7445',
'aphront-dialog-view-css' => 'b4c8105f', 'aphront-dialog-view-css' => 'f95d7445',
'aphront-error-view-css' => 'b4c8105f', 'aphront-error-view-css' => 'f95d7445',
'aphront-form-view-css' => 'b4c8105f', 'aphront-form-view-css' => 'f95d7445',
'aphront-headsup-action-list-view-css' => 'ec01d039', 'aphront-headsup-action-list-view-css' => 'ec01d039',
'aphront-headsup-view-css' => 'b4c8105f', 'aphront-headsup-view-css' => 'f95d7445',
'aphront-list-filter-view-css' => 'b4c8105f', 'aphront-list-filter-view-css' => 'f95d7445',
'aphront-pager-view-css' => 'b4c8105f', 'aphront-pager-view-css' => 'f95d7445',
'aphront-panel-view-css' => 'b4c8105f', 'aphront-panel-view-css' => 'f95d7445',
'aphront-table-view-css' => 'b4c8105f', 'aphront-table-view-css' => 'f95d7445',
'aphront-tokenizer-control-css' => 'b4c8105f', 'aphront-tokenizer-control-css' => 'f95d7445',
'aphront-tooltip-css' => 'b4c8105f', 'aphront-tooltip-css' => 'f95d7445',
'aphront-typeahead-control-css' => 'b4c8105f', 'aphront-typeahead-control-css' => 'f95d7445',
'differential-changeset-view-css' => 'ec01d039', 'differential-changeset-view-css' => 'ec01d039',
'differential-core-view-css' => 'ec01d039', 'differential-core-view-css' => 'ec01d039',
'differential-inline-comment-editor' => 'ac53d36a', 'differential-inline-comment-editor' => 'ac53d36a',
@ -3498,7 +3498,7 @@ celerity_register_resource_map(array(
'differential-table-of-contents-css' => 'ec01d039', 'differential-table-of-contents-css' => 'ec01d039',
'diffusion-commit-view-css' => 'c8ce2d88', 'diffusion-commit-view-css' => 'c8ce2d88',
'diffusion-icons-css' => 'c8ce2d88', 'diffusion-icons-css' => 'c8ce2d88',
'global-drag-and-drop-css' => 'b4c8105f', 'global-drag-and-drop-css' => 'f95d7445',
'inline-comment-summary-css' => 'ec01d039', 'inline-comment-summary-css' => 'ec01d039',
'javelin-aphlict' => 'c90b892e', 'javelin-aphlict' => 'c90b892e',
'javelin-behavior' => 'fbeded59', 'javelin-behavior' => 'fbeded59',
@ -3568,48 +3568,48 @@ celerity_register_resource_map(array(
'javelin-util' => 'fbeded59', 'javelin-util' => 'fbeded59',
'javelin-vector' => 'fbeded59', 'javelin-vector' => 'fbeded59',
'javelin-workflow' => 'fbeded59', 'javelin-workflow' => 'fbeded59',
'lightbox-attachment-css' => 'b4c8105f', 'lightbox-attachment-css' => 'f95d7445',
'maniphest-task-summary-css' => '83f07678', 'maniphest-task-summary-css' => '83f07678',
'maniphest-transaction-detail-css' => '83f07678', 'maniphest-transaction-detail-css' => '83f07678',
'phabricator-busy' => 'c90b892e', 'phabricator-busy' => 'c90b892e',
'phabricator-content-source-view-css' => 'ec01d039', 'phabricator-content-source-view-css' => 'ec01d039',
'phabricator-core-buttons-css' => 'b4c8105f', 'phabricator-core-buttons-css' => 'f95d7445',
'phabricator-core-css' => 'b4c8105f', 'phabricator-core-css' => 'f95d7445',
'phabricator-crumbs-view-css' => 'b4c8105f', 'phabricator-crumbs-view-css' => 'f95d7445',
'phabricator-directory-css' => 'b4c8105f', 'phabricator-directory-css' => 'f95d7445',
'phabricator-drag-and-drop-file-upload' => 'ac53d36a', 'phabricator-drag-and-drop-file-upload' => 'ac53d36a',
'phabricator-dropdown-menu' => 'c90b892e', 'phabricator-dropdown-menu' => 'c90b892e',
'phabricator-file-upload' => 'c90b892e', 'phabricator-file-upload' => 'c90b892e',
'phabricator-filetree-view-css' => 'b4c8105f', 'phabricator-filetree-view-css' => 'f95d7445',
'phabricator-flag-css' => 'b4c8105f', 'phabricator-flag-css' => 'f95d7445',
'phabricator-form-view-css' => 'b4c8105f', 'phabricator-form-view-css' => 'f95d7445',
'phabricator-header-view-css' => 'b4c8105f', 'phabricator-header-view-css' => 'f95d7445',
'phabricator-jump-nav' => 'b4c8105f', 'phabricator-jump-nav' => 'f95d7445',
'phabricator-keyboard-shortcut' => 'c90b892e', 'phabricator-keyboard-shortcut' => 'c90b892e',
'phabricator-keyboard-shortcut-manager' => 'c90b892e', 'phabricator-keyboard-shortcut-manager' => 'c90b892e',
'phabricator-main-menu-view' => 'b4c8105f', 'phabricator-main-menu-view' => 'f95d7445',
'phabricator-menu-item' => 'c90b892e', 'phabricator-menu-item' => 'c90b892e',
'phabricator-nav-view-css' => 'b4c8105f', 'phabricator-nav-view-css' => 'f95d7445',
'phabricator-notification' => 'c90b892e', 'phabricator-notification' => 'c90b892e',
'phabricator-notification-css' => 'b4c8105f', 'phabricator-notification-css' => 'f95d7445',
'phabricator-notification-menu-css' => 'b4c8105f', 'phabricator-notification-menu-css' => 'f95d7445',
'phabricator-object-item-list-view-css' => 'b4c8105f', 'phabricator-object-item-list-view-css' => 'f95d7445',
'phabricator-object-selector-css' => 'ec01d039', 'phabricator-object-selector-css' => 'ec01d039',
'phabricator-paste-file-upload' => 'c90b892e', 'phabricator-paste-file-upload' => 'c90b892e',
'phabricator-prefab' => 'c90b892e', 'phabricator-prefab' => 'c90b892e',
'phabricator-project-tag-css' => '83f07678', 'phabricator-project-tag-css' => '83f07678',
'phabricator-remarkup-css' => 'b4c8105f', 'phabricator-remarkup-css' => 'f95d7445',
'phabricator-shaped-request' => 'ac53d36a', 'phabricator-shaped-request' => 'ac53d36a',
'phabricator-side-menu-view-css' => 'b4c8105f', 'phabricator-side-menu-view-css' => 'f95d7445',
'phabricator-standard-page-view' => 'b4c8105f', 'phabricator-standard-page-view' => 'f95d7445',
'phabricator-textareautils' => 'c90b892e', 'phabricator-textareautils' => 'c90b892e',
'phabricator-tooltip' => 'c90b892e', 'phabricator-tooltip' => 'c90b892e',
'phabricator-transaction-view-css' => 'b4c8105f', 'phabricator-transaction-view-css' => 'f95d7445',
'phabricator-zindex-css' => 'b4c8105f', 'phabricator-zindex-css' => 'f95d7445',
'sprite-apps-large-css' => 'b4c8105f', 'sprite-apps-large-css' => 'f95d7445',
'sprite-gradient-css' => 'b4c8105f', 'sprite-gradient-css' => 'f95d7445',
'sprite-icon-css' => 'b4c8105f', 'sprite-icon-css' => 'f95d7445',
'sprite-menu-css' => 'b4c8105f', 'sprite-menu-css' => 'f95d7445',
'syntax-highlighting-css' => 'b4c8105f', 'syntax-highlighting-css' => 'f95d7445',
), ),
)); ));

View file

@ -198,6 +198,18 @@ abstract class PhabricatorApplication {
} }
/**
* On the Phabricator homepage sidebar, this function returns the URL for
* a quick create X link which is displayed in the wide button only.
*
* @return string
* @task ui
*/
public function getQuickCreateURI() {
return null;
}
/* -( Application Management )--------------------------------------------- */ /* -( Application Management )--------------------------------------------- */

View file

@ -32,6 +32,10 @@ final class PhabricatorApplicationCalendar extends PhabricatorApplication {
return true; return true;
} }
public function getQuickCreateURI() {
return $this->getBaseURI().'status/create/';
}
public function getRoutes() { public function getRoutes() {
return array( return array(
'/calendar/' => array( '/calendar/' => array(

View file

@ -123,7 +123,7 @@ abstract class PhabricatorDirectoryController extends PhabricatorController {
} }
if ($is_small_tiles) { if ($is_small_tiles) {
while (count($tiles) % 4) { while (count($tiles) % 3) {
$tiles[] = id(new PhabricatorApplicationLaunchView()); $tiles[] = id(new PhabricatorApplicationLaunchView());
} }
$nav->addLabel($groups[$group]); $nav->addLabel($groups[$group]);

View file

@ -32,6 +32,10 @@ final class PhabricatorApplicationManiphest extends PhabricatorApplication {
); );
} }
public function getQuickCreateURI() {
return $this->getBaseURI().'task/create/';
}
public function getRoutes() { public function getRoutes() {
return array( return array(
'/T(?P<id>[1-9]\d*)' => 'ManiphestTaskDetailController', '/T(?P<id>[1-9]\d*)' => 'ManiphestTaskDetailController',

View file

@ -29,6 +29,7 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
$content = array(); $content = array();
$icon = null; $icon = null;
$create_button = null;
if ($application) { if ($application) {
$content[] = phutil_render_tag( $content[] = phutil_render_tag(
'span', 'span',
@ -90,15 +91,36 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
'style' => nonempty(implode('; ', $styles), null), 'style' => nonempty(implode('; ', $styles), null),
), ),
''); '');
}
$classes = array(); $classes = array();
if ($application->getQuickCreateURI()) {
$classes[] = 'phabricator-application-create-icon';
$classes[] = 'sprite-icon';
$classes[] = 'action-new-grey';
$plus_icon = phutil_render_tag(
'span',
array(
'class' => implode(' ', $classes),
));
$create_button = phutil_render_tag(
'a',
array(
'href' => $application->getQuickCreateURI(),
'class' => 'phabricator-application-launch-create',
),
$plus_icon);
$classes = array();
$classes[] = 'application-tile-create';
}
}
$classes[] = 'phabricator-application-launch-container'; $classes[] = 'phabricator-application-launch-container';
if ($this->fullWidth) { if ($this->fullWidth) {
$classes[] = 'application-tile-full'; $classes[] = 'application-tile-full';
} }
return phutil_render_tag( $app_button = phutil_render_tag(
$application ? 'a' : 'div', $application ? 'a' : 'div',
array( array(
'class' => implode(' ', $classes), 'class' => implode(' ', $classes),
@ -106,5 +128,7 @@ final class PhabricatorApplicationLaunchView extends AphrontView {
), ),
$icon. $icon.
$this->renderSingleView($content)); $this->renderSingleView($content));
return $app_button.$create_button;
} }
} }

View file

@ -18,6 +18,10 @@ final class PhabricatorApplicationPaste extends PhabricatorApplication {
return self::GROUP_UTILITIES; return self::GROUP_UTILITIES;
} }
public function getQuickCreateURI() {
return $this->getBaseURI().'create/';
}
public function getRoutes() { public function getRoutes() {
return array( return array(
'/P(?P<id>[1-9]\d*)' => 'PhabricatorPasteViewController', '/P(?P<id>[1-9]\d*)' => 'PhabricatorPasteViewController',

View file

@ -77,9 +77,15 @@
.phabricator-side-menu-home .phabricator-nav-column-background, .phabricator-side-menu-home .phabricator-nav-column-background,
.phabricator-side-menu-home .phabricator-nav-local { .phabricator-side-menu-home .phabricator-nav-local {
width: 300px; width: 240px;
} }
.device-desktop .phabricator-side-menu-home .phabricator-nav-content { .device-desktop .phabricator-side-menu-home .phabricator-nav-content {
margin-left: 300px; margin-left: 240px;
}
/* Chrome annoyingly has a url display over the nav
if the nav is the tallest page (home) */
.phabricator-menu-view {
margin-bottom: 40px;
} }

View file

@ -25,8 +25,8 @@ a.phabricator-application-launch-container,
div.phabricator-application-launch-container { div.phabricator-application-launch-container {
display: block; display: block;
float: left; float: left;
width: 73px; width: 78px;
height: 70px; height: 66px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
@ -37,10 +37,33 @@ div.phabricator-application-launch-container {
} }
a.application-tile-full { a.application-tile-full {
width: 100%; width: 240px;
height: 52px; height: 52px;
} }
a.application-tile-full.application-tile-create {
width: 210px;
height: 52px;
border-right: none;
}
.application-tile-full + .phabricator-application-launch-create {
display: block;
float: right;
width: 28px;
border-top: 1px solid #080909;
border-bottom: 1px solid #080909;
border-left: 1px solid #080909;
height: 52px;
position: relative;
}
a.phabricator-application-launch-create:hover {
background-image: url('/rsrc/image/texture/dark-menu-hover.png');
color: #fff;
text-decoration: none;
}
a.phabricator-application-launch-container:hover { a.phabricator-application-launch-container:hover {
text-decoration: none; text-decoration: none;
} }
@ -54,20 +77,29 @@ a.phabricator-application-launch-container:hover {
.phabricator-application-launch-icon { .phabricator-application-launch-icon {
display: block; display: block;
position: absolute; position: absolute;
left: 23px; left: 25px;
top: 13px; top: 10px;
width: 28px; width: 28px;
height: 28px; height: 28px;
} }
.phabricator-application-create-icon {
display: block;
position: absolute;
right: 7px;
top: 20px;
width: 14px;
height: 14px;
}
.application-tile-full .phabricator-application-launch-icon { .application-tile-full .phabricator-application-launch-icon {
top: 12px; top: 12px;
left: 12px; left: 10px;
} }
.phabricator-application-launch-name { .phabricator-application-launch-name {
display: block; display: block;
margin-top: 46px; margin-top: 42px;
font-weight: bold; font-weight: bold;
font-size: 11px; font-size: 11px;
text-align: center; text-align: center;
@ -76,10 +108,10 @@ a.phabricator-application-launch-container:hover {
} }
.application-tile-full .phabricator-application-launch-name { .application-tile-full .phabricator-application-launch-name {
font-size: 12px; font-size: 13px;
margin-top: 12px; margin-top: 11px;
text-align: left; text-align: left;
margin-left: 52px; margin-left: 48px;
} }
@ -87,7 +119,7 @@ a.phabricator-application-launch-container:hover {
color: #bfbfbf; color: #bfbfbf;
font-size: 11px; font-size: 11px;
margin-top: 24px; margin-top: 24px;
margin-left: 52px; margin-left: 48px;
} }
.phabricator-application-beta, .phabricator-application-beta,
@ -110,11 +142,27 @@ a.phabricator-application-launch-container:hover {
.phabricator-application-beta { .phabricator-application-beta {
left: 4px; left: 4px;
background-color: #ff8f00; background-color: rgb(109, 92, 41);
} }
.application-tile-full .phabricator-application-launch-attention { .application-tile-full .phabricator-application-launch-attention {
top: 16px; top: 16px;
right: 12px; right: 8px;
} }
.application-tile-full .phabricator-application-launch-create {
display: inline-block;
float: right;
background: rgb(0, 122, 255);
border-radius: 5px;
color: white;
font-weight: bold;
padding: 1px 6px 2px;
border: 2px solid #333;
font-size: 11px;
box-shadow: 0 0px 2px #000;
}
.phabricator-application-launch-create {
display: none;
}