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

Changeset anchor links.

This commit is contained in:
epriestley 2011-02-04 16:18:08 -08:00
parent 12df78ed6a
commit 8b7755b834
3 changed files with 11 additions and 2 deletions

View file

@ -140,4 +140,8 @@ class DifferentialChangeset extends DifferentialDAO {
return implode("\n", $file);
}
public function getAnchorName() {
return substr(md5($this->getFilename()), 0, 8);
}
}

View file

@ -54,7 +54,12 @@ class DifferentialChangesetDetailView extends AphrontView {
),
'class' => $class,
),
'<a name="#'."TODO".'"></a>'.
phutil_render_tag(
'a',
array(
'name' => $changeset->getAnchorName(),
),
'').
implode('', $this->buttons).
'<h1>'.phutil_escape_html($display_filename).'</h1>'.
'<div style="clear: both;"></div>'.

View file

@ -65,7 +65,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
$link = phutil_render_tag(
'a',
array(
'href' => '#', // TODO: filename normalizer
'href' => '#'.$changeset->getAnchorName(),
),
phutil_escape_html($display_file));
if ($type == DifferentialChangeType::TYPE_MOVE_HERE) {