From 04c086b9f73ab834045830a77afe9ba4802dee88 Mon Sep 17 00:00:00 2001 From: linda2927 Date: Tue, 3 Jan 2023 13:05:50 +0900 Subject: [PATCH 01/58] feat: edit gitignore --- .gitignore | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 87d6ac1..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/.venv -.env -db.sqlite3 \ No newline at end of file From f0ce8120dd573a59dc92e14b170ae4632b3e33d7 Mon Sep 17 00:00:00 2001 From: linda2927 Date: Tue, 3 Jan 2023 13:07:41 +0900 Subject: [PATCH 02/58] feat: implement basic html pages for authentication --- .gitignore | 4 ++ .idea/.gitignore | 8 ---- apps/user/html_urls.py | 9 ++-- apps/user/static/user/css/base.css | 21 ++++++++++ apps/user/static/user/js/profile.js | 11 +++++ apps/user/templates/account/base.html | 27 ++++++++++++ apps/user/templates/account/profile.html | 53 ++++++++++++++++++------ apps/user/urls.py | 5 +++ 8 files changed, 115 insertions(+), 23 deletions(-) create mode 100644 .gitignore delete mode 100644 .idea/.gitignore create mode 100644 apps/user/static/user/css/base.css create mode 100644 apps/user/static/user/js/profile.js create mode 100644 apps/user/templates/account/base.html create mode 100644 apps/user/urls.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4b5a7fc --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/.venv +.env +db.sqlite3 +.idea \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/apps/user/html_urls.py b/apps/user/html_urls.py index a5b921a..4a677f3 100644 --- a/apps/user/html_urls.py +++ b/apps/user/html_urls.py @@ -1,8 +1,11 @@ from django.urls import path, include +from django.views.generic import RedirectView + from .html_views import home_view, profile_view urlpatterns = [ - path("", include("allauth.urls")), - path("home", home_view, name="home"), - path("profile", profile_view, name="profile"), + path("", RedirectView.as_view(url="/account/login/")), + path("account/", include("allauth.urls")), + path("home/", home_view, name="home"), + path("profile/", profile_view, name="profile"), ] \ No newline at end of file diff --git a/apps/user/static/user/css/base.css b/apps/user/static/user/css/base.css new file mode 100644 index 0000000..1b06007 --- /dev/null +++ b/apps/user/static/user/css/base.css @@ -0,0 +1,21 @@ +html, body { + height: 100%; + width: 100%; + background-color: rgb(174, 229, 213); +} + +#root { + height: 100%; + width: 100%; + display: flex; + justify-content: center; + align-items: center; +} + +#container { + width: 80%; + height: 80%; + border-radius: 2rem; + background-color: white; + padding: 2rem; +} \ No newline at end of file diff --git a/apps/user/static/user/js/profile.js b/apps/user/static/user/js/profile.js new file mode 100644 index 0000000..75a03ad --- /dev/null +++ b/apps/user/static/user/js/profile.js @@ -0,0 +1,11 @@ +const copyToClipboard = (el) => { + console.log(el.value); + window.navigator.clipboard.writeText(el.value).then(res => { + alert("복사되었습니다."); + }); +} + +const openPopup = (url, name) => { + const option = "width = 500, height = 500, top = 100, left = 200, location = no" + window.open(url, name,) +} \ No newline at end of file diff --git a/apps/user/templates/account/base.html b/apps/user/templates/account/base.html new file mode 100644 index 0000000..5004a86 --- /dev/null +++ b/apps/user/templates/account/base.html @@ -0,0 +1,27 @@ +{% load tailwind_tags %} +{% load static %} + + + + + {% block extrahead %} + {% endblock extrahead %} + + + + {% block style %} + {% endblock %} + {% tailwind_css %} + + +
+
+ {% block content %} + {% endblock %} +
+ +
+ {% block scripts %} + {% endblock scripts %} + + \ No newline at end of file diff --git a/apps/user/templates/account/profile.html b/apps/user/templates/account/profile.html index 43fd3b5..bee3905 100644 --- a/apps/user/templates/account/profile.html +++ b/apps/user/templates/account/profile.html @@ -1,13 +1,42 @@ -{% load tailwind_tags %} - - - - - My Page - {% tailwind_css %} - - +{% extends "account/base.html" %} +{% load static %} +{% load i18n %} +{% load account %} + +{% block extrahead %} +마이페이지 +{% endblock extrahead %} + +{% block content %} + {% user_display user as user_display %}

My Page

- - - \ No newline at end of file + +

내 정보

+ +
+

Keys

+ +
+ +{# #} + +
+ {% csrf_token %} + {% if redirect_field_value %} + + {% endif %} + +
+{% endblock content %} +{% block scripts %} + +{% endblock scripts %} diff --git a/apps/user/urls.py b/apps/user/urls.py new file mode 100644 index 0000000..8ae5776 --- /dev/null +++ b/apps/user/urls.py @@ -0,0 +1,5 @@ +from django.urls import path + +urlpatterns = [ + path("", ), +] \ No newline at end of file From 30b1b3629ae38dc70d82b7b2b41992422ab719c6 Mon Sep 17 00:00:00 2001 From: linda2927 Date: Tue, 3 Jan 2023 13:07:47 +0900 Subject: [PATCH 03/58] feat: implement basic html pages for authentication --- apps/user/html_views.py | 9 ++++++++- apps/user/templates/account/signup.html | 2 +- config/settings.py | 7 +++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/apps/user/html_views.py b/apps/user/html_views.py index 5c1c490..ac9f365 100644 --- a/apps/user/html_views.py +++ b/apps/user/html_views.py @@ -1,3 +1,4 @@ +from django.contrib.auth.decorators import login_required from django.shortcuts import render @@ -5,5 +6,11 @@ def home_view(request): return render(request, "account/home.html") +@login_required(login_url="account:login") def profile_view(request): - return render(request, "account/profile.html") + return render(request, "account/profile.html", context={"user_info": request.user}) + + +@login_required(login_url="account:login") +def update_password(request): + return render(request, "account") diff --git a/apps/user/templates/account/signup.html b/apps/user/templates/account/signup.html index fbb495b..356a6c7 100644 --- a/apps/user/templates/account/signup.html +++ b/apps/user/templates/account/signup.html @@ -14,7 +14,7 @@ {% block content %}

{% trans "Sign Up" %}

-

{% blocktrans %}Already have an account? Then please sign in.{% endblocktrans %}

+

{% blocktrans %}Already have an account? Then please sign in.{% endblocktrans %}