Fix some HTML problems
Summary: I'm too lazy to attaching them for diffs where they were introduced. Test Plan: / /D1, wrote comment with code snippet DarkConsole commit detail, wrote comment task detail, wrote comment Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2432 Differential Revision: https://secure.phabricator.com/D4911
This commit is contained in:
@@ -110,9 +110,9 @@ final class PhrictionDocumentController
|
||||
|
||||
$project_info = null;
|
||||
if ($project_phid) {
|
||||
$project_info =
|
||||
'<br />This document is about the project '.
|
||||
$handles[$project_phid]->renderLink().'.';
|
||||
$project_info = hsprintf(
|
||||
'<br />This document is about the project %s.',
|
||||
$handles[$project_phid]->renderLink());
|
||||
}
|
||||
|
||||
$index_link = phutil_tag(
|
||||
@@ -122,12 +122,11 @@ final class PhrictionDocumentController
|
||||
),
|
||||
pht('Document Index'));
|
||||
|
||||
$byline =
|
||||
'<div class="phriction-byline">'.
|
||||
"Last updated {$when} by ".
|
||||
$handles[$content->getAuthorPHID()]->renderLink().'.'.
|
||||
$project_info.
|
||||
'</div>';
|
||||
$byline = hsprintf(
|
||||
'<div class="phriction-byline">Last updated %s by %s.%s</div>',
|
||||
$when,
|
||||
$handles[$content->getAuthorPHID()]->renderLink(),
|
||||
$project_info);
|
||||
|
||||
|
||||
$doc_status = $document->getStatus();
|
||||
@@ -145,12 +144,11 @@ final class PhrictionDocumentController
|
||||
throw new Exception("Unknown document status '{$doc_status}'!");
|
||||
}
|
||||
|
||||
$page_content =
|
||||
'<div class="phriction-content">'.
|
||||
$index_link.
|
||||
$byline.
|
||||
$core_content.
|
||||
'</div>';
|
||||
$page_content = hsprintf(
|
||||
'<div class="phriction-content">%s%s%s</div>',
|
||||
$index_link,
|
||||
$byline,
|
||||
$core_content);
|
||||
}
|
||||
|
||||
if ($version_note) {
|
||||
@@ -170,17 +168,14 @@ final class PhrictionDocumentController
|
||||
$header = id(new PhabricatorHeaderView())
|
||||
->setHeader($page_title);
|
||||
|
||||
$page =
|
||||
$crumbs->render().
|
||||
$header->render().
|
||||
$actions->render().
|
||||
$version_note.
|
||||
$page_content.
|
||||
$children;
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
array(
|
||||
$page,
|
||||
$crumbs->render(),
|
||||
$header->render(),
|
||||
$actions->render(),
|
||||
$version_note,
|
||||
$page_content,
|
||||
$children,
|
||||
),
|
||||
array(
|
||||
'title' => $page_title,
|
||||
@@ -309,31 +304,32 @@ final class PhrictionDocumentController
|
||||
$children = isort($children, 'title');
|
||||
|
||||
$list = array();
|
||||
$list[] = '<ul>';
|
||||
foreach ($children as $child) {
|
||||
$list[] = hsprintf('<li>');
|
||||
$list[] = $this->renderChildDocumentLink($child);
|
||||
$grand = idx($grandchildren, $child['slug'], array());
|
||||
if ($grand) {
|
||||
$list[] = '<ul>';
|
||||
$list[] = hsprintf('<ul>');
|
||||
foreach ($grand as $grandchild) {
|
||||
$list[] = hsprintf('<li>');
|
||||
$list[] = $this->renderChildDocumentLink($grandchild);
|
||||
$list[] = hsprintf('</li>');
|
||||
}
|
||||
$list[] = '</ul>';
|
||||
$list[] = hsprintf('</ul>');
|
||||
}
|
||||
$list[] = hsprintf('</li>');
|
||||
}
|
||||
if ($more_children) {
|
||||
$list[] = '<li>'.pht('More...').'</li>';
|
||||
$list[] = phutil_tag('li', array(), pht('More...'));
|
||||
}
|
||||
$list[] = '</ul>';
|
||||
$list = implode("\n", $list);
|
||||
|
||||
return
|
||||
return hsprintf(
|
||||
'<div class="phriction-children">'.
|
||||
'<div class="phriction-children-header">'.
|
||||
pht('Document Hierarchy').
|
||||
'</div>'.
|
||||
$list.
|
||||
'</div>';
|
||||
'<div class="phriction-children-header">%s</div>'.
|
||||
'%s'.
|
||||
'</div>',
|
||||
pht('Document Hierarchy'),
|
||||
phutil_tag('ul', array(), $list));
|
||||
}
|
||||
|
||||
private function renderChildDocumentLink(array $info) {
|
||||
@@ -346,10 +342,10 @@ final class PhrictionDocumentController
|
||||
$title);
|
||||
|
||||
if (isset($info['empty'])) {
|
||||
$item = '<em>'.$item.'</em>';
|
||||
$item = phutil_tag('em', array(), $item);
|
||||
}
|
||||
|
||||
return '<li>'.$item.'</li>';
|
||||
return $item;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user