new contest ui (#80)

This commit is contained in:
Võ Trung Hoàng Hưng 2023-09-08 23:22:57 +07:00 committed by GitHub
parent 6c64e42322
commit 3542d6ba64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 269 additions and 240 deletions

View file

@ -134,7 +134,7 @@ class ContestList(
QueryStringSortMixin, DiggPaginatorMixin, TitleMixin, ContestListMixin, ListView QueryStringSortMixin, DiggPaginatorMixin, TitleMixin, ContestListMixin, ListView
): ):
model = Contest model = Contest
paginate_by = 20 paginate_by = 10
template_name = "contest/list.html" template_name = "contest/list.html"
title = gettext_lazy("Contests") title = gettext_lazy("Contests")
context_object_name = "past_contests" context_object_name = "past_contests"

View file

@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: lqdoj2\n" "Project-Id-Version: lqdoj2\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-02 07:40+0700\n" "POT-Creation-Date: 2023-09-08 22:40+0700\n"
"PO-Revision-Date: 2021-07-20 03:44\n" "PO-Revision-Date: 2021-07-20 03:44\n"
"Last-Translator: Icyene\n" "Last-Translator: Icyene\n"
"Language-Team: Vietnamese\n" "Language-Team: Vietnamese\n"
@ -21,7 +21,7 @@ msgstr ""
#: chat_box/models.py:39 chat_box/models.py:64 chat_box/models.py:79 #: chat_box/models.py:39 chat_box/models.py:64 chat_box/models.py:79
#: judge/admin/interface.py:150 judge/models/contest.py:636 #: judge/admin/interface.py:150 judge/models/contest.py:636
#: judge/models/contest.py:842 judge/models/course.py:115 #: judge/models/contest.py:842 judge/models/course.py:115
#: judge/models/profile.py:384 judge/models/profile.py:462 #: judge/models/profile.py:390 judge/models/profile.py:468
msgid "user" msgid "user"
msgstr "người dùng" msgstr "người dùng"
@ -1993,7 +1993,7 @@ msgid ""
msgstr "Ảnh này sẽ thay thế logo mặc định khi ở trong tổ chức." msgstr "Ảnh này sẽ thay thế logo mặc định khi ở trong tổ chức."
#: judge/models/profile.py:143 judge/models/profile.py:172 #: judge/models/profile.py:143 judge/models/profile.py:172
#: judge/models/profile.py:390 judge/models/profile.py:469 #: judge/models/profile.py:396 judge/models/profile.py:475
msgid "organization" msgid "organization"
msgstr "" msgstr ""
@ -2099,43 +2099,43 @@ msgstr "ghi chú nội bộ"
msgid "Notes for administrators regarding this user." msgid "Notes for administrators regarding this user."
msgstr "Ghi chú riêng cho quản trị viên." msgstr "Ghi chú riêng cho quản trị viên."
#: judge/models/profile.py:249 #: judge/models/profile.py:250
msgid "Custom background" msgid "Custom background"
msgstr "Background tự chọn" msgstr "Background tự chọn"
#: judge/models/profile.py:249 #: judge/models/profile.py:253
msgid "CSS custom background properties: url(\"image_url\"), color, etc" msgid "CSS custom background properties: url(\"image_url\"), color, etc"
msgstr "CSS background tự chọn. Ví dụ: url(\"image_url\"), white, ..." msgstr "CSS background tự chọn. Ví dụ: url(\"image_url\"), white, ..."
#: judge/models/profile.py:377 #: judge/models/profile.py:383
msgid "user profile" msgid "user profile"
msgstr "thông tin người dùng" msgstr "thông tin người dùng"
#: judge/models/profile.py:378 #: judge/models/profile.py:384
msgid "user profiles" msgid "user profiles"
msgstr "thông tin người dùng" msgstr "thông tin người dùng"
#: judge/models/profile.py:394 #: judge/models/profile.py:400
msgid "request time" msgid "request time"
msgstr "thời gian đăng ký" msgstr "thời gian đăng ký"
#: judge/models/profile.py:397 #: judge/models/profile.py:403
msgid "state" msgid "state"
msgstr "trạng thái" msgstr "trạng thái"
#: judge/models/profile.py:404 #: judge/models/profile.py:410
msgid "reason" msgid "reason"
msgstr "lý do" msgstr "lý do"
#: judge/models/profile.py:407 #: judge/models/profile.py:413
msgid "organization join request" msgid "organization join request"
msgstr "đơn đăng ký tham gia" msgstr "đơn đăng ký tham gia"
#: judge/models/profile.py:408 #: judge/models/profile.py:414
msgid "organization join requests" msgid "organization join requests"
msgstr "đơn đăng ký tham gia" msgstr "đơn đăng ký tham gia"
#: judge/models/profile.py:474 #: judge/models/profile.py:480
#, fuzzy #, fuzzy
#| msgid "last seen" #| msgid "last seen"
msgid "last visit" msgid "last visit"
@ -2983,7 +2983,7 @@ msgid "You are not allowed to access this organization."
msgstr "Bạn không được phép chỉnh sửa tổ chức này." msgstr "Bạn không được phép chỉnh sửa tổ chức này."
#: judge/views/organization.py:230 judge/views/stats.py:184 #: judge/views/organization.py:230 judge/views/stats.py:184
#: templates/contest/list.html:89 templates/problem/list-base.html:97 #: templates/contest/list.html:93 templates/problem/list-base.html:97
#: templates/stats/site.html:33 templates/user/user-left-sidebar.html:4 #: templates/stats/site.html:33 templates/user/user-left-sidebar.html:4
#: templates/user/user-list-tabs.html:6 #: templates/user/user-list-tabs.html:6
msgid "Groups" msgid "Groups"
@ -3400,8 +3400,8 @@ msgstr "Phải qua một kỳ thi"
#: judge/views/submission.py:914 #: judge/views/submission.py:914
#, python-brace-format #, python-brace-format
msgid "" msgid ""
"<a href=\"{1}\">{0}</a>'s submissions for <a href=\"{3}\">{2}</a> in <a href=" "<a href=\"{1}\">{0}</a>'s submissions for <a href=\"{3}\">{2}</a> in <a "
"\"{5}\">{4}</a>" "href=\"{5}\">{4}</a>"
msgstr "" msgstr ""
"Các bài nộp của <a href=\"{1}\">{0}</a> cho <a href=\"{3}\">{2}</a> trong <a " "Các bài nộp của <a href=\"{1}\">{0}</a> cho <a href=\"{3}\">{2}</a> trong <a "
"href=\"{5}\">{4}</a>" "href=\"{5}\">{4}</a>"
@ -3673,7 +3673,7 @@ msgstr "đã đăng vào %(time)s"
#: templates/blog/blog.html:31 templates/comments/content-list.html:62 #: templates/blog/blog.html:31 templates/comments/content-list.html:62
#: templates/comments/content-list.html:76 #: templates/comments/content-list.html:76
#: templates/contest/contest-tabs.html:35 templates/contest/list.html:124 #: templates/contest/contest-tabs.html:35 templates/contest/list.html:129
#: templates/contest/tag-title.html:9 templates/flatpages/admin_link.html:3 #: templates/contest/tag-title.html:9 templates/flatpages/admin_link.html:3
#: templates/license.html:10 templates/problem/editorial.html:15 #: templates/license.html:10 templates/problem/editorial.html:15
#: templates/problem/feed/problems.html:50 #: templates/problem/feed/problems.html:50
@ -3949,7 +3949,7 @@ msgstr "Thứ sáu"
msgid "Saturday" msgid "Saturday"
msgstr "Thứ bảy" msgstr "Thứ bảy"
#: templates/contest/clarification.html:52 templates/contest/list.html:229 #: templates/contest/clarification.html:52 templates/contest/list.html:232
#: templates/organization/new.html:10 templates/ticket/new.html:38 #: templates/organization/new.html:10 templates/ticket/new.html:38
msgid "Create" msgid "Create"
msgstr "Tạo mới" msgstr "Tạo mới"
@ -4014,8 +4014,8 @@ msgstr "G:i T, j F, Y"
#: templates/contest/contest-datetime.html:39 #: templates/contest/contest-datetime.html:39
#, python-format #, python-format
msgid "" msgid ""
"<b>%(time_limit)s</b> window between <b>%(start_time)s</b> and <b>" "<b>%(time_limit)s</b> window between <b>%(start_time)s</b> and "
"%(end_time)s</b>" "<b>%(end_time)s</b>"
msgstr "" msgstr ""
"Kéo dài <b>%(time_limit)s</b> từ <b>%(start_time)s</b> đến <b>%(end_time)s</" "Kéo dài <b>%(time_limit)s</b> từ <b>%(start_time)s</b> đến <b>%(end_time)s</"
"b>" "b>"
@ -4075,7 +4075,7 @@ msgstr "Nhân bản"
msgid "Leave contest" msgid "Leave contest"
msgstr "Rời kỳ thi" msgstr "Rời kỳ thi"
#: templates/contest/contest.html:42 templates/contest/list.html:408 #: templates/contest/contest.html:42 templates/contest/list.html:400
msgid "Virtual join" msgid "Virtual join"
msgstr "Tham gia ảo" msgstr "Tham gia ảo"
@ -4099,9 +4099,7 @@ msgstr "Đăng nhập để tham gia"
msgid "AC Rate" msgid "AC Rate"
msgstr "Tỷ lệ AC" msgstr "Tỷ lệ AC"
#: templates/contest/contest.html:103 templates/contest/list.html:242 #: templates/contest/contest.html:103 templates/problem/list.html:24
#: templates/contest/list.html:291 templates/contest/list.html:385
#: templates/problem/list.html:24
msgid "Users" msgid "Users"
msgstr "Người nộp" msgstr "Người nộp"
@ -4110,11 +4108,11 @@ msgstr "Người nộp"
msgid "Editorial" msgid "Editorial"
msgstr "Hướng dẫn" msgstr "Hướng dẫn"
#: templates/contest/list.html:85 templates/contest/media-js.html:152 #: templates/contest/list.html:89 templates/contest/media-js.html:152
msgid "Are you sure you want to join?" msgid "Are you sure you want to join?"
msgstr "Bạn có chắc tham gia?" msgstr "Bạn có chắc tham gia?"
#: templates/contest/list.html:86 #: templates/contest/list.html:90
msgid "" msgid ""
"Joining a contest for the first time starts your timer, after which it " "Joining a contest for the first time starts your timer, after which it "
"becomes unstoppable." "becomes unstoppable."
@ -4122,88 +4120,83 @@ msgstr ""
"Tham gia kỳ thi lần đầu sẽ kích hoạt thời gian đếm ngược, không thể dừng lại " "Tham gia kỳ thi lần đầu sẽ kích hoạt thời gian đếm ngược, không thể dừng lại "
"sau đó." "sau đó."
#: templates/contest/list.html:118 #: templates/contest/list.html:123
msgid "hidden" msgid "hidden"
msgstr "ẩn" msgstr "ẩn"
#: templates/contest/list.html:130 #: templates/contest/list.html:135
msgid "private" msgid "private"
msgstr "riêng tư" msgstr "riêng tư"
#: templates/contest/list.html:146 #: templates/contest/list.html:151
msgid "rated" msgid "rated"
msgstr "rated" msgstr "rated"
#: templates/contest/list.html:172 #: templates/contest/list.html:177
#, python-format #, python-format
msgid "%(time_limit)s window" msgid "%(time_limit)s window"
msgstr "Cửa sổ thi dài %(time_limit)s" msgstr "Cửa sổ thi dài %(time_limit)s"
#: templates/contest/list.html:174 #: templates/contest/list.html:179
#, python-format #, python-format
msgid "%(duration)s long" msgid "%(duration)s long"
msgstr "Kéo dài %(duration)s" msgstr "Kéo dài %(duration)s"
#: templates/contest/list.html:194 #: templates/contest/list.html:198
msgid "Spectate" msgid "Spectate"
msgstr "Theo dõi" msgstr "Theo dõi"
#: templates/contest/list.html:200 templates/organization/home.html:30 #: templates/contest/list.html:204 templates/organization/home.html:30
msgid "Join" msgid "Join"
msgstr "Tham gia" msgstr "Tham gia"
#: templates/contest/list.html:211 #: templates/contest/list.html:214
msgid "Search contests..." msgid "Search contests..."
msgstr "Tìm kiếm kỳ thi..." msgstr "Tìm kiếm kỳ thi..."
#: templates/contest/list.html:221 templates/internal/problem.html:33 #: templates/contest/list.html:224 templates/internal/problem.html:33
msgid "Search" msgid "Search"
msgstr "Tìm kiếm" msgstr "Tìm kiếm"
#: templates/contest/list.html:225 #: templates/contest/list.html:228
msgid "Hide organization contests" msgid "Hide organization contests"
msgstr "Ẩn các kỳ thi riêng tư của nhóm" msgstr "Ẩn các kỳ thi riêng tư của nhóm"
#: templates/contest/list.html:235 #: templates/contest/list.html:238
msgid "Active Contests" msgid "Active Contests"
msgstr "Kỳ thi bạn đang tham gia" msgstr "Kỳ thi bạn đang tham gia"
#: templates/contest/list.html:241 templates/contest/list.html:290 #: templates/contest/list.html:255
#: templates/contest/list.html:338 templates/contest/list.html:382
msgid "Contest"
msgstr "Kỳ thi"
#: templates/contest/list.html:259
#, python-format #, python-format
msgid "Window ends in %(countdown)s" msgid "Window ends in %(countdown)s"
msgstr "Cửa số thi còn %(countdown)s" msgstr "Cửa số thi còn %(countdown)s"
#: templates/contest/list.html:262 templates/contest/list.html:306 #: templates/contest/list.html:258 templates/contest/list.html:299
#, python-format #, python-format
msgid "Ends in %(countdown)s" msgid "Ends in %(countdown)s"
msgstr "Kết thúc trong %(countdown)s" msgstr "Kết thúc trong %(countdown)s"
#: templates/contest/list.html:283 #: templates/contest/list.html:284
msgid "Ongoing Contests" msgid "Ongoing Contests"
msgstr "Kỳ thi đang diễn ra" msgstr "Kỳ thi đang diễn ra"
#: templates/contest/list.html:324 #: templates/contest/list.html:322
msgid "There is no ongoing contest at this time." msgid "There is no ongoing contest at this time."
msgstr "Không có kỳ thi nào đang diễn ra hiện tại." msgstr "Không có kỳ thi nào đang diễn ra hiện tại."
#: templates/contest/list.html:331 #: templates/contest/list.html:329
msgid "Upcoming Contests" msgid "Upcoming Contests"
msgstr "Kỳ thi sắp tới" msgstr "Kỳ thi sắp tới"
#: templates/contest/list.html:363 #: templates/contest/list.html:359
msgid "There is no scheduled contest at this time." msgid "There is no scheduled contest at this time."
msgstr "Không có kỳ thi nào được lên lịch hiện tại." msgstr "Không có kỳ thi nào được lên lịch hiện tại."
#: templates/contest/list.html:370 #: templates/contest/list.html:366
msgid "Past Contests" msgid "Past Contests"
msgstr "Kỳ thi trong quá khứ" msgstr "Kỳ thi trong quá khứ"
#: templates/contest/list.html:423 #: templates/contest/list.html:413
msgid "There is no past contest." msgid "There is no past contest."
msgstr "Không có kỳ thi nào trong quá khứ." msgstr "Không có kỳ thi nào trong quá khứ."
@ -4728,7 +4721,7 @@ msgid "Thinking point"
msgstr "Độ khó nghĩ" msgstr "Độ khó nghĩ"
#: templates/problem/feed/problems.html:83 #: templates/problem/feed/problems.html:83
#: templates/problem/search-form.html:83 #: templates/problem/search-form.html:68
msgid "Problem types" msgid "Problem types"
msgstr "Dạng bài" msgstr "Dạng bài"
@ -4756,7 +4749,7 @@ msgstr "Hệ thống lỗi!"
msgid "Successful vote! Thank you!" msgid "Successful vote! Thank you!"
msgstr "Đã gửi thành công! Cảm ơn bạn!" msgstr "Đã gửi thành công! Cảm ơn bạn!"
#: templates/problem/list.html:40 templates/problem/search-form.html:67 #: templates/problem/list.html:40 templates/problem/search-form.html:79
#: templates/user/user-problems.html:57 #: templates/user/user-problems.html:57
msgid "Category" msgid "Category"
msgstr "Nhóm bài" msgstr "Nhóm bài"
@ -5024,7 +5017,7 @@ msgstr "Hiển thị hướng dẫn"
msgid "Have editorial" msgid "Have editorial"
msgstr "Có hướng dẫn" msgstr "Có hướng dẫn"
#: templates/problem/search-form.html:70 templates/problem/search-form.html:72 #: templates/problem/search-form.html:82 templates/problem/search-form.html:84
#: templates/submission/list.html:381 #: templates/submission/list.html:381
#: templates/submission/submission-list-tabs.html:4 #: templates/submission/submission-list-tabs.html:4
msgid "All" msgid "All"
@ -5930,6 +5923,9 @@ msgstr "Thông tin"
msgid "Check all" msgid "Check all"
msgstr "Chọn tất cả" msgstr "Chọn tất cả"
#~ msgid "Contest"
#~ msgstr "Kỳ thi"
#~ msgid "0 to not show testcases, 1 to show" #~ msgid "0 to not show testcases, 1 to show"
#~ msgstr "0 để ẩn test, 1 để hiện" #~ msgstr "0 để ẩn test, 1 để hiện"
@ -5966,8 +5962,8 @@ msgstr "Chọn tất cả"
#~ msgstr "bình luận nữa" #~ msgstr "bình luận nữa"
#~ msgid "" #~ msgid ""
#~ "This comment is hidden due to too much negative feedback. Click <a href=" #~ "This comment is hidden due to too much negative feedback. Click <a "
#~ "\"javascript:comment_show_content(%(id)s)\">here</a> to view it." #~ "href=\"javascript:comment_show_content(%(id)s)\">here</a> to view it."
#~ msgstr "" #~ msgstr ""
#~ "Bình luận bị ẩn vì nhiều phản hồi tiêu cực. Nhấp vào <a href=\"javascript:" #~ "Bình luận bị ẩn vì nhiều phản hồi tiêu cực. Nhấp vào <a href=\"javascript:"
#~ "comment_show_content(%(id)s)\">đây</a> để mở." #~ "comment_show_content(%(id)s)\">đây</a> để mở."

View file

@ -15,12 +15,15 @@ msgstr "Thành viên"
msgid "Contests" msgid "Contests"
msgstr "Kỳ thi" msgstr "Kỳ thi"
msgid "Groups" msgid "Chat"
msgstr "Nhóm" msgstr ""
msgid "About" msgid "About"
msgstr "Giới thiệu" msgstr "Giới thiệu"
msgid "Groups"
msgstr "Nhóm"
msgid "Status" msgid "Status"
msgstr "Máy chấm" msgstr "Máy chấm"

View file

@ -1,5 +1,40 @@
@import "vars"; @import "vars";
.list-contest {
box-shadow: 0px 4px 8px rgba(4, 83, 67, 0.2), 0px 6px 20px rgba(4, 83, 67, 0.19);
border-radius: 15px;
padding: 20px;
margin-bottom: 20px;
width: 100%;
box-sizing: border-box;
display: flex;
.info-contest:first-child {
margin-right: 15px;
}
.info-contest:nth-child(2) {
margin-right: 5px;
}
.info-contest {
flex: 1;
}
.participate-button {
display: flex;
justify-content: center;
align-items: center;
}
.contest-title {
font-size: 17px;
font-weight: 600;
line-height: 150%;
margin-bottom: 10px;
}
}
#contest-calendar { #contest-calendar {
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;

View file

@ -326,11 +326,14 @@ input {
// Bootstrap-y pagination // Bootstrap-y pagination
ul.pagination a:hover { ul.pagination a:hover {
color: #FFF; color: #FFF;
background: rgba(0, 0, 0, 0.55); background: #0aa082;
border: none;
} }
ul.pagination { ul.pagination {
display: inline-block; align-items: center;
justify-content: center;
display: flex;
padding-left: 0; padding-left: 0;
margin: 0; margin: 0;
border-radius: $widget_border_radius; border-radius: $widget_border_radius;
@ -339,33 +342,35 @@ ul.pagination {
li { li {
display: inline; display: inline;
&:first-child > { // &:first-child > {
a, span { // a, span {
margin-left: 0; // margin-left: 0;
border-top-left-radius: $widget_border_radius; // border-top-left-radius: $widget_border_radius;
border-bottom-left-radius: $widget_border_radius; // border-bottom-left-radius: $widget_border_radius;
} // }
} // }
&:last-child > { // &:last-child > {
a, span { // a, span {
margin-left: 0; // margin-left: 0;
border-top-right-radius: $widget_border_radius; // border-top-right-radius: $widget_border_radius;
border-bottom-right-radius: $widget_border_radius; // border-bottom-right-radius: $widget_border_radius;
} // }
} // }
> { > {
a, span { a, span {
position: relative; position: relative;
float: left; float: left;
padding: 4px 12px; padding: 4px 12px;
margin-right: 5px;
font-weight: bold;
line-height: 1.42857; line-height: 1.42857;
text-decoration: none; text-decoration: none;
color: #FFF; color: #045343;
background-color: $widget_black; background-color: white;
border: 1px solid #505050; border: 2px solid #045343;
margin-left: -1px; border-radius: 10px;
} }
} }
} }
@ -373,22 +378,22 @@ ul.pagination {
.disabled-page > { .disabled-page > {
a { a {
color: #888; color: #888;
background-color: $widget_black; background-color: #04534380;
border-color: #282828; border-color: #04534380;
} }
span { span {
color: #888; color: #888;
background-color: $widget_black; background-color: #04534380;
border-color: #505050; border-color: #04534380;
} }
} }
.active-page > { .active-page > {
a { a {
z-index: 2; z-index: 2;
color: black; color: white;
background-color: #7dc7ff; background-color: #045343;
border-color: transparent; border-color: transparent;
cursor: default; cursor: default;
} }

View file

@ -5,6 +5,10 @@
{% block two_col_media %} {% block two_col_media %}
<style> <style>
.non-padding-top {
padding-top: 0;
}
.content-description ul { .content-description ul {
padding: 0 !important; padding: 0 !important;
} }
@ -109,10 +113,11 @@
{% macro contest_head(contest) %} {% macro contest_head(contest) %}
{% spaceless %} {% spaceless %}
<a href="{{ url('contest_view', contest.key) }}" class="contest-list-title"> <a href="{{ url('contest_view', contest.key) }}" class="contest-list-title" style="margin-right: 5px;">
{{- contest.name -}} {{- contest.name -}}
</a> </a>
<span class="contest-tags"> <br>
<div class="contest-tags" style="margin-top: 5px;">
{% if not contest.is_visible %} {% if not contest.is_visible %}
<span class="contest-tag contest-tag-hidden"> <span class="contest-tag contest-tag-hidden">
<i class="fa fa-eye-slash"></i> {{ _('hidden') }} <i class="fa fa-eye-slash"></i> {{ _('hidden') }}
@ -155,12 +160,12 @@
</a> </a>
</span> </span>
{% endfor %} {% endfor %}
</span> </div>
{% endspaceless %} {% endspaceless %}
{% endmacro %} {% endmacro %}
{% macro time_left(contest) %} {% macro time_left(contest, padding_top = true) %}
<div class="time time-left"> <div class="time time-left {{ 'non-padding-top' if padding_top == false }}">
{% if contest.time_limit %} {% if contest.time_limit %}
{{ contest.start_time|date(_("M j, Y, G:i")) }} - {{ contest.start_time|date(_("M j, Y, G:i")) }} -
{{ contest.end_time|date(_("M j, Y, G:i")) }} {{ contest.end_time|date(_("M j, Y, G:i")) }}
@ -186,21 +191,19 @@
{% macro contest_join(contest, request) %} {% macro contest_join(contest, request) %}
{% if not request.in_contest %} {% if not request.in_contest %}
<td> {% if request.profile in contest.authors.all() or request.profile in contest.curators.all() or request.profile in contest.testers.all() %}
{% if request.profile in contest.authors.all() or request.profile in contest.curators.all() or request.profile in contest.testers.all() %} <form action="{{ url('contest_join', contest.key) }}" method="post">
<form action="{{ url('contest_join', contest.key) }}" method="post"> {% csrf_token %}
{% csrf_token %} <input type="submit" class="unselectable button full small"
<input type="submit" class="unselectable button full small" value="{{ _('Spectate') }}">
value="{{ _('Spectate') }}"> </form>
</form> {% else %}
{% else %} <form action="{{ url('contest_join', contest.key) }}" method="post">
<form action="{{ url('contest_join', contest.key) }}" method="post"> {% csrf_token %}
{% csrf_token %} <input type="submit" class="unselectable button full small join-warning"
<input type="submit" class="unselectable button full small join-warning" value="{{ _('Join') }}">
value="{{ _('Join') }}"> </form>
</form> {% endif %}
{% endif %}
</td>
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
@ -235,45 +238,43 @@
{{ _('Active Contests') }} {{ _('Active Contests') }}
</h3> </h3>
<div class="toggled"> <div class="toggled">
<table class="contest-list table striped">
<thead> {% for participation in active_participations %}
<tr> {% with contest=participation.contest %}
<th style="width:90%">{{ _('Contest') }}</th> <div class="list-contest">
<th>{{ _('Users') }}</th> <div class="info-contest" style="flex: 1.5">
{% if not request.in_contest %} <div class="contest-title"> {{ _('Contests') }} </div>
<th style="width:15%"></th> {{ contest_head(contest) }}
{% endif %} </div>
</tr> <div class="info-contest" style="flex: 1.5">
</thead> <div class="contest-title"> {{ _('Time') }} </div>
<tbody> <div class="contest-block">
{% for participation in active_participations %} {% if contest.start_time %}
{% with contest=participation.contest %} {% if contest.time_limit %}
<tr> <span class="time">
<td> {% trans countdown=participation.end_time|as_countdown %}Window ends in {{countdown}}{% endtrans %}
<div class="contest-block"> </span>
{{ contest_head(contest) }} {% elif contest.time_before_end %}
{% if contest.start_time %} <span class="time">{% trans countdown=contest.end_time|as_countdown %}Ends in {{countdown}}{% endtrans %}</span>
<br> {% endif %}
{% if contest.time_limit %} {{ time_left(contest) }}
<span class="time"> {% endif %}
{% trans countdown=participation.end_time|as_countdown %}Window ends in {{countdown}}{% endtrans %} </div>
</span> </div>
{% elif contest.time_before_end %} <div class="info-contest">
<span class="time">{% trans countdown=contest.end_time|as_countdown %}Ends in {{countdown}}{% endtrans %}</span> <div class="contest-title"> {{ _('Format') }} </div>
{% endif %} {{ contest.format.name }}
{{ time_left(contest) }} </div>
{% endif %} <div class="info-contest">
</div> <div class="contest-title"> {{ _('Users') }} </div>
</td> {{ user_count(contest, request.user) }}
<td> </div>
{{ user_count(contest, request.user) }} <div class="participate-button">
</td> {{ contest_join(contest, request) }}
{{ contest_join(contest, request) }} </div>
</tr> </div>
{% endwith %} {% endwith %}
{% endfor %} {% endfor %}
</tbody>
</table>
</div> </div>
<br> <br>
{% endif %} {% endif %}
@ -284,39 +285,36 @@
</h3> </h3>
{% if current_contests %} {% if current_contests %}
<div id="ongoing-table" class="toggled"> <div id="ongoing-table" class="toggled">
<table class="contest-list table striped"> {% for contest in current_contests %}
<thead> <div class="list-contest">
<tr> <div class="info-contest" style="flex: 1.5">
<th style="width:90%">{{ _('Contest') }}</th> <div class="contest-title"> {{ _('Contests') }} </div>
<th>{{ _('Users') }}</th> {{ contest_head(contest) }}
{% if not request.in_contest %} </div>
<th style="width:15%"></th> <div class="info-contest" style="flex: 1.5">
{% endif %} <div class="contest-title"> {{ _('Time') }} </div>
</tr> <div class="contest-block">
</thead> {% if contest.start_time %}
<tbody> {% if contest.time_before_end %}
{% for contest in current_contests %} <span class="time">{% trans countdown=contest.end_time|as_countdown %}Ends in {{countdown}}{% endtrans %}</span>
<tr> {% endif %}
<td> {{ time_left(contest) }}
<div class="contest-block"> {% endif %}
{{ contest_head(contest) }} </div>
{% if contest.start_time %} </div>
<br> <div class="info-contest">
{% if contest.time_before_end %} <div class="contest-title"> {{ _('Format') }} </div>
<span class="time">{% trans countdown=contest.end_time|as_countdown %}Ends in {{countdown}}{% endtrans %}</span> {{ contest.format.name }}
{% endif %} </div>
{{ time_left(contest) }} <div class="info-contest">
{% endif %} <div class="contest-title"> {{ _('Users') }} </div>
</div> {{ user_count(contest, request.user) }}
</td> </div>
<td> <div class="participate-button">
{{ user_count(contest, request.user) }} {{ contest_join(contest, request) }}
</td> </div>
{{ contest_join(contest, request) }} </div>
</tr> {% endfor %}
{% endfor %}
</tbody>
</table>
<br> <br>
</div> </div>
{% else %} {% else %}
@ -332,31 +330,29 @@
</h3> </h3>
{% if future_contests %} {% if future_contests %}
<div class="toggled"> <div class="toggled">
<table class="contest-list table striped"> {% for contest in future_contests %}
<thead> <div class="list-contest">
<tr> <div class="info-contest" style="flex: 1.5">
<th>{{ _('Contest') }}</th> <div class="contest-title"> {{ _('Contests') }} </div>
</tr> {{ contest_head(contest) }}
</thead> </div>
<tbody> <div class="info-contest" style="flex: 1.5">
{% for contest in future_contests %} <div class="contest-title"> {{ _('Time') }} </div>
<tr> <div class="contest-block">
<td> {% if contest.start_time %}
<div class="contest-block"> {% if contest.time_before_start %}
{{ contest_head(contest) }} <span class="time">{{ _('Starting in %(countdown)s.', countdown=contest.start_time|as_countdown) }}</span>
{% if contest.start_time %} {% endif %}
<br> {{ time_left(contest) }}
{% if contest.time_before_start %} {% endif %}
<span class="time">{{ _('Starting in %(countdown)s.', countdown=contest.start_time|as_countdown) }}</span> </div>
{% endif %} </div>
{{ time_left(contest) }} <div class="info-contest">
{% endif %} <div class="contest-title"> {{ _('Format') }} </div>
</div> {{ contest.format.name }}
</td> </div>
</tr> </div>
{% endfor %} {% endfor %}
</tbody>
</table>
</div> </div>
{% else %} {% else %}
<div class="toggled"> <div class="toggled">
@ -371,48 +367,42 @@
</h3> </h3>
{% if past_contests %} {% if past_contests %}
{% if page_obj and page_obj.num_pages > 1 %} {% if page_obj and page_obj.num_pages > 1 %}
<div style="margin-bottom: 4px;"> <div style="margin-bottom: 10px;">
{% include "list-pages.html" %} {% include "list-pages.html" %}
</div> </div>
{% endif %} {% endif %}
<table class="contest-list table striped">
<thead> {% for contest in past_contests %}
<tr> <div class="list-contest">
<th style="width:90%"> <div class="info-contest" style="flex: 1.5">
<a class="contest-list-sort" href="{{ sort_links.name }}">{{ _('Contest') }}{{ sort_order.name }}</a> <div class="contest-title"> {{ _('Contests') }} </div>
</th> {{ contest_head(contest) }}
<th> </div>
<a class="contest-list-sort" href="{{ sort_links.user_count }}">{{ _('Users') }}{{ sort_order.user_count }}</a> <div class="info-contest" style="flex: 1.5">
</th> <div class="contest-title"> {{ _('Time') }} </div>
{% if not request.in_contest %} <div class="contest-block">
<th style="width:15%"></th> {{ time_left(contest, false) }}
{% endif %} </div>
</tr> </div>
</thead> <div class="info-contest">
<tbody> <div class="contest-title"> {{ _('Format') }} </div>
{% for contest in past_contests %} {{ contest.format.name }}
<tr> </div>
<td> <div class="info-contest">
<div class="contest-block"> <div class="contest-title"> {{ _('Users') }} </div>
{{ contest_head(contest) }} {{ user_count(contest, request.user) }}
{{ time_left(contest) }} </div>
</div> {% if not request.in_contest %}
</td> <div class="participate-button">
<td> <form action="{{ url('contest_join', contest.key) }}" method="post">
{{ user_count(contest, request.user) }} {% csrf_token %}
</td> <input type="submit" class="unselectable button full small"
{% if not request.in_contest %} value="{{ _('Virtual join') }}">
<td><form action="{{ url('contest_join', contest.key) }}" method="post"> </form>
{% csrf_token %} </div>
<input type="submit" class="unselectable button full small" {% endif %}
value="{{ _('Virtual join') }}"> </div>
</form> {% endfor %}
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{% if page_obj and page_obj.num_pages > 1 %} {% if page_obj and page_obj.num_pages > 1 %}
<div style="margin-top: 10px;"> <div style="margin-top: 10px;">
{% include "list-pages.html" %} {% include "list-pages.html" %}