mirror of
https://github.com/correl/codereview.git
synced 2024-12-26 19:16:49 +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
|
@register.filter
|
||||||
@stringfilter
|
@stringfilter
|
||||||
def lines(value):
|
def lines(value):
|
||||||
return value.split('\n')
|
return value.split('\n')[:-1]
|
||||||
|
|
||||||
@register.filter
|
@register.filter
|
||||||
@stringfilter
|
@stringfilter
|
||||||
|
|
|
@ -70,6 +70,11 @@ table.diff .break {
|
||||||
}
|
}
|
||||||
table.diff .number {
|
table.diff .number {
|
||||||
width: 3em;
|
width: 3em;
|
||||||
|
text-align: right;
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
}
|
||||||
|
table.diff .text {
|
||||||
|
border-left: 1px solid #e0e0e0;
|
||||||
}
|
}
|
||||||
table.diff .add .number {
|
table.diff .add .number {
|
||||||
background-color: #baeeba;
|
background-color: #baeeba;
|
||||||
|
|
|
@ -6,14 +6,25 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h2>Blob View</h2>
|
<h2>File Contents</h2>
|
||||||
<table class="diff">
|
{% 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 %}
|
{% for line in blob.data|lines %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="number">{{ forloop.counter }}</td>
|
<td class="number">{{ forloop.counter }}</td>
|
||||||
<td class="text">{{ line }}</td>
|
<td class="text">{{ line }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
{% else %}
|
||||||
|
<em>File is empty</em>
|
||||||
|
{% endif %}
|
||||||
{% include "browser/commitlog.html" %}
|
{% include "browser/commitlog.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue