mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 05:20:56 +01:00
Changeset anchor links.
This commit is contained in:
parent
12df78ed6a
commit
8b7755b834
3 changed files with 11 additions and 2 deletions
|
@ -139,5 +139,9 @@ class DifferentialChangeset extends DifferentialDAO {
|
||||||
}
|
}
|
||||||
return implode("\n", $file);
|
return implode("\n", $file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getAnchorName() {
|
||||||
|
return substr(md5($this->getFilename()), 0, 8);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,12 @@ class DifferentialChangesetDetailView extends AphrontView {
|
||||||
),
|
),
|
||||||
'class' => $class,
|
'class' => $class,
|
||||||
),
|
),
|
||||||
'<a name="#'."TODO".'"></a>'.
|
phutil_render_tag(
|
||||||
|
'a',
|
||||||
|
array(
|
||||||
|
'name' => $changeset->getAnchorName(),
|
||||||
|
),
|
||||||
|
'').
|
||||||
implode('', $this->buttons).
|
implode('', $this->buttons).
|
||||||
'<h1>'.phutil_escape_html($display_filename).'</h1>'.
|
'<h1>'.phutil_escape_html($display_filename).'</h1>'.
|
||||||
'<div style="clear: both;"></div>'.
|
'<div style="clear: both;"></div>'.
|
||||||
|
|
|
@ -65,7 +65,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
|
||||||
$link = phutil_render_tag(
|
$link = phutil_render_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
'href' => '#', // TODO: filename normalizer
|
'href' => '#'.$changeset->getAnchorName(),
|
||||||
),
|
),
|
||||||
phutil_escape_html($display_file));
|
phutil_escape_html($display_file));
|
||||||
if ($type == DifferentialChangeType::TYPE_MOVE_HERE) {
|
if ($type == DifferentialChangeType::TYPE_MOVE_HERE) {
|
||||||
|
|
Loading…
Reference in a new issue