Copyright and fix for test formatter (#107)
This commit is contained in:
parent
c2f6dba462
commit
df34e547ad
5 changed files with 35 additions and 22 deletions
20
dmoj/urls.py
20
dmoj/urls.py
|
@ -429,26 +429,6 @@ urlpatterns = [
|
|||
markdown_editor.MarkdownEditor.as_view(),
|
||||
name="markdown_editor",
|
||||
),
|
||||
url(
|
||||
r"^test_formatter/",
|
||||
include(
|
||||
[
|
||||
url(
|
||||
r"^$", test_formatter.TestFormatter.as_view(), name="test_formatter"
|
||||
),
|
||||
url(
|
||||
r"^edit_page$",
|
||||
test_formatter.EditTestFormatter.as_view(),
|
||||
name="edit_page",
|
||||
),
|
||||
url(
|
||||
r"^download_page$",
|
||||
test_formatter.DownloadTestFormatter.as_view(),
|
||||
name="download_page",
|
||||
),
|
||||
]
|
||||
),
|
||||
),
|
||||
url(
|
||||
r"^submission_source_file/(?P<filename>(\w|\.)+)",
|
||||
submission.SubmissionSourceFileView.as_view(),
|
||||
|
|
|
@ -25,8 +25,11 @@ def id_to_path(id):
|
|||
|
||||
|
||||
def get_names_in_archive(file_path):
|
||||
suffixes = ("inp", "out", "INP", "OUT")
|
||||
with ZipFile(os.path.join(settings.MEDIA_ROOT, file_path)) as f:
|
||||
result = [x for x in f.namelist() if not x.endswith("/")]
|
||||
result = [
|
||||
x for x in f.namelist() if not x.endswith("/") and x.endswith(suffixes)
|
||||
]
|
||||
return list(sorted(result, key=tf_utils.natural_sorting_key))
|
||||
|
||||
|
||||
|
|
|
@ -23,6 +23,12 @@
|
|||
.button {
|
||||
display:inline-block;
|
||||
}
|
||||
.copyright {
|
||||
position: absolute;
|
||||
bottom: 48px;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
|
@ -76,6 +82,9 @@
|
|||
<button type="submit" id="download" class="button">{{_('Download')}}</button>
|
||||
<a href="{{url('test_formatter_edit')}}?file_path={{file_path_getnames}}" id="edit" class="button">{{_('Edit')}}</a>
|
||||
</div>
|
||||
<div class="copyright">
|
||||
<p >{{_('Copyright')}} Nguyễn Tiến Trung Kiên</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -23,6 +23,12 @@
|
|||
.preview-container {
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
.copyright {
|
||||
position: absolute;
|
||||
bottom: 48px;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
#preview {
|
||||
background-color: rgb(220, 220, 220);
|
||||
border: solid 2px rgb(180, 180, 180);
|
||||
|
@ -127,5 +133,8 @@
|
|||
<button type="submit" id="convert" class="button">{{_('Convert')}}</button>
|
||||
<button type="submit" id="download" class="button">{{_('Download')}}</button>
|
||||
</div>
|
||||
<div class="copyright">
|
||||
<p >{{_('Copyright')}} Nguyễn Tiến Trung Kiên</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block media %}
|
||||
<style>
|
||||
.copyright {
|
||||
position: absolute;
|
||||
bottom: 48px;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<center>
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
|
@ -7,5 +16,8 @@
|
|||
{{ form }}
|
||||
<button type="submit" style="margin-top: 2em">{{_('Upload')}}</button>
|
||||
</form>
|
||||
<div class="copyright">
|
||||
<p >{{_('Copyright')}} Nguyễn Tiến Trung Kiên</p>
|
||||
</div>
|
||||
</center>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue