From 9d0ac596472e9044042a0ece3e9451c54b85c4a2 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 15 Jul 2014 20:56:34 +0200 Subject: [PATCH] Don't require attachments to attach a mail thread to an existing patch We still require attachments to create a new patch, but it should be possible to attach a pure discussion thread to an existing patch. --- pgcommitfest/commitfest/ajax.py | 3 ++- pgcommitfest/commitfest/static/commitfest/js/commitfest.js | 1 + pgcommitfest/commitfest/templates/base_form.html | 1 + pgcommitfest/commitfest/templates/thread_attach.inc | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pgcommitfest/commitfest/ajax.py b/pgcommitfest/commitfest/ajax.py index 08d86a2..d32ce91 100644 --- a/pgcommitfest/commitfest/ajax.py +++ b/pgcommitfest/commitfest/ajax.py @@ -47,9 +47,10 @@ def _archivesAPI(suburl, params=None): def getThreads(request): search = request.GET.has_key('s') and request.GET['s'] or None + attachonly = request.GET.has_key('a') and 1 or 0 # Make a JSON api call to the archives server - params = {'n': 100, 'a': 1} + params = {'n': 100, 'a': attachonly} if search: params['s'] = search diff --git a/pgcommitfest/commitfest/static/commitfest/js/commitfest.js b/pgcommitfest/commitfest/static/commitfest/js/commitfest.js index 0ca6316..972dd67 100644 --- a/pgcommitfest/commitfest/static/commitfest/js/commitfest.js +++ b/pgcommitfest/commitfest/static/commitfest/js/commitfest.js @@ -10,6 +10,7 @@ function findLatestThreads() { $('#attachThreadSearchButton').addClass('disabled'); $.get('/ajax/getThreads/', { 's': $('#attachThreadSearchField').val(), + 'a': $('#attachThreadAttachOnly').val(), }).success(function(data) { sel = $('#attachThreadList'); sel.find('option').remove(); diff --git a/pgcommitfest/commitfest/templates/base_form.html b/pgcommitfest/commitfest/templates/base_form.html index ab07ecf..ac42f43 100644 --- a/pgcommitfest/commitfest/templates/base_form.html +++ b/pgcommitfest/commitfest/templates/base_form.html @@ -105,6 +105,7 @@ $(document).ready(function() { $('button.attachThreadButton').each(function (i,o) { var b = $(o); b.click(function() { + $('#attachThreadAttachOnly').val('1'); browseThreads(function(msgid) { b.prev().val(msgid); return true; diff --git a/pgcommitfest/commitfest/templates/thread_attach.inc b/pgcommitfest/commitfest/templates/thread_attach.inc index 3322ba8..44c4316 100644 --- a/pgcommitfest/commitfest/templates/thread_attach.inc +++ b/pgcommitfest/commitfest/templates/thread_attach.inc @@ -20,6 +20,7 @@