Use ObjectItemListView for Maniphest
Summary:
This isn't quite complete, but everything else is technical cleanup. Broadly:
- Removed checkboxes. Selected state is now indicated with CSS, and toggled with shift-click. When nothing is selected, the text reads "Shift-Click Tasks to Select" to let users discover this feature.
- Updated drag-to-reorder code to work with ObjectItemListView.
- Closed/resolved is now shown with a grey footer icon.
- Assigned is now shown with a user profile image handle icon, with a hover state.
This could probably use some more tweaks, but overall I think it looks pretty reasonable?
Test Plan: {F35897}
Reviewers: chad
Reviewed By: chad
CC: aran
Differential Revision: https://secure.phabricator.com/D5340
This commit is contained in:
@@ -240,6 +240,8 @@ final class PhabricatorProjectProfileController
|
||||
PhabricatorProject $project,
|
||||
PhabricatorProjectProfile $profile) {
|
||||
|
||||
$user = $this->getRequest()->getUser();
|
||||
|
||||
$query = id(new ManiphestTaskQuery())
|
||||
->withAnyProjects(array($project->getPHID()))
|
||||
->withStatus(ManiphestTaskQuery::STATUS_OPEN)
|
||||
@@ -250,23 +252,16 @@ final class PhabricatorProjectProfileController
|
||||
$count = $query->getRowCount();
|
||||
|
||||
$phids = mpull($tasks, 'getOwnerPHID');
|
||||
$phids = array_merge(
|
||||
$phids,
|
||||
array_mergev(mpull($tasks, 'getProjectPHIDs')));
|
||||
$phids = array_filter($phids);
|
||||
$handles = $this->loadViewerHandles($phids);
|
||||
|
||||
$task_views = array();
|
||||
foreach ($tasks as $task) {
|
||||
$view = id(new ManiphestTaskSummaryView())
|
||||
->setTask($task)
|
||||
->setHandles($handles)
|
||||
->setUser($this->getRequest()->getUser());
|
||||
$task_views[] = $view->render();
|
||||
}
|
||||
|
||||
if (empty($tasks)) {
|
||||
$task_views = phutil_tag('em', array(), pht('No open tasks.'));
|
||||
} else {
|
||||
$task_views = phutil_implode_html('', $task_views);
|
||||
}
|
||||
$task_list = new ManiphestTaskListView();
|
||||
$task_list->setUser($user);
|
||||
$task_list->setTasks($tasks);
|
||||
$task_list->setHandles($handles);
|
||||
|
||||
$open = number_format($count);
|
||||
|
||||
@@ -286,7 +281,7 @@ final class PhabricatorProjectProfileController
|
||||
'</div>
|
||||
</div>',
|
||||
pht('Open Tasks (%s)', $open),
|
||||
$task_views,
|
||||
$task_list,
|
||||
$more_link);
|
||||
|
||||
return $content;
|
||||
|
||||
Reference in New Issue
Block a user