forked from CGM_Public/pretix_original
Removed all inline <script> tags
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
/*globals $, Morris*/
|
||||
$(function () {
|
||||
new Morris.Area({
|
||||
element: 'obd_chart',
|
||||
data: JSON.parse($("#obd-data").html()),
|
||||
xkey: 'date',
|
||||
ykeys: ['ordered', 'paid'],
|
||||
labels: ['{% trans "Placed orders" %}', '{% trans "Paid orders" %}'],
|
||||
lineColors: ['#000099', '#009900'],
|
||||
smooth: false,
|
||||
resize: true,
|
||||
fillOpacity: 0.3,
|
||||
behaveLikeLine: true
|
||||
});
|
||||
new Morris.Area({
|
||||
element: 'rev_chart',
|
||||
data: JSON.parse($("#rev-data").html()),
|
||||
xkey: 'date',
|
||||
ykeys: ['revenue'],
|
||||
labels: ['{% trans "Total revenue" %}'],
|
||||
smooth: false,
|
||||
resize: true,
|
||||
fillOpacity: 0.3,
|
||||
preUnits: '{{ request.event.currency }} '
|
||||
});
|
||||
new Morris.Bar({
|
||||
element: 'obp_chart',
|
||||
data: JSON.parse($("#odp-data").html()),
|
||||
xkey: 'item',
|
||||
ykeys: ['ordered', 'paid'],
|
||||
labels: ['{% trans "Placed orders" %}', '{% trans "Paid orders" %}'],
|
||||
barColors: ['#000099', '#009900'],
|
||||
resize: true
|
||||
});
|
||||
});
|
||||
@@ -29,39 +29,9 @@
|
||||
<div id="obp_chart" style="height: 250px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
new Morris.Area({
|
||||
element: 'obd_chart',
|
||||
data: {{ obd_data|safe }},
|
||||
xkey: 'date',
|
||||
ykeys: ['ordered', 'paid'],
|
||||
labels: ['{% trans "Placed orders" %}', '{% trans "Paid orders" %}'],
|
||||
lineColors: ['#000099', '#009900'],
|
||||
smooth: false,
|
||||
resize: true,
|
||||
fillOpacity: 0.3,
|
||||
behaveLikeLine: true
|
||||
});
|
||||
new Morris.Area({
|
||||
element: 'rev_chart',
|
||||
data: {{ rev_data|safe }},
|
||||
xkey: 'date',
|
||||
ykeys: ['revenue'],
|
||||
labels: ['{% trans "Total revenue" %}'],
|
||||
smooth: false,
|
||||
resize: true,
|
||||
fillOpacity: 0.3,
|
||||
preUnits: '{{ request.event.currency }} '
|
||||
});
|
||||
new Morris.Bar({
|
||||
element: 'obp_chart',
|
||||
data: {{ obp_data|safe }},
|
||||
xkey: 'item',
|
||||
ykeys: ['ordered', 'paid'],
|
||||
labels: ['{% trans "Placed orders" %}', '{% trans "Paid orders" %}'],
|
||||
barColors: ['#000099', '#009900'],
|
||||
resize: true
|
||||
});
|
||||
</script>
|
||||
<script type="application/json" id="obd-data">{{ obd_data|safe }}</script>
|
||||
<script type="application/json" id="rev-data">{{ rev_data|safe }}</script>
|
||||
<script type="application/json" id="obp-data">{{ obp_data|safe }}</script>
|
||||
<script type="application/javascript" src="{% static "pretixplugins/statistics/statistics.js" %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user