Skip to content
Browse files

Adding anchors to line numbers in commit details

  • Loading branch information...
1 parent 60d07d1 commit 688c04b163d2acf08dc9c23306c910d05f499dae @klaussilveira committed Jul 21, 2012
Showing with 20 additions and 2 deletions.
  1. +20 −2 views/commit.twig
View
22 views/commit.twig
@@ -39,8 +39,26 @@
<table>
{% for line in diff.getLines %}
<tr>
- <td class="lineNo">{{ line.getNumOld }}</td>
- <td class="lineNo">{{ line.getNumNew }}</td>
+ <td class="lineNo">
+ {% if line.getType != 'chunk' %}
+ <a name="L{{ loop.index }}R{{ line.getNumOld }}"></a>
+ <a href="#L{{ loop.index }}L{{ line.getNumOld }}">
+ {% endif %}
+ {{ line.getNumOld }}
+ {% if line.getType != 'chunk' %}
+ </a>
+ {% endif %}
+ </td>
+ <td class="lineNo">
+ {% if line.getType != 'chunk' %}
+ <a name="L{{ loop.index }}L{{ line.getNumNew }}"></a>
+ <a href="#L{{ loop.index }}L{{ line.getNumNew }}">
+ {% endif %}
+ {{ line.getNumNew }}
+ {% if line.getType != 'chunk' %}
+ </a>
+ {% endif %}
+ </td>
<td style="width: 100%">
<pre{% if line.getType %} class="{{ line.getType }}"{% endif %}>{{ line.getLine }}</pre>
</td>

0 comments on commit 688c04b

Please sign in to comment.
Something went wrong with that request. Please try again.