Design right sidebar of problem and organization home page (#117)

* Design right sidebar of problem and organization home page

* Change button small and message button
This commit is contained in:
Phuoc Anh Kha Le 2024-06-10 15:13:53 -05:00 committed by GitHub
parent d7cc620a0a
commit 45c1f400a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 510 additions and 445 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -792,10 +792,34 @@ ul.errorlist {
align-self: center !important; align-self: center !important;
} }
.a-problem { .link-row {
font-size: 15px; display: flex;
line-height: 1.8; align-items: center;
padding: 6px;
font-weight: normal; font-weight: normal;
cursor: pointer;
transition: background-color 0.3s;
a {
color: inherit;
display: flex;
align-items: center;
width: 100%;
text-decoration: none;
i {
width: 1.5em;
}
}
span {
flex-grow: 1;
}
&:hover {
color: $theme_color;
background-color: #f8f8f2;
}
} }
a { a {

View file

@ -53,7 +53,7 @@
{% if actionbar_report_url %} {% if actionbar_report_url %}
<span class="actionbar-block"> <span class="actionbar-block">
<a class="actionbar-button black" href="{{actionbar_report_url}}"> <a class="actionbar-button black" href="{{actionbar_report_url}}">
<i class="fa fa-flag-o" style="font-size: large;"></i> <i class="fa fa-flag" style="font-size: large;"></i>
<span class="actionbar-text">{{_("Report")}}</span> <span class="actionbar-text">{{_("Report")}}</span>
</a> </a>
</span> </span>

View file

@ -24,7 +24,8 @@
</form> </form>
{% else %} {% else %}
<a href="{{ url('request_organization', organization.id, organization.slug) }}" <a href="{{ url('request_organization', organization.id, organization.slug) }}"
class="unselectable button">{{ _('Request membership') }}</a> class="unselectable button">
{{ _('Request membership') }}</a>
{% endif %} {% endif %}
{% endif %} {% endif %}
</div> </div>

View file

@ -4,71 +4,64 @@
<h3><i class="fa fa-cog"></i>{{ _('Controls') }}</h3> <h3><i class="fa fa-cog"></i>{{ _('Controls') }}</h3>
<ul id="control-list" class="sidebox-content" style="margin: 0;"> <ul id="control-list" class="sidebox-content" style="margin: 0;">
{% if can_edit %} {% if can_edit %}
<li> <div class="link-row">
<div> <a href="{{ url('edit_organization', organization.id, organization.slug) }}">
<a href="{{ url('edit_organization', organization.id, organization.slug) }}">{{ _('Edit group') }}</a> <i class="fa fa-edit"></i>{{ _('Edit group') }}</a>
</div> </div>
</li>
{% endif %} {% endif %}
{% if can_edit and not organization.is_open %} {% if can_edit and not organization.is_open %}
<li> <div class="link-row">
<div> <a href="{{ url('organization_requests_pending', organization.id, organization.slug) }}">
<a href="{{ url('organization_requests_pending', organization.id, organization.slug) }}">{{ _('View requests') }}</a> <i class="fa fa-inbox"></i>{{ _('View requests') }}</a>
{% if pending_count > 0 %} {% if pending_count > 0 %}
<span id="pending-count-box"> <span id="pending-count-box">
{{pending_count}} {{pending_count}}
</span> </span>
{% endif %} {% endif %}
</div> </div>
</li>
{% endif %} {% endif %}
{% if can_edit %} {% if can_edit %}
<li> <div class="link-row">
<div> <a href="{{ url('add_organization_member', organization.id, organization.slug) }}">
<a href="{{ url('add_organization_member', organization.id, organization.slug) }}">{{ _('Add members') }}</a> <i class="fa fa-user-plus"></i>{{ _('Add members') }}</a>
</div> </div>
</li>
{% endif %} {% endif %}
{% if is_member %} {% if is_member %}
<li> <div class="link-row">
<div> <a href="{{ url('add_organization_blog', organization.id, organization.slug) }}">
<a href="{{ url('add_organization_blog', organization.id, organization.slug) }}">{{ _('Add blog') }}</a> <i class="fa fa-pencil"></i>{{ _('Add blog') }}</a>
</div> </div>
</li>
{% endif %} {% endif %}
<li> <div class="link-row">
<div> <a href="{{ url('organization_pending_blogs', organization.id, organization.slug) }}">
<a href="{{ url('organization_pending_blogs', organization.id, organization.slug) }}">{{ _('Pending blogs') }}</a> <i class="fa fa-clipboard-list"></i>{{ _('Pending blogs') }}</a>
{% if pending_blog_count > 0 %} {% if pending_blog_count > 0 %}
<span id="pending-count-box"> <span id="pending-count-box">
{{pending_blog_count}} {{pending_blog_count}}
</span> </span>
{% endif %} {% endif %}
</div> </div>
</li>
{% if can_edit %} {% if can_edit %}
<li> <div class="link-row">
<div> <a href="{{ url('organization_contest_add', organization.id, organization.slug) }}">
<a href="{{ url('organization_contest_add', organization.id, organization.slug) }}">{{ _('Add contest') }}</a> <i class="fa fa-calendar-plus"></i>{{ _('Add contest') }}</a>
</div> </div>
</li>
{% endif %} {% endif %}
{% if is_member %} {% if is_member %}
<li> <div class="link-row">
<div>
<a href="{{ organization_subdomain }}" target="_blank"> <a href="{{ organization_subdomain }}" target="_blank">
{{_('Subdomain')}} <i class="fa fa-globe"></i>{{_('Subdomain')}}
</a> </a>
</div> </div>
</li>
{% endif %} {% endif %}
{% if is_member and not is_admin %} {% if is_member and not is_admin %}
<li> <div class="link-row" style="color: red;">
<form method="post" action="{{ url('leave_organization', organization.id, organization.slug) }}"> <form method="post" action="{{ url('leave_organization', organization.id, organization.slug) }}">
{% csrf_token %} {% csrf_token %}
<a href="#" class="leave-organization">{{ _('Leave group') }}</a> <a href="#" class="leave-organization">
<i class="fa fa-sign-out-alt"></i>{{ _('Leave group') }}</a>
</form> </form>
</li> </div>
{% endif %} {% endif %}
</ul> </ul>
</div> </div>

View file

@ -131,7 +131,7 @@
<a id="pdf_button" class="view-pdf" href='#'> <a id="pdf_button" class="view-pdf" href='#'>
{% endif %} {% endif %}
<span class="pdf-icon"> <span class="pdf-icon">
<span class="fa fa-file-pdf-o pdf-icon-logo"></span> <span class="fa fa-file-pdf pdf-icon-logo"></span>
<span class="pdf-icon-bar"></span> <span class="pdf-icon-bar"></span>
</span> </span>
{{ _('View as PDF') }} {{ _('View as PDF') }}
@ -147,7 +147,7 @@
<button class="btn-green btn btn-primary btn-block btn-round"> <button class="btn-green btn btn-primary btn-block btn-round">
<span>{{ _('Submit') }}</span> <span>{{ _('Submit') }}</span>
<div class="icon icon-round d-flex align-items-center justify-content-center"> <div class="icon icon-round d-flex align-items-center justify-content-center">
<i class="fa fa-send"></i> <i class="fa fa-paper-plane"></i>
</div> </div>
</button> </button>
</a> </a>
@ -162,7 +162,7 @@
<button class="btn btn-disabled btn-block btn-round"> <button class="btn btn-disabled btn-block btn-round">
<span>{{ _('Submit') }}</span> <span>{{ _('Submit') }}</span>
<div class="icon icon-round d-flex align-items-center justify-content-center"> <div class="icon icon-round d-flex align-items-center justify-content-center">
<i class="fa fa-send"></i> <i class="fa fa-paper-plane"></i>
</div> </div>
</button> </button>
<div class="no-submissions-left submissions-left">{{ _('0 submissions left') }}</div> <div class="no-submissions-left submissions-left">{{ _('0 submissions left') }}</div>
@ -172,7 +172,7 @@
<button class="btn-green btn btn-primary btn-block btn-round"> <button class="btn-green btn btn-primary btn-block btn-round">
<span>{{ _('Submit') }}</span> <span>{{ _('Submit') }}</span>
<div class="icon icon-round d-flex align-items-center justify-content-center"> <div class="icon icon-round d-flex align-items-center justify-content-center">
<i class="fa fa-send"></i> <i class="fa fa-paper-plane"></i>
</div> </div>
</button> </button>
</a> </a>
@ -181,46 +181,76 @@
<hr style="padding-bottom: 0.3em"> <hr style="padding-bottom: 0.3em">
{% if request.user.is_authenticated and has_submissions %} {% if request.user.is_authenticated and has_submissions %}
<div> <div class="link-row">
<a class="a-problem" href="{{ url('user_submissions', problem.code, request.user.username) }}">{{ _('My submissions') }}</a> <a href="{{url('user_submissions', problem.code, request.user.username) }}">
</div> <i class="fa fa-address-book"></i><span> {{ _('My submissions') }}</span>
{% endif %} </a>
<div><a class="a-problem" href="{{ url('chronological_submissions', problem.code) }}">{{ _('All submissions') }}</a></div> </div>
<div><a class="a-problem" href="{{ url('ranked_submissions', problem.code) }}">{{ _('Best submissions') }}</a></div> {% endif %}
{% if editorial and editorial.is_public and <div class="link-row">
not (request.user.is_authenticated and request.in_contest_mode) %} <a href="{{ url('chronological_submissions', problem.code) }}">
<hr> <i class="fa fa-rectangle-list"></i><span> {{ _('All submissions') }}</span>
<div><a class="a-problem" href="{{ url('problem_editorial', problem.code) }}">{{ _('Read editorial') }}</a></div> </a>
{% endif %} </div>
{% if can_edit_problem %} <div class="link-row">
<hr> <a href="{{ url('ranked_submissions', problem.code) }}">
<div> <i class="fa fa-list-check"></i><span> {{ _('Best submissions') }}</span>
<a class="a-problem" href="{{ url('problem_ticket_list', problem.code) }}">{{ _('Manage tickets') }} </a>
{% if num_open_tickets %}<span class="badge">{{ num_open_tickets }}</span>{% endif %} </div>
{% if editorial and editorial.is_public and not (request.user.is_authenticated and request.in_contest_mode) %}
<hr>
<div class="link-row">
<a href="{{ url('problem_editorial', problem.code) }}">
<i class="fa fa-newspaper"></i><span> {{ _('Read editorial') }}</span>
</a>
</div>
{% endif %}
{% if can_edit_problem %}
<hr>
<div class="link-row">
<a href="{{ url('problem_ticket_list', problem.code) }}">
<i class="fa fa-clipboard-list"></i><span> {{ _('Manage tickets') }}
{% if num_open_tickets %}<span class="badge">{{ num_open_tickets }}</span>{% endif %}
</span>
</a>
</div>
<div class="link-row">
<a href="{{ url('admin:judge_problem_change', problem.id) }}">
<i class="fa fa-edit"></i><span> {{ _('Edit problem') }}</span>
</a> </a>
</div> </div>
<div><a class="a-problem" href="{{ url('admin:judge_problem_change', problem.id) }}">{{ _('Edit problem') }}</a></div>
{% if not problem.is_manually_managed %} {% if not problem.is_manually_managed %}
<div><a class="a-problem" href="{{ url('problem_data', problem.code) }}">{{ _('Edit test data') }}</a></div> <div class="link-row">
<a href="{{ url('problem_data', problem.code) }}">
<i class="fa fa-database"></i><span> {{ _('Edit test data') }}</span>
</a>
</div>
{% endif %} {% endif %}
{% elif request.user.is_authenticated and has_tickets %} {% elif request.user.is_authenticated and has_tickets %}
<hr> <hr>
<div> <div class="link-row">
<a class="a-problem" href="{{ url('problem_ticket_list', problem.code) }}">{{ _('My tickets') }} <a href="{{ url('problem_ticket_list', problem.code) }}">
<i class="fa fa-inbox"></i><span> {{ _('My tickets') }}
{% if num_open_tickets %}<span class="badge">{{ num_open_tickets }}</span>{% endif %} {% if num_open_tickets %}<span class="badge">{{ num_open_tickets }}</span>{% endif %}
</span>
</a> </a>
</div> </div>
{% endif %} {% endif %}
{% if problem.is_subs_manageable_by(request.user) %} {% if problem.is_subs_manageable_by(request.user) %}
<div> <div class="link-row">
<a class="a-problem" href="{{ url('problem_manage_submissions', problem.code) }}">{{ _('Manage submissions') }}</a> <a href="{{ url('problem_manage_submissions', problem.code) }}">
<i class="fas fa-table"></i><span> {{ _('Manage submissions') }}</span>
</a>
</div> </div>
{% endif %} {% endif %}
{% if perms.judge.clone_problem %} {% if perms.judge.clone_problem %}
<div> <div class="link-row">
<a class="a-problem" href="{{ url('problem_clone', problem.code) }}">{{ _('Clone problem') }}</a> <a href="{{ url('problem_clone', problem.code) }}">
<i class="fas fa-clone"></i><span> {{ _('Clone problem') }}</span>
</a>
</div> </div>
{% endif %} {% endif %}
@ -229,7 +259,7 @@
{% endif %} {% endif %}
{% if problem.language_time_limit %} {% if problem.language_time_limit %}
<div class="problem-info-entry"> <div class="problem-info-entry">
<i class="fa fa-clock-o fa-fw"></i><span class="pi-name">{{ _('Time limit:') }}</span> <i class="fa fa-clock"></i><span class="pi-name"> {{ _('Time limit:') }}</span>
</div> </div>
<div class="problem-lang-limits"> <div class="problem-lang-limits">
{% for name, limit in problem.language_time_limit %} {% for name, limit in problem.language_time_limit %}
@ -242,7 +272,7 @@
{% endif %} {% endif %}
{% if problem.language_memory_limit %} {% if problem.language_memory_limit %}
<div class="problem-info-entry"> <div class="problem-info-entry">
<i class="fa fa-server fa-fw"></i><span class="pi-name">{{ _('Memory limit:') }}</span> <i class="fa fa-server"></i><span class="pi-name"> {{ _('Memory limit:') }}</span>
</div> </div>
<div class="problem-lang-limits"> <div class="problem-lang-limits">
{% for name, limit in problem.language_memory_limit %} {% for name, limit in problem.language_memory_limit %}
@ -274,7 +304,7 @@
<div id="problem-types"> <div id="problem-types">
{% with types=problem.types_list %} {% with types=problem.types_list %}
<div class="toggle closed unselectable"> <div class="toggle closed unselectable">
<i class="fa fa-chevron-right fa-fw"></i>{% trans trimmed count=problem.types_list|length %} <i class="fa fa-chevron-right"></i> {% trans trimmed count=problem.types_list|length %}
Problem type Problem type
{% pluralize count %} {% pluralize count %}
Problem types Problem types
@ -287,7 +317,7 @@
{% if show_languages %} {% if show_languages %}
<div id="allowed-langs"> <div id="allowed-langs">
<div class="toggle open unselectable"> <div class="toggle open unselectable">
<i class="fa fa-chevron-right fa-fw"></i>{{ _('Allowed languages') }} <i class="fa fa-chevron-right"></i> {{ _('Allowed languages') }}
</div> </div>
<div class="toggled"> <div class="toggled">
{% with usable=problem.usable_common_names, langs=problem.languages_list() %} {% with usable=problem.usable_common_names, langs=problem.languages_list() %}
@ -306,7 +336,7 @@
{% if problem.is_editable_by(request.user) %} {% if problem.is_editable_by(request.user) %}
<div id="available-judges"> <div id="available-judges">
<div class="toggle closed" id="judge-toggle"> <div class="toggle closed" id="judge-toggle">
<i class="fa fa-chevron-right fa-fw"></i><span <i class="fa fa-chevron-right"></i><span
class="pi-name"> {% trans trimmed count=available_judges|length %} class="pi-name"> {% trans trimmed count=available_judges|length %}
Judge Judge
{% pluralize count %} {% pluralize count %}
@ -345,7 +375,7 @@
{% endif %} {% endif %}
<div class = "new-problem-info d-flex-problem"> <div class = "new-problem-info d-flex-problem">
<span class="info-block"> <span class="info-block">
<i class="fa fa-check fa-fw"></i><span class="pi-name">{{ _('Points:') }}</span> <i class="fa fa-check"></i><span class="pi-name"> {{ _('Points:') }}</span>
<span class="new-pi-value"> <span class="new-pi-value">
{% if contest_problem %} {% if contest_problem %}
{{ contest_problem.points }} {% if contest_problem.partial %}(p){% endif %} {{ contest_problem.points }} {% if contest_problem.partial %}(p){% endif %}
@ -356,24 +386,24 @@
</span> </span>
<span class="info-block"> <span class="info-block">
<i class="fa fa-clock-o fa-fw"></i><span class="pi-name">{{ _('Time limit:') }}</span> <i class="fa fa-clock"></i><span class="pi-name"> {{ _('Time limit:') }}</span>
<span class="new-pi-value">{{ problem.time_limit }}s</span> <span class="new-pi-value">{{ problem.time_limit }}s</span>
</span> </span>
<span class="info-block"> <span class="info-block">
<i class="fa fa-server fa-fw"></i><span class="pi-name">{{ _('Memory limit:') }}</span> <i class="fa fa-server"></i><span class="pi-name"> {{ _('Memory limit:') }}</span>
<span class="new-pi-value">{{ problem.memory_limit|kbsimpleformat }}</span> <span class="new-pi-value">{{ problem.memory_limit|kbsimpleformat }}</span>
</span> </span>
<span class="info-block"> <span class="info-block">
<i class="fa fa-file-o fa-fw"></i><span class="pi-name">{{ _('Input:') }}</span> <i class="fa fa-file"></i><span class="pi-name"> {{ _('Input:') }}</span>
<span class="new-pi-value"> <span class="new-pi-value">
{{ fileio_input or _('stdin') }} {{ fileio_input or _('stdin') }}
</span> </span>
</span> </span>
<span> <span>
<i class="fa fa-file fa-fw"></i><span class="pi-name">{{ _('Output:') }}</span> <i class="fa fa-file"></i><span class="pi-name"> {{ _('Output:') }}</span>
<span class="new-pi-value">{{ fileio_output or _('stdout') }}</span> <span class="new-pi-value">{{ fileio_output or _('stdout') }}</span>
</span> </span>
</div> </div>

View file

@ -135,19 +135,23 @@
{% block body %} {% block body %}
<div style="clear: both"></div> <div style="clear: both"></div>
<br> <br>
<div style="width: fit-content;">
{% if request.profile == submission.user or perms.judge.resubmit_other %} {% if request.profile == submission.user or perms.judge.resubmit_other %}
<div><a href="{{ url('problem_submit', submission.problem.code, submission.id) }}">{{ _('Resubmit') }}</a></div> <div class="link-row"><a href="{{ url('problem_submit', submission.problem.code, submission.id) }}">
<i class="fa fa-upload"></i>{{ _('Resubmit') }}</a></div>
{% endif %} {% endif %}
{% if perms.judge.rejudge_submission %} {% if perms.judge.rejudge_submission %}
<div> <div class="link-row">
<form action="{{ url('submission_rejudge') }}" method="post"> <form action="{{ url('submission_rejudge') }}" method="post">
{% csrf_token %} {% csrf_token %}
<a href="#" onclick="parentNode.submit()">{{ _('Rejudge') }}</a> <a href="#" onclick="parentNode.submit()">
<i class="fa fa-rotate-right"></i>{{ _('Rejudge') }}</a>
<input type="hidden" name="id" value="{{ submission.id }}"> <input type="hidden" name="id" value="{{ submission.id }}">
<input type="hidden" name="path" value="{{ url('submission_status', submission.id) }}"> <input type="hidden" name="path" value="{{ url('submission_status', submission.id) }}">
</form> </form>
</div> </div>
{% endif %} {% endif %}
</div>
<br> <br>
<h3 id="source-header" class="toggle closed"><i class="fa fa-chevron-right fa-fw"></i>{{_('Source code')}}</h3> <h3 id="source-header" class="toggle closed"><i class="fa fa-chevron-right fa-fw"></i>{{_('Source code')}}</h3>

View file

@ -112,7 +112,7 @@
{% if request.user.is_authenticated and request.profile != user %} {% if request.user.is_authenticated and request.profile != user %}
<br> <br>
<button class="small btn-midnightblue" style="width:100%" id="message-button"> <button class="small btn-midnightblue" style="width:100%" id="message-button">
{{ _('Send message') }} <i class="fa fa-envelope"></i> {{ _('Message') }}
</button> </button>
{% endif %} {% endif %}