Skip to content

Commit 4709813

Browse files
authored
Merge pull request #74 from darjeeling/my_page_payments
init my_page payments
2 parents b501a37 + 2a1fcce commit 4709813

File tree

3 files changed

+64
-2
lines changed

3 files changed

+64
-2
lines changed

account/templates/_base.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{% load static %}
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
<head>
5+
<title>
6+
{% block title %}
7+
{% endblock title %}
8+
</title>
9+
<meta charset="UTF-8">
10+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
11+
<script src="https://cdn.tailwindcss.com"></script>
12+
<script>
13+
tailwind.config = {
14+
theme: {
15+
extend: {
16+
colors: {
17+
clifford: '#da373d',
18+
}
19+
}
20+
}
21+
}
22+
</script>
23+
</head>
24+
<body class="bg-green-50">
25+
<div class="container mx-auto mt-4">
26+
{% block content %}
27+
{% endblock content %}
28+
</div>
29+
</body>
30+
</html>
Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,30 @@
1+
{% extends "_base.html" %}
2+
{% block content %}
3+
<table class="table-auto">
4+
<thead>
5+
<tr>
6+
<th>id </th>
7+
<th>user</th>
8+
<th>금액</th>
9+
<th>결제일 </th>
10+
<th>취소</th>
11+
</tr>
12+
</thead>
13+
<tbody>
14+
{% for payment in payment_list %}
15+
<tr>
16+
<td>{{ payment.id }}</td>
17+
<td>{{ payment.user_id }}</td>
18+
<td>{{ payment.money }}</td>
19+
<td>{{ payment.create_at }}</td>
20+
<td>
21+
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full">
22+
Button
23+
</button>
124

2-
hello
25+
</td>
26+
</tr>
27+
{% endfor %}
28+
</tbody>
29+
</table>
30+
{% endblock content %}

account/views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from django.shortcuts import render
88
from rest_framework.views import APIView
99

10+
import payment
11+
1012

1113
class GitHubLogin(SocialLoginView):
1214
adapter_class = GitHubOAuth2Adapter
@@ -24,4 +26,6 @@ class MyPage(APIView):
2426

2527
@login_required
2628
def mypage_payments(request):
27-
return render(request, 'account_mypage_payments.html')
29+
payment_list = payment.models.Payment.objects.filter(user_id=request.user)
30+
return render(request, 'account_mypage_payments.html',
31+
context={'payment_list': payment_list})

0 commit comments

Comments
 (0)