Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions backend/submission/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Meta:

class SubmissionListSerializer(serializers.ModelSerializer):
problem = serializers.SlugRelatedField(read_only=True, slug_field="_id")
problem_id = serializers.SerializerMethodField()
show_link = serializers.SerializerMethodField()
user_avatar = serializers.SerializerMethodField()

Expand All @@ -53,3 +54,6 @@ def get_show_link(self, obj):

def get_user_avatar(self, obj):
return obj.user_avatar

def get_problem_id(self, obj):
return obj.problem._id
16 changes: 14 additions & 2 deletions backend/submission/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ def test_get_submissions_general(self):
resp = self.client.get(f"{self.url}?limit=10")
self.assertSuccess(resp)
self.assertTrue("results" in resp.data["data"])
result = next(
sub for sub in resp.data["data"]["results"] if sub["id"] == submission.id
)
self.assertEqual(result["problem_id"], self.problem._id)

def test_get_submissions_filtered_by_problem(self):
# 문제 필터링 테스트 (일반 문제만)
Expand Down Expand Up @@ -281,10 +285,18 @@ def test_get_submissions_contest_admin_access(self):

def test_get_submissions_contest_myself(self):
# contest_id 지정, myself=1일때는 조회 성공
sub = self.create_submission(self.user, self.contest_problem, contest_id=self.contest["id"])
sub = self.create_submission(
self.user,
self.contest_problem,
contest_id=self.contest["id"],
result=JudgeStatus.ACCEPTED,
)
resp = self.client.get(f"{self.url}?limit=10&contest_id={self.contest['id']}&myself=1")
self.assertSuccess(resp)
self.assertTrue(any(s["id"] == sub.id for s in resp.data["data"]["results"]))
result = next(
s for s in resp.data["data"]["results"] if s["id"] == sub.id
)
self.assertEqual(result["problem_id"], self.contest_problem._id)

def test_get_submissions_with_problem_not_exist(self):
# problem_id 지정했으나 존재하지 않는 경우 에러 발생
Expand Down
29 changes: 16 additions & 13 deletions frontend/src/i18n/oj/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export const m = {
Tags: "태그",
Show: "Show",
Submit: "제출",
Submitting: "처리중",
Judging: "Judging",
Wrong_Answer: "Wrong Answer",
Submitting: "제출 중",
Judging: "채점 중",
Wrong_Answer: "오답",
Statistic: "Statistic",
Close: "Close",
View_Contest: "View Contest",
Expand Down Expand Up @@ -380,21 +380,24 @@ export const m = {
// SubmissionList.vue
When: "제출시각",
ID: "ID",
Time: "Time",
Time: "시간",
Memory: "메모리",
Author: "작성자",
Problem_ID: "문제 번호",
Option: "옵션",
Check: "확인",
Mine: "사용자",
Mine: "내 제출만",
Submission_Table_Author: "제출자",
Accepted: "Accepted",
Time_Limit_Exceeded: "Time Limit Exceeded",
Memory_Limit_Exceeded: "Memory Limit Exceeded",
Runtime_Error: "Runtime Error",
System_Error: "System Error",
Pending: "Pending",
Partial_Accepted: "Partial Accepted",
Compile_Error: "Compile Error",
Search_Submitter: "제출자 검색",
Accepted: "정답",
Time_Limit_Exceeded: "시간 초과",
Memory_Limit_Exceeded: "메모리 초과",
Runtime_Error: "런타임 에러",
System_Error: "시스템 에러",
Pending: "대기 중",
Partial_Accepted: "부분 정답",
Compile_Error: "컴파일 에러",
Loading: "불러오는 중...",
Rejudge: "재채점",
Rejudging: "채점중...",

Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/oj/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ export const m = {
Option: "选项",
Mine: "我的",
Search_Author: "搜索作者",
Search_Submitter: "搜索提交者",
Accepted: "答案正确",
Time_Limit_Exceeded: "运行超时",
Memory_Limit_Exceeded: "内存超限",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/oj/zh-TW.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ export const m = {
Option: "選項",
Mine: "我的",
Search_Author: "搜尋作者",
Search_Submitter: "搜尋提交者",
Accepted: "答案正確",
Time_Limit_Exceeded: "超出時間限制",
Memory_Limit_Exceeded: "超出記憶體空間限制",
Expand Down
81 changes: 77 additions & 4 deletions frontend/src/pages/oj/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
<template v-else>
<NavBar></NavBar>
</template>
<div class="content-app" :class="{ ps: isProblemSolving }">
<div
class="content-app"
:class="{ ps: isProblemSolving, 'submission-list-app': isSubmissionList }"
>
<transition name="fadeInUp" mode="out-in">
<router-view></router-view>
</transition>
</div>
<template v-if="!isProblemSolving">
<div class="footer-dummy"></div>
<div
class="footer-dummy"
:class="{ 'submission-list-footer-dummy': isSubmissionList }"
></div>
<CSEPFooter></CSEPFooter>
</template>
<BackTop></BackTop>
Expand Down Expand Up @@ -41,20 +47,47 @@ export default {
},
mounted() {
this.getWebsiteConfig()
this.syncSubmissionListChrome()
},
updated() {
this.syncSubmissionListChrome()
},
beforeDestroy() {
this.syncSubmissionListChrome(false)
},
methods: {
...mapActions(["getWebsiteConfig", "changeDomTitle"]),
syncSubmissionListChrome(force) {
const enabled =
typeof force === "boolean" ? force : this.isSubmissionList
document.documentElement.classList.toggle(
"submission-list-page",
enabled,
)
document.body.classList.toggle("submission-list-page", enabled)
},
},
computed: {
...mapState(["website"]),
...mapGetters(["isProblemSolving", "removedPopupId"]),
isSubmissionList() {
return (
this.$route.name === "submission-list" || this.$route.path === "/status"
)
},
},
watch: {
website() {
this.changeDomTitle()
},
$route() {
this.changeDomTitle()
$route: {
immediate: true,
handler() {
this.changeDomTitle()
this.$nextTick(() => {
this.syncSubmissionListChrome()
})
},
},
},
}
Expand Down Expand Up @@ -253,6 +286,46 @@ a {
background-color: var(--site-background-color);
}

.submission-list-app,
.submission-list-footer-dummy {
background-color: #ffffff;
}

.submission-list-app {
margin-top: calc(var(--header-height) + 28px);
}

html.submission-list-page,
body.submission-list-page,
html.submission-list-page #app,
html.submission-list-page #wrapper {
background-color: #ffffff;
}

html:has(.content-app.submission-list-app),
body:has(.content-app.submission-list-app) {
background-color: #ffffff;
}

html.submission-list-page {
--header-glass-bg: #ffffff;
--header-glass-border-color: #eef1f5;
--header-glass-shadow: none;
}

html.submission-list-page #header .header-menu {
padding-right: 32px;
padding-left: 32px;
}

html.submission-list-page #header .logo {
margin-left: 0;
}

html.submission-list-page #header .header-menu > .drop-menu {
padding-right: 0 !important;
}

.ps {
margin-top: 50px;
background-color: var(--bg-color);
Expand Down
Loading