diff --git a/backlogger/migrations/0005_item_status.py b/backlogger/migrations/0005_item_status.py new file mode 100644 index 0000000..f04592d --- /dev/null +++ b/backlogger/migrations/0005_item_status.py @@ -0,0 +1,20 @@ +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('backlogger', '0004_item_hltb_fields'), + ] + + operations = [ + migrations.AddField( + model_name='item', + name='status', + field=models.CharField( + choices=[('active', 'Active'), ('completed', 'Completed'), ('abandoned', 'Abandoned')], + default='active', + max_length=10, + ), + ), + ] diff --git a/backlogger/models.py b/backlogger/models.py index 9bac648..962cd47 100644 --- a/backlogger/models.py +++ b/backlogger/models.py @@ -14,9 +14,19 @@ class Item(models.Model): (OTHER, 'Other'), ] + ACTIVE = 'active' + COMPLETED = 'completed' + ABANDONED = 'abandoned' + STATUS_CHOICES = [ + (ACTIVE, 'Active'), + (COMPLETED, 'Completed'), + (ABANDONED, 'Abandoned'), + ] + user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='items', null=True) category = models.CharField(max_length=10, choices=CATEGORY_CHOICES) + status = models.CharField(max_length=10, choices=STATUS_CHOICES, default=ACTIVE) name = models.CharField(max_length=200) progress_percent = models.FloatField(default=0.0) favorite = models.BooleanField(default=False) diff --git a/backlogger/templates/backlogger/list.html b/backlogger/templates/backlogger/list.html index 332f99b..a87801e 100644 --- a/backlogger/templates/backlogger/list.html +++ b/backlogger/templates/backlogger/list.html @@ -53,6 +53,10 @@ .btn-outline { background: transparent; color: #94a3b8; border: 1px solid #334155; } .btn-danger { background: transparent; color: #f87171; border: 1px solid #f87171; padding: 0.3rem 0.65rem; font-size: 0.78rem; } .btn-danger:hover { background: #f87171; color: #0f172a; opacity: 1; } + .btn-done { background: transparent; color: #34d399; border: 1px solid #34d399; padding: 0.3rem 0.65rem; font-size: 0.78rem; } + .btn-done:hover { background: #34d399; color: #0f172a; opacity: 1; } + .btn-abandon { background: transparent; color: #fb923c; border: 1px solid #fb923c; padding: 0.3rem 0.65rem; font-size: 0.78rem; } + .btn-abandon:hover { background: #fb923c; color: #0f172a; opacity: 1; } .filter-bar { display: flex; @@ -72,6 +76,7 @@ } .tab:hover { color: #e2e8f0; } .tab.active { color: #38bdf8; border-bottom-color: #38bdf8; } + .tab-sep { width: 1px; background: #1e293b; margin: 0.5rem 0.25rem; align-self: stretch; } .sort-wrap { padding-bottom: 0.75rem; } .sort-wrap select { @@ -175,13 +180,19 @@