Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions webapp/templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
{% block extrahead %}
<link rel="stylesheet" href="{{ asset('style_domjudge.css') }}">

{{ extrahead|default('') }}
{{ extrahead | default('') }}
{% endblock %}
{% for file in customAssetFiles('css') %}
<link rel="stylesheet" href="{{ asset('css/custom/' ~ file) }}">
{% endfor %}
</head>
<body{% if static is defined and static %} class="static"{% endif%}>
<body{% if static is defined and static %} class="static"{% endif %}>
{% block menu %}{% endblock %}
{% block body %}
<div class="container-fluid">
Expand All @@ -36,7 +36,7 @@
{% block messages %}
{% include 'partials/messages.html.twig' %}
{% endblock %}
{% block content %}{{ body|raw }}{% endblock %}
{% block content %}{{ body | raw }}{% endblock %}
</div>
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions webapp/templates/form_theme.html.twig
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{% use 'bootstrap_5_layout.html.twig' %}

{% block choice_widget_collapsed -%}
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control form-select')|trim}) -%}
{%- set attr = attr | merge({class: (attr.class | default('') ~ ' form-control form-select') | trim}) -%}
{{- parent() -}}
{%- endblock choice_widget_collapsed %}

{% block button_widget -%}
{% set attr = attr|merge({class: (attr.class|default('') ~ ' btn')|trim}) %}
{% set attr = attr | merge({class: (attr.class | default('') ~ ' btn') | trim}) %}
{% if label is empty -%}
{%- if label_format is not empty -%}
{% set label = label_format|replace({
{% set label = label_format | replace({
'%name%': name,
'%id%': id,
}) %}
{%- else -%}
{% set label = name|humanize %}
{% set label = name | humanize %}
{%- endif -%}
{%- endif -%}
{% if icon|default %}
{% if icon | default %}
{% set iconHtml = '<i class="fa ' ~ icon ~ '"></i> ' %}
{% else %}
{% set iconHtml = '' %}
{% endif %}
<button type="{{ type|default('button') }}" {{ block('button_attributes') }}>{{ iconHtml|raw }}{{ label|trans({}, translation_domain) }}</button>
<button type="{{ type | default('button') }}" {{ block('button_attributes') }}>{{ iconHtml | raw }}{{ label | trans({}, translation_domain) }}</button>
{%- endblock button_widget %}

{% block form_widget_simple %}
Expand Down
42 changes: 21 additions & 21 deletions webapp/templates/jury/analysis/contest_overview.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

{% block extrahead %}
{{ parent() }}
<link rel="stylesheet" href="{{asset('css/nv.d3.min.css')}}">
<script src="{{asset('js/d3.min.js')}}"></script>
<script src="{{asset('js/nv.d3.min.js')}}"></script>
<script src="{{asset('js/FileSaver.min.js')}}"></script>
<link rel="stylesheet" href="{{ asset('css/nv.d3.min.css') }}">
<script src="{{ asset('js/d3.min.js') }}"></script>
<script src="{{ asset('js/nv.d3.min.js') }}"></script>
<script src="{{ asset('js/FileSaver.min.js') }}"></script>
<style>
.card-body.tablecard{
overflow-y: auto;
Expand Down Expand Up @@ -50,9 +50,9 @@ $(function() {
<br>
Calculated as:<br>
average across all teams of [3 people x (number of minutes elapsed - minute last problem solved by team t)]
">Misery index</abbr>: {{misc.misery_index|number_format(0)}} minutes<br>
">Misery index</abbr>: {{ misc.misery_index | number_format(0) }} minutes<br>
# Submissions: {{ misc.total_submissions }}<br>
# Accepted Submissions: {{ misc.total_accepted }} <span class="text-muted">(~{{ (misc.total_submissions>0 ? (misc.total_accepted/misc.total_submissions)*100:0)|number_format(0) }}%)</span><br>
# Accepted Submissions: {{ misc.total_accepted }} <span class="text-muted">(~{{ (misc.total_submissions>0 ? (misc.total_accepted/misc.total_submissions)*100:0) | number_format(0) }}%)</span><br>
# of Teams: {{ misc.num_teams }}<br>
</div>
</div>
Expand Down Expand Up @@ -116,13 +116,13 @@ $(function() {
{% set id=p.probid %}
<tr>
{% set link = path('analysis_problem', {'probid': id, 'view': view}) %}
<td scope="row"><a href="{{path('analysis_problem', {'probid': id, 'view': view}) }}">{{ id }}</a></td>
<td scope="row"><a href="{{ path('analysis_problem', {'probid': id, 'view': view}) }}">{{ id }}</a></td>
<td><a href="{{ link }}">{{ p | problemBadge }} {{ p.problem.name }}</a></td>
<td><a href="{{ link }}">{{ p.problem.timelimit }}</a></td>
<td><a href="{{ link }}">{{ p.problem.memlimit|default('default') }}</a></td>
<td><a href="{{ link }}">{{ p.problem.memlimit | default('default') }}</a></td>
<td><a href="{{ link }}">{{ misc.problem_num_testcases[id] }}</a></td>
<td><a href="{{ link }}">{{ misc.problem_attempts[id]|default(0) }} / {{ misc.problem_solutions[id]|default(0) }}</a></td>
<td><a href="{{ link }}">{{ misc.problem_stats.teams_attempted[id]|default([])|length }} / {{ misc.problem_stats.teams_solved[id]|default([])|length }}</a></td>
<td><a href="{{ link }}">{{ misc.problem_attempts[id] | default(0) }} / {{ misc.problem_solutions[id] | default(0) }}</a></td>
<td><a href="{{ link }}">{{ misc.problem_stats.teams_attempted[id] | default([]) | length }} / {{ misc.problem_stats.teams_solved[id] | default([]) | length }}</a></td>
</tr>
{% endfor %}
</tbody>
Expand Down Expand Up @@ -156,8 +156,8 @@ $(function() {
<td><a href="{{ link }}">{% if t.affiliation %}{{ t.affiliation.name }}{% else %}-{% endif %}</a></td>
<td class="truncate" style="max-width: 200px"><a href="{{ link }}">{{ t.effectiveName }}</a></td>
<td><a href="{{ link }}">{{ misc.team_stats[id].total_submitted }} / {{ misc.team_stats[id].total_accepted }}</a></td>
<td><a href="{{ link }}">{{ misc.team_stats[id].problems_submitted|length }} / {{ misc.team_stats[id].problems_accepted|length }}</a></td>
<td><a href="{{ link }}">{{ misc.team_stats[id].misery_index|number_format(0) }}</a></td>
<td><a href="{{ link }}">{{ misc.team_stats[id].problems_submitted | length }} / {{ misc.team_stats[id].problems_accepted | length }}</a></td>
<td><a href="{{ link }}">{{ misc.team_stats[id].misery_index | number_format(0) }}</a></td>
</tr>
{% endfor %}
</tbody>
Expand All @@ -173,7 +173,7 @@ $(function() {
Delayed Judgings (by more than {{ delayed_judgings.delay }}s)
</div>
<div class="card-body tablecard">
{% if delayed_judgings.data|length > 0 %}
{% if delayed_judgings.data | length > 0 %}
<table class="table table-sm table-striped table-hover table-full-clickable-cell">
<thead>
<tr>
Expand Down Expand Up @@ -235,7 +235,7 @@ var language_stats = [
values: [
{% for lang,count in misc.language_stats.total_submissions %}
{
"label" : "{{lang}}",
"label" : "{{ lang }}",
"value" : {{ count }},
},
{% endfor %}
Expand All @@ -247,7 +247,7 @@ var language_stats = [
values: [
{% for lang,count in misc.language_stats.total_solutions %}
{
"label" : "{{lang}}",
"label" : "{{ lang }}",
"value" : {{ count }},
},
{% endfor %}
Expand Down Expand Up @@ -288,8 +288,8 @@ var problem_stats = [
values: [
{% for prob in problems %}
{
"label" : "{{prob.shortname}}",
"value" : {{ misc.problem_stats.teams_attempted[prob.probid]|default([])|length }},
"label" : "{{ prob.shortname }}",
"value" : {{ misc.problem_stats.teams_attempted[prob.probid] | default([]) | length }},
},
{% endfor %}
]
Expand All @@ -300,8 +300,8 @@ var problem_stats = [
values: [
{% for prob in problems %}
{
"label" : "{{prob.shortname}}",
"value" : {{ misc.problem_stats.teams_solved[prob.probid]|default([])|length }},
"label" : "{{ prob.shortname }}",
"value" : {{ misc.problem_stats.teams_solved[prob.probid] | default([]) | length }},
},
{% endfor %}
]
Expand Down Expand Up @@ -344,8 +344,8 @@ nv.addGraph(function() {
const submission_stats = [
{% for result in ['correct', 'wrong-answer', 'timelimit', 'run-error', 'compiler-error', 'no-output'] %}
{
key: "{{result}}",
color: "{{colors[result]}}",
key: "{{ result }}",
color: "{{ colors[result] }}",
values: []
},
{% endfor %}
Expand Down
24 changes: 12 additions & 12 deletions webapp/templates/jury/analysis/problem.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

{% block extrahead %}
{{ parent() }}
<link rel="stylesheet" href="{{asset('css/nv.d3.min.css')}}">
<script src="{{asset('js/d3.min.js')}}"></script>
<script src="{{asset('js/nv.d3.min.js')}}"></script>
<script src="{{asset('js/FileSaver.min.js')}}"></script>
<link rel="stylesheet" href="{{ asset('css/nv.d3.min.css') }}">
<script src="{{ asset('js/d3.min.js') }}"></script>
<script src="{{ asset('js/nv.d3.min.js') }}"></script>
<script src="{{ asset('js/FileSaver.min.js') }}"></script>
<style>
.row.equal {
display: flex;
Expand All @@ -31,16 +31,16 @@
<div class="card-body">
<dl class="row">
<dt class="col-sm-6"># Submissions</dt>
<dd class="col-sm-6">{{ submissions|length }}</dd>
<dd class="col-sm-6">{{ submissions | length }}</dd>

<dt class="col-sm-6"># Correct</dt>
<dd class="col-sm-6">{{ results['correct']|default(0) }} <span class="text-muted">({{ misc.correct_percentage|number_format(2) }}%)</span></dd>
<dd class="col-sm-6">{{ results['correct'] | default(0) }} <span class="text-muted">({{ misc.correct_percentage | number_format(2) }}%)</span></dd>

<dt class="col-sm-6"># Teams Attempted</dt>
<dd class="col-sm-6">{{ misc.num_teams_attempted }}</dd>

<dt class="col-sm-6"># Teams Correct</dt>
<dd class="col-sm-6">{{misc.num_teams_correct}} <span class="text-muted">({{ misc.teams_correct_percentage|number_format(2) }}%)</dd>
<dd class="col-sm-6">{{ misc.num_teams_correct }} <span class="text-muted">({{ misc.teams_correct_percentage | number_format(2) }}%)</dd>
</dl>
</div>
</div>
Expand Down Expand Up @@ -163,9 +163,9 @@ $(function(){
line = d3.select('#maxruntime svg #maxline')
.attr({
x1: chart.margin().left,
y1: chart.yAxis.scale()({{timelimit}})+ chart.margin().top,
y1: chart.yAxis.scale()({{ timelimit }})+ chart.margin().top,
x2: +svgsize - chart.margin().right,
y2: chart.yAxis.scale()({{timelimit}}) + chart.margin().top,
y2: chart.yAxis.scale()({{ timelimit }}) + chart.margin().top,
})
}
updateline();
Expand All @@ -184,7 +184,7 @@ $(function(){
values: [
{% for result,count in results %}
{
"label" : "{{result}}",
"label" : "{{ result }}",
"value" : {{ count }},
"color" : "{{ colors[result] }}",
},
Expand Down Expand Up @@ -218,8 +218,8 @@ $(function(){
const submission_stats = [
{% for result in ['correct', 'wrong-answer', 'timelimit', 'run-error', 'compiler-error', 'no-output'] %}
{
key: "{{result}}",
color: "{{colors[result]}}",
key: "{{ result }}",
color: "{{ colors[result] }}",
values: []
},
{% endfor %}
Expand Down
44 changes: 22 additions & 22 deletions webapp/templates/jury/analysis/team.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

{% block extrahead %}
{{ parent() }}
<link rel="stylesheet" href="{{asset('css/nv.d3.min.css')}}">
<script src="{{asset('js/d3.min.js')}}"></script>
<script src="{{asset('js/nv.d3.min.js')}}"></script>
<script src="{{asset('js/FileSaver.min.js')}}"></script>
<link rel="stylesheet" href="{{ asset('css/nv.d3.min.css') }}">
<script src="{{ asset('js/d3.min.js') }}"></script>
<script src="{{ asset('js/nv.d3.min.js') }}"></script>
<script src="{{ asset('js/FileSaver.min.js') }}"></script>
<style>
.row.equal {
display: flex;
Expand Down Expand Up @@ -35,10 +35,10 @@
<div class="card-body">
<dl class="row">
<dt class="col-sm-6"># Submissions</dt>
<dd class="col-sm-6">{{ submissions|length }}</dd>
<dd class="col-sm-6">{{ submissions | length }}</dd>

<dt class="col-sm-6"># Correct</dt>
<dd class="col-sm-6">{{ results['correct']|default(0) }} <span class="text-muted">({{ misc.correct_percentage|number_format(2) }}%)</span></dd>
<dd class="col-sm-6">{{ results['correct'] | default(0) }} <span class="text-muted">({{ misc.correct_percentage | number_format(2) }}%)</span></dd>
</dl>
</div>
</div>
Expand Down Expand Up @@ -66,7 +66,7 @@
</div>
<div class="row equal">
{% for problem in problems %}
<div class="col-3 mt-3" id="maxruntime_{{problem.probid}}">
<div class="col-3 mt-3" id="maxruntime_{{ problem.probid }}">
<div class="card">
<div class="card-header">
Max Runtimes for problem {{ problem.name }}
Expand Down Expand Up @@ -97,7 +97,7 @@ set colors = {
$(function(){

{% for problem in problems %}
var run_max_times_{{problem.probid}} = [
var run_max_times_{{ problem.probid }} = [
{
key: "Max Runtimes",
values: [
Expand All @@ -120,7 +120,7 @@ $(function(){
.x(function(d) { return d.label })
.y(function(d) { return d.value })
.valueFormat(d3.format('.3f'))
.staggerLabels(run_max_times_{{problem.probid}}[0].values.length > 10)
.staggerLabels(run_max_times_{{ problem.probid }}[0].values.length > 10)
.showValues(false)
.forceY([0, {{ problem.timelimit*1.20 }}])
.margin({bottom: 90})
Expand All @@ -132,8 +132,8 @@ $(function(){
.tickFormat(d3.format('.3f'))
.axisLabel('Runtime(in s)');
chart.xAxis.axisLabel("Judgings");
d3.select('#maxruntime_{{problem.probid}} svg')
.datum(run_max_times_{{problem.probid}})
d3.select('#maxruntime_{{ problem.probid }} svg')
.datum(run_max_times_{{ problem.probid }})
.call(chart);
// Clicking on one of the bars takes you to the judgment
chart.discretebar.dispatch.on('elementClick', function(e) {
Expand All @@ -156,24 +156,24 @@ $(function(){
});

// Create our timelimit line
d3.select('#maxruntime_{{problem.probid}} svg')
d3.select('#maxruntime_{{ problem.probid }} svg')
.append('line')
.attr({id: 'maxline'})
.style("stroke", "#F00");

var svgsize = chart.container.clientWidth || chart.container.parentNode.clientWidth;
updateline_{{problem.probid}} = function(){
line = d3.select('#maxruntime_{{problem.probid}} svg #maxline')
updateline_{{ problem.probid }} = function(){
line = d3.select('#maxruntime_{{ problem.probid }} svg #maxline')
.attr({
x1: chart.margin().left,
y1: chart.yAxis.scale()({{problem.timelimit}})+ chart.margin().top,
y1: chart.yAxis.scale()({{ problem.timelimit }})+ chart.margin().top,
x2: +svgsize - chart.margin().right,
y2: chart.yAxis.scale()({{problem.timelimit}}) + chart.margin().top,
y2: chart.yAxis.scale()({{ problem.timelimit }}) + chart.margin().top,
})
}
updateline_{{problem.probid}}();
updateline_{{ problem.probid }}();
nv.utils.windowResize(function() {
updateline_{{problem.probid}}();
updateline_{{ problem.probid }}();
chart.update()
});
return chart;
Expand All @@ -189,7 +189,7 @@ $(function(){
values: [
{% for result,count in results %}
{
"label" : "{{result}}",
"label" : "{{ result }}",
"value" : {{ count }},
"color" : "{{ colors[result] }}",
},
Expand Down Expand Up @@ -227,8 +227,8 @@ $(function(){
var submission_stats = [
{% for result in ['correct', 'wrong-answer', 'timelimit', 'run-error', 'compiler-error', 'no-output'] %}
{
key: "{{result}}",
color: "{{colors[result]}}",
key: "{{ result }}",
color: "{{ colors[result] }}",
values: [
{# TODO: make sure these are actually ordered by submittime #}
{# TODO: also make sure these submissions are in the same contest #}
Expand Down Expand Up @@ -256,7 +256,7 @@ $(function(){
.showYAxis(true) //Show the y-axis
.showXAxis(true) //Show the x-axis
.forceX([0, {{ (current_contest.endtime - current_contest.starttime) / 60 }}])
.forceY([0, {{ submissions|length *1.10 }}])
.forceY([0, {{ submissions | length *1.10 }}])
;
chart.xAxis //Chart x-axis settings
.axisLabel('Contest Time(minutes)')
Expand Down
4 changes: 2 additions & 2 deletions webapp/templates/jury/auditlog.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{% if maxPages > 1 %}
<ul class="pagination pagination-sm">
<li class="page-item{{ showAll or thisPage == 1 ? ' disabled' }}">
<a class="page-link" href="{{ path('jury_auditlog', {page: thisPage-1 < 1 ? 1 : thisPage-1}) }}">«</a>
<a class="page-link" href="{{ path('jury_auditlog', {page: thisPage - 1 < 1 ? 1 : thisPage - 1}) }}">«</a>
</li>

{% for i in 1..maxPages %}
Expand All @@ -24,7 +24,7 @@
{% endfor %}

<li class="page-item{{ showAll or thisPage == maxPages ? ' disabled' }}">
<a class="page-link" href="{{ path('jury_auditlog', {page: thisPage+1 <= maxPages ? thisPage+1 : thisPage}) }}">»</a>
<a class="page-link" href="{{ path('jury_auditlog', {page: thisPage + 1 <= maxPages ? thisPage + 1 : thisPage}) }}">»</a>
</li>

<li class="page-item{{ showAll ? ' active' }}">
Expand Down
2 changes: 1 addition & 1 deletion webapp/templates/jury/balloons.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
$('select[data-filter-field]').each(function () {
var $filterField = $(this);
if ($filterField.data('filter-field') == "category-id") {
$filterField.val({{- defaultCategories|json_encode() -}}).trigger('change');
$filterField.val({{- defaultCategories | json_encode() -}}).trigger('change');
} else {
$filterField.val([]).trigger('change');
}
Expand Down
Loading
Loading