Change problem page
This commit is contained in:
parent
5c6391fb76
commit
f539a90635
13 changed files with 6941 additions and 543 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue