Parent: [bb43fd] (diff)

Child: [8b9054] (diff)

Download this file

tarball.html    64 lines (59 with data), 2.3 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
{% 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 extra_js %}
{{ super() }}
<script type="text/javascript">(function() {
var tarball_status = document.getElementById('tarball_status');
if (tarball_status) {
var opts = {
lines: 9, // The number of lines to draw
length: 4, // The length of each line
width: 2, // The line thickness
radius: 3, // The radius of the inner circle
rotate: 0, // The rotation offset
color: '#555', // #rgb or #rrggbb
speed: 1, // Rounds per second
trail: 60, // Afterglow percentage
shadow: false, // Whether to render a shadow
hwaccel: false, // Whether to use hardware acceleration
className: 'spinner', // The CSS class to assign to the spinner
zIndex: 2e9, // The z-index (defaults to 2000000000)
top: 10, // Top position relative to parent in px
left: 10 // Left position relative to parent in px
};
var spinner = new Spinner(opts).spin(tarball_status);
function check_status() {
$.get('{{commit.url()}}tarball_status', function(data) {
if (data.status === 'ready') {
window.clearInterval(status_checker);
spinner.opts.speed = 0;
spinner.opts.opacity = 1;
spinner.spin(tarball_status);
$('#tarball_status h2').html(' <a href="{{c.app.repo.tarball_url(revision)}}">Click here to download</a>');
window.location.href = '{{c.app.repo.tarball_url(revision)}}';
}
});
}
// Check tarball status every 5 seconds
var status_checker = window.setInterval(check_status, 5000);
}
}());
</script>
{% endblock %}
{% block content %}
<div id='tarball_status'>
<h2>Generating snapshot...</h2>
</div>
{% endblock %}
{% block extra_css %}
<style type="text/css">
#tarball_status h2 {
padding-left: 33px;
}
</style>
{% endblock %}