From 9c1dd30db7c1e75c5979582c5185af18e7431e4d Mon Sep 17 00:00:00 2001 From: starnakin Date: Mon, 11 Dec 2023 13:25:00 +0100 Subject: [PATCH 1/2] add: css to me --- frontend/static/css/me.css | 19 +++++++++++++++++++ frontend/static/js/views/MeView.js | 21 +++++++++++++-------- 2 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 frontend/static/css/me.css diff --git a/frontend/static/css/me.css b/frontend/static/css/me.css new file mode 100644 index 0000000..f7c2313 --- /dev/null +++ b/frontend/static/css/me.css @@ -0,0 +1,19 @@ +#app .account +{ + background-color: red; +} + +#app .account, #app .profile +{ + width: 60%; + display: flex; + margin-left: auto; + margin-right: auto; + flex-direction: column; + flex-wrap: wrap; +} + +#app .profile +{ + background-color: green; +} \ No newline at end of file diff --git a/frontend/static/js/views/MeView.js b/frontend/static/js/views/MeView.js index 8ae6378..1b0c5a2 100644 --- a/frontend/static/js/views/MeView.js +++ b/frontend/static/js/views/MeView.js @@ -12,8 +12,8 @@ export default class extends AbstractAuthentificateView { if (this.fill() === null) return; - document.getElementById("save-button").onclick = this.save; - document.getElementById("delete-button").onclick = this.delete_accounts; + document.getElementById("save-account-button").onclick = this.acccount_save; + document.getElementById("delete-account-button").onclick = this.account_delete_accounts; } async fill() @@ -104,22 +104,27 @@ export default class extends AbstractAuthentificateView async getHtml() { return ` +

ME

-
+
- +

Profile

+ + +
- - - - Logout `; } From d8a279f4d8e96fca6329468571ebd1b4888de8bf Mon Sep 17 00:00:00 2001 From: starnakin Date: Mon, 11 Dec 2023 14:36:36 +0100 Subject: [PATCH 2/2] fix: profiles list display new profiles --- profiles/viewsets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/profiles/viewsets.py b/profiles/viewsets.py index d9500aa..0c6b86f 100644 --- a/profiles/viewsets.py +++ b/profiles/viewsets.py @@ -11,7 +11,7 @@ from .serializers import ProfileSerializer from .models import ProfileModel class ProfileViewSet(viewsets.ModelViewSet): - queryset = ProfileModel.objects.all() + queryset = ProfileModel.objects.all serializer_class = ProfileSerializer parser_classes = (MultiPartParser, FormParser) permission_classes = (permissions.IsAuthenticatedOrReadOnly,) @@ -23,7 +23,7 @@ class ProfileViewSet(viewsets.ModelViewSet): status=status.HTTP_200_OK) def list(self, request: HttpRequest): - serializer = ProfileSerializer(self.queryset, many=True) + serializer = ProfileSerializer(self.queryset(), many=True) for profile in serializer.data: profile["avatar_url"] = profile["avatar_url"][profile["avatar_url"].find("static") - 1:] return Response(serializer.data)