Skip to content

Commit

Permalink
Merge pull request daldal-Mango#36 from dddooo9/main
Browse files Browse the repository at this point in the history
인증 성공시 별20 획득, 완료된 목표 처리
  • Loading branch information
hyeoneedyou authored Aug 28, 2021
2 parents 002b164 + 385a08b commit 24e6cc3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions groups/templates/groups/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ <h4 class="text_center">참여인원: {{ member_count }}</h4>
</table>
</article>
<article id="tab2" class="content-container__content">
<!-- <div class="psn_top">
<h1 class="text_center">{{ goal.name }}</h1>
<h3 class="text_center">하루 {{ goal.goal_page }}페이지 독서하기</h3>
</div> -->
{% if 30 >= start_days %}
<div class="psn_boxes">
<div class="psn_box start">
시작<br><span class="psn_day">{{ start_days }}</span><br>일째
Expand All @@ -100,6 +105,11 @@ <h4 class="text_center">참여인원: {{ member_count }}</h4>
성공<br><span class="psn_day">{{ success_days }}</span><br>일째
</div>
</div>
{% else %}
<div class="psn_boxes">
<h2>{{dates|index_1:0}} ~ {{dates|index_1:29}}</h2>
</div>
{% endif %}
<div class="psn_check table_container">
<table>
<thead>
Expand Down Expand Up @@ -181,9 +191,11 @@ <h4 class="text_center">참여인원: {{ member_count }}</h4>
</section>
</div>

{% if 30 >= start_days %}
<div class="goal_verify">
<a class="btn1" href="{% url 'groups:certify' goal.id %}">인증하기</a>
</div>
{% endif %}

<!-- The Modal -->
<div id="myModal" class="modal">
Expand Down
3 changes: 3 additions & 0 deletions groups/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ def certify(request, goal_id):
else: # 이하여야 성공
if float(figure) > goal.value:
achievement = False
if achievement:
user.profile.cash += 20
user.profile.save()
Certify.objects.create(goal=goal, user=user, created=created, text=text, image=image, figure=figure, achievement=achievement)
return redirect('groups:main', goal_id)
return render(request, 'groups/certify.html', {'goal': goal})
Expand Down

0 comments on commit 24e6cc3

Please sign in to comment.