From 50103712541f3ffef5747b6e7fe92edf1f174760 Mon Sep 17 00:00:00 2001 From: SOLBI1028 Date: Mon, 3 Jan 2022 19:45:02 +0900 Subject: [PATCH 001/297] Design Banner setting page for admin (publishing) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- admin page - general에 배너 이미지를 세팅할 수 있는 페이지 추가 --- .../src/pages/admin/components/SideMenu.vue | 6 ++ frontend/src/pages/admin/router.js | 7 +- .../src/pages/admin/views/general/Banner.vue | 100 ++++++++++++++++++ frontend/src/pages/admin/views/index.js | 3 +- 4 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 frontend/src/pages/admin/views/general/Banner.vue diff --git a/frontend/src/pages/admin/components/SideMenu.vue b/frontend/src/pages/admin/components/SideMenu.vue index 28322f272..44f1d5810 100644 --- a/frontend/src/pages/admin/components/SideMenu.vue +++ b/frontend/src/pages/admin/components/SideMenu.vue @@ -37,6 +37,12 @@ > Announcement + + Banner + +
+ + + + + + + +
* Banner image size: 2000 * 613
+ + + + Save +
+
+ + + + + diff --git a/frontend/src/pages/admin/views/index.js b/frontend/src/pages/admin/views/index.js index 78ee648e4..67d399c26 100644 --- a/frontend/src/pages/admin/views/index.js +++ b/frontend/src/pages/admin/views/index.js @@ -10,8 +10,9 @@ import ContestList from './contest/ContestList.vue' import Contest from './contest/Contest.vue' import Login from './general/Login.vue' import Home from './Home.vue' +import Banner from './general/Banner.vue' export { Announcement, User, Conf, JudgeServer, Problem, ProblemList, Contest, - ContestList, Login, Home, PruneTestCase, Dashboard + ContestList, Login, Home, PruneTestCase, Dashboard, Banner } From 5cf27d4b4afe4c2e1a8923f79dfd8642308f96eb Mon Sep 17 00:00:00 2001 From: SOLBI1028 Date: Mon, 3 Jan 2022 19:45:02 +0900 Subject: [PATCH 002/297] Initiate banner model --- backend/banner/__init__.py | 0 backend/banner/migrations/__init__.py | 0 backend/banner/models.py | 3 +++ backend/banner/serializers.py | 3 +++ backend/banner/tests.py | 3 +++ backend/banner/urls/__init__.py | 0 backend/banner/urls/admin.py | 7 +++++++ backend/banner/urls/oj.py | 7 +++++++ backend/banner/views.py | 3 +++ backend/oj/urls.py | 2 ++ 10 files changed, 28 insertions(+) create mode 100644 backend/banner/__init__.py create mode 100644 backend/banner/migrations/__init__.py create mode 100644 backend/banner/models.py create mode 100644 backend/banner/serializers.py create mode 100644 backend/banner/tests.py create mode 100644 backend/banner/urls/__init__.py create mode 100644 backend/banner/urls/admin.py create mode 100644 backend/banner/urls/oj.py create mode 100644 backend/banner/views.py diff --git a/backend/banner/__init__.py b/backend/banner/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/backend/banner/migrations/__init__.py b/backend/banner/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/backend/banner/models.py b/backend/banner/models.py new file mode 100644 index 000000000..71a836239 --- /dev/null +++ b/backend/banner/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/backend/banner/serializers.py b/backend/banner/serializers.py new file mode 100644 index 000000000..5a34c5934 --- /dev/null +++ b/backend/banner/serializers.py @@ -0,0 +1,3 @@ +from utils.api import UsernameSerializer, serializers + +from .models import Contest, ContestAnnouncement, ContestRuleType \ No newline at end of file diff --git a/backend/banner/tests.py b/backend/banner/tests.py new file mode 100644 index 000000000..7ce503c2d --- /dev/null +++ b/backend/banner/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/backend/banner/urls/__init__.py b/backend/banner/urls/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/backend/banner/urls/admin.py b/backend/banner/urls/admin.py new file mode 100644 index 000000000..0a22faa6a --- /dev/null +++ b/backend/banner/urls/admin.py @@ -0,0 +1,7 @@ +from django.urls import path + +from ..views.admin import ContestAnnouncementAPI, ContestAPI, DownloadContestSubmissions + +urlpatterns = [ + path("banner/", BannerAPI.as_view(), name="banner_admin_api"), +] \ No newline at end of file diff --git a/backend/banner/urls/oj.py b/backend/banner/urls/oj.py new file mode 100644 index 000000000..e3b3aaafb --- /dev/null +++ b/backend/banner/urls/oj.py @@ -0,0 +1,7 @@ +from django.urls import path + +from ..views.oj import ContestAnnouncementListAPI + +urlpatterns = [ + path("banner/", BannerAPI.as_view(), name="banner_api"), +] diff --git a/backend/banner/views.py b/backend/banner/views.py new file mode 100644 index 000000000..91ea44a21 --- /dev/null +++ b/backend/banner/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/backend/oj/urls.py b/backend/oj/urls.py index f8a59f887..cc0662dda 100644 --- a/backend/oj/urls.py +++ b/backend/oj/urls.py @@ -14,4 +14,6 @@ path("api/admin/", include("contest.urls.admin")), path("api/", include("submission.urls")), path("api/admin/", include("utils.urls")), + path("api/", include("banner.urls")), + path("api/admin/", include("banner.urls")), ] From 41a36433b1e10fed9f8abb4acbd53bd967a11bdb Mon Sep 17 00:00:00 2001 From: SOLBI1028 Date: Mon, 3 Jan 2022 19:45:02 +0900 Subject: [PATCH 003/297] Add bannerAPI --- backend/banner/migrations/0001_initial.py | 28 ++++++++ backend/banner/models.py | 11 ++- backend/banner/serializers.py | 25 ++++++- backend/banner/tests.py | 3 - backend/banner/urls/admin.py | 6 +- backend/banner/urls/oj.py | 4 +- backend/banner/views.py | 3 - backend/banner/views/__init__.py | 0 backend/banner/views/admin.py | 88 +++++++++++++++++++++++ backend/banner/views/oj.py | 18 +++++ backend/oj/settings.py | 1 + backend/oj/urls.py | 4 +- backend/utils/views.py | 5 +- 13 files changed, 178 insertions(+), 18 deletions(-) create mode 100644 backend/banner/migrations/0001_initial.py delete mode 100644 backend/banner/views.py create mode 100644 backend/banner/views/__init__.py create mode 100644 backend/banner/views/admin.py create mode 100644 backend/banner/views/oj.py diff --git a/backend/banner/migrations/0001_initial.py b/backend/banner/migrations/0001_initial.py new file mode 100644 index 000000000..761fa2898 --- /dev/null +++ b/backend/banner/migrations/0001_initial.py @@ -0,0 +1,28 @@ +# Generated by Django 3.2.9 on 2022-01-01 10:15 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Banner', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.TextField()), + ('create_time', models.DateTimeField(auto_now_add=True)), + ('path', models.TextField()), + ('visible', models.BooleanField(default=False)), + ], + options={ + 'db_table': 'banner', + 'ordering': ('-create_time',), + }, + ), + ] diff --git a/backend/banner/models.py b/backend/banner/models.py index 71a836239..6307049a6 100644 --- a/backend/banner/models.py +++ b/backend/banner/models.py @@ -1,3 +1,12 @@ from django.db import models -# Create your models here. + +class Banner(models.Model): + title = models.TextField() + create_time = models.DateTimeField(auto_now_add=True) + path = models.TextField() + visible = models.BooleanField(default=False) + + class Meta: + db_table = "banner" + ordering = ("-create_time",) diff --git a/backend/banner/serializers.py b/backend/banner/serializers.py index 5a34c5934..291e41c43 100644 --- a/backend/banner/serializers.py +++ b/backend/banner/serializers.py @@ -1,3 +1,24 @@ -from utils.api import UsernameSerializer, serializers +from utils.api import serializers -from .models import Contest, ContestAnnouncement, ContestRuleType \ No newline at end of file +from .models import Banner + + +class BannerSerializer(serializers.Serializer): + path = serializers.CharField(max_length=1024) + + +class BannerAdminSerializer(serializers.ModelSerializer): + class Meta: + model = Banner + fields = "__all__" + + +class CreateBannerSerializer(serializers.Serializer): + title = serializers.CharField(max_length=64) + path = serializers.CharField(max_length=1024) + + +class EditBannerSerializer(serializers.Serializer): + id = serializers.IntegerField() + path = serializers.CharField() + visible = serializers.BooleanField() diff --git a/backend/banner/tests.py b/backend/banner/tests.py index 7ce503c2d..e69de29bb 100644 --- a/backend/banner/tests.py +++ b/backend/banner/tests.py @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/backend/banner/urls/admin.py b/backend/banner/urls/admin.py index 0a22faa6a..47419b851 100644 --- a/backend/banner/urls/admin.py +++ b/backend/banner/urls/admin.py @@ -1,7 +1,7 @@ from django.urls import path -from ..views.admin import ContestAnnouncementAPI, ContestAPI, DownloadContestSubmissions +from ..views.admin import BannerAdminAPI urlpatterns = [ - path("banner/", BannerAPI.as_view(), name="banner_admin_api"), -] \ No newline at end of file + path("banner/", BannerAdminAPI.as_view(), name="banner_admin_api") +] diff --git a/backend/banner/urls/oj.py b/backend/banner/urls/oj.py index e3b3aaafb..985764cf3 100644 --- a/backend/banner/urls/oj.py +++ b/backend/banner/urls/oj.py @@ -1,7 +1,7 @@ from django.urls import path -from ..views.oj import ContestAnnouncementListAPI +from ..views.oj import BannerAPI urlpatterns = [ - path("banner/", BannerAPI.as_view(), name="banner_api"), + path("banner/", BannerAPI.as_view(), name="banner_api") ] diff --git a/backend/banner/views.py b/backend/banner/views.py deleted file mode 100644 index 91ea44a21..000000000 --- a/backend/banner/views.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.shortcuts import render - -# Create your views here. diff --git a/backend/banner/views/__init__.py b/backend/banner/views/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/backend/banner/views/admin.py b/backend/banner/views/admin.py new file mode 100644 index 000000000..39fada3e6 --- /dev/null +++ b/backend/banner/views/admin.py @@ -0,0 +1,88 @@ +from drf_yasg.utils import swagger_auto_schema +from drf_yasg import openapi + +from banner.models import Banner +from banner.serializers import (BannerAdminSerializer, CreateBannerSerializer, EditBannerSerializer) +from utils.api import APIView, validate_serializer +from utils.decorators import super_admin_required +from utils.shortcuts import check_is_id + + +class BannerAdminAPI(APIView): + @swagger_auto_schema( + manual_parameters=[ + openapi.Parameter( + name="id", in_=openapi.IN_QUERY, + type=openapi.TYPE_INTEGER, + description="unique banner id", + ) + ], + operation_description="Get Banner image" + ) + @validate_serializer(BannerAdminSerializer) + @super_admin_required + def get(self, request): + banner_id = request.GET.get("id") + # get single banner image + if banner_id: + if not id or not check_is_id(id): + return self.error("Invalid parameter, id is required") + try: + banner = Banner.objects.get(id=banner_id) + return self.success(BannerAdminSerializer(banner).data) + except Banner.DoesNotExist: + return self.error("Banner does not exist") + # get all banner images + else: + banners = Banner.objects.all() + return self.success(BannerAdminSerializer(banners).data) + + @swagger_auto_schema( + request_body=CreateBannerSerializer, + operation_description="Create new Banner image", + responses={200: BannerAdminSerializer}, + ) + @validate_serializer(CreateBannerSerializer) + @super_admin_required + def post(self, request): + data = request.data + banner = Banner.objects.create(title=data["title"], + path=data["path"]) + return self.success(BannerAdminSerializer(banner).data) + + @swagger_auto_schema( + request_body=EditBannerSerializer, + operation_description="Edit Banner image" + ) + @validate_serializer(EditBannerSerializer) + @super_admin_required + def put(self, request): + data = request.data + try: + banner = Banner.objects.get(id=data.pop("id")) + except Banner.DoesNotExist: + return self.error("Banner does not exist") + + for k, v in data.items(): + setattr(banner, k, v) + banner.save() + + return self.success(BannerAdminSerializer(banner).data) + + @swagger_auto_schema( + manual_parameters=[ + openapi.Parameter( + name="id", in_=openapi.IN_QUERY, + type=openapi.TYPE_INTEGER, + description="unique banner id", + ), + ], + operation_description="Delete Banner Image" + ) + @super_admin_required + def delete(self, request): + id = request.GET.get("id") + if not id: + return self.error("Invalid Parameter, id is required") + Banner.objects.filter(id__in=id).delete() + return self.success() diff --git a/backend/banner/views/oj.py b/backend/banner/views/oj.py new file mode 100644 index 000000000..29267d2b0 --- /dev/null +++ b/backend/banner/views/oj.py @@ -0,0 +1,18 @@ +from drf_yasg.utils import swagger_auto_schema + +from banner.models import Banner +from banner.serializers import BannerSerializer +from utils.api import APIView, validate_serializer + + +class BannerAPI(APIView): + @swagger_auto_schema( + manual_parameters=[], + operation_description="Get Banner Image List" + ) + @validate_serializer(BannerSerializer) + def get(self, request): + banners = Banner.objects.filter(visible=True) + data = {} + data["path"] = BannerSerializer(banners, many=True).data + return self.success(data) diff --git a/backend/oj/settings.py b/backend/oj/settings.py index 13c1785c0..e42381cd6 100644 --- a/backend/oj/settings.py +++ b/backend/oj/settings.py @@ -39,6 +39,7 @@ LOCAL_APPS = [ 'account', 'announcement', + 'banner', 'conf', 'problem', 'contest', diff --git a/backend/oj/urls.py b/backend/oj/urls.py index cc0662dda..bf1b9b7e3 100644 --- a/backend/oj/urls.py +++ b/backend/oj/urls.py @@ -14,6 +14,6 @@ path("api/admin/", include("contest.urls.admin")), path("api/", include("submission.urls")), path("api/admin/", include("utils.urls")), - path("api/", include("banner.urls")), - path("api/admin/", include("banner.urls")), + path("api/", include("banner.urls.oj")), + path("api/admin/", include("banner.urls.admin")), ] diff --git a/backend/utils/views.py b/backend/utils/views.py index e6eee42e5..371aeaac1 100644 --- a/backend/utils/views.py +++ b/backend/utils/views.py @@ -40,7 +40,8 @@ def post(self, request): except IOError as e: logger.error(e) return self.error("Upload Error") - return self.success({"file_path": f"{settings.UPLOAD_PREFIX}/{img_name}"}) + return self.success({"file_path": f"{settings.UPLOAD_PREFIX}/{img_name}", + "img_name": img_name}) class SimditorFileUploadAPIView(CSRFExemptAPIView): @@ -72,4 +73,4 @@ def post(self, request): return self.success({ "file_path": f"{settings.UPLOAD_PREFIX}/{file_name}", "file_name": file.name - }) + }) From 943c2de5b8f41d6dd6c3b3b5badfa43a64cebb80 Mon Sep 17 00:00:00 2001 From: SOLBI1028 Date: Mon, 3 Jan 2022 21:25:29 +0900 Subject: [PATCH 004/297] Fix server error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - validate serializer 삭제 및 오타 수정 --- backend/banner/views/admin.py | 19 +++++++++---------- backend/banner/views/oj.py | 3 +-- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/backend/banner/views/admin.py b/backend/banner/views/admin.py index 39fada3e6..f971128ad 100644 --- a/backend/banner/views/admin.py +++ b/backend/banner/views/admin.py @@ -5,7 +5,6 @@ from banner.serializers import (BannerAdminSerializer, CreateBannerSerializer, EditBannerSerializer) from utils.api import APIView, validate_serializer from utils.decorators import super_admin_required -from utils.shortcuts import check_is_id class BannerAdminAPI(APIView): @@ -19,14 +18,11 @@ class BannerAdminAPI(APIView): ], operation_description="Get Banner image" ) - @validate_serializer(BannerAdminSerializer) @super_admin_required def get(self, request): banner_id = request.GET.get("id") # get single banner image if banner_id: - if not id or not check_is_id(id): - return self.error("Invalid parameter, id is required") try: banner = Banner.objects.get(id=banner_id) return self.success(BannerAdminSerializer(banner).data) @@ -35,7 +31,7 @@ def get(self, request): # get all banner images else: banners = Banner.objects.all() - return self.success(BannerAdminSerializer(banners).data) + return self.success(BannerAdminSerializer(banners, many=True).data) @swagger_auto_schema( request_body=CreateBannerSerializer, @@ -81,8 +77,11 @@ def put(self, request): ) @super_admin_required def delete(self, request): - id = request.GET.get("id") - if not id: - return self.error("Invalid Parameter, id is required") - Banner.objects.filter(id__in=id).delete() - return self.success() + banner_id = request.GET.get("id") + if not banner_id: + return self.error("Invalid parameter, id is required") + try: + Banner.objects.filter(id=request.GET["id"]).delete() + return self.success() + except Banner.DoesNotExist: + return self.error("Banner does not exist") diff --git a/backend/banner/views/oj.py b/backend/banner/views/oj.py index 29267d2b0..e01c3f135 100644 --- a/backend/banner/views/oj.py +++ b/backend/banner/views/oj.py @@ -2,7 +2,7 @@ from banner.models import Banner from banner.serializers import BannerSerializer -from utils.api import APIView, validate_serializer +from utils.api import APIView class BannerAPI(APIView): @@ -10,7 +10,6 @@ class BannerAPI(APIView): manual_parameters=[], operation_description="Get Banner Image List" ) - @validate_serializer(BannerSerializer) def get(self, request): banners = Banner.objects.filter(visible=True) data = {} From 8b3f93894806a46adf7d8289a43710886947d63d Mon Sep 17 00:00:00 2001 From: SOLBI1028 Date: Mon, 3 Jan 2022 21:26:36 +0900 Subject: [PATCH 005/297] Implement banner page --- frontend/src/pages/admin/api.js | 20 +++ .../src/pages/admin/views/general/Banner.vue | 135 +++++++++++------- frontend/src/pages/oj/api.js | 3 + frontend/src/pages/oj/components/Banner.vue | 19 ++- 4 files changed, 119 insertions(+), 58 deletions(-) diff --git a/frontend/src/pages/admin/api.js b/frontend/src/pages/admin/api.js index fe3d7059e..3dcacd8cd 100644 --- a/frontend/src/pages/admin/api.js +++ b/frontend/src/pages/admin/api.js @@ -97,6 +97,26 @@ export default { data }) }, + getBannerImage (id) { + return ajax('admin/banner/', 'get', { + params: { + id + } + }) + }, + createBannerImage (data) { + return ajax('admin/banner/', 'post', { data }) + }, + editBannerImage (data) { + return ajax('admin/banner/', 'put', { data }) + }, + deleteBannerImage (id) { + return ajax('admin/banner/', 'delete', { + params: { + id + } + }) + }, getLanguages () { return ajax('languages/', 'get') }, diff --git a/frontend/src/pages/admin/views/general/Banner.vue b/frontend/src/pages/admin/views/general/Banner.vue index c51e51447..9f0773868 100644 --- a/frontend/src/pages/admin/views/general/Banner.vue +++ b/frontend/src/pages/admin/views/general/Banner.vue @@ -1,100 +1,131 @@ diff --git a/frontend/src/pages/oj/api.js b/frontend/src/pages/oj/api.js index a74f161c6..cc411b1bd 100644 --- a/frontend/src/pages/oj/api.js +++ b/frontend/src/pages/oj/api.js @@ -250,6 +250,9 @@ export default { return ajax('submission/', 'put', { data }) + }, + getBannerImage () { + return ajax('banner/', 'get') } } diff --git a/frontend/src/pages/oj/components/Banner.vue b/frontend/src/pages/oj/components/Banner.vue index c414ad931..e57df347a 100644 --- a/frontend/src/pages/oj/components/Banner.vue +++ b/frontend/src/pages/oj/components/Banner.vue @@ -6,23 +6,30 @@ @sliding-start="onSlideStart" @sliding-end="onSlideEnd" > - - - - - + + + diff --git a/frontend/src/pages/oj/views/contest/ContestDetail.vue b/frontend/src/pages/oj/views/contest/ContestDetail.vue index ae073e5fa..b72e2c940 100644 --- a/frontend/src/pages/oj/views/contest/ContestDetail.vue +++ b/frontend/src/pages/oj/views/contest/ContestDetail.vue @@ -26,6 +26,9 @@ + + + @@ -40,13 +43,15 @@ import { CONTEST_STATUS_REVERSE } from '@/utils/constants' import StatusBadge from '../../components/StatusBadge.vue' import ContestProblemList from './ContestProblemList.vue' import ContestRanking from './ContestRanking.vue' +import ContestClarification from './ContestClarification.vue' export default { name: 'ContestDetail', components: { StatusBadge, ContestProblemList, - ContestRanking + ContestRanking, + ContestClarification }, data () { return { From 15481a4e54f9d44e8833ad26d28aec86aa8db74c Mon Sep 17 00:00:00 2001 From: DailyLinux Date: Tue, 4 Jan 2022 17:08:46 +0900 Subject: [PATCH 017/297] Get Contest Problems to get Clarifications. --- .../pages/oj/views/contest/ContestClarification.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/src/pages/oj/views/contest/ContestClarification.vue b/frontend/src/pages/oj/views/contest/ContestClarification.vue index 2885f51db..dab3cf6f8 100644 --- a/frontend/src/pages/oj/views/contest/ContestClarification.vue +++ b/frontend/src/pages/oj/views/contest/ContestClarification.vue @@ -45,6 +45,7 @@ export default { total: 0, perPage: 10, currentPage: 1, + contestProblems: [], clarifications: [], contestClarificationFields: [ 'Problem', @@ -57,8 +58,17 @@ export default { } }, async mounted () { + await this.getContestProblems() }, methods: { + async getContestProblems () { + try { + const res = await this.$store.dispatch('getContestProblems') + const data = res.data.data + this.contestProblems = data + } catch (err) { + } + }, async getContestAnnouncementList () { const result = await api.getContestAnnouncementList(this.contestID) const data = result.data.data From f0ed3eb49614f3aa325e8ff1f853890c5af0f207 Mon Sep 17 00:00:00 2001 From: DailyLinux Date: Tue, 4 Jan 2022 17:43:24 +0900 Subject: [PATCH 018/297] Fixed API working in getContestAnnouncementList() --- frontend/src/pages/oj/views/contest/ContestClarification.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/pages/oj/views/contest/ContestClarification.vue b/frontend/src/pages/oj/views/contest/ContestClarification.vue index dab3cf6f8..c34ac3af6 100644 --- a/frontend/src/pages/oj/views/contest/ContestClarification.vue +++ b/frontend/src/pages/oj/views/contest/ContestClarification.vue @@ -45,6 +45,7 @@ export default { total: 0, perPage: 10, currentPage: 1, + contestID: '', contestProblems: [], clarifications: [], contestClarificationFields: [ @@ -58,7 +59,9 @@ export default { } }, async mounted () { + this.contestID = this.$route.params.contestID await this.getContestProblems() + await this.getContestAnnouncementList() }, methods: { async getContestProblems () { From a5c650da83ef587463261a01856d592dce967463 Mon Sep 17 00:00:00 2001 From: DailyLinux Date: Tue, 4 Jan 2022 19:16:12 +0900 Subject: [PATCH 019/297] Fix typo --- frontend/src/pages/oj/views/contest/ContestDetail.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/oj/views/contest/ContestDetail.vue b/frontend/src/pages/oj/views/contest/ContestDetail.vue index b72e2c940..ddd64ad84 100644 --- a/frontend/src/pages/oj/views/contest/ContestDetail.vue +++ b/frontend/src/pages/oj/views/contest/ContestDetail.vue @@ -26,7 +26,7 @@ - + From 824a24e9b5ba7e54b32d284114ab2d6803132c23 Mon Sep 17 00:00:00 2001 From: Jimin Ha Date: Fri, 7 Jan 2022 23:18:25 +0900 Subject: [PATCH 020/297] Fix: Change dependency of migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - problem을 ForeignKey로 가지는데 버그로 인해 problem __first__가 dependency로 잡히지 않아 수동으로 수정 --- .../contest/migrations/0013_contestannouncement_problem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/contest/migrations/0013_contestannouncement_problem.py b/backend/contest/migrations/0013_contestannouncement_problem.py index 8a2864d07..46c70a06d 100644 --- a/backend/contest/migrations/0013_contestannouncement_problem.py +++ b/backend/contest/migrations/0013_contestannouncement_problem.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.4 on 2021-12-30 14:08 +# Generated by Django 3.2.10 on 2022-01-07 14:16 from django.db import migrations, models import django.db.models.deletion @@ -7,7 +7,7 @@ class Migration(migrations.Migration): dependencies = [ - ('problem', '0015_auto_20211030_1535'), + ('problem', '__first__'), ('contest', '0012_rename_total_score_acmcontestrank_total_penalty'), ] From 476ede35847b8cdf8725aa887d7ad8fb12c04170 Mon Sep 17 00:00:00 2001 From: Jimin Ha Date: Sat, 8 Jan 2022 00:39:13 +0900 Subject: [PATCH 021/297] Add problem_id field in contest_announcement test --- backend/contest/tests.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/backend/contest/tests.py b/backend/contest/tests.py index 26a9bd28b..c7f5a2e86 100644 --- a/backend/contest/tests.py +++ b/backend/contest/tests.py @@ -7,6 +7,20 @@ from .models import ContestAnnouncement, ContestRuleType, Contest +from problem.models import ProblemIOMode + +DEFAULT_PROBLEM_DATA = {"_id": "A-110", "title": "test", "description": "

test

", "input_description": "test", + "output_description": "test", "time_limit": 1000, "memory_limit": 256, "difficulty": "Level1", + "visible": True, "tags": ["test"], "languages": ["C", "C++", "Java", "Python2"], "template": {}, + "samples": [{"input": "test", "output": "test"}], "spj": False, "spj_language": "C", + "spj_code": "", "spj_compile_ok": True, "test_case_id": "499b26290cc7994e0b497212e842ea85", + "test_case_score": [{"output_name": "1.out", "input_name": "1.in", "output_size": 0, + "stripped_output_md5": "d41d8cd98f00b204e9800998ecf8427e", + "input_size": 0, "score": 0}], + "io_mode": {"io_mode": ProblemIOMode.standard, "input": "input.txt", "output": "output.txt"}, + "share_submission": False, + "rule_type": "ACM", "hint": "

test

", "source": "test"} + DEFAULT_CONTEST_DATA = {"title": "test title", "description": "test description", "start_time": timezone.localtime(timezone.now()), "end_time": timezone.localtime(timezone.now()) + timedelta(days=1), @@ -103,7 +117,12 @@ def setUp(self): self.create_super_admin() self.url = self.reverse("contest_announcement_admin_api") contest_id = self.create_contest().data["data"]["id"] - self.data = {"title": "test title", "content": "test content", "contest_id": contest_id, "visible": True} + url = self.reverse("contest_problem_admin_api") + data = copy.deepcopy(DEFAULT_PROBLEM_DATA) + data["contest_id"] = contest_id + self.problem = self.client.post(url, data=data).data["data"] + problem_id = self.problem["id"] + self.data = {"title": "test title", "content": "test content", "contest_id": contest_id, "visible": True, "problem_id": problem_id} def create_contest(self): url = self.reverse("contest_admin_api") @@ -140,8 +159,8 @@ def setUp(self): def create_contest_announcements(self): contest_id = self.client.post(self.reverse("contest_admin_api"), data=DEFAULT_CONTEST_DATA).data["data"]["id"] url = self.reverse("contest_announcement_admin_api") - self.client.post(url, data={"title": "test title1", "content": "test content1", "contest_id": contest_id}) - self.client.post(url, data={"title": "test title2", "content": "test content2", "contest_id": contest_id}) + self.client.post(url, data={"title": "test title1", "content": "test content1", "contest_id": contest_id, "problem_id": "1"}) + self.client.post(url, data={"title": "test title2", "content": "test content2", "contest_id": contest_id, "problem_id": "1"}) return contest_id def test_get_contest_announcement_list(self): From 9e1fc0672b6368daece5d83466a5db1602cd002b Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Wed, 12 Jan 2022 06:39:31 +0000 Subject: [PATCH 022/297] fix: upgrade papaparse from 5.3.0 to 5.3.1 Snyk has created this PR to upgrade papaparse from 5.3.0 to 5.3.1. See this package in npm: See this project in Snyk: https://app.snyk.io/org/dotoleeoak/project/6c5249a3-a958-4fdb-937f-aedffbfc44fa?utm_source=github&utm_medium=referral&page=upgrade-pr --- frontend/package.json | 2 +- frontend/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index ac7b53b15..f4e1d4dcf 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -21,7 +21,7 @@ "iview": "2", "katex": "^0.15.1", "moment": "^2.29.1", - "papaparse": "^5.3.0", + "papaparse": "^5.3.1", "turndown": "^7.0.0", "vue": "^2.6.14", "vue-clipboard2": "^0.3.1", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 83d425e71..ffc9626b3 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -6787,10 +6787,10 @@ pako@~1.0.5: resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== -papaparse@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/papaparse/-/papaparse-5.3.0.tgz#ab1702feb96e79ab4309652f36db9536563ad05a" - integrity sha512-Lb7jN/4bTpiuGPrYy4tkKoUS8sTki8zacB5ke1p5zolhcSE4TlWgrlsxjrDTbG/dFVh07ck7X36hUf/b5V68pg== +papaparse@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/papaparse/-/papaparse-5.3.1.tgz#770b7a9124d821d4b2132132b7bd7dce7194b5b1" + integrity sha512-Dbt2yjLJrCwH2sRqKFFJaN5XgIASO9YOFeFP8rIBRG2Ain8mqk5r1M6DkfvqEVozVcz3r3HaUGw253hA1nLIcA== parallel-transform@^1.1.0: version "1.2.0" From 5eec66b5eb1a5da4123a8d9eed41c84806c3b604 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Wed, 12 Jan 2022 06:39:34 +0000 Subject: [PATCH 023/297] fix: upgrade vue-dompurify-html from 2.3.0 to 2.4.0 Snyk has created this PR to upgrade vue-dompurify-html from 2.3.0 to 2.4.0. See this package in npm: See this project in Snyk: https://app.snyk.io/org/dotoleeoak/project/6c5249a3-a958-4fdb-937f-aedffbfc44fa?utm_source=github&utm_medium=referral&page=upgrade-pr --- frontend/package.json | 2 +- frontend/yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index f4e1d4dcf..51ec129e5 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -26,7 +26,7 @@ "vue": "^2.6.14", "vue-clipboard2": "^0.3.1", "vue-codemirror-lite": "^1.0.4", - "vue-dompurify-html": "^2.3.0", + "vue-dompurify-html": "^2.4.0", "vue-katex": "^0.5.0", "vue-router": "^3.2.0", "vue-simple-alert": "^1.1.1", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index ffc9626b3..b7b221748 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -3716,10 +3716,10 @@ domino@^2.1.6: resolved "https://registry.yarnpkg.com/domino/-/domino-2.1.6.tgz#fe4ace4310526e5e7b9d12c7de01b7f485a57ffe" integrity sha512-3VdM/SXBZX2omc9JF9nOPCtDaYQ67BGp5CoLpIQlO2KCAPETs8TcDHacF26jXadGbvUteZzRTeos2fhID5+ucQ== -dompurify@^2.0.0: - version "2.2.9" - resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.2.9.tgz#4b42e244238032d9286a0d2c87b51313581d9624" - integrity sha512-+9MqacuigMIZ+1+EwoEltogyWGFTJZWU3258Rupxs+2CGs4H914G9er6pZbsme/bvb5L67o2rade9n21e4RW/w== +dompurify@^2.3.4: + version "2.3.4" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-2.3.4.tgz#1cf5cf0105ccb4debdf6db162525bd41e6ddacc6" + integrity sha512-6BVcgOAVFXjI0JTjEvZy901Rghm+7fDQOrNIcxB4+gdhj6Kwp6T9VBhBY/AbagKHJocRkDYGd6wvI+p4/10xtQ== domutils@^1.5.1, domutils@^1.7.0: version "1.7.0" @@ -9233,12 +9233,12 @@ vue-codemirror-lite@^1.0.4: dependencies: codemirror "^5.22.0" -vue-dompurify-html@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/vue-dompurify-html/-/vue-dompurify-html-2.3.0.tgz#b175edda57362cf7b03d2864468fa644e05a2ad0" - integrity sha512-Iz9wI4iiJF+rzC2x3r8quw/VXrkwgMsWXt9p0Le4wXtolBXwMDJOmK3QNMiNg36bzU2b0f3En/wjidoeRVNZ7A== +vue-dompurify-html@^2.4.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/vue-dompurify-html/-/vue-dompurify-html-2.5.0.tgz#635a266e6802e413c520bccd628d9a28c42ad0cd" + integrity sha512-k2ejMJmsCsREGtJFDXNwqMvvek447id5ZAOU10jm2+cmsZHXgFIEdlwDam4cU4wh0iOZM+uDmkwbVJAJtmgeVQ== dependencies: - dompurify "^2.0.0" + dompurify "^2.3.4" vue-eslint-parser@^7.10.0: version "7.11.0" From 4493cdec8fee1bb731c533b74fde1b6ed4bf5d33 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Wed, 12 Jan 2022 06:39:26 +0000 Subject: [PATCH 024/297] fix: upgrade vue-router from 3.5.1 to 3.5.3 Snyk has created this PR to upgrade vue-router from 3.5.1 to 3.5.3. See this package in npm: See this project in Snyk: https://app.snyk.io/org/dotoleeoak/project/6c5249a3-a958-4fdb-937f-aedffbfc44fa?utm_source=github&utm_medium=referral&page=upgrade-pr --- frontend/package.json | 2 +- frontend/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 51ec129e5..56a1d5e49 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -28,7 +28,7 @@ "vue-codemirror-lite": "^1.0.4", "vue-dompurify-html": "^2.4.0", "vue-katex": "^0.5.0", - "vue-router": "^3.2.0", + "vue-router": "^3.5.3", "vue-simple-alert": "^1.1.1", "vuex": "^3.4.0", "vuex-router-sync": "^5.0.0" diff --git a/frontend/yarn.lock b/frontend/yarn.lock index b7b221748..9caddc529 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -9290,10 +9290,10 @@ vue-loader@^15.7.0, vue-loader@^15.9.2: vue-hot-reload-api "^2.3.0" vue-style-loader "^4.1.0" -vue-router@^3.2.0: - version "3.5.1" - resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.5.1.tgz#edf3cf4907952d1e0583e079237220c5ff6eb6c9" - integrity sha512-RRQNLT8Mzr8z7eL4p7BtKvRaTSGdCbTy2+Mm5HTJvLGYSSeG9gDzNasJPP/yOYKLy+/cLG/ftrqq5fvkFwBJEw== +vue-router@^3.5.3: + version "3.5.3" + resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.5.3.tgz#041048053e336829d05dafacf6a8fb669a2e7999" + integrity sha512-FUlILrW3DGitS2h+Xaw8aRNvGTwtuaxrRkNSHWTizOfLUie7wuYwezeZ50iflRn8YPV5kxmU2LQuu3nM/b3Zsg== vue-simple-alert@^1.1.1: version "1.1.1" From 6997bdad997c502ca0a69f50b67f770e2dcf9d04 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Wed, 12 Jan 2022 06:39:19 +0000 Subject: [PATCH 025/297] fix: upgrade vue-clipboard2 from 0.3.1 to 0.3.3 Snyk has created this PR to upgrade vue-clipboard2 from 0.3.1 to 0.3.3. See this package in npm: See this project in Snyk: https://app.snyk.io/org/dotoleeoak/project/6c5249a3-a958-4fdb-937f-aedffbfc44fa?utm_source=github&utm_medium=referral&page=upgrade-pr --- frontend/package.json | 2 +- frontend/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 56a1d5e49..346c46cb2 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -24,7 +24,7 @@ "papaparse": "^5.3.1", "turndown": "^7.0.0", "vue": "^2.6.14", - "vue-clipboard2": "^0.3.1", + "vue-clipboard2": "^0.3.3", "vue-codemirror-lite": "^1.0.4", "vue-dompurify-html": "^2.4.0", "vue-katex": "^0.5.0", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 9caddc529..8ec0fb8e1 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -9219,10 +9219,10 @@ vue-cli-plugin-dll@~1.1.12: mini-css-extract-plugin "^0.5.0" vue-loader "^15.7.0" -vue-clipboard2@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/vue-clipboard2/-/vue-clipboard2-0.3.1.tgz#6e551fb7bd384889b28b0da3b12289ed6bca4894" - integrity sha512-H5S/agEDj0kXjUb5GP2c0hCzIXWRBygaWLN3NEFsaI9I3uWin778SFEMt8QRXiPG+7anyjqWiw2lqcxWUSfkYg== +vue-clipboard2@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/vue-clipboard2/-/vue-clipboard2-0.3.3.tgz#331fec85f9d4f175eb0d4feaef4d77338562af36" + integrity sha512-aNWXIL2DKgJyY/1OOeITwAQz1fHaCIGvUFHf9h8UcoQBG5a74MkdhS/xqoYe7DNZdQmZRL+TAdIbtUs9OyVjbw== dependencies: clipboard "^2.0.0" From 9f7016138c0cbfe0bed9ff3ba4cdae6bfdcabeca Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Wed, 12 Jan 2022 06:39:15 +0000 Subject: [PATCH 026/297] fix: upgrade turndown from 7.0.0 to 7.1.1 Snyk has created this PR to upgrade turndown from 7.0.0 to 7.1.1. See this package in npm: See this project in Snyk: https://app.snyk.io/org/dotoleeoak/project/6c5249a3-a958-4fdb-937f-aedffbfc44fa?utm_source=github&utm_medium=referral&page=upgrade-pr --- frontend/package.json | 2 +- frontend/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 346c46cb2..22bee8c52 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -22,7 +22,7 @@ "katex": "^0.15.1", "moment": "^2.29.1", "papaparse": "^5.3.1", - "turndown": "^7.0.0", + "turndown": "^7.1.1", "vue": "^2.6.14", "vue-clipboard2": "^0.3.3", "vue-codemirror-lite": "^1.0.4", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 8ec0fb8e1..2785c3c55 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -8927,10 +8927,10 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" -turndown@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/turndown/-/turndown-7.0.0.tgz#19b2a6a2d1d700387a1e07665414e4af4fec5225" - integrity sha512-G1FfxfR0mUNMeGjszLYl3kxtopC4O9DRRiMlMDDVHvU1jaBkGFg4qxIyjIk2aiKLHyDyZvZyu4qBO2guuYBy3Q== +turndown@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/turndown/-/turndown-7.1.1.tgz#96992f2d9b40a1a03d3ea61ad31b5a5c751ef77f" + integrity sha512-BEkXaWH7Wh7e9bd2QumhfAXk5g34+6QUmmWx+0q6ThaVOLuLUqsnkq35HQ5SBHSaxjSfSM7US5o4lhJNH7B9MA== dependencies: domino "^2.1.6" From 55a0c2c5f568ee04a9ed36e9a9e8acac53a5a9bf Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Wed, 12 Jan 2022 06:36:32 +0000 Subject: [PATCH 027/297] fix: Dockerfile to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-ALPINE313-APKTOOLS-1533754 - https://snyk.io/vuln/SNYK-ALPINE313-OPENSSL-1569446 - https://snyk.io/vuln/SNYK-ALPINE313-OPENSSL-1569446 - https://snyk.io/vuln/SNYK-ALPINE313-OPENSSL-1569448 - https://snyk.io/vuln/SNYK-ALPINE313-OPENSSL-1569448 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2283c0125..1d9b62424 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN yarn install && \ yarn build # Deploy Stage -FROM python:3.8.10-alpine3.13 +FROM python:3.8.12-alpine3.15 ENV OJ_ENV production ENV NODE_ENV production From 6e304b09dc51f2d5682ef869c5f3ba5394374cad Mon Sep 17 00:00:00 2001 From: SOLBI1028 Date: Wed, 12 Jan 2022 22:16:46 +0900 Subject: [PATCH 028/297] Initiate lecture oj page --- frontend/src/pages/oj/components/Header.vue | 3 ++ frontend/src/pages/oj/router/routes.js | 44 ++++++++++++++++- frontend/src/pages/oj/views/index.js | 9 +++- .../views/lecture/LectureAssignmentDetail.vue | 28 +++++++++++ .../views/lecture/LectureAssignmentList.vue | 28 +++++++++++ .../oj/views/lecture/LectureDashboard.vue | 28 +++++++++++ .../pages/oj/views/lecture/LectureList.vue | 48 +++++++++++++++++++ .../src/pages/oj/views/lecture/LectureQnA.vue | 28 +++++++++++ .../oj/views/lecture/LectureQnADetail.vue | 28 +++++++++++ 9 files changed, 242 insertions(+), 2 deletions(-) create mode 100644 frontend/src/pages/oj/views/lecture/LectureAssignmentDetail.vue create mode 100644 frontend/src/pages/oj/views/lecture/LectureAssignmentList.vue create mode 100644 frontend/src/pages/oj/views/lecture/LectureDashboard.vue create mode 100644 frontend/src/pages/oj/views/lecture/LectureList.vue create mode 100644 frontend/src/pages/oj/views/lecture/LectureQnA.vue create mode 100644 frontend/src/pages/oj/views/lecture/LectureQnADetail.vue diff --git a/frontend/src/pages/oj/components/Header.vue b/frontend/src/pages/oj/components/Header.vue index 5cb551ec9..cf4caaf17 100644 --- a/frontend/src/pages/oj/components/Header.vue +++ b/frontend/src/pages/oj/components/Header.vue @@ -18,6 +18,9 @@ Problems + + Lectures + diff --git a/frontend/src/pages/oj/router/routes.js b/frontend/src/pages/oj/router/routes.js index b008a1ea3..0b9d11037 100644 --- a/frontend/src/pages/oj/router/routes.js +++ b/frontend/src/pages/oj/router/routes.js @@ -15,7 +15,13 @@ import { Problem, ProblemList, ResetPassword, - ProfileSetting + ProfileSetting, + LectureList, + LectureDashboardOj, + LectureAssignmentList, + LectureAssignmentDetail, + LectureQna, + LectureQnaDetail } from '../views' export default [ @@ -115,6 +121,42 @@ export default [ meta: { requiresAuth: true, title: 'Profile Settings' }, component: ProfileSetting }, + { + name: 'lecture-list', + path: '/lecture', + meta: { title: 'Lecture List' }, + component: LectureList + }, + { + name: 'lecture-dashboard', + path: '/lecture/:courseID', + meta: { title: 'Lecture Dashboard' }, + component: LectureDashboardOj + }, + { + name: 'lecture-assignment', + path: '/lecture/:courseID/assignment', + meta: { title: 'Lecture Assignment' }, + component: LectureAssignmentList + }, + { + name: 'lecture-assignment-detail', + path: '/lecture/:courseID/assignment/:assignmentID', + meta: { title: 'Lecture Assignment Detail' }, + component: LectureAssignmentDetail + }, + { + name: 'lecture-qna', + path: '/lecture/:courseID/question', + meta: { title: 'Lecture QnA' }, + component: LectureQna + }, + { + name: 'lecture-qna-detail', + path: '/lecture/:courseID/question/:questionID', + meta: { title: 'Lecture QnA Detail' }, + component: LectureQnaDetail + }, { path: '*', meta: { title: '404' }, diff --git a/frontend/src/pages/oj/views/index.js b/frontend/src/pages/oj/views/index.js index 96fb1c6a0..8688b723a 100644 --- a/frontend/src/pages/oj/views/index.js +++ b/frontend/src/pages/oj/views/index.js @@ -6,6 +6,12 @@ import NotFound from './general/404.vue' import Home from './general/Home.vue' import ContestRanking from './contest/ContestRanking.vue' import ContestProblemList from './contest/ContestProblemList.vue' +import LectureList from './lecture/LectureList.vue' +import LectureDashboardOj from './lecture/LectureDashboard.vue' +import LectureAssignmentList from './lecture/LectureAssignmentList.vue' +import LectureAssignmentDetail from './lecture/LectureAssignmentDetail.vue' +import LectureQna from './lecture/LectureQnA.vue' +import LectureQnaDetail from './lecture/LectureQnADetail.vue' // Grouping Components in the Same Chunk const Problem = () => import(/* webpackChunkName: "Problem" */ '@oj/views/problem/Problem.vue') @@ -25,7 +31,8 @@ export { Home, NotFound, Logout, ProblemList, Announcement, AnnouncementList, Problem, ApplyResetPassword, ResetPassword, EmailAuth, ProfileSetting, - ContestList, ContestDetail, ContestProblemList, ContestRanking, Register + ContestList, ContestDetail, ContestProblemList, ContestRanking, Register, + LectureList, LectureDashboardOj, LectureAssignmentList, LectureAssignmentDetail, LectureQna, LectureQnaDetail } /* 구성 요소 내보내기는 두 가지 범주로 나뉩니다. * 하나는 일반적으로 직접 내보내기에 사용되며 diff --git a/frontend/src/pages/oj/views/lecture/LectureAssignmentDetail.vue b/frontend/src/pages/oj/views/lecture/LectureAssignmentDetail.vue new file mode 100644 index 000000000..fe6a48af7 --- /dev/null +++ b/frontend/src/pages/oj/views/lecture/LectureAssignmentDetail.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/frontend/src/pages/oj/views/lecture/LectureAssignmentList.vue b/frontend/src/pages/oj/views/lecture/LectureAssignmentList.vue new file mode 100644 index 000000000..b622f6adc --- /dev/null +++ b/frontend/src/pages/oj/views/lecture/LectureAssignmentList.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/frontend/src/pages/oj/views/lecture/LectureDashboard.vue b/frontend/src/pages/oj/views/lecture/LectureDashboard.vue new file mode 100644 index 000000000..241bc32f8 --- /dev/null +++ b/frontend/src/pages/oj/views/lecture/LectureDashboard.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/frontend/src/pages/oj/views/lecture/LectureList.vue b/frontend/src/pages/oj/views/lecture/LectureList.vue new file mode 100644 index 000000000..a754a4d06 --- /dev/null +++ b/frontend/src/pages/oj/views/lecture/LectureList.vue @@ -0,0 +1,48 @@ + + + + + diff --git a/frontend/src/pages/oj/views/lecture/LectureQnA.vue b/frontend/src/pages/oj/views/lecture/LectureQnA.vue new file mode 100644 index 000000000..c6cf42b1f --- /dev/null +++ b/frontend/src/pages/oj/views/lecture/LectureQnA.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/frontend/src/pages/oj/views/lecture/LectureQnADetail.vue b/frontend/src/pages/oj/views/lecture/LectureQnADetail.vue new file mode 100644 index 000000000..e5f90d6fa --- /dev/null +++ b/frontend/src/pages/oj/views/lecture/LectureQnADetail.vue @@ -0,0 +1,28 @@ + + + + + From 7473c53ea6986246346807c6141aa38bea005670 Mon Sep 17 00:00:00 2001 From: y-jiu Date: Wed, 12 Jan 2022 22:16:46 +0900 Subject: [PATCH 029/297] Make draft LectureList.vue LectureDashboard .vue --- .../oj/views/lecture/LectureDashboard.vue | 54 ++++++++++- .../pages/oj/views/lecture/LectureList.vue | 92 ++++++++++++++----- 2 files changed, 119 insertions(+), 27 deletions(-) diff --git a/frontend/src/pages/oj/views/lecture/LectureDashboard.vue b/frontend/src/pages/oj/views/lecture/LectureDashboard.vue index 241bc32f8..3cdc6c334 100644 --- a/frontend/src/pages/oj/views/lecture/LectureDashboard.vue +++ b/frontend/src/pages/oj/views/lecture/LectureDashboard.vue @@ -1,6 +1,39 @@ @@ -23,6 +56,19 @@ export default { } - diff --git a/frontend/src/pages/oj/views/lecture/LectureList.vue b/frontend/src/pages/oj/views/lecture/LectureList.vue index a754a4d06..b60ac6653 100644 --- a/frontend/src/pages/oj/views/lecture/LectureList.vue +++ b/frontend/src/pages/oj/views/lecture/LectureList.vue @@ -1,26 +1,26 @@ @@ -32,17 +32,63 @@ export default { }, data () { return { + perPage: 10, + currentPage: 1, + items: [ + { subject: '프로그래밍 기초와 실습', semester: '2021 spring' }, + { subject: '공학 컴퓨터 프로그래밍', semester: '2021 fall' } + ] } }, async mounted () { }, methods: { + async goDashboard () { + await this.$router.push({ + name: 'lecture-dashboard' + }) + } }, computed: { + rows () { + return this.items.length + } } } - From 25a7e96a3a178ac9cc3c2b507380bab7f4e1056b Mon Sep 17 00:00:00 2001 From: y-jiu Date: Wed, 12 Jan 2022 22:16:46 +0900 Subject: [PATCH 030/297] Calendar fix LectureDashboard.vue LectureList.vue list hover --- .../oj/views/lecture/LectureDashboard.vue | 30 +++++++++++++------ .../pages/oj/views/lecture/LectureList.vue | 2 +- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/frontend/src/pages/oj/views/lecture/LectureDashboard.vue b/frontend/src/pages/oj/views/lecture/LectureDashboard.vue index 3cdc6c334..c97b227f4 100644 --- a/frontend/src/pages/oj/views/lecture/LectureDashboard.vue +++ b/frontend/src/pages/oj/views/lecture/LectureDashboard.vue @@ -7,7 +7,7 @@ diff --git a/frontend/src/pages/oj/views/lecture/LectureList.vue b/frontend/src/pages/oj/views/lecture/LectureList.vue index b60ac6653..903a683b5 100644 --- a/frontend/src/pages/oj/views/lecture/LectureList.vue +++ b/frontend/src/pages/oj/views/lecture/LectureList.vue @@ -5,6 +5,7 @@
Date: Wed, 12 Jan 2022 22:16:46 +0900 Subject: [PATCH 031/297] LectureDashboard.vue Button Color Change v-model fix LectureDashboard.vue Button hover --- .../oj/views/lecture/LectureDashboard.vue | 42 ++++++++++++++----- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/frontend/src/pages/oj/views/lecture/LectureDashboard.vue b/frontend/src/pages/oj/views/lecture/LectureDashboard.vue index c97b227f4..b4531167e 100644 --- a/frontend/src/pages/oj/views/lecture/LectureDashboard.vue +++ b/frontend/src/pages/oj/views/lecture/LectureDashboard.vue @@ -14,24 +14,19 @@ > - -
- {{ value }} -
- -
- Assignment 3 -
-
+ + + Assignment 3 +
- Go to Q&A page + Go to Q&A page - Go to Assignments page + Go to Assignments page
@@ -45,6 +40,7 @@ export default { }, data () { return { + value: '' } }, async mounted () { @@ -57,6 +53,10 @@ export default { From b2f116b01d8ad4cc35b2c6d6fb02dd4693216842 Mon Sep 17 00:00:00 2001 From: y-jiu Date: Wed, 12 Jan 2022 22:16:46 +0900 Subject: [PATCH 032/297] LectureDashboard.vue Add Button click event hotfix --- .../oj/views/lecture/LectureDashboard.vue | 28 +++++++++++++++---- .../pages/oj/views/lecture/LectureList.vue | 2 +- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/frontend/src/pages/oj/views/lecture/LectureDashboard.vue b/frontend/src/pages/oj/views/lecture/LectureDashboard.vue index b4531167e..16a1ae970 100644 --- a/frontend/src/pages/oj/views/lecture/LectureDashboard.vue +++ b/frontend/src/pages/oj/views/lecture/LectureDashboard.vue @@ -1,7 +1,7 @@