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