| {#- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| -#} |
| {% 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() { |
| {% 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, path)}}'; |
| }); |
| {% endif %} |
| {% else %} |
| 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($('#snapshot_status')[0]); |
| var delay = 5000; |
| // Check tarball status every 5 seconds |
| function check_status() { |
| $.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, path)}}'; |
| {% endif %} |
| } else { |
| if (delay < 600000){ |
| delay = delay * 2 |
| } |
| window.setTimeout(check_status, delay); |
| } |
| }); |
| } |
| window.setTimeout(check_status, delay); |
| {% endif %} |
| }); |
| </script> |
| {% 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, path)}}">direct link</a>.</h2> |
| </div> |
| {% endblock %} |
| |
| {% block extra_css %} |
| <style type="text/css"> |
| #snapshot_status h2 { |
| padding-left: 33px; |
| } |
| #snapshot_status .{{ 'busy' if status == 'ready' else 'ready' }} { |
| display: none; |
| } |
| </style> |
| {% endblock %} |