Change problem page
This commit is contained in:
parent
5c6391fb76
commit
f539a90635
13 changed files with 6941 additions and 543 deletions
|
@ -1,21 +1,17 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title_row %}{% endblock %}
|
||||
{% block title_ruler %}{% endblock %}
|
||||
|
||||
{% block media %}
|
||||
<link rel="alternate" type="application/atom+xml" href="{{ url('blog_atom') }}" title="Atom Blog Feed">
|
||||
<link rel="alternate" type="application/rss+xml" href="{{ url('blog_rss') }}" title="RSS Blog Feed">
|
||||
<link rel="alternate" type="application/atom+xml" href="{{ url('comment_atom') }}" title="Atom Comment Feed">
|
||||
<link rel="alternate" type="application/rss+xml" href="{{ url('comment_rss') }}" title="RSS Comment Feed">
|
||||
<link rel="alternate" type="application/atom+xml" href="{{ url('problem_atom') }}" title="Atom Problem Feed">
|
||||
<link rel="alternate" type="application/rss+xml" href="{{ url('problem_rss') }}" title="RSS Problem Feed">
|
||||
{% extends "three-column-content.html" %}
|
||||
{% block three_col_media %}
|
||||
{% include "blog/media-css.html" %}
|
||||
<style>
|
||||
@media (max-width: 800px) {
|
||||
@media (max-width: 799px) {
|
||||
.title {
|
||||
clear: both;
|
||||
}
|
||||
}
|
||||
@media (min-width: 800px) {
|
||||
#event-tab {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.time {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
@ -36,237 +32,162 @@
|
|||
#add-clarification:hover {
|
||||
color: cyan;
|
||||
}
|
||||
|
||||
#content {
|
||||
width: 99%;
|
||||
margin-left: 0;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block js_media %}
|
||||
{% block three_col_js %}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('.time-remaining').each(function () {
|
||||
count_down($(this));
|
||||
});
|
||||
|
||||
$('.blog-sidebar').hide();
|
||||
$('#blog-tab').find('a').click(function (e) {
|
||||
e.preventDefault();
|
||||
$('#blog-tab').addClass('active');
|
||||
$('#event-tab').removeClass('active');
|
||||
$('.blog-content').show();
|
||||
$('.blog-sidebar').hide();
|
||||
});
|
||||
$('#event-tab').find('a').click(function (e) {
|
||||
$('.right-sidebar').hide();
|
||||
$('#event-tab').click(function (e) {
|
||||
e.preventDefault();
|
||||
$('.left-sidebar-item').removeClass('active');
|
||||
$('#event-tab').addClass('active');
|
||||
$('#blog-tab').removeClass('active');
|
||||
$('.blog-content').hide();
|
||||
$('.blog-sidebar').show();
|
||||
$('.middle-content').hide();
|
||||
$('.right-sidebar').show();
|
||||
});
|
||||
$('.blog-description').on('click', function() {
|
||||
var max_height = $(this).css('max-height');
|
||||
if (max_height !== 'fit-content') {
|
||||
$(this).css('max-height', 'fit-content');
|
||||
$(this).parent().css('background-image', 'inherit')
|
||||
.css('padding-bottom', '0.5em');
|
||||
$(this).css('cursor', 'auto');
|
||||
}
|
||||
})
|
||||
$('.blog-description').each(function() {
|
||||
if ($(this).prop('scrollHeight') > $(this).height() ) {
|
||||
$(this).parent().css('background-image', '-webkit-linear-gradient(bottom, gray, lightgray 3%, transparent 8%, transparent 100%)');
|
||||
$(this).parent().css('padding-bottom', '0');
|
||||
$(this).css('cursor', 'pointer');
|
||||
}
|
||||
});
|
||||
$('.left-sidebar-item').on('click', function() {
|
||||
var url = $(this).attr('data-href');
|
||||
window.location.replace(url);
|
||||
});
|
||||
{% if feed_type == 'blog' %}
|
||||
$('#news-icon').css('color', 'green');
|
||||
{% elif feed_type == 'problem' %}
|
||||
$('#problems-icon').css('color', 'green');
|
||||
{% elif feed_type == 'ticket' %}
|
||||
$('#tickets-icon').css('color', 'green');
|
||||
{% elif feed_type == 'comment' %}
|
||||
$('#comments-icon').css('color', 'green');
|
||||
{% endif %}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{% block before_posts %}{% endblock %}
|
||||
<div id="mobile" class="tabs">
|
||||
<ul>
|
||||
<li id="blog-tab" class="tab active"><a href="#">
|
||||
<i class="tab-icon fa fa-info-circle"></i> {{ _('Feed') }}
|
||||
</a></li>
|
||||
<li id="event-tab" class="tab"><a href="#"><i class="tab-icon fa fa-rss"></i> {{ _('Events') }}</a></li>
|
||||
</ul>
|
||||
{% block left_sidebar %}
|
||||
<div class="left-sidebar">
|
||||
{{ make_tab_item('blog', 'fa fa-rss', url('home'), _('News')) }}
|
||||
{{ make_tab_item('comment', 'fa fa-comments', url('comment_feed'), _('Comments')) }}
|
||||
{{ make_tab_item('ticket', 'fa fa-question-circle', url('ticket_feed'), _('Tickets')) }}
|
||||
{{ make_tab_item('event', 'fa fa-calendar', '#', _('Events')) }}
|
||||
</div>
|
||||
<div id="blog-container">
|
||||
<div class="blog-left-sidebar">
|
||||
<h3 class="left-sidebar-header">{{_('Content')}}</h3>
|
||||
<div class="left-sidebar-item" data-href="{{url('home')}}">
|
||||
<div class="sidebar-icon" id="news-icon"><i class="fa fa-rss"></i></div>
|
||||
{{_('News')}}
|
||||
</div>
|
||||
<div class="left-sidebar-item" data-href="{{url('problem_feed')}}">
|
||||
<div class="sidebar-icon" id="problems-icon"><i class="fa fa-tasks"></i></div>
|
||||
{{_('Problems')}}
|
||||
</div>
|
||||
<div class="left-sidebar-item" data-href="{{url('comment_feed')}}">
|
||||
<div class="sidebar-icon" id="comments-icon"><i class="fa fa-comments"></i></div>
|
||||
{{_('Comments')}}
|
||||
</div>
|
||||
<div class="left-sidebar-item" data-href="{{url('ticket_feed')}}">
|
||||
<div class="sidebar-icon" id="tickets-icon"><i class="fa fa-question-circle"></i></div>
|
||||
{{_('Tickets')}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="blog-content">
|
||||
{% set show_organization_private_icon=True %}
|
||||
{% if feed_type == 'blog' %}
|
||||
{% for post in posts %}
|
||||
{% include "blog/content.html" %}
|
||||
{% endfor %}
|
||||
{% elif feed_type == 'problem' %}
|
||||
{% for problem in problems %}
|
||||
{% include "problem/feed.html" %}
|
||||
{% endfor %}
|
||||
{% elif feed_type == 'ticket' %}
|
||||
{% if tickets %}
|
||||
{% for ticket in tickets %}
|
||||
{% include "ticket/feed.html" %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<h3 style="text-align: center">{{_('You have no ticket')}}</h3>
|
||||
{% endif %}
|
||||
{% elif feed_type == 'comment' %}
|
||||
{% for comment in comments %}
|
||||
{% include "comments/feed.html" %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if page_obj.num_pages > 1 %}
|
||||
<div style="margin-bottom:10px;margin-top:10px">{% include "list-pages.html" %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="blog-sidebar">
|
||||
{% if request.in_contest_mode and request.participation.contest.use_clarifications %}
|
||||
<div class="blog-sidebox sidebox">
|
||||
<h3>{{ _('Clarifications') }}
|
||||
<i class="fa fa-question-circle"></i>
|
||||
{% if can_edit_contest %}
|
||||
<a href="{{url('new_contest_clarification', request.participation.contest.key)}}"
|
||||
class="fa fa-plus-circle"
|
||||
id="add-clarification"
|
||||
title="{{_('Add')}}">
|
||||
</a>
|
||||
{% endif %}
|
||||
</h3>
|
||||
<div class="sidebox-content">
|
||||
{% if has_clarifications %}
|
||||
<ul>
|
||||
{% for clarification in clarifications %}
|
||||
<li class="clarification">
|
||||
<a href="{{ url('problem_detail', clarification.problem.code) }}"
|
||||
class="problem">
|
||||
{{ clarification.problem.name }}
|
||||
</a>
|
||||
<span class="time">{{ relative_time(clarification.date) }}</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p class="no-clarifications-message">
|
||||
{{ _('No clarifications have been made at this time.') }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if current_contests %}
|
||||
<div class="blog-sidebox sidebox">
|
||||
<h3>{{ _('Ongoing contests') }} <i class="fa fa-trophy"></i></h3>
|
||||
<div class="sidebox-content">
|
||||
{% for contest in current_contests %}
|
||||
<div class="contest">
|
||||
<div class="contest-list-title">
|
||||
<a href="{{ url('contest_view', contest.key) }}">{{ contest.name }}</a>
|
||||
</div>
|
||||
<div class="time">
|
||||
{{ _('Ends in') }} {{ _('%(countdown)s.', countdown=contest.end_time|as_countdown) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if future_contests %}
|
||||
<div class="blog-sidebox sidebox">
|
||||
<h3>{{ _('Upcoming contests') }} <i class="fa fa-trophy"></i></h3>
|
||||
<div class="sidebox-content">
|
||||
{% for contest in future_contests %}
|
||||
<div class="contest">
|
||||
<div class="contest-list-title">
|
||||
<a href="{{ url('contest_view', contest.key) }}">{{ contest.name }}</a>
|
||||
</div>
|
||||
<div class="time">
|
||||
{{ _('Starting in %(countdown)s.', countdown=contest.start_time|as_countdown) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="blog-sidebox sidebox">
|
||||
<h3>{{ _('Top Rating') }} <i class="fa fa-trophy"></i></h3>
|
||||
<div class="sidebox-content" style="padding: 0; border: 0">
|
||||
<table class="table feed-table">
|
||||
<tbody>
|
||||
{% for user in top_rated %}
|
||||
<tr>
|
||||
<td style="padding: 7px 2px"><b>{{loop.index}}</b></td>
|
||||
<td>{{link_user(user)}}</td>
|
||||
<td>{{user.rating}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="blog-sidebox sidebox">
|
||||
<h3>{{ _('Top Score') }} <i class="fa fa-trophy"></i></h3>
|
||||
<div class="sidebox-content" style="padding: 0; border: 0">
|
||||
<table class="table feed-table">
|
||||
<tbody>
|
||||
{% for user in top_scorer %}
|
||||
<tr>
|
||||
<td style="padding: 7px 2px"><b>{{loop.index}}</b></td>
|
||||
<td>{{link_user(user)}}</td>
|
||||
<td>{{ user.performance_points|floatformat(0) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% block after_posts %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block bodyend %}
|
||||
{{ super() }}
|
||||
{% if REQUIRE_JAX %}
|
||||
{% include "mathjax-load.html" %}
|
||||
{% block middle_content %}
|
||||
{% set show_organization_private_icon=True %}
|
||||
{% if page_type == 'blog' %}
|
||||
{% for post in posts %}
|
||||
{% include "blog/content.html" %}
|
||||
{% endfor %}
|
||||
{% elif page_type == 'ticket' %}
|
||||
{% if tickets %}
|
||||
{% for ticket in tickets %}
|
||||
{% include "ticket/feed.html" %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<h3 style="text-align: center">{{_('You have no ticket')}}</h3>
|
||||
{% endif %}
|
||||
{% elif page_type == 'comment' %}
|
||||
{% for comment in comments %}
|
||||
{% include "comments/feed.html" %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if page_obj.num_pages > 1 %}
|
||||
<div style="margin-bottom:10px;margin-top:10px">{% include "list-pages.html" %}</div>
|
||||
{% endif %}
|
||||
{% include "comments/math.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block right_sidebar %}
|
||||
<div class="right-sidebar">
|
||||
{% if request.in_contest_mode and request.participation.contest.use_clarifications %}
|
||||
<div class="blog-sidebox sidebox">
|
||||
<h3>{{ _('Clarifications') }}
|
||||
<i class="fa fa-question-circle"></i>
|
||||
{% if can_edit_contest %}
|
||||
<a href="{{url('new_contest_clarification', request.participation.contest.key)}}"
|
||||
class="fa fa-plus-circle"
|
||||
id="add-clarification"
|
||||
title="{{_('Add')}}">
|
||||
</a>
|
||||
{% endif %}
|
||||
</h3>
|
||||
<div class="sidebox-content">
|
||||
{% if has_clarifications %}
|
||||
<ul>
|
||||
{% for clarification in clarifications %}
|
||||
<li class="clarification">
|
||||
<a href="{{ url('problem_detail', clarification.problem.code) }}"
|
||||
class="problem">
|
||||
{{ clarification.problem.name }}
|
||||
</a>
|
||||
<span class="time">{{ relative_time(clarification.date) }}</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p class="no-clarifications-message">
|
||||
{{ _('No clarifications have been made at this time.') }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if current_contests %}
|
||||
<div class="blog-sidebox sidebox">
|
||||
<h3>{{ _('Ongoing contests') }} <i class="fa fa-trophy"></i></h3>
|
||||
<div class="sidebox-content">
|
||||
{% for contest in current_contests %}
|
||||
<div class="contest">
|
||||
<div class="contest-list-title">
|
||||
<a href="{{ url('contest_view', contest.key) }}">{{ contest.name }}</a>
|
||||
</div>
|
||||
<div class="time">
|
||||
{{ _('Ends in') }} {{ _('%(countdown)s.', countdown=contest.end_time|as_countdown) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if future_contests %}
|
||||
<div class="blog-sidebox sidebox">
|
||||
<h3>{{ _('Upcoming contests') }} <i class="fa fa-trophy"></i></h3>
|
||||
<div class="sidebox-content">
|
||||
{% for contest in future_contests %}
|
||||
<div class="contest">
|
||||
<div class="contest-list-title">
|
||||
<a href="{{ url('contest_view', contest.key) }}">{{ contest.name }}</a>
|
||||
</div>
|
||||
<div class="time">
|
||||
{{ _('Starting in %(countdown)s.', countdown=contest.start_time|as_countdown) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="blog-sidebox sidebox">
|
||||
<h3>{{ _('Top Rating') }} <i class="fa fa-trophy"></i></h3>
|
||||
<div class="sidebox-content" style="padding: 0; border: 0">
|
||||
<table class="table feed-table">
|
||||
<tbody>
|
||||
{% for user in top_rated %}
|
||||
<tr>
|
||||
<td style="padding: 7px 2px"><b>{{loop.index}}</b></td>
|
||||
<td>{{link_user(user)}}</td>
|
||||
<td>{{user.rating}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="blog-sidebox sidebox">
|
||||
<h3>{{ _('Top Score') }} <i class="fa fa-trophy"></i></h3>
|
||||
<div class="sidebox-content" style="padding: 0; border: 0">
|
||||
<table class="table feed-table">
|
||||
<tbody>
|
||||
{% for user in top_scorer %}
|
||||
<tr>
|
||||
<td style="padding: 7px 2px"><b>{{loop.index}}</b></td>
|
||||
<td>{{link_user(user)}}</td>
|
||||
<td>{{ user.performance_points|floatformat(0) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -3,6 +3,13 @@
|
|||
<a href="{{ url('problem_detail', problem.code) }}">
|
||||
{{ problem.name }}
|
||||
</a>
|
||||
{% if problem.id in completed_problem_ids %}
|
||||
<i class="solved-problem-color fa fa-check-circle"></i>
|
||||
{% elif problem.id in attempted_problems %}
|
||||
<i class="attempted-problem-color fa fa-minus-circle"></i>
|
||||
{% else %}
|
||||
<i class="unsolved-problem-color fa fa-minus-circle"></i>
|
||||
{% endif %}
|
||||
</h3>
|
||||
{% with authors=problem.authors.all() %}
|
||||
{% if authors %}
|
||||
|
@ -12,7 +19,7 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% if true %}
|
||||
{% if show_types %}
|
||||
<div class="problem-feed-types">
|
||||
<i class="fa fa-tag"></i>
|
||||
{% for type in problem.types_list %}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{% extends "common-content.html" %}
|
||||
|
||||
{% block media %}
|
||||
{% extends "three-column-content.html" %}
|
||||
{% block three_col_media %}
|
||||
<link rel="stylesheet" href="{{ static('libs/nouislider.min.css') }}">
|
||||
<noscript>
|
||||
<style>
|
||||
|
@ -34,11 +33,15 @@
|
|||
ul.problem-list {
|
||||
padding: 0 !important;
|
||||
}
|
||||
#content {
|
||||
width: 99%;
|
||||
margin-left: 0;
|
||||
}
|
||||
</style>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block js_media %}
|
||||
{% block three_col_js %}
|
||||
<script>
|
||||
window.point_start = {{point_start}};
|
||||
window.point_end = {{point_end}};
|
||||
|
@ -48,6 +51,13 @@
|
|||
<script src="{{ static('libs/nouislider.min.js') }}" type="text/javascript"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
{% if not request.in_contest_mode %}
|
||||
// wrap middle and write column
|
||||
if (window.matchMedia('(max-width: 799px)').matches) {
|
||||
$('.middle-content').next().addBack().wrapAll('<div class="problem-middle-right"/>');
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
var $form = $('form#filter-form');
|
||||
var $search = $('#search');
|
||||
var $category = $('#category');
|
||||
|
@ -83,7 +93,7 @@
|
|||
|
||||
$('#go').click(clean_submit);
|
||||
|
||||
$('input#full_text, input#hide_solved, input#show_types, input#show_editorial').click(function () {
|
||||
$('input#full_text, input#hide_solved, input#show_types, input#show_editorial, input#have_editorial').click(function () {
|
||||
prep_form();
|
||||
($('<form>').attr('action', window.location.pathname + '?' + $form.serialize())
|
||||
.append($('<input>').attr('type', 'hidden').attr('name', 'csrfmiddlewaretoken')
|
||||
|
@ -91,18 +101,6 @@
|
|||
.attr('method', 'POST').appendTo($('body')).submit());
|
||||
});
|
||||
|
||||
var info_float = $('.info-float');
|
||||
var container = $('#content-right');
|
||||
if (window.bad_browser) {
|
||||
container.css('float', 'right');
|
||||
} else if (!featureTest('position', 'sticky')) {
|
||||
fix_div(info_float, 55);
|
||||
$(window).resize(function () {
|
||||
info_float.width(container.width());
|
||||
});
|
||||
info_float.width(container.width());
|
||||
}
|
||||
|
||||
var intFormatter = {
|
||||
to: function (value) {
|
||||
return value;
|
||||
|
@ -159,50 +157,30 @@
|
|||
return (node.hasClass('p') ? text.replace(/p$/, '') : text);
|
||||
}
|
||||
});
|
||||
|
||||
window.register_contest_notification("{{url('contest_clarification_ajax', request.participation.contest.key)}}");
|
||||
|
||||
{% if request.in_contest_mode %}
|
||||
$('.left-sidebar').hide();
|
||||
$('.middle-content').css('max-width', '80%');
|
||||
{% endif %}
|
||||
});
|
||||
</script>
|
||||
{% endcompress %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block title_ruler %}{% endblock %}
|
||||
|
||||
{% block title_row %}
|
||||
{% set tab = 'list' %}
|
||||
{% set title = 'Problems' %}
|
||||
{% include "problem/problem-list-tabs.html" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{% if page_obj.num_pages > 1 %}
|
||||
<div style="margin-bottom: 7px; margin-top: 11px;">
|
||||
{% include "list-pages.html" %}
|
||||
{% block left_sidebar %}
|
||||
{% if not request.in_contest_mode %}
|
||||
<div class="left-sidebar">
|
||||
{{ make_tab_item('feed', 'fa fa-pagelines', url('problem_feed'), _('Feed')) }}
|
||||
{{ make_tab_item('list', 'fa fa-list', url('problem_list'), _('List')) }}
|
||||
{{ make_tab_item('admin', 'fa fa-edit', url('admin:judge_problem_changelist'), _('Admin')) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
<div id="common-content">
|
||||
{% block before_table %}{% endblock %}
|
||||
{% if not request.in_contest_mode %}
|
||||
<div id="content-right" class="problems">
|
||||
<div class="info-float">
|
||||
{% include "problem/search-form.html" %}
|
||||
{% if hot_problems %}
|
||||
<div class="sidebox">
|
||||
<h3>{{ _('Hot problems') }} <i class="fa fa-fire"></i></h3>
|
||||
<div class="sidebox-content">
|
||||
<ul class="problem-list">{% for problem in hot_problems %}
|
||||
<li><a href="{{ url('problem_detail', problem.code) }}" class="hot-problem-link">
|
||||
{{ problem.name }}
|
||||
</a></li>
|
||||
{% endfor %}</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% block middle_content %}
|
||||
{% if in_contest_mode or page_type == 'list' %}
|
||||
<div id="content-left" class="problems">
|
||||
<table id="problem-table" class="table striped">
|
||||
<thead>
|
||||
|
@ -212,9 +190,7 @@
|
|||
<th class="solved"><i class="fa fa-check"></i></th>
|
||||
{% endif %}
|
||||
<th class="problem">{{ _('Problem') }}</th>
|
||||
<!-- Luong begin -->
|
||||
<th class="pcode">{{ _('Problem code') }}</th>
|
||||
<!-- Luong end -->
|
||||
<th class="category">{{ _('Category') }}</th>
|
||||
{% if show_types %}
|
||||
<th>{{ _('Types') }}</th>
|
||||
|
@ -255,7 +231,7 @@
|
|||
</th>
|
||||
{% if show_editorial %}
|
||||
<th class="editorial">
|
||||
Editorial
|
||||
{{_('Editorial')}}
|
||||
</th>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
@ -370,18 +346,34 @@
|
|||
</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if page_obj.num_pages > 1 %}
|
||||
<div style="margin-top:10px;">{% include "list-pages.html" %}</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<!-- Luong begin -->
|
||||
<script>
|
||||
$(".pcodecell").each(function(idx, elt){
|
||||
var pcode = elt.text;
|
||||
elt.text = pcode.toUpperCase();
|
||||
});
|
||||
</script>
|
||||
<!-- Luong end -->
|
||||
{% elif page_type == 'feed' %}
|
||||
<div class="problem-feed-option">
|
||||
<a href="{{url('problem_feed')}}" class="problem-feed-option-item {{'active' if feed_type=='for_you'}}">
|
||||
{{_('FOR YOU')}}
|
||||
</a>
|
||||
<a href="{{url('problem_feed_new')}}" class="problem-feed-option-item {{'active' if feed_type=='new'}}">
|
||||
{{_('NEW')}}
|
||||
</a>
|
||||
</div>
|
||||
{% for problem in problems %}
|
||||
{% include "problem/feed.html" %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if page_obj.num_pages > 1 %}
|
||||
<div style="margin-top:10px;">{% include "list-pages.html" %}</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block right_sidebar %}
|
||||
{% if not request.in_contest_mode %}
|
||||
<div class="right-sidebar">
|
||||
<div id="content-right" class="problems">
|
||||
<div class="info-float">
|
||||
{% include "problem/search-form.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -7,13 +7,6 @@
|
|||
<input id="search" type="text" name="search" value="{{ search_query or '' }}"
|
||||
placeholder="{{ _('Search problems...') }}">
|
||||
</div>
|
||||
<!-- {% if has_fts %}
|
||||
<div>
|
||||
<input id="full_text" type="checkbox" name="full_text" value="1"
|
||||
{% if full_text %}checked{% endif %}>
|
||||
<label for="full_text">{{ _('Full text search') }}</label>
|
||||
</div>
|
||||
{% endif %} -->
|
||||
{% if request.user.is_authenticated %}
|
||||
<div>
|
||||
<input id="hide_solved" type="checkbox" name="hide_solved" value="1"
|
||||
|
@ -26,11 +19,19 @@
|
|||
{% if show_types %} checked{% endif %}>
|
||||
<label for="show_types">{{ _('Show problem types') }}</label>
|
||||
</div>
|
||||
<div>
|
||||
<input id="show_editorial" type="checkbox" name="show_editorial" value="1"
|
||||
{% if show_editorial %} checked{% endif %}>
|
||||
<label for="show_editorial">{{ _('Show editorial') }}</label>
|
||||
</div>
|
||||
{% if page_type == 'list' %}
|
||||
<div>
|
||||
<input id="show_editorial" type="checkbox" name="show_editorial" value="1"
|
||||
{% if show_editorial %} checked{% endif %}>
|
||||
<label for="show_editorial">{{ _('Show editorial') }}</label>
|
||||
</div>
|
||||
{% elif page_type == 'feed' %}
|
||||
<div>
|
||||
<input id="have_editorial" type="checkbox" name="have_editorial" value="1"
|
||||
{% if have_editorial %} checked{% endif %}>
|
||||
<label for="have_editorial">{{ _('Have editorial') }}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="filter-form-group">
|
||||
<label for="type"><i>{{ _('Organization') }}</i></label>
|
||||
<select id="search-org" name="orgs" multiple>
|
||||
|
|
69
templates/three-column-content.html
Normal file
69
templates/three-column-content.html
Normal file
|
@ -0,0 +1,69 @@
|
|||
{% extends "base.html" %}
|
||||
{% block title_row %}{% endblock %}
|
||||
{% block title_ruler %}{% endblock %}
|
||||
|
||||
{% block media %}
|
||||
<style>
|
||||
#content {
|
||||
width: 98%;
|
||||
margin-left: 0;
|
||||
}
|
||||
</style>
|
||||
{% block three_col_media %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block js_media %}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('.left-sidebar-item').on('click', function() {
|
||||
var url = $(this).attr('data-href');
|
||||
if (url === '#') return;
|
||||
window.location.href = url;
|
||||
});
|
||||
$('.blog-description').on('click', function() {
|
||||
var max_height = $(this).css('max-height');
|
||||
if (max_height !== 'fit-content') {
|
||||
$(this).css('max-height', 'fit-content');
|
||||
$(this).parent().css('background-image', 'inherit')
|
||||
.css('padding-bottom', '0.5em');
|
||||
$(this).css('cursor', 'auto');
|
||||
}
|
||||
})
|
||||
$('.blog-description').each(function() {
|
||||
if ($(this).prop('scrollHeight') > $(this).height() ) {
|
||||
$(this).parent().css('background-image', '-webkit-linear-gradient(bottom, gray, lightgray 3%, transparent 8%, transparent 100%)');
|
||||
$(this).parent().css('padding-bottom', '0');
|
||||
$(this).css('cursor', 'pointer');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% block three_col_js %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% macro make_tab_item(name, fa, url, text) %}
|
||||
<div class="left-sidebar-item {% if page_type == name %}active{% endif %}" data-href="{{ url }}" id="{{ name }}-tab">
|
||||
<div class="sidebar-icon"><i class="{{ fa }}"></i></div>
|
||||
{{ text }}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% block body %}
|
||||
{% block before_posts %}{% endblock %}
|
||||
<div id="three-col-container">
|
||||
{% block left_sidebar %}{% endblock %}
|
||||
<div class="middle-content">
|
||||
{% block middle_content %}{% endblock %}
|
||||
</div>
|
||||
{% block right_sidebar %}{% endblock %}
|
||||
</div>
|
||||
{% block after_posts %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block bodyend %}
|
||||
{{ super() }}
|
||||
{% if REQUIRE_JAX %}
|
||||
{% include "mathjax-load.html" %}
|
||||
{% endif %}
|
||||
{% include "comments/math.html" %}
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue