22f5af8235924b621be0d09fcbd0ffca7f3d927b
[wolnelektury.git] / src / waiter / templates / waiter / wait.html
1 {% extends "base/base.html" %}
2 {% load i18n %}
3 {% load static from static %}
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>
37         {% blocktrans %}Your file is ready!
38           If the download doesn't start in a few seconds,
39           feel free to use this <a href="{{ file_url }}">direct link</a>.{% endblocktrans %}
40       </p>
41     </div>
42   {% else %}
43     {% if waiting %}
44       <h1>
45         <img src="{% static "img/indicator.gif" %}" alt="{% trans 'Please wait' %}"/>
46         {% trans "Your file is being prepared, please wait." %}
47       </h1>
48
49       <div class="normal-text">
50         <p>{% blocktrans with d=waiting.description %}The file you requested was: <em>{{d}}</em>.{% endblocktrans %}</p>
51
52         <p>
53           {% blocktrans %}<strong>Be aware:</strong> Generating the file can take a while.
54             Please be patient, or bookmark this page and come back later.{% endblocktrans %}
55         </p>
56       </div>
57     {% else %}
58       <h1>{% trans "Something went wrong." %}</h1>
59
60       <div class="normal-text">
61         {% url 'suggest' as s %}
62         <p>
63           {% blocktrans %}Something seems to have gone wrong while generating your file.
64             Please order it again or <a id='suggest' class='ajaxable' href="{{s}}">complain to us</a> about it.{% endblocktrans %}
65         </p>
66       </div>
67     {% endif %}
68   {% endif %}
69 {% endblock %}
70
71 {% block extrabody %}
72   {% if waiting %}
73   <script language="JavaScript">
74     <!--
75     (function($) {
76         $(function(){
77
78     function wait() {
79         $.ajax({
80             href: '',
81             success: function(data) {
82                 if (data) {
83                     location.reload();
84                 }
85                 else
86                     setTimeout(wait, 10*1000);
87             },
88             error: function(xhr) {
89                 location.reload();
90             }
91         });
92     }
93     setTimeout(wait, 10*1000);
94
95         });
96     })(jQuery);
97     //-->
98   </script>
99   {% endif %}
100 {% endblock %}