mirror of
https://github.com/correl/codereview.git
synced 2025-04-10 17:00:04 -09:00
Changed the diff / blob view to scroll rather than expand off the page
This commit is contained in:
parent
e77436498f
commit
36c061bbdd
5 changed files with 52 additions and 48 deletions
|
@ -55,9 +55,13 @@ div.vcs-nav {
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
.diff-container {
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
border: 1px solid black;
|
||||
}
|
||||
table.diff {
|
||||
width: 100%;
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.diff td {
|
||||
|
|
|
@ -15,14 +15,16 @@
|
|||
</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>
|
||||
<div class="diff-container">
|
||||
<table class="diff">
|
||||
{% for line in blob.data|lines %}
|
||||
<tr>
|
||||
<td class="number">{{ forloop.counter }}</td>
|
||||
<td class="text">{{ line }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<em>File is empty</em>
|
||||
{% endif %}
|
||||
|
|
|
@ -14,11 +14,9 @@
|
|||
{% csrf_token %}
|
||||
<input type="submit" value="Create New Review" />
|
||||
</form>
|
||||
<div class="diff-container">
|
||||
<div class="diff-html">
|
||||
{% for diff in diffs %}
|
||||
{% include "components/diff.html" %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="diffs">
|
||||
{% for diff in diffs %}
|
||||
{% include "components/diff.html" %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -35,11 +35,9 @@
|
|||
{% csrf_token %}
|
||||
<input type="submit" value="Create New Review" />
|
||||
</form>
|
||||
<div class="diff-container">
|
||||
<div class="diff-html">
|
||||
{% for diff in diffs %}
|
||||
{% include "components/diff.html" %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="diffs">
|
||||
{% for diff in diffs %}
|
||||
{% include "components/diff.html" %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
<table class="diff">
|
||||
<caption>
|
||||
{% if diff.a %}{{ diff.a.path }}{% else %}(New File){% endif %}
|
||||
{% if diff.a.path != diff.b.path %}
|
||||
=>
|
||||
{% if diff.b %}{{ diff.b.path }}{% else %}(Deleted){% endif %}
|
||||
{% endif %}
|
||||
</caption>
|
||||
{% for change in diff.changes %}
|
||||
{% if change.type == '@' %}
|
||||
<tr class="break">
|
||||
<td colspan="3">{{ change.text }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr id="{{ review.pk }}_{{ forloop.parentloop.counter0 }}_{% if change.type != '+' %}{{ change.line_a }}{% else %}0{% endif %}_{% if change.type != '-' %}{{ change.line_b }}{% else %}0{% endif %}"
|
||||
class="{% if change.type == '+' %}add{% endif %}{% if change.type == '-' %}del{% endif %}">
|
||||
<td class="number">{% if change.type != '+' %}{{ change.line_a }}{% endif %}</td>
|
||||
<td class="number">{% if change.type != '-' %}{{ change.line_b }}{% endif %}</td>
|
||||
<td class="text">{{ change.text }}</td>
|
||||
</tr>
|
||||
<div class="diff-container">
|
||||
<table class="diff">
|
||||
<caption>
|
||||
{% if diff.a %}{{ diff.a.path }}{% else %}(New File){% endif %}
|
||||
{% if diff.a.path != diff.b.path %}
|
||||
=>
|
||||
{% if diff.b %}{{ diff.b.path }}{% else %}(Deleted){% endif %}
|
||||
{% endif %}
|
||||
</caption>
|
||||
{% for change in diff.changes %}
|
||||
{% if change.type == '@' %}
|
||||
<tr class="break">
|
||||
<td colspan="3">{{ change.text }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr id="{{ review.pk }}_{{ forloop.parentloop.counter0 }}_{% if change.type != '+' %}{{ change.line_a }}{% else %}0{% endif %}_{% if change.type != '-' %}{{ change.line_b }}{% else %}0{% endif %}"
|
||||
class="{% if change.type == '+' %}add{% endif %}{% if change.type == '-' %}del{% endif %}">
|
||||
<td class="number">{% if change.type != '+' %}{{ change.line_a }}{% endif %}</td>
|
||||
<td class="number">{% if change.type != '-' %}{{ change.line_b }}{% endif %}</td>
|
||||
<td class="text">{{ change.text }}</td>
|
||||
</tr>
|
||||
|
||||
{% if review %}
|
||||
{% for comment in review.comment_set.all %}
|
||||
{% if review %}
|
||||
{% for comment in review.comment_set.all %}
|
||||
{% if not diff.b and comment.path == diff.a.path or comment.path == diff.b.path %}
|
||||
{% if change.type == '+' and change.line_b == comment.line_b or change.type == '-' and change.line_a == comment.line_a or change.line_a == comment.line_a and change.line_b == comment.line_b %}
|
||||
<tr class="annotation">
|
||||
|
@ -29,9 +30,10 @@
|
|||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue