New UI for users and submissions

This commit is contained in:
cuom1999 2022-06-06 11:36:35 -05:00
parent d0ac92914d
commit 247e0e4740
12 changed files with 183 additions and 226 deletions

View file

@ -1,5 +1,5 @@
{% extends "common-content.html" %}
{% block js_media %}
{% extends "three-column-content.html" %}
{% block three_col_js %}
<script type="text/javascript">
{% if dynamic_update and last_msg %}
{% if request.in_contest_mode %}
@ -256,11 +256,9 @@
{% block title_ruler %}{% endblock %}
{% block title_row %}
{% include "submission/submission-list-tabs.html" %}
{% endblock %}
{% block title_row %}{% endblock %}
{% block media %}
{% block three_col_media %}
{% if perms.judge.change_submission and perms.judge.rejudge_submission %}
<style>
td.sub-prop, col.sub-prop {
@ -294,83 +292,96 @@
</style>
{% endblock %}
{% block body %}
{% block middle_content %}
{% if page_obj.num_pages > 1 %}
<div style="margin-bottom: 6px; margin-top: 11px">
{% include "list-pages.html" %}
</div>
{% endif %}
<div id="common-content">
<div id="content-right" class="submission">
<div class="info-float">
<div class="sidebox">
<h3>{{ _('Filter submissions') }} <i class="fa fa-search"></i></h3>
<div class="sidebox-content">
<form id="filter-form" name="form" action="" method="get">
<div class="filter-form-group">
<label for="status"><i>{{ _('Status') }}</i></label>
<select id="status" name="status" multiple>
{% for id, name in all_statuses %}
<option {% if id in selected_statuses %}selected{% endif %}
value="{{ id }}">{{ name }}</option>
{% endfor %}
</select>
</div>
<div class="filter-form-group">
<label for="language"><i>{{ _('Language') }}</i></label>
<select id="language" name="language" multiple>
{% for code, name in all_languages %}
<option {% if code in selected_languages %}selected{% endif %}
value="{{ code }}">{{ name }}</option>
{% endfor %}
</select>
</div>
<div class="form-submit-group">
<a id="go" onclick="form.submit()" class="button">{{ _('Go') }}</a>
</div>
</form>
</div>
</div>
<div class="submission">
<div class="ws-closed">
<a href="javascript:void(0)">{{ _('You were disconnected. Refresh to show latest updates.') }}</a>
</div>
<div class="sidebox">
<div id="statistics-table">
<h3>{{ _('Statistics') }} <i class="fa fa-pie-chart"></i></h3>
<div class="sidebox-content">
<div id="status-graph">
<canvas width="230" height="170"></canvas>
</div>
<div class="total">
{{ _('Total:') }} <span id="total-submission-count"></span>
</div>
<div id="submissions-table">
{% set profile_id = request.profile.id if request.user.is_authenticated else 0 %}
{% for submission in submissions %}
<div class="submission-row" id="{{ submission.id }}">
{% with problem_name=show_problem and submission.problem.i18n_name %}
{% include "submission/row.html" %}
{% endwith %}
</div>
{% endfor %}
{% if page_obj.num_pages > 1 %}
<div style="margin-top:10px;">{% include "list-pages.html" %}</div>
{% endif %}
</div>
</div>
{% endblock %}
{% block right_sidebar %}
<div class="right-sidebar">
<div class="submission">
<div class="sidebox">
<h3>{{ _('Filter submissions') }} <i class="fa fa-search"></i></h3>
<div class="sidebox-content">
<form id="filter-form" name="form" action="" method="get">
<div class="filter-form-group">
<label for="status"><i>{{ _('Status') }}</i></label>
<select id="status" name="status" multiple>
{% for id, name in all_statuses %}
<option {% if id in selected_statuses %}selected{% endif %}
value="{{ id }}">{{ name }}</option>
{% endfor %}
</select>
</div>
<div class="filter-form-group">
<label for="language"><i>{{ _('Language') }}</i></label>
<select id="language" name="language" multiple>
{% for code, name in all_languages %}
<option {% if code in selected_languages %}selected{% endif %}
value="{{ code }}">{{ name }}</option>
{% endfor %}
</select>
</div>
<div class="form-submit-group">
<a id="go" onclick="form.submit()" class="button">{{ _('Go') }}</a>
</div>
</form>
</div>
</div>
<div class="sidebox">
<div id="statistics-table">
<h3>{{ _('Statistics') }} <i class="fa fa-pie-chart"></i></h3>
<div class="sidebox-content">
<div id="status-graph">
<canvas width="230" height="170"></canvas>
</div>
<div class="total">
{{ _('Total:') }} <span id="total-submission-count"></span>
</div>
</div>
</div>
</div>
</div>
<div id="content-left" class="submission">
<div class="ws-closed">
<a href="javascript:void(0)">{{ _('You were disconnected. Refresh to show latest updates.') }}</a>
</div>
<div id="submissions-table">
{% set profile_id = request.profile.id if request.user.is_authenticated else 0 %}
{% for submission in submissions %}
<div class="submission-row" id="{{ submission.id }}">
{% with problem_name=show_problem and submission.problem.i18n_name %}
{% include "submission/row.html" %}
{% endwith %}
</div>
{% endfor %}
</div>
{% if page_obj.num_pages > 1 %}
<div style="margin-top:10px;">{% include "list-pages.html" %}</div>
{% endif %}
</div>
</div>
{% endblock %}
{% block bodyend %}
{# Don't load MathJax from common-content! #}
{% endblock %}
{% block left_sidebar %}
<div class="left-sidebar">
{{ make_tab_item('all_submissions_list', 'fa fa-list', all_submissions_link, _('All')) }}
{% if my_submissions_link or tab == 'my_submissions_tab' %}
{{ make_tab_item('my_submissions_tab', 'fa fa-user', my_submissions_link, _('Mine')) }}
{% endif %}
{% if best_submissions_link %}
{{ make_tab_item('best_submissions_list', 'fa fa-bar-chart', best_submissions_link, _('Best')) }}
{% endif %}
{% if page_type == 'user_submissions_tab' %}
{{ make_tab_item('user_submissions_tab', 'fa fa-user', None, _("%(user)s", user=tab_username)) }}
{% endif %}
{% if perms.judge.change_submission %}
{{ make_tab_item('admin', 'fa fa-edit', url('admin:judge_submission_changelist'), _('Admin')) }}
{% endif %}
</div>
{% endblock %}