1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-05 19:38:27 +01:00

Prompt to adding a project if none in Maniphest

Summary: Adds 'Add Project...' if no projects present on Maniphest items. Also - I can't seem to get a dialog to pop, what am I missing? Fixes T3308

Test Plan: Click add project, get edit form.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T3308

Differential Revision: https://secure.phabricator.com/D6121
This commit is contained in:
Chad Little 2013-06-04 10:58:49 -07:00
parent 03b1ecbcdd
commit 989c7748e9
4 changed files with 38 additions and 19 deletions

View file

@ -3275,7 +3275,7 @@ celerity_register_resource_map(array(
), ),
'phabricator-project-tag-css' => 'phabricator-project-tag-css' =>
array( array(
'uri' => '/res/1b5efcb2/rsrc/css/application/projects/project-tag.css', 'uri' => '/res/383b8c30/rsrc/css/application/projects/project-tag.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(
@ -4199,7 +4199,7 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/a9f14d76/javelin.pkg.js', 'uri' => '/res/pkg/a9f14d76/javelin.pkg.js',
'type' => 'js', 'type' => 'js',
), ),
'6b1fccc6' => '03ab92cf' =>
array( array(
'name' => 'maniphest.pkg.css', 'name' => 'maniphest.pkg.css',
'symbols' => 'symbols' =>
@ -4209,7 +4209,7 @@ celerity_register_resource_map(array(
2 => 'aphront-attached-file-view-css', 2 => 'aphront-attached-file-view-css',
3 => 'phabricator-project-tag-css', 3 => 'phabricator-project-tag-css',
), ),
'uri' => '/res/pkg/6b1fccc6/maniphest.pkg.css', 'uri' => '/res/pkg/03ab92cf/maniphest.pkg.css',
'type' => 'css', 'type' => 'css',
), ),
'1621e522' => '1621e522' =>
@ -4229,7 +4229,7 @@ celerity_register_resource_map(array(
), ),
'reverse' => 'reverse' =>
array( array(
'aphront-attached-file-view-css' => '6b1fccc6', 'aphront-attached-file-view-css' => '03ab92cf',
'aphront-dialog-view-css' => '8e459ff2', 'aphront-dialog-view-css' => '8e459ff2',
'aphront-error-view-css' => '8e459ff2', 'aphront-error-view-css' => '8e459ff2',
'aphront-form-view-css' => '8e459ff2', 'aphront-form-view-css' => '8e459ff2',
@ -4328,8 +4328,8 @@ celerity_register_resource_map(array(
'javelin-vector' => 'a9f14d76', 'javelin-vector' => 'a9f14d76',
'javelin-workflow' => 'a9f14d76', 'javelin-workflow' => 'a9f14d76',
'lightbox-attachment-css' => '8e459ff2', 'lightbox-attachment-css' => '8e459ff2',
'maniphest-task-summary-css' => '6b1fccc6', 'maniphest-task-summary-css' => '03ab92cf',
'maniphest-transaction-detail-css' => '6b1fccc6', 'maniphest-transaction-detail-css' => '03ab92cf',
'phabricator-action-list-view-css' => '8e459ff2', 'phabricator-action-list-view-css' => '8e459ff2',
'phabricator-application-launch-view-css' => '8e459ff2', 'phabricator-application-launch-view-css' => '8e459ff2',
'phabricator-busy' => '98f60e3f', 'phabricator-busy' => '98f60e3f',
@ -4358,7 +4358,7 @@ celerity_register_resource_map(array(
'phabricator-object-selector-css' => 'dd27a69b', 'phabricator-object-selector-css' => 'dd27a69b',
'phabricator-phtize' => '98f60e3f', 'phabricator-phtize' => '98f60e3f',
'phabricator-prefab' => '98f60e3f', 'phabricator-prefab' => '98f60e3f',
'phabricator-project-tag-css' => '6b1fccc6', 'phabricator-project-tag-css' => '03ab92cf',
'phabricator-property-list-view-css' => '8e459ff2', 'phabricator-property-list-view-css' => '8e459ff2',
'phabricator-remarkup-css' => '8e459ff2', 'phabricator-remarkup-css' => '8e459ff2',
'phabricator-shaped-request' => '9488bb69', 'phabricator-shaped-request' => '9488bb69',

View file

@ -86,7 +86,6 @@ final class ManiphestTaskListView extends ManiphestView {
$item->addSigil('maniphest-task'); $item->addSigil('maniphest-task');
} }
if ($task->getProjectPHIDs()) {
$projects_view = new ManiphestTaskProjectsView(); $projects_view = new ManiphestTaskProjectsView();
$projects_view->setHandles( $projects_view->setHandles(
array_select_keys( array_select_keys(
@ -94,7 +93,6 @@ final class ManiphestTaskListView extends ManiphestView {
$task->getProjectPHIDs())); $task->getProjectPHIDs()));
$item->addAttribute($projects_view); $item->addAttribute($projects_view);
}
$item->setMetadata( $item->setMetadata(
array( array(

View file

@ -20,6 +20,7 @@ final class ManiphestTaskProjectsView extends ManiphestView {
$show = array_slice($this->handles, 0, 2); $show = array_slice($this->handles, 0, 2);
$tags = array(); $tags = array();
if ($show) {
foreach ($show as $handle) { foreach ($show as $handle) {
$tags[] = phutil_tag( $tags[] = phutil_tag(
'a', 'a',
@ -29,6 +30,16 @@ final class ManiphestTaskProjectsView extends ManiphestView {
), ),
phutil_utf8_shorten($handle->getName(), 24)); phutil_utf8_shorten($handle->getName(), 24));
} }
} else {
$tags[] = phutil_tag(
'a',
array(
'class' => 'phabricator-project-tag phabricator-project-tag-grey',
'href' => '/maniphest/view/all/?s&projects='.
ManiphestTaskOwner::PROJECT_NO_PROJECT
),
pht('No Project'));
}
if (count($this->handles) > 2) { if (count($this->handles) > 2) {
require_celerity_resource('aphront-tooltip-css'); require_celerity_resource('aphront-tooltip-css');

View file

@ -23,6 +23,16 @@
white-space: nowrap; white-space: nowrap;
} }
.phabricator-project-tag.phabricator-project-tag-grey {
border: 1px solid #ccc;
background: #f7f7f7;
color: #888;
}
.phabricator-project-tag.phabricator-project-tag-grey:hover {
background: #e7e7e7;
}
.phabricator-project-tag:last-child { .phabricator-project-tag:last-child {
margin-right: 0px; margin-right: 0px;
} }