Reformat html files

This commit is contained in:
cuom1999 2023-01-27 17:11:10 -06:00
parent 9a208ca108
commit 52f1e77fe1
205 changed files with 11096 additions and 11086 deletions

View file

@ -1,15 +1,15 @@
{% extends "base.html" %}
{% block js_media %}
{% compress js %}
{% include "stats/media-js.html" %}
{% endcompress %}
{% compress js %}
{% include "stats/media-js.html" %}
{% endcompress %}
{% endblock %}
{% block content_title %}{% endblock %}
{% block title_ruler %}{% endblock %}
{% block body %}
{% include "stats/tab.html" %}
{% block chart_body %}{% endblock %}
{% include "stats/tab.html" %}
{% block chart_body %}{% endblock %}
{% endblock %}

View file

@ -1,45 +1,45 @@
{% extends "stats/base.html" %}
{% block media %}
<style>
.chart {
margin: 10px 0;
}
</style>
<style>
.chart {
margin: 10px 0;
}
</style>
{% endblock %}
{% block chart_body %}
<h3>{{ _('Submission Statistics') }}</h3>
<div id="status-counts" class="chart">
<canvas width="400" height="300"></canvas>
</div>
<h3>{{ _('Submission Statistics') }}</h3>
<div id="status-counts" class="chart">
<canvas width="400" height="300"></canvas>
</div>
<h3>{{ _('Submissions by Language') }}</h3>
<div id="lang-all" class="chart">
<canvas width="400" height="300"></canvas>
</div>
<h3>{{ _('Submissions by Language') }}</h3>
<div id="lang-all" class="chart">
<canvas width="400" height="300"></canvas>
</div>
<h3>{{ _('AC Submissions by Language') }}</h3>
<div id="lang-ac" class="chart">
<canvas width="400" height="300"></canvas>
</div>
<h3>{{ _('AC Submissions by Language') }}</h3>
<div id="lang-ac" class="chart">
<canvas width="400" height="300"></canvas>
</div>
<h3>{{ _('Language AC Rate') }}</h3>
<div id="ac-rate" class="chart">
<canvas><canvas>
<h3>{{ _('Language AC Rate') }}</h3>
<div id="ac-rate" class="chart">
<canvas><canvas>
</div>
{% endblock %}
{% block bodyend %}
<script type="text/javascript">
$(function () {
Chart.defaults.global.scaleFontFamily =
Chart.defaults.global.tooltipFontFamily =
Chart.defaults.global.tooltipTitleFontFamily =
$('body').css('font-family');
draw_pie_chart({{ data_all }}, $('#lang-all'));
draw_pie_chart({{ lang_ac }}, $('#lang-ac'));
draw_pie_chart({{ status_counts }}, $('#status-counts'));
draw_bar_chart({{ ac_rate }}, $('#ac-rate'));
});
</script>
<script type="text/javascript">
$(function () {
Chart.defaults.global.scaleFontFamily =
Chart.defaults.global.tooltipFontFamily =
Chart.defaults.global.tooltipTitleFontFamily =
$('body').css('font-family');
draw_pie_chart({{ data_all }}, $('#lang-all'));
draw_pie_chart({{ lang_ac }}, $('#lang-ac'));
draw_pie_chart({{ status_counts }}, $('#status-counts'));
draw_bar_chart({{ ac_rate }}, $('#ac-rate'));
});
</script>
{% endblock %}

View file

@ -1,110 +1,110 @@
<script type="text/javascript" src="{{ static('libs/chart.js/Chart.js') }}"></script>
<script type="text/javascript">
function draw_pie_chart(data, $chart) {
var ctx = $chart.find('canvas')[0].getContext('2d');
var chart = new Chart(ctx, {
type: 'pie',
data: data,
options: {
maintainAspectRatio: false,
responsive: false,
animation: false,
legend: {
position: 'right',
labels: {
fontColor: 'black',
boxWidth: 20,
},
},
},
});
}
function draw_pie_chart(data, $chart) {
var ctx = $chart.find('canvas')[0].getContext('2d');
var chart = new Chart(ctx, {
type: 'pie',
data: data,
options: {
maintainAspectRatio: false,
responsive: false,
animation: false,
legend: {
position: 'right',
labels: {
fontColor: 'black',
boxWidth: 20,
},
},
},
});
}
function draw_bar_chart(data, $chart) {
var ctx = $chart.find('canvas')[0].getContext('2d');
ctx.canvas.height = 20 * data.labels.length + 100;
var chart = new Chart(ctx, {
type: 'horizontalBar',
data: data,
options: {
maintainAspectRatio: false,
legend: {
display: false,
},
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
return (Math.round(tooltipItem.value * 100) / 100) + '%';
},
},
},
function draw_bar_chart(data, $chart) {
var ctx = $chart.find('canvas')[0].getContext('2d');
ctx.canvas.height = 20 * data.labels.length + 100;
var chart = new Chart(ctx, {
type: 'horizontalBar',
data: data,
options: {
maintainAspectRatio: false,
legend: {
display: false,
},
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
return (Math.round(tooltipItem.value * 100) / 100) + '%';
},
});
}
},
},
},
});
}
function draw_stacked_bar_chart(data, $chart) {
var ctx = $chart.find('canvas')[0].getContext('2d');
ctx.canvas.height = 20 * data.labels.length + 100;
var chart = new Chart(ctx, {
type: 'horizontalBar',
data: data,
options: {
maintainAspectRatio: false,
tooltips: {
mode: 'index',
intersect: false,
},
scales: {
xAxes: [{
stacked: true,
}],
yAxes: [{
stacked: true,
}],
},
function draw_stacked_bar_chart(data, $chart) {
var ctx = $chart.find('canvas')[0].getContext('2d');
ctx.canvas.height = 20 * data.labels.length + 100;
var chart = new Chart(ctx, {
type: 'horizontalBar',
data: data,
options: {
maintainAspectRatio: false,
tooltips: {
mode: 'index',
intersect: false,
},
scales: {
xAxes: [{
stacked: true,
}],
yAxes: [{
stacked: true,
}],
},
},
});
}
function draw_histogram(data, $chart) {
var ctx = $chart.find('canvas')[0].getContext('2d');
ctx.canvas.height = 20 * data.labels.length + 100;
var chart = new Chart(ctx, {
type: 'bar',
data: data,
options: {
maintainAspectRatio: false,
legend: {
display: false,
},
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
return tooltipItem.value;
},
});
}
function draw_histogram(data, $chart) {
var ctx = $chart.find('canvas')[0].getContext('2d');
ctx.canvas.height = 20 * data.labels.length + 100;
var chart = new Chart(ctx, {
type: 'bar',
data: data,
options: {
maintainAspectRatio: false,
legend: {
display: false,
},
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
return tooltipItem.value;
},
},
},
},
});
return chart;
}
},
},
},
});
return chart;
}
function draw_timeline(data, $chart) {
var ctx = $chart.find('canvas')[0].getContext('2d');
var chart = new Chart(ctx, {
type: 'line',
data: data,
options: {
maintainAspectRatio: false,
legend: {
display: false,
},
scales: {
xAxes: [{
type: 'time',
}]
},
},
});
return chart;
}
function draw_timeline(data, $chart) {
var ctx = $chart.find('canvas')[0].getContext('2d');
var chart = new Chart(ctx, {
type: 'line',
data: data,
options: {
maintainAspectRatio: false,
legend: {
display: false,
},
scales: {
xAxes: [{
type: 'time',
}]
},
},
});
return chart;
}
</script>

View file

@ -1,65 +1,65 @@
{% extends "stats/base.html" %}
{% block media %}
<style>
.graph {
padding-bottom: 3em;
}
</style>
{% endblock %}
{% block chart_body %}
<div class="graph">
<div id="submissions" class="chart">
<canvas width="90%" height="300"></canvas>
</div>
<center><h3>{{ _('Submissions') }}</h3></center>
</div>
<div class="graph">
<div id="contests" class="chart">
<canvas width="90%" height="300"></canvas>
</div>
<center><h3>{{ _('Contests') }}</h3></center>
</div>
<div class="graph">
<div id="new_users" class="chart">
<canvas width="90%" height="300"></canvas>
</div>
<center><h3>{{ _('New users') }}</h3></center>
</div>
<div class="graph">
<div id="groups" class="chart">
<canvas width="90%" height="300"></canvas>
</div>
<center><h3>{{ _('Groups') }}</h3></center>
</div>
<div class="graph">
<div id="comments" class="chart">
<canvas width="90%" height="300"></canvas>
</div>
<center><h3>{{ _('Comments') }}</h3></center>
</div>
<div class="graph">
<div id="chat_messages" class="chart">
<canvas width="90%" height="300"></canvas>
</div>
<center><h3>{{ _('Chat messages') }}</h3></center>
</div>
{% endblock %}
{% block bodyend %}
<script type="text/javascript">
$(function () {
Chart.defaults.global.scaleFontFamily =
Chart.defaults.global.tooltipFontFamily =
Chart.defaults.global.tooltipTitleFontFamily =
$('body').css('font-family');
draw_timeline({{submissions}}, $('#submissions'));
draw_timeline({{new_users}}, $('#new_users'));
draw_timeline({{comments}}, $('#comments'));
draw_timeline({{chat_messages}}, $('#chat_messages'));
draw_timeline({{contests}}, $('#contests'));
draw_timeline({{groups}}, $('#groups'));
});
</script>
{% endblock %}
{% extends "stats/base.html" %}
{% block media %}
<style>
.graph {
padding-bottom: 3em;
}
</style>
{% endblock %}
{% block chart_body %}
<div class="graph">
<div id="submissions" class="chart">
<canvas width="90%" height="300"></canvas>
</div>
<center><h3>{{ _('Submissions') }}</h3></center>
</div>
<div class="graph">
<div id="contests" class="chart">
<canvas width="90%" height="300"></canvas>
</div>
<center><h3>{{ _('Contests') }}</h3></center>
</div>
<div class="graph">
<div id="new_users" class="chart">
<canvas width="90%" height="300"></canvas>
</div>
<center><h3>{{ _('New users') }}</h3></center>
</div>
<div class="graph">
<div id="groups" class="chart">
<canvas width="90%" height="300"></canvas>
</div>
<center><h3>{{ _('Groups') }}</h3></center>
</div>
<div class="graph">
<div id="comments" class="chart">
<canvas width="90%" height="300"></canvas>
</div>
<center><h3>{{ _('Comments') }}</h3></center>
</div>
<div class="graph">
<div id="chat_messages" class="chart">
<canvas width="90%" height="300"></canvas>
</div>
<center><h3>{{ _('Chat messages') }}</h3></center>
</div>
{% endblock %}
{% block bodyend %}
<script type="text/javascript">
$(function () {
Chart.defaults.global.scaleFontFamily =
Chart.defaults.global.tooltipFontFamily =
Chart.defaults.global.tooltipTitleFontFamily =
$('body').css('font-family');
draw_timeline({{submissions}}, $('#submissions'));
draw_timeline({{new_users}}, $('#new_users'));
draw_timeline({{comments}}, $('#comments'));
draw_timeline({{chat_messages}}, $('#chat_messages'));
draw_timeline({{contests}}, $('#contests'));
draw_timeline({{groups}}, $('#groups'));
});
</script>
{% endblock %}

View file

@ -1,6 +1,6 @@
{% extends "tabs-base.html" %}
{% block tabs %}
{{ make_tab('language', 'fa-list', url('language_stats'), _('Language')) }}
{{ make_tab('site', 'fa-list', url('site_stats'), _('Site')) }}
{% extends "tabs-base.html" %}
{% block tabs %}
{{ make_tab('language', 'fa-list', url('language_stats'), _('Language')) }}
{{ make_tab('site', 'fa-list', url('site_stats'), _('Site')) }}
{% endblock %}