From 8c13827a20ed3d4ced8a56caee6c2e3874ff3c5d Mon Sep 17 00:00:00 2001 From: dddooo9 Date: Sat, 28 Aug 2021 20:41:13 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B7=B8=EB=A3=B9=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20function=20merge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- groups/templates/groups/main.html | 2 -- groups/urls.py | 2 -- groups/views.py | 33 ++++++++++--------------------- 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/groups/templates/groups/main.html b/groups/templates/groups/main.html index 47857e6..2bc3c8e 100644 --- a/groups/templates/groups/main.html +++ b/groups/templates/groups/main.html @@ -193,8 +193,6 @@

여기

인증하기 - 개인 도장판 - 인증 열람
diff --git a/groups/urls.py b/groups/urls.py index 4019f23..9206488 100644 --- a/groups/urls.py +++ b/groups/urls.py @@ -5,8 +5,6 @@ urlpatterns = [ path('', views.main, name="main"), path('/certify/', views.certify, name="certify"), - path('/personal/', views.personal, name="personal"), - path('/show_certify/', views.show_certify, name="show_certify"), path('group_list/', views.group_list, name="group_list"), path('group_detail/', views.group_detail, name="group_detail"), path('make_group/', views.make_group, name="make_group") diff --git a/groups/views.py b/groups/views.py index b6f9337..88ddcc6 100644 --- a/groups/views.py +++ b/groups/views.py @@ -34,14 +34,22 @@ def main(request, goal_id): daily_name.append(name) total_name.append(daily_name) + certifiy_list = goal.certifies.all() + status = get_status(goal) + context = { 'goal': goal, 'dates': board['dates'], 'member_count': member_count, 'level': level, - 'name': total_name - + 'name': total_name, + 'certifies': certifiy_list, + 'achievements': board['achievements'], + 'start_days': status['start_days'], + 'success_days': status['success_days'], + 'continuity_days': status['continuity_days'], } + return render(request, 'groups/main.html', context) @@ -66,21 +74,6 @@ def certify(request, goal_id): return render(request, 'groups/certify.html', {'goal': goal}) -def personal(request, goal_id): - goal = get_object_or_404(Goal, pk=goal_id) - status = get_status(goal) - board = get_board(goal) - context = { - 'goal': goal, - 'start_days': status['start_days'], - 'success_days': status['success_days'], - 'continuity_days': status['continuity_days'], - 'dates': board['dates'], - 'achievements': board['achievements'], - } - return render(request, 'groups/personal.html', context) - - def get_status(goal): # 시작, 성공, 연속 일수를 리턴하는 함수 certifies = goal.certifies.all() start_days = (datetime.date.today() - goal.start_date).days + 1 @@ -124,12 +117,6 @@ def get_board(goal): # 도장판의 날짜와 성공 여부를 리턴하는 return res -def show_certify(request, goal_id): - goal = Goal.objects.get(pk=goal_id) - certifies = goal.certifies.all() - return render(request, 'groups/show_certify.html', {'goal': goal, 'certifies': certifies}) - - def group_list(request): return render(request, 'groups/group_list.html')