1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Better text when project home has no tasks

Summary: Adds more user friendly copy to the result list

Test Plan: Test on a project with and without tasks.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11352
This commit is contained in:
Chad Little 2015-01-12 13:39:08 -08:00
parent 270a0c54b4
commit 25167776dc
2 changed files with 13 additions and 0 deletions

View file

@ -6,6 +6,7 @@ final class ManiphestTaskListView extends ManiphestView {
private $handles; private $handles;
private $showBatchControls; private $showBatchControls;
private $showSubpriorityControls; private $showSubpriorityControls;
private $noDataString;
public function setTasks(array $tasks) { public function setTasks(array $tasks) {
assert_instances_of($tasks, 'ManiphestTask'); assert_instances_of($tasks, 'ManiphestTask');
@ -29,6 +30,11 @@ final class ManiphestTaskListView extends ManiphestView {
return $this; return $this;
} }
public function setNoDataString($text) {
$this->noDataString = $text;
return $this;
}
public function render() { public function render() {
$handles = $this->handles; $handles = $this->handles;
@ -37,6 +43,12 @@ final class ManiphestTaskListView extends ManiphestView {
$list = new PHUIObjectItemListView(); $list = new PHUIObjectItemListView();
$list->setFlush(true); $list->setFlush(true);
if ($this->noDataString) {
$list->setNoDataString($this->noDataString);
} else {
$list->setNoDataString(pht('No tasks.'));
}
$status_map = ManiphestTaskStatus::getTaskStatusMap(); $status_map = ManiphestTaskStatus::getTaskStatusMap();
$color_map = ManiphestTaskPriority::getColorMap(); $color_map = ManiphestTaskPriority::getColorMap();

View file

@ -110,6 +110,7 @@ final class PhabricatorProjectProfileController
$task_list->setUser($user); $task_list->setUser($user);
$task_list->setTasks($tasks); $task_list->setTasks($tasks);
$task_list->setHandles($handles); $task_list->setHandles($handles);
$task_list->setNoDataString(pht('This project has no open tasks.'));
$phid = $project->getPHID(); $phid = $project->getPHID();
$view_uri = urisprintf( $view_uri = urisprintf(