1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

render_tag -> tag: Maniphest summary view, setup issue view

Summary: One trivial, one not-so-trivial.

Test Plan: Viewed maniphest list; saw expected output.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4725
This commit is contained in:
epriestley 2013-01-30 11:26:03 -08:00
parent 74a90999d8
commit 607fca98df
3 changed files with 80 additions and 43 deletions

View file

@ -64,7 +64,7 @@ final class PhabricatorConfigIssueViewController
$view = new PhabricatorSetupIssueView();
$view->setIssue($issue);
$container = phutil_render_tag(
$container = phutil_tag(
'div',
array(
'class' => 'setup-issue-background',

View file

@ -52,7 +52,7 @@ final class ManiphestTaskProjectsView extends ManiphestView {
"\xE2\x80\xA6");
}
return implode("\n", $tags);
return $this->renderHTMLView($tags);
}
}

View file

@ -60,17 +60,19 @@ final class ManiphestTaskSummaryView extends ManiphestView {
$batch = null;
if ($this->showBatchControls) {
$batch =
'<td class="maniphest-task-batch">'.
javelin_tag(
'input',
array(
'type' => 'checkbox',
'name' => 'batch[]',
'value' => $task->getID(),
'sigil' => 'maniphest-batch',
)).
'</td>';
$batch = phutil_tag(
'td',
array(
'class' => 'maniphest-task-batch',
),
javelin_tag(
'input',
array(
'type' => 'checkbox',
'name' => 'batch[]',
'value' => $task->getID(),
'sigil' => 'maniphest-batch',
)));
}
$projects_view = new ManiphestTaskProjectsView();
@ -94,7 +96,70 @@ final class ManiphestTaskSummaryView extends ManiphestView {
),
'');
return javelin_render_tag(
$task_id = phutil_tag(
'td',
array(
'class' => 'maniphest-task-number',
),
'T'.$task->getID());
$task_status = phutil_tag(
'td',
array(
'class' => 'maniphest-task-status',
),
idx($status_map, $task->getStatus(), 'Unknown'));
$task_owner = phutil_tag(
'td',
array(
'class' => 'maniphest-task-owner',
),
$task->getOwnerPHID()
? $handles[$task->getOwnerPHID()]->renderLink()
: phutil_tag('em', array(), pht('None')));
$task_name = phutil_tag(
'td',
array(
'class' => 'maniphest-task-name',
),
phutil_tag(
'a',
array(
'href' => '/T'.$task->getID(),
),
$task->getTitle()));
$task_projects = phutil_tag(
'td',
array(
'class' => 'maniphest-task-projects',
),
$projects_view->render());
$task_updated = phutil_tag(
'td',
array(
'class' => 'maniphest-task-updated',
),
phabricator_date($task->getDateModified(), $this->user));
$row = phutil_tag(
'tr',
array(),
array(
$handle,
$batch,
$task_id,
$task_status,
$task_owner,
$task_name,
$task_projects,
$task_updated,
));
return javelin_tag(
'table',
array(
'class' => 'maniphest-task-summary',
@ -103,35 +168,7 @@ final class ManiphestTaskSummaryView extends ManiphestView {
'taskID' => $task->getID(),
),
),
'<tr>'.
$handle.
$batch.
'<td class="maniphest-task-number">'.
'T'.$task->getID().
'</td>'.
'<td class="maniphest-task-status">'.
idx($status_map, $task->getStatus(), 'Unknown').
'</td>'.
'<td class="maniphest-task-owner">'.
($task->getOwnerPHID()
? $handles[$task->getOwnerPHID()]->renderLink()
: '<em>None</em>').
'</td>'.
'<td class="maniphest-task-name">'.
phutil_tag(
'a',
array(
'href' => '/T'.$task->getID(),
),
$task->getTitle()).
'</td>'.
'<td class="maniphest-task-projects">'.
$projects_view->render().
'</td>'.
'<td class="maniphest-task-updated">'.
phabricator_date($task->getDateModified(), $this->user).
'</td>'.
'</tr>');
$row);
}
}