1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 17:28:51 +02:00

render_tag -> tag: fix more callsites (more view, misc)

Summary: Fixes even more callsites.

Test Plan: See inlines.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

Differential Revision: https://secure.phabricator.com/D4749
This commit is contained in:
epriestley 2013-01-31 09:08:02 -08:00
parent 95d37af5d9
commit 7f43826854
8 changed files with 78 additions and 40 deletions

View file

@ -244,12 +244,14 @@ final class DifferentialChangesetViewController extends DifferentialController {
$detail->setVsChangesetID($left_source);
$panel = new DifferentialPrimaryPaneView();
$panel->appendChild(phutil_render_tag('div',
$panel->appendChild(
phutil_tag(
'div',
array(
'class' => 'differential-review-stage',
'id' => 'differential-review-stage',
), $detail->render())
);
),
$detail->render()));
return $this->buildStandardPageResponse(
array(

View file

@ -148,7 +148,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
$rows[] =
'<tr>'.
phutil_render_tag(
phutil_tag(
'td',
array(
'class' => 'differential-toc-char',

View file

@ -88,13 +88,13 @@ final class DifferentialLocalCommitsView extends AphrontView {
$summary = phutil_utf8_shorten($summary, 80);
$view = new AphrontMoreView();
$view->setSome(phutil_escape_html($summary));
$view->setSome($summary);
if ($message && (trim($summary) != trim($message))) {
$view->setMore(nl2br(phutil_escape_html($message)));
$view->setMore(phutil_escape_html_newlines($message));
}
$row[] = phutil_render_tag(
$row[] = phutil_tag(
'td',
array(
'class' => 'summary',

View file

@ -159,22 +159,29 @@ final class DifferentialRevisionCommentListView extends AphrontView {
array(
'markup' => implode("\n", $hidden),
));
$hidden = javelin_render_tag(
$hidden = javelin_tag(
'div',
array(
'sigil' => "differential-all-comments-container",
),
'<div class="differential-older-comments-are-hidden">'.
pht('%d older comments are hidden. ', number_format(count($hidden))).
javelin_tag(
'a',
array(
'href' => '#',
'mustcapture' => true,
'sigil' => 'differential-show-all-comments',
),
pht('Show all comments.')).
'</div>');
phutil_tag(
'div',
array(
'class' => 'differential-older-comments-are-hidden',
),
array(
pht(
'%d older comments are hidden. ',
number_format(count($hidden))),
javelin_tag(
'a',
array(
'href' => '#',
'mustcapture' => true,
'sigil' => 'differential-show-all-comments',
),
pht('Show all comments.')),
)));
} else {
$hidden = null;
}

View file

@ -271,6 +271,10 @@ final class DiffusionBrowseFileController extends DiffusionController {
'sigil' => 'diffusion-source',
),
implode("\n", $rows));
// TODO: [HTML] Major cheating here.
$corpus_table = phutil_safe_html($corpus_table);
$corpus = phutil_tag(
'div',
array(
@ -723,18 +727,29 @@ final class DiffusionBrowseFileController extends DiffusionController {
array(
'target' => 'scroll_target',
));
$anchor_text = '<a id="scroll_target"></a>';
$anchor_text = phutil_tag(
'a',
array(
'id' => 'scroll_target',
),
'');
} else {
$anchor_text = null;
}
$blame[] = phutil_render_tag(
$blame[] = phutil_tag(
'td',
array(
),
$anchor_text.
"\xE2\x80\x8B". // NOTE: See phabricator-oncopy behavior.
$line['data']);
array(
$anchor_text,
// NOTE: See phabricator-oncopy behavior.
"\xE2\x80\x8B",
// TODO: [HTML] Not ideal.
phutil_safe_html($line['data']),
));
$rows[] = phutil_tag(
'tr',

View file

@ -442,13 +442,25 @@ final class DiffusionCommitController extends DiffusionController {
foreach ($parents as $parent) {
$parent_links[] = $handles[$parent->getPHID()]->renderLink();
}
$props['Parents'] = implode(' &middot; ', $parent_links);
$props['Parents'] = array_interleave(
" \xC2\xB7 ",
$parent_links);
}
$request = $this->getDiffusionRequest();
$props['Branches'] = '<span id="commit-branches">Unknown</span>';
$props['Tags'] = '<span id="commit-tags">Unknown</span>';
$props['Branches'] = phutil_tag(
'span',
array(
'id' => 'commit-branches',
),
'Unknown');
$props['Tags'] = phutil_tag(
'span',
array(
'id' => 'commit-tags',
),
'Unknown');
$callsign = $request->getRepository()->getCallsign();
$root = '/diffusion/'.$callsign.'/commit/'.$commit->getCommitIdentifier();
@ -906,8 +918,8 @@ final class DiffusionCommitController extends DiffusionController {
),
$ref);
}
$ref_links = implode(', ', $ref_links);
return $ref_links;
return array_interleave(', ', $ref_links);
}
private function buildRawDiffResponse(DiffusionRequest $drequest) {

View file

@ -44,8 +44,8 @@ final class PonderAddCommentView extends AphrontView {
->setValue($is_serious ? 'Submit' : 'Editorialize'));
$view = id(new AphrontMoreView())
->setSome(id(new AphrontNullView())->render())
->setMore($form->render())
->setSome('')
->setMore(phutil_safe_html($form->render()))
->setExpandText('Add Comment');
return $view->render();

View file

@ -22,17 +22,19 @@ final class AphrontMoreView extends AphrontView {
}
public function render() {
$some = $this->some;
$text = "(Show More\xE2\x80\xA6)";
if ($this->expandtext !== null) {
$text = $this->expandtext;
}
$content = array();
$content[] = $this->some;
$link = null;
if ($this->more && $this->more != $this->some) {
$text = "(Show More\xE2\x80\xA6)";
if ($this->expandtext !== null) {
$text = $this->expandtext;
}
Javelin::initBehavior('aphront-more');
$link = ' '.javelin_tag(
$content[] = ' ';
$content[] = javelin_tag(
'a',
array(
'sigil' => 'aphront-more-view-show-more',
@ -45,11 +47,11 @@ final class AphrontMoreView extends AphrontView {
$text);
}
return javelin_render_tag(
return javelin_tag(
'div',
array(
'sigil' => 'aphront-more-view',
),
$some.$link);
$content);
}
}