Skip to content

Instantly share code, notes, and snippets.

@Eugeny
Created December 5, 2010 21:17
Show Gist options
  • Save Eugeny/729474 to your computer and use it in GitHub Desktop.
Save Eugeny/729474 to your computer and use it in GitHub Desktop.
<div id="patch">
{% for file in diff.files %}
<div class="box wide-box" id="file-{{file.name|slugify}}">
<div class="top">
{{ file.name }}
<div class="links">
view file:
{% if c and not c.merge and not file.created %}
<a href="/{{repository.user.username}}/{{repository.name}}/{{c.parent}}/blob/{{file.name}}"" class="link lined">
before</a> |
{% endif %}
{% if not file.deleted %}
<a href="/{{repository.user.username}}/{{repository.name}}/{{c.treeish}}/blob/{{file.name}}"" class="link lined">
after
</a>
{% endif %}
</div>
</div>
<div class="bottom">
{% if file.binary %}
<div class="binary blob-image-file">
{% if file.image %}
{% if file.deleted %}
File deleted
{% else %}
<img src="/{{repository.user.username}}/{{repository.name}}/{{c.treeish}}/raw/{{file.name}}"/>
{% endif %}
{% else %}
Binary file content hidden
{% endif %}
</div>
{% else %}
<div class="code-wrapper">
<table class="code">
{% for line in file.lines %}
<tr>
<td class="linenumbers">
<a href="#F{{file.idx}}L{{line.idx}}" id="F{{file.idx}}L{{line.idx}}">
{{line.idxa}}
</a>
</td>
<td class="linenumbers">
<a href="#F{{file.idx}}R{{line.idx}}" id="F{{file.idx}}R{{line.idx}}">
{{line.idxb}}
</a>
</td>
<td width="100%" class="line {{line.cls}}">
{% if user.is_authenticated %}
<a href="#" onclick="return codeNoteForm('{{file.idx}}', '{{line.idx}}')" class="add-note"></a>
{% endif %}
<pre>{{line.text}}</pre>
</td>
</tr>
{% if line.notes %}
<tr><td colspan="3" class="code-inline">
{% for note in line.notes %}
{% with note as c %}
{% include "comment.html" %}
{% endwith %}
{% endfor %}
<a href="#" class="button" onclick="return codeNoteForm('{{file.idx}}', '{{line.idx}}')"><img src="/static/images/icons/note-add.png"/> Reply</a>
</td></tr>
{% endif %}
<tr>
<td colspan="3" id="comment-form-{{file.idx}}-{{line.idx}}"></td>
</tr>
{% endfor %}
<tr class="code-note-form-hider">
<td>
<form id="code-note-form" action="" method="POST">
{% csrf_token %}
<textarea name="text"></textarea>
<input id="note-file-data" type="hidden" name="file" value=""/>
<input id="note-line-data" type="hidden" name="line" value=""/>
<input type="submit" class="button button-special" name="comment" value="Post"/>
</form>
</td>
</tr>
</table>
</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment