add abandoned status to distinguish given-up habits from completed ones

Completed and abandoned habits were both lumped under a single terminal
state, making it impossible to tell "finished successfully" apart from
"gave up" when reviewing habit history.
This commit is contained in:
2026-07-17 20:19:35 +09:00
parent d0dd530e26
commit 55918d56d1
11 changed files with 167 additions and 3 deletions
+2
View File
@@ -8,6 +8,7 @@
<a href="/habits?tab=build" class="{{ 'active' if tab == 'build' }}">만들고 싶은 습관</a>
<a href="/habits?tab=quit" class="{{ 'active' if tab == 'quit' }}">멈추고 싶은 습관</a>
<a href="/habits?tab=completed" class="{{ 'active' if tab == 'completed' }}">완료된 습관</a>
<a href="/habits?tab=abandoned" class="{{ 'active' if tab == 'abandoned' }}">포기한 습관</a>
</div>
{% if tab in ("build", "quit") %}
@@ -25,6 +26,7 @@
<div class="empty-state">
{% if tab == "build" %}만들고 싶은 습관이 아직 없어요. 위에서 추가해보세요.
{% elif tab == "quit" %}끊고 싶은 습관이 아직 없어요. 위에서 추가해보세요.
{% elif tab == "abandoned" %}아직 포기한 습관이 없어요.
{% else %}아직 완료된 습관이 없어요.{% endif %}
</div>
{% endif %}
+8
View File
@@ -41,6 +41,14 @@
hx-swap="none"
hx-confirm="'{{ habit.name }}' 습관을 완료 처리할까요?"
>완료 처리</button>
<button
type="button"
class="btn btn-secondary"
hx-post="/habits/{{ habit.id }}/abandon"
hx-target="body"
hx-swap="none"
hx-confirm="'{{ habit.name }}' 습관을 포기할까요?"
>포기</button>
{% else %}
<button
type="button"