summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander2014-07-15 18:56:34 +0000
committerMagnus Hagander2014-07-15 18:56:34 +0000
commit9d0ac596472e9044042a0ece3e9451c54b85c4a2 (patch)
tree6f8b54af7918997308c8f5e6e704a665d91870fa
parentb06376aff1fe8fec6f8af84f3f39f0e872b0c135 (diff)
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.
-rw-r--r--pgcommitfest/commitfest/ajax.py3
-rw-r--r--pgcommitfest/commitfest/static/commitfest/js/commitfest.js1
-rw-r--r--pgcommitfest/commitfest/templates/base_form.html1
-rw-r--r--pgcommitfest/commitfest/templates/thread_attach.inc1
4 files changed, 5 insertions, 1 deletions
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 @@
</div>
<div class="modal-body">
<form class="form-inline" style="margin-bottom: 5px;">
+ <input type="hidden" id="attachThreadAttachOnly" value="0">
<div class="input-append">
<input id="attachThreadSearchField" type="text" class="span2 search-query">
<button id="attachThreadSearchButton" onclick="return findLatestThreads()" class="btn btn-default disabled">Search</button>