Skip to content

Commit 7c31f28

Browse files
committed
2 parents 986e48a + 83b638f commit 7c31f28

File tree

12 files changed

+318
-14
lines changed

12 files changed

+318
-14
lines changed

static/css/diaries_detail.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@ button i {
409409
cursor: pointer;
410410
}
411411

412+
.delete-comment-btn {
413+
margin-left: 10px;
414+
}
415+
412416
.save-comment-btn{
413417
white-space: nowrap;
414418
}
@@ -549,6 +553,7 @@ button i {
549553
overflow: hidden;
550554
text-overflow: ellipsis;
551555
max-width: 30%;
556+
margin-right: 0;
552557
}
553558

554559
.comments-list-content {
@@ -595,8 +600,16 @@ button i {
595600
}
596601

597602
@media (max-width: 500px){
598-
.comments-list-name, .comments-list-content, .comment-edit-btn,
603+
.comment-edit-btn,
599604
.save-comment-btn, .comment-del-btn, .comment-input, .add-comment-btn{
600605
font-size: 0.9rem;
601606
}
607+
608+
.comments-list-name, .comments-list-content{
609+
font-size: 0.7rem;
610+
}
611+
612+
.delete-comment-btn {
613+
margin-left: 0px;
614+
}
602615
}

static/css/login.css

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.login-container {
22
position: relative;
3-
width: 846px;
4-
height: 461px;
3+
width: 940px;
4+
height: 490px;
55
display: flex;
66
align-items: center;
77
justify-content: center;
@@ -75,7 +75,7 @@
7575

7676
.login-logo {
7777
position: absolute;
78-
top: -15px;
78+
top: 0px;
7979
left: 200px;
8080
width: 50px;
8181
height: auto;
@@ -124,7 +124,7 @@
124124

125125
.login-btn {
126126
width: 80%;
127-
max-width: 320px;
127+
max-width: 365px;
128128
padding: 10px;
129129
background: linear-gradient(-90deg, var(--primary-yellow), var(--light-yellow));
130130
border: none;
@@ -134,6 +134,7 @@
134134
border-radius: 30px;
135135
cursor: pointer;
136136
transition: all 0.6s ease-in-out;
137+
margin-bottom: 10px;
137138
}
138139

139140
.login-btn:hover {
@@ -153,7 +154,7 @@
153154
display: flex;
154155
justify-content: center;
155156
gap: 20px;
156-
margin-top: 20px;
157+
margin-top: 25px;
157158
}
158159

159160
.social-btn {
@@ -210,6 +211,43 @@
210211
outline: none;
211212
}
212213

214+
.find-buttons{
215+
display: flex;
216+
align-items: center;
217+
gap: 181px;
218+
position: absolute;
219+
left: 300px;
220+
}
221+
222+
.find-email-btn {
223+
font-size: 12px;
224+
color: var(--primary-yellow);
225+
font-weight: var(--font-weight-regular);
226+
text-decoration: none;
227+
white-space: nowrap;
228+
}
229+
230+
.find-pwd-btn {
231+
display: inline-block;
232+
font-size: 12px;
233+
text-align: center;
234+
color: var(--primary-yellow);
235+
font-weight: var(--font-weight-regular);
236+
border: none;
237+
background-color: transparent;
238+
cursor: pointer;
239+
white-space: nowrap;
240+
}
241+
242+
.find-pwd-btn:hover, .find-email-btn:hover {
243+
text-decoration: underline;
244+
background-color: transparent;
245+
}
246+
247+
.find-btn-pwd:active {
248+
transform: scale(0.95);
249+
}
250+
213251
@media screen and (max-width: 600px) {
214252
.login-container {
215253
width: 90vw;
@@ -249,7 +287,7 @@
249287
margin-left: 0;
250288
padding: 10px;
251289
position: relative;
252-
top: -40px;
290+
top: -15px;
253291
}
254292

255293
.login-logo {
@@ -318,4 +356,22 @@
318356
width: 60%;
319357
height: 60%;
320358
}
359+
360+
.find-buttons {
361+
gap: 180px;
362+
left: 40px;
363+
}
364+
}
365+
366+
@media screen and (max-width: 400px)
367+
{
368+
.find-buttons {
369+
gap: 50px;
370+
left: 40px;
371+
}
372+
373+
.find-pwd-btn{
374+
position: absolute;
375+
bottom: 1px;
376+
}
321377
}

templates/diaries/view_calendar.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,15 @@
137137
const today = new Date();
138138
today.setHours(0, 0, 0, 0); // 시간을 00:00:00으로 초기화
139139

140+
const todayYear = today.getFullYear();
141+
const todayMonth = today.getMonth() + 1;
142+
const todayDay = today.getDate();
143+
144+
const todayElement = document.querySelector(`.diary-day[data-year="${todayYear}"][data-month="${todayMonth}"][data-day="${todayDay}"]`);
145+
146+
if (todayElement) {
147+
todayElement.style.fontWeight = "bold";
148+
}
140149
// 캘린더의 날짜 버튼을 가져오기 (날짜를 클릭할 요소의 클래스를 사용)
141150
const dateButtons = document.querySelectorAll(".diary-day");
142151
dateButtons.forEach(button => {

templates/users/find_email.html

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{% extends 'users/main_1.html' %}
2+
3+
{% block content %}
4+
5+
<div style="
6+
position: absolute;
7+
top: 50%;
8+
left: 50%;
9+
transform: translate(-50%, -50%);
10+
background: white;
11+
padding: 20px;
12+
border-radius: 10px;
13+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
14+
text-align: center;
15+
max-width: 400px;
16+
width: 100%;
17+
margin: auto;
18+
">
19+
<form method="post" id="find-email-form">
20+
{% csrf_token %}
21+
<input type="text" id="nickname" name="nickname" placeholder="닉네임 입력" required
22+
style="width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 14px;">
23+
<button type="submit" style="
24+
width: 100%;
25+
padding: 10px;
26+
background-color: #ffcc00;
27+
border: none;
28+
border-radius: 5px;
29+
cursor: pointer;
30+
font-size: 16px;
31+
">이메일 찾기</button>
32+
</form>
33+
<p id="result" style="margin-top: 10px; font-weight: bold;"></p>
34+
</div>
35+
36+
<script>
37+
const form = document.getElementById('find-email-form');
38+
form.onsubmit = async (event) => {
39+
event.preventDefault();
40+
41+
const nickname = document.getElementById('nickname').value;
42+
const csrfToken = document.querySelector('[name=csrfmiddlewaretoken]').value; // CSRF 토큰 가져오기
43+
44+
const response = await fetch("{% url 'users:find-email' %}", {
45+
method: 'POST',
46+
headers: {
47+
'Content-Type': 'application/x-www-form-urlencoded',
48+
'X-CSRFToken': csrfToken // CSRF 토큰을 헤더에 포함
49+
},
50+
body: `nickname=${nickname}`,
51+
});
52+
53+
const data = await response.json();
54+
55+
if (response.ok) {
56+
document.getElementById('result').innerText = `이메일: ${data.email}`;
57+
} else {
58+
document.getElementById('result').innerText = data.error;
59+
}
60+
};
61+
</script>
62+
63+
{% endblock %}

templates/users/login.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,16 @@ <h1 class="login-title">Login</h1>
3030
{{ form.password }}
3131
</div>
3232
<button type="submit" class="login-btn">로그인</button>
33-
</form>
34-
33+
</form>
34+
<div class-"find-buttons-container">
35+
<div class="find-buttons">
36+
<a href="{% url 'users:find-email' %}" class="find-email-btn">이메일 찾기</a>
37+
<form action="{% url 'users:password_reset_request' %}" method="post">
38+
{% csrf_token %}
39+
<button type="submit" class="find-pwd-btn">비밀번호를 잊으셨나요?</button>
40+
</form>
41+
</div>
42+
</div>
3543
<div class="social-icons">
3644
<div class="naver_login">
3745
<button type="button" class="social-btn naver" onclick="location.href='{% provider_login_url 'naver' %}'">
@@ -46,6 +54,7 @@ <h1 class="login-title">Login</h1>
4654
</div>
4755
</div>
4856
</div>
57+
4958
</div>
5059
</body>
5160
</html>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div style="display: flex; justify-content: center; align-items: center; height: 100vh;">
2+
<div style="
3+
text-align: center;
4+
max-width: 400px;
5+
padding: 20px;
6+
background: rgba(255, 255, 255, 0.9);
7+
border-radius: 12px;
8+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
9+
">
10+
<h2 style="color: #333; font-size: 22px; margin-bottom: 10px;">비밀번호 재설정 요청이 완료되었습니다.</h2>
11+
<p style="color: #555; font-size: var(--font-size-normal); margin-bottom: 5px;">5분 이내에 이메일을 확인하고 인증을 완료해주세요!</p>
12+
</div>
13+
</div>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<div style="display: flex; justify-content: center; align-items: center; height: 100vh;">
2+
<div style="
3+
text-align: center;
4+
max-width: 400px;
5+
padding: 20px;
6+
background: rgba(255, 255, 255, 0.9);
7+
border-radius: 12px;
8+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
9+
">
10+
<h2 style="color: #333; font-size: 22px; margin-bottom: 20px;">새 비밀번호 설정</h2>
11+
<form method="POST">
12+
{% csrf_token %}
13+
<div style="margin-bottom: 15px;">
14+
<label for="new_password" style="display: block; font-size: 14px; margin-bottom: 5px;">새 비밀번호</label>
15+
<input type="password" name="new_password" required style="
16+
width: 100%;
17+
padding: 10px;
18+
border: 1px solid #ccc;
19+
border-radius: 5px;
20+
font-size: 14px;
21+
box-sizing: border-box;
22+
">
23+
</div>
24+
<button type="submit" style="
25+
width: 100%;
26+
padding: 10px;
27+
background-color: #ffcc00;
28+
border: none;
29+
border-radius: 5px;
30+
cursor: pointer;
31+
font-size: 16px;
32+
">비밀번호 변경하기</button>
33+
</form>
34+
</div>
35+
</div>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{% extends 'users/main_1.html' %}
2+
3+
{% block content %}
4+
5+
<div style="max-width: 500px; margin: 0 auto; padding: 30px; background: white; border-radius: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center;">
6+
<h2 style="font-size: 26px; color: #333; margin-bottom: 20px;">비밀번호 재설정</h2>
7+
<form method="POST" style="width: 100%;">
8+
{% csrf_token %}
9+
10+
<div style="margin-bottom: 20px;">
11+
<label for="email" style="display: block; font-size: 16px; margin-bottom: 10px;"></label>
12+
{{ form.email }}
13+
</div>
14+
15+
<div style="display: none;">
16+
{{ form.email.errors }}
17+
</div>
18+
19+
<button type="submit" style="width: 100%; padding: 12px; background-color: #ffcc00; border: none; border-radius: 6px; cursor: pointer; font-size: 18px;">
20+
이메일로 인증 링크 받기
21+
</button>
22+
</form>
23+
</div>
24+
25+
{% endblock %}

templates/users/verification_failed.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h2 style="color: #d32f2f; font-size: 22px; margin-bottom: 10px;">이메일 인
2525
transition: background-color 0.3s, transform 0.2s;
2626
" onmouseover="this.style.backgroundColor='#1565c0'; this.style.transform='scale(1.05)';"
2727
onmouseout="this.style.backgroundColor='#1976d2'; this.style.transform='scale(1)';">
28-
다시 회원가입하기
28+
다시 시도하기
2929
</a>
3030
</div>
3131
</div>

users/forms.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@ class Meta:
3131
class ProfileForm(forms.ModelForm):
3232
class Meta:
3333
model = User
34-
fields = ['nickname', 'profile_image']
34+
fields = ['nickname', 'profile_image']
35+
36+
class PasswordResetRequestForm(forms.Form):
37+
email = forms.EmailField(label='이메일', required=True, widget=forms.EmailInput(attrs={'placeholder': '이메일 입력'}), error_messages={'required': ''})

0 commit comments

Comments
 (0)