-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #221
- Loading branch information
Showing
14 changed files
with
272 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,6 +206,7 @@ td { | |
|
||
.pagination { | ||
overflow-x: auto; | ||
margin-bottom: 0; | ||
} | ||
|
||
.hidden { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{% extends "layout.html" %} | ||
|
||
{% block title %}Archived Problems{% endblock %} | ||
{% block active %}Practice{% endblock %} | ||
|
||
{% block main %} | ||
<h1>Archived Problems</h1> | ||
<div class="alert alert-warning alert-dismissible fade show" role="alert"> | ||
These problems are archived. That means they used to be solveable, but may no longer be anymore due to servers shutting down or other reasons. | ||
They may also be archived because they are too low quality, but users who have solved them previously still retain the points. | ||
<button type="button" | ||
class="btn-close" | ||
data-bs-dismiss="alert" | ||
aria-label="Close"></button> | ||
</div> | ||
<div id="pagination" style="display: inline-block; min-height: 42px" data-pages="{{ length }}"></div> | ||
<div id="category-selector-container"> | ||
<label for="category-selector">Category</label> | ||
<select class="form-control form-select" | ||
id="category-selector" | ||
onchange="selectCategory(this.value)"> | ||
<option value="">All</option> | ||
<option disabled>----------</option> | ||
{% for category in categories %} | ||
{% if selected == category['category'] %} | ||
<option selected>{{ category['category'] }}</option> | ||
{% else %} | ||
<option>{{ category['category'] }}</option> | ||
{% endif %} | ||
{% endfor %} | ||
</select> | ||
</div> | ||
<div class="mb-1"><a href="/problems">Back to unarchived problems</a></div> | ||
<div style="overflow-x: auto;"> | ||
<table class="table table-hover table-full-width"> | ||
<thead class="table-dark"> | ||
<tr> | ||
<th scope="col" style="width: 10%;">Status</th> | ||
<th scope="col" style="width: 60%;">Name</th> | ||
<th scope="col" style="width: 10%;">Category</th> | ||
<th scope="col" style="width: 10%;">Value</th> | ||
<th scope="col" style="width: 10%;">Users</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for row in data %} | ||
<tr> | ||
<td> | ||
{% if row["id"] in solved %} | ||
<img class="svg-green icon" | ||
src="/assets/images/check.svg" | ||
alt="Solved" | ||
onerror="this.src='/assets/images/check.png'"> | ||
{% else %} | ||
<img class="svg-red icon" | ||
src="/assets/images/times.svg" | ||
alt="Solved" | ||
onerror="this.src='/assets/images/times.png'"> | ||
{% endif %} | ||
</td> | ||
<td><a href="/problem/{{ row["id"] }}">{{ row["name"] }}</a></td> | ||
<td>{{ row["category"] }}</td> | ||
<td>{{ row["point_value"] }}</td> | ||
{% if check_perm(["ADMIN", "SUPERADMIN", "CONTENT_MANAGER"]) %} | ||
<td><a href="/admin/submissions?problem_id={{ row['id'] }}&correct=AC"> | ||
{{ row["sols"] }} | ||
</a></td> | ||
{% else %} | ||
<td>{{ row["sols"] }}</td> | ||
{% endif %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
<script> | ||
document.getElementById("category-selector").addEventListener("change", function() { | ||
let value = this.value; | ||
let kvp = document.location.search.substr(1).split('&'); | ||
let i = 0; | ||
for (; i < kvp.length; i++) { | ||
if (kvp[i].startsWith('category=')) { | ||
let pair = kvp[i].split('='); | ||
pair[1] = value; | ||
kvp[i] = pair.join('='); | ||
break; | ||
} | ||
} | ||
|
||
if (i >= kvp.length) { | ||
kvp[kvp.length] = ["category", value].join('='); | ||
} | ||
for (let i = 0; i < kvp.length; i++) { | ||
if (kvp[i].startsWith('page')) { | ||
let pair = kvp[i].split('='); | ||
pair[1] = "1"; | ||
kvp[i] = pair.join('='); | ||
break; | ||
} | ||
} | ||
document.location.search = kvp.join('&'); | ||
}); | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.