mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 23:32:40 +01:00
Convert phutil_render_tag() to phutil_tag() for inline comments
Test Plan: Looked at file with lint errors in Diffusion. I've also tried inline comments in Differential but it failed. I'll try it again after you land all your diffs. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2432 Differential Revision: https://secure.phabricator.com/D4755
This commit is contained in:
parent
de0261358f
commit
6e95901161
3 changed files with 37 additions and 36 deletions
|
@ -324,26 +324,29 @@ final class DifferentialChangesetTwoUpRenderer
|
|||
}
|
||||
}
|
||||
}
|
||||
$html[] =
|
||||
$html[] = hsprintf(
|
||||
'<tr class="inline">'.
|
||||
'<th />'.
|
||||
'<td class="left">'.$comment_html.'</td>'.
|
||||
'<td class="left">%s</td>'.
|
||||
'<th />'.
|
||||
'<td colspan="3" class="right3">'.$new.'</td>'.
|
||||
'</tr>';
|
||||
'<td colspan="3" class="right3">%s</td>'.
|
||||
'</tr>',
|
||||
$comment_html,
|
||||
$new);
|
||||
}
|
||||
}
|
||||
if ($n_num && isset($new_comments[$n_num])) {
|
||||
foreach ($new_comments[$n_num] as $comment) {
|
||||
$comment_html = $this->renderInlineComment($comment,
|
||||
$on_right = true);
|
||||
$html[] =
|
||||
$html[] = hsprintf(
|
||||
'<tr class="inline">'.
|
||||
'<th />'.
|
||||
'<td class="left" />'.
|
||||
'<th />'.
|
||||
'<td colspan="3" class="right3">'.$comment_html.'</td>'.
|
||||
'</tr>';
|
||||
'<td colspan="3" class="right3">%s</td>'.
|
||||
'</tr>',
|
||||
$comment_html);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -175,10 +175,10 @@ final class DifferentialInlineCommentView extends AphrontView {
|
|||
}
|
||||
|
||||
if ($links) {
|
||||
$links =
|
||||
'<span class="differential-inline-comment-links">'.
|
||||
implode(' · ', $links).
|
||||
'</span>';
|
||||
$links = phutil_tag(
|
||||
'span',
|
||||
array('class' => 'differential-inline-comment-links'),
|
||||
array_interleave(" \xC2\xB7 ", $links));
|
||||
} else {
|
||||
$links = null;
|
||||
}
|
||||
|
@ -217,24 +217,25 @@ final class DifferentialInlineCommentView extends AphrontView {
|
|||
$author = $handles[$inline->getAuthorPHID()]->getName();
|
||||
}
|
||||
|
||||
$markup = javelin_render_tag(
|
||||
$markup = javelin_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => $classes,
|
||||
'sigil' => $sigil,
|
||||
'meta' => $metadata,
|
||||
),
|
||||
hsprintf(
|
||||
'<div class="differential-inline-comment-head">'.
|
||||
$anchor.
|
||||
$links.
|
||||
' <span class="differential-inline-comment-line">'.$line.'</span> '.
|
||||
phutil_escape_html($author).
|
||||
'%s%s <span class="differential-inline-comment-line">%s</span> %s'.
|
||||
'</div>'.
|
||||
'<div class="differential-inline-comment-content">'.
|
||||
'<div class="phabricator-remarkup">'.
|
||||
$content.
|
||||
'</div>'.
|
||||
'</div>');
|
||||
'<div class="phabricator-remarkup">%s</div>'.
|
||||
'</div>',
|
||||
$anchor,
|
||||
$links,
|
||||
$line,
|
||||
$author,
|
||||
$content));
|
||||
|
||||
return $this->scaffoldMarkup($markup);
|
||||
}
|
||||
|
@ -247,15 +248,17 @@ final class DifferentialInlineCommentView extends AphrontView {
|
|||
$left_markup = !$this->onRight ? $markup : '';
|
||||
$right_markup = $this->onRight ? $markup : '';
|
||||
|
||||
return
|
||||
return hsprintf(
|
||||
'<table>'.
|
||||
'<tr class="inline">'.
|
||||
'<th></th>'.
|
||||
'<td class="left">'.$left_markup.'</td>'.
|
||||
'<td class="left">%s</td>'.
|
||||
'<th></th>'.
|
||||
'<td class="right3" colspan="3">'.$right_markup.'</td>'.
|
||||
'<td class="right3" colspan="3">%s</td>'.
|
||||
'</tr>'.
|
||||
'</table>';
|
||||
'</table>',
|
||||
$left_markup,
|
||||
$right_markup);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -264,16 +264,13 @@ final class DiffusionBrowseFileController extends DiffusionController {
|
|||
));
|
||||
}
|
||||
|
||||
$corpus_table = javelin_render_tag(
|
||||
$corpus_table = javelin_tag(
|
||||
'table',
|
||||
array(
|
||||
'class' => "diffusion-source remarkup-code PhabricatorMonospaced",
|
||||
'sigil' => 'diffusion-source',
|
||||
),
|
||||
implode("\n", $rows));
|
||||
|
||||
// TODO: [HTML] Major cheating here.
|
||||
$corpus_table = phutil_safe_html($corpus_table);
|
||||
$rows);
|
||||
|
||||
$corpus = phutil_tag(
|
||||
'div',
|
||||
|
@ -774,11 +771,9 @@ final class DiffusionBrowseFileController extends DiffusionController {
|
|||
->setMarkupEngine($engine)
|
||||
->setInlineComment($inline)
|
||||
->render();
|
||||
$rows[] =
|
||||
'<tr class="inline">'.
|
||||
str_repeat('<th></th>', ($needs_blame ? 5 : 1)).
|
||||
'<td>'.$inline_view.'</td>'.
|
||||
'</tr>';
|
||||
$row = array_fill(0, ($needs_blame ? 5 : 1), phutil_tag('th'));
|
||||
$row[] = phutil_tag('td', array(), $inline_view);
|
||||
$rows[] = phutil_tag('tr', array('class' => 'inline'), $row);
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue