Code layout change.
[wolnelektury.git] / src / waiter / templates / waiter / wait.html
1 {% extends "base.html" %}
2 {% load i18n %}
3 {% load static from staticfiles %}
4
5 {% block titleextra %}
6 {% if file_url %}
7     {% trans "The file is ready for download!" %}
8 {% else %}
9     {% if waiting %}
10         {% trans "Your file is being prepared, please wait." %}
11     {% else %}
12         {% trans "Something went wrong." %}
13     {% endif %}
14 {% endif %}
15 {% endblock %}
16
17
18 {% block extrahead %}
19 {% if file_url %}
20     <meta http-equiv="refresh" content="3; url={{ file_url }}" />
21 {% else %}
22     {% if waiting %}
23         <noscript>
24             <meta http-equiv="refresh" content="10" />
25         </noscript>
26     {% endif %}
27 {% endif %}
28 {% endblock %}
29
30
31 {% block body %}
32 {% if file_url %}
33     <h1>{% trans "The file is ready for download!" %}</h1>
34
35     <div class="normal-text white-box">
36     <p>{% blocktrans %}Your file is ready!
37         If the download doesn't start in a few seconds,
38         feel free to use this <a href="{{ file_url }}">direct link</a>.{% endblocktrans %}</p>
39     </div>
40 {% else %}
41  {% if waiting %}
42     <h1><img src="{% static "img/indicator.gif" %}" alt="{% trans 'Please wait' %}"/>
43         {% trans "Your file is being prepared, please wait." %}</h1>
44
45     <div class="normal-text">
46     <p>{% blocktrans with d=waiting.description %}The file you requested was: <em>{{d}}</em>.{% endblocktrans %}</p>
47
48     <p>{% blocktrans %}<strong>Be aware:</strong> Generating the file can take a while.
49         Please be patient, or bookmark this page and come back later.</p>{% endblocktrans %}
50     </div>
51  {% else %}
52     <h1>{% trans "Something went wrong." %}</h1>
53
54     <div class="normal-text">
55     {% url 'suggest' as s %}
56     <p>{% blocktrans %}Something seems to have gone wrong while generating your file.
57         Please order it again or <a id='suggest' class='ajaxable' href="{{s}}">complain to us</a> about it.{% endblocktrans %}</p>
58     </div>
59  {% endif %}
60 {% endif %}
61         
62 {% endblock %}
63
64 {% block extrabody %}
65 {% if waiting %}
66 <script language="JavaScript">
67 <!--
68 (function($) {
69     $(function(){
70
71 function wait() {
72     $.ajax({
73         href: '',
74         success: function(data) {
75             if (data) {
76                 location.reload();
77             }
78             else
79                 setTimeout(wait, 10*1000);
80         },
81         error: function(xhr) {
82             location.reload();
83         }
84     });
85 }
86 setTimeout(wait, 10*1000);
87
88     });
89 })(jQuery);
90 //-->
91 </script>
92 {% endif %}
93 {% endblock %}