forked from CGM_Public/pretix_original
Statistics: Prevent issues with async script loading
This commit is contained in:
@@ -14,7 +14,8 @@
|
|||||||
<link rel="stylesheet" type="text/x-scss" href="{% static "pretixcontrol/scss/main.scss" %}" />
|
<link rel="stylesheet" type="text/x-scss" href="{% static "pretixcontrol/scss/main.scss" %}" />
|
||||||
{% endcompress %}
|
{% endcompress %}
|
||||||
{% if DEBUG %}
|
{% if DEBUG %}
|
||||||
<script type="text/javascript" src="{% url 'javascript-catalog' lang=request.LANGUAGE_CODE %}" async></script>
|
<script type="text/javascript" src="{% url 'javascript-catalog' lang=request.LANGUAGE_CODE %}"
|
||||||
|
defer></script>
|
||||||
{% else %}
|
{% else %}
|
||||||
<script src="{% statici18n LANGUAGE_CODE %}" async></script>
|
<script src="{% statici18n LANGUAGE_CODE %}" async></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
/*globals $, Morris, gettext*/
|
/*globals $, Morris, gettext, django*/
|
||||||
|
function gettext(msgid) {
|
||||||
|
if (typeof django !== 'undefined' && typeof django.gettext !== 'undefined') {
|
||||||
|
return django.gettext(msgid);
|
||||||
|
}
|
||||||
|
return msgid;
|
||||||
|
}
|
||||||
$(function () {
|
$(function () {
|
||||||
$(".chart").css("height", "250px");
|
$(".chart").css("height", "250px");
|
||||||
new Morris.Area({
|
new Morris.Area({
|
||||||
|
|||||||
@@ -63,7 +63,8 @@
|
|||||||
<script type="application/json" id="rev-data">{{ rev_data|escapejson }}</script>
|
<script type="application/json" id="rev-data">{{ rev_data|escapejson }}</script>
|
||||||
<script type="application/json" id="obp-data">{{ obp_data|escapejson }}</script>
|
<script type="application/json" id="obp-data">{{ obp_data|escapejson }}</script>
|
||||||
<script type="application/text" id="currency">{{ request.event.currency }}</script>
|
<script type="application/text" id="currency">{{ request.event.currency }}</script>
|
||||||
<script type="application/javascript" src="{% static "pretixplugins/statistics/statistics.js" %}"></script>
|
<script type="application/javascript" src="{% static "pretixplugins/statistics/statistics.js" %}"
|
||||||
|
defer></script>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="empty-collection">
|
<div class="empty-collection">
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
Reference in New Issue
Block a user