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