Switch to unified view

a/Allura/allura/templates/repo/tarball.html b/Allura/allura/templates/repo/tarball.html
...
...
52
            top: 10, // Top position relative to parent in px
52
            top: 10, // Top position relative to parent in px
53
            left: 10 // Left position relative to parent in px
53
            left: 10 // Left position relative to parent in px
54
        };
54
        };
55
        var spinner = new Spinner(opts).spin($('#snapshot_status')[0]);
55
        var spinner = new Spinner(opts).spin($('#snapshot_status')[0]);
56
        var delay = 500;
56
        var delay = 500;
57
        // Check tarball status every 5 seconds
58
        function check_status() {
57
        function check_status() {
59
            $.get('{{commit.url()}}tarball_status?path={{path}}', function(data) {
58
            $.get('{{commit.url()}}tarball_status?path={{path}}', function(data) {
60
                if (data.status !== 'na') {
59
                if (data.status !== 'na') {
61
                    spinner.stop();
60
                    spinner.stop();
62
                    $('#snapshot_status h2').hide();
61
                    $('#snapshot_status h2').hide();
63
                    $('#snapshot_status h2.' + data.status).show();
62
                    $('#snapshot_status h2.' + data.status).show();
64
                    {% if 'no-redirect' not in request.params %}
63
                    {% if 'no-redirect' not in request.params %}
65
                        window.location.href = '{{c.app.repo.tarball_url(revision, path)}}';
64
                        window.location.href = '{{c.app.repo.tarball_url(revision, path)}}';
66
                    {% endif %}
65
                    {% endif %}
67
                } else {
66
                } else {
68
                    if (delay < 600000){
67
                    if (delay < 60000){
69
                        delay = delay * 2
68
                        delay = delay * 2;
69
                    }
70
                    if (delay >= 16000) {
71
                      // we've been waiting at least 15 seconds
72
                      $('#snapshot_status form').show();
70
                    }
73
                    }
71
                    window.setTimeout(check_status, delay);
74
                    window.setTimeout(check_status, delay);
72
                }
75
                }
73
            });
76
            });
74
        }
77
        }
...
...
82
{% set path = request.params.get('path', '') %}
85
{% set path = request.params.get('path', '') %}
83
<div id='snapshot_status'>
86
<div id='snapshot_status'>
84
    <h2 class="busy">Generating snapshot...</h2>
87
    <h2 class="busy">Generating snapshot...</h2>
85
    <h2 class="ready">Your download will begin shortly, or use this <a href="{{c.app.repo.tarball_url(revision, path)}}">direct link</a>.</h2>
88
    <h2 class="ready">Your download will begin shortly, or use this <a href="{{c.app.repo.tarball_url(revision, path)}}">direct link</a>.</h2>
86
    <h2 class="na">Checking snapshot status...</h2>
89
    <h2 class="na">Checking snapshot status...</h2>
90
    <form action="tarball" method="post">
91
      <p>We're having trouble finding that snapshot. Would you like to resubmit?</p>
92
      <input type="hidden" name="path" value="{{path}}" />
93
      <input type="submit" value="Resubmit Snapshot Request" />
94
    </form>
87
</div>
95
</div>
88
{% endblock %}
96
{% endblock %}
89
97
90
{% block extra_css %}
98
{% block extra_css %}
91
<style type="text/css">
99
<style type="text/css">
...
...
94
        display: none;
102
        display: none;
95
    }
103
    }
96
    #snapshot_status .{{ status }} {
104
    #snapshot_status .{{ status }} {
97
        display: block;
105
        display: block;
98
    }
106
    }
107
    #snapshot_status form {
108
      display: none;
109
      margin-left: 20px;
110
    }
111
    #snapshot_status form p {
112
      padding-left: 0;
113
    }
99
</style>
114
</style>
100
{% endblock %}
115
{% endblock %}