You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/06/03 21:19:11 UTC
[12/38] git commit: [#6235] ticket:352 Fix waiting for snapshot page
[#6235] ticket:352 Fix waiting for snapshot page
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/c0fb628a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/c0fb628a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/c0fb628a
Branch: refs/heads/cj/6218
Commit: c0fb628a53d8388e123417a9568d76f9a6d05e68
Parents: 20be6df
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri May 17 16:05:08 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri May 31 22:14:08 2013 +0000
----------------------------------------------------------------------
Allura/allura/model/repository.py | 4 ++--
Allura/allura/templates/repo/tarball.html | 12 +++++++-----
2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c0fb628a/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 65ac0a2..1b6cfc4 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -272,8 +272,8 @@ class Repository(Artifact, ActivityObject):
filename = '%s-%s-%s' % (shortname, mount_point, revision)
return filename
- def tarball_url(self, revision):
- filename = '%s%s' % (self.tarball_filename(revision), '.zip')
+ def tarball_url(self, revision, path=None):
+ filename = '%s%s' % (self.tarball_filename(revision, path), '.zip')
r = os.path.join(self.tool,
self.project.shortname[:1],
self.project.shortname[:2],
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c0fb628a/Allura/allura/templates/repo/tarball.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/tarball.html b/Allura/allura/templates/repo/tarball.html
index 91f6f0b..e4a9cad 100644
--- a/Allura/allura/templates/repo/tarball.html
+++ b/Allura/allura/templates/repo/tarball.html
@@ -28,10 +28,11 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
{% block extra_js %}
{{ super() }}
<script type="text/javascript">$(function() {
+ {% set path = request.params.get('path', '') %}
{% if status == 'ready' %}
{% if 'no-redirect' not in request.params %}
$(document).ready(function() {
- window.location.href = '{{c.app.repo.tarball_url(revision)}}';
+ window.location.href = '{{c.app.repo.tarball_url(revision, path)}}';
});
{% endif %}
{% else %}
@@ -52,15 +53,15 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
left: 10 // Left position relative to parent in px
};
var spinner = new Spinner(opts).spin($('#snapshot_status')[0]);
- var delay = 5000
+ var delay = 5000;
// Check tarball status every 5 seconds
function check_status() {
- $.get('{{commit.url()}}tarball_status', function(data) {
+ $.get('{{commit.url()}}tarball_status?path={{path}}', function(data) {
if (data.status === 'ready') {
spinner.stop();
$('#snapshot_status h2').toggle();
{% if 'no-redirect' not in request.params %}
- window.location.href = '{{c.app.repo.tarball_url(revision)}}';
+ window.location.href = '{{c.app.repo.tarball_url(revision, path)}}';
{% endif %}
} else {
if (delay < 600000){
@@ -77,9 +78,10 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a> {{commit_labels(
{% endblock %}
{% block content %}
+{% set path = request.params.get('path', '') %}
<div id='snapshot_status'>
<h2 class="busy">Generating snapshot...</h2>
- <h2 class="ready">Your download will begin shortly, or use this <a href="{{c.app.repo.tarball_url(revision)}}">direct link</a>.</h2>
+ <h2 class="ready">Your download will begin shortly, or use this <a href="{{c.app.repo.tarball_url(revision, path)}}">direct link</a>.</h2>
</div>
{% endblock %}