--- a/Allura/allura/templates/repo/commit.html
+++ b/Allura/allura/templates/repo/commit.html
@@ -85,9 +85,7 @@
<h6>
{% if type in ('added', 'changed') %}
<a href="{{commit.url()}}tree/{{h.really_unicode(file)}}">{{h.really_unicode(file)}}</a>
- {% if prev %}
- <a class="commit-diff-link" href="{{commit.url()}}tree/{{h.really_unicode(file)}}?diff={{prev[0]._id}}">Diff</a>
- {% endif %}
+ <a class="commit-diff-link" href="{{commit.url()}}tree/{{h.really_unicode(file)}}?diff={{prev[0]._id if prev else ''}}">Diff</a>
{% elif type == 'removed' %}
<a href="{{prev[0].url()}}tree/{{h.really_unicode(file)}}">{{h.really_unicode(file)}}</a>
{% elif type == 'copied' %}
@@ -106,17 +104,15 @@
{{g.highlight(file.diff, lexer='diff')}}
{% endif %}
{% else %}
- {% if prev %}
<img src="{{g.forge_static('images/spinner.gif')}}" class="loading_icon" alt="Loading..."/>
<script type="text/javascript">
$(document).ready(function() {
diff_queue.push({
selector: '#diff-{{loop.index}}',
- url: '{{commit.url()}}tree/{{h.really_unicode(file)}}?barediff={{prev[0]._id}}'
+ url: '{{commit.url()}}tree/{{h.really_unicode(file)}}?barediff={{prev[0]._id if prev else ''}}'
});
});
</script>
- {% endif %}
{% endif %}
</div>
</div>