diff options
author | Magnus Hagander | 2018-12-23 12:07:56 +0000 |
---|---|---|
committer | Magnus Hagander | 2018-12-23 12:07:56 +0000 |
commit | 535af6e586adae94bdc8502fb78602877345dad8 (patch) | |
tree | 6a793c0b899bce37679edb4edff19d64c4d85e2c | |
parent | 41ce86f574a20bc378570998f330b9ac72391b13 (diff) |
Add "withdrawn" commitfest status
By popular (?) request
-rw-r--r-- | pgcommitfest/commitfest/migrations/0003_withdrawn_status.py | 32 | ||||
-rw-r--r-- | pgcommitfest/commitfest/models.py | 5 | ||||
-rw-r--r-- | pgcommitfest/commitfest/static/commitfest/js/commitfest.js | 3 | ||||
-rw-r--r-- | pgcommitfest/commitfest/templates/patch_commands.inc | 1 | ||||
-rw-r--r-- | pgcommitfest/commitfest/views.py | 2 | ||||
-rw-r--r-- | pgcommitfest/urls.py | 2 |
6 files changed, 43 insertions, 2 deletions
diff --git a/pgcommitfest/commitfest/migrations/0003_withdrawn_status.py b/pgcommitfest/commitfest/migrations/0003_withdrawn_status.py new file mode 100644 index 0000000..346adf9 --- /dev/null +++ b/pgcommitfest/commitfest/migrations/0003_withdrawn_status.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('commitfest', '0002_notifications'), + ] + + operations = [ + migrations.AlterField( + model_name='patchoncommitfest', + name='status', + field=models.IntegerField(default=1, choices=[(1, b'Needs review'), (2, b'Waiting on Author'), (3, b'Ready for Committer'), (4, b'Committed'), (5, b'Moved to next CF'), (6, b'Rejected'), (7, b'Returned with feedback'), (8, b'Withdrawn')]), + ), + migrations.RunSQL(""" +INSERT INTO commitfest_patchstatus (status, statusstring, sortkey) VALUES +(1,'Needs review',10), +(2,'Waiting on Author',15), +(3,'Ready for Committer',20), +(4,'Committed',25), +(5,'Moved to next CF',30), +(6,'Rejected',50), +(7,'Returned with Feedback',50), +(8,'Withdrawn', 50) +ON CONFLICT (status) DO UPDATE SET statusstring=excluded.statusstring, sortkey=excluded.sortkey; +"""), + migrations.RunSQL("DELETE FROM commitfest_patchstatus WHERE status < 1 OR status > 8"), + ] diff --git a/pgcommitfest/commitfest/models.py b/pgcommitfest/commitfest/models.py index 8e5a442..60dcaf4 100644 --- a/pgcommitfest/commitfest/models.py +++ b/pgcommitfest/commitfest/models.py @@ -159,6 +159,7 @@ class PatchOnCommitFest(models.Model): STATUS_NEXT=5 STATUS_REJECTED=6 STATUS_RETURNED=7 + STATUS_WITHDRAWN=8 _STATUS_CHOICES=( (STATUS_REVIEW, 'Needs review'), (STATUS_AUTHOR, 'Waiting on Author'), @@ -166,7 +167,8 @@ class PatchOnCommitFest(models.Model): (STATUS_COMMITTED, 'Committed'), (STATUS_NEXT, 'Moved to next CF'), (STATUS_REJECTED, 'Rejected'), - (STATUS_RETURNED, 'Returned with feedback') + (STATUS_RETURNED, 'Returned with feedback'), + (STATUS_WITHDRAWN, 'Withdrawn'), ) _STATUS_LABELS=( (STATUS_REVIEW, 'default'), @@ -176,6 +178,7 @@ class PatchOnCommitFest(models.Model): (STATUS_NEXT, 'warning'), (STATUS_REJECTED, 'danger'), (STATUS_RETURNED, 'danger'), + (STATUS_WITHDRAWN, 'danger'), ) OPEN_STATUSES=[STATUS_REVIEW, STATUS_AUTHOR, STATUS_COMMITTER] OPEN_STATUS_CHOICES=[x for x in _STATUS_CHOICES if x[0] in OPEN_STATUSES] diff --git a/pgcommitfest/commitfest/static/commitfest/js/commitfest.js b/pgcommitfest/commitfest/static/commitfest/js/commitfest.js index 84d728d..69c41ec 100644 --- a/pgcommitfest/commitfest/static/commitfest/js/commitfest.js +++ b/pgcommitfest/commitfest/static/commitfest/js/commitfest.js @@ -1,6 +1,9 @@ function verify_reject() { return confirm('Are you sure you want to close this patch as Rejected?\n\nThis should only be done when a patch will never be applied - if more work is needed, it should instead be set to "Returned with Feedback" or "Moved to next CF".\n\nSo - are you sure?'); } +function verify_withdrawn() { + return confirm('Are you sure you want to close this patch as Withdrawn?\n\nThis should only be done when the author voluntarily withdraws the patch.\n\nSo - are you sure?'); +} function verify_returned() { return confirm('Are you sure you want to close this patch as Returned with Feedback?\n\nThis should be done if the patch is expected to be finished at some future time, but not necessarily in the next commitfest. If work is undergoing and expected in the next commitfest, it should instead be set to "Moved to next CF".\n\nSo - are you sure?'); } diff --git a/pgcommitfest/commitfest/templates/patch_commands.inc b/pgcommitfest/commitfest/templates/patch_commands.inc index d2861ac..8f18f71 100644 --- a/pgcommitfest/commitfest/templates/patch_commands.inc +++ b/pgcommitfest/commitfest/templates/patch_commands.inc @@ -19,6 +19,7 @@ <li role="presentation" class="divider"></li> <li role="presentation" class="dropdown-header">Closed statuses</li> <li role="presentation"><a href="close/reject/" onclick="return verify_reject()">Rejected</a></li> + <li role="presentation"><a href="close/withdrawn/" onclick="return verify_withdrawn()">Withdrawn</a></li> <li role="presentation"><a href="close/feedback/" onclick="return verify_returned()">Returned with feedback</a></li> <li role="presentation"><a href="close/next/" onclick="return verify_next()">Move to next CF</a></li> <li role="presentation"><a href="close/committed/" onclick="return flagCommitted({%if patch.committer%}'{{patch.committer}}'{%elif is_committer%}'{{user.username}}'{%else%}null{%endif%})">Committed</a></li> diff --git a/pgcommitfest/commitfest/views.py b/pgcommitfest/commitfest/views.py index 47c3848..5f68895 100644 --- a/pgcommitfest/commitfest/views.py +++ b/pgcommitfest/commitfest/views.py @@ -520,6 +520,8 @@ def close(request, cfid, patchid, status): # need to check if the individual status has changed. if status == 'reject': poc.status = PatchOnCommitFest.STATUS_REJECTED + elif status == 'withdrawn': + poc.status = PatchOnCommitFest.STATUS_WITHDRAWN elif status == 'feedback': poc.status = PatchOnCommitFest.STATUS_RETURNED elif status == 'next': diff --git a/pgcommitfest/urls.py b/pgcommitfest/urls.py index eafb99c..109a341 100644 --- a/pgcommitfest/urls.py +++ b/pgcommitfest/urls.py @@ -21,7 +21,7 @@ urlpatterns = [ url(r'^(\d+)/(\d+)/edit/$', views.patchform), url(r'^(\d+)/new/$', views.newpatch), url(r'^(\d+)/(\d+)/status/(review|author|committer)/$', views.status), - url(r'^(\d+)/(\d+)/close/(reject|feedback|committed|next)/$', views.close), + url(r'^(\d+)/(\d+)/close/(reject|withdrawn|feedback|committed|next)/$', views.close), url(r'^(\d+)/(\d+)/reviewer/(become|remove)/$', views.reviewer), url(r'^(\d+)/(\d+)/committer/(become|remove)/$', views.committer), url(r'^(\d+)/(\d+)/(un)?subscribe/$', views.subscribe), |