mirror of
https://github.com/correl/codereview.git
synced 2024-12-25 19:25:37 +00:00
Prettied up the blob view
This commit is contained in:
parent
6c34163c70
commit
9a3e32c612
3 changed files with 26 additions and 10 deletions
|
@ -13,7 +13,7 @@ def oneline(value):
|
|||
@register.filter
|
||||
@stringfilter
|
||||
def lines(value):
|
||||
return value.split('\n')
|
||||
return value.split('\n')[:-1]
|
||||
|
||||
@register.filter
|
||||
@stringfilter
|
||||
|
|
|
@ -70,6 +70,11 @@ table.diff .break {
|
|||
}
|
||||
table.diff .number {
|
||||
width: 3em;
|
||||
text-align: right;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
table.diff .text {
|
||||
border-left: 1px solid #e0e0e0;
|
||||
}
|
||||
table.diff .add .number {
|
||||
background-color: #baeeba;
|
||||
|
|
|
@ -6,14 +6,25 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Blob View</h2>
|
||||
<table class="diff">
|
||||
{% for line in blob.data|lines %}
|
||||
<tr>
|
||||
<td class="number">{{ forloop.counter }}</td>
|
||||
<td class="text">{{ line }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<h2>File Contents</h2>
|
||||
{% with log|first as commit %}
|
||||
<h3>
|
||||
{{ blob.path|basename }}
|
||||
@
|
||||
<a href="{% url codereview.browser.views.view repository=repository ref=commit.id %}">{{ commit.id }}</a>
|
||||
</h3>
|
||||
{% endwith %}
|
||||
{% if blob.data %}
|
||||
<table class="diff">
|
||||
{% for line in blob.data|lines %}
|
||||
<tr>
|
||||
<td class="number">{{ forloop.counter }}</td>
|
||||
<td class="text">{{ line }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<em>File is empty</em>
|
||||
{% endif %}
|
||||
{% include "browser/commitlog.html" %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue