Child: [ff3044] (diff)

Download this file

commit.html    93 lines (85 with data), 3.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{% extends 'allura:templates/repo/repo_master.html' %}
{% block title %}
{{c.project.name}} / {{c.app.config.options.mount_label}} / Commit {{commit.shorthand_id()}}
{% endblock %}
{% block header -%}
Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(commit)}}
{%- endblock %}
{% block actions %}
<a href="{{commit.url()}}log/">
<b data-icon="{{g.icons.history.char}}" class="ico {{g.icons.history.css}}" title="History"> </b> History
</a>
{% endblock %}
{% block extra_js %}
<script type="text/javascript">
var MAX_REQUESTS = 5; // max simultaneous load requests
var WAIT_FOR = 500; // wait for 100ms when requests queue is full and try again
var diff_queue = []; // queue of diffs waiting for load
var called_count = 0; // count of running load requests
function load_diff() {
if (called_count >= MAX_REQUESTS || diff_queue.length == 0) {
return;
}
called_count++;
var diff = diff_queue.shift();
$(diff.selector).load(diff.url, function(response, status, xhr) {
if (status == 'error') {
$(this).text('Can\'t load diff');
}
called_count--;
});
}
$(document).ready(function() {
setInterval(load_diff, WAIT_FOR);
});
</script>
{% endblock %}
{% block content %}
{{ clone_info(c.app.repo) }}
{{c.revision_widget.display(value=commit, prev=prev, next=next)}}
<table>
<tbody>
{% for type, file in artifacts %}
<tr>
<td>{{ type }}</td>
<td><a href="#diff-{{loop.index}}">{{h.really_unicode(file)}}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% for type, file in artifacts %}
<div class="inline-diff">
<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 %}
{% elif type == 'removed' %}
<a href="{{prev[0].url()}}tree/{{h.really_unicode(file)}}">{{h.really_unicode(file)}}</a>
{% elif type == 'copied' %}
<a href="{{prev[0].url()}}tree/{{h.really_unicode(file.old)}}">{{h.really_unicode(file.old)}}</a>
to
<a href="{{commit.url()}}tree/{{h.really_unicode(file.new)}}">{{h.really_unicode(file.new)}}</a>
{% endif %}
</h6>
<div id="diff-{{loop.index}}" class="inline-diff-body">
{% if type != 'removed' %}
{% 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}}'
});
});
</script>
{% endif %}
{% else %}
<span class="empty-diff">File was removed.</span>
{% endif %}
</div>
</div>
{% endfor %}
{% endblock %}