X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/b9ad70bc652c43fb141313cdfb3256eb22e14e84..c76406e46e71cb86cfb440667bfbbe21b36e709e:/forum/skins/default/templates/osqaadmin/nodeman.html diff --git a/forum/skins/default/templates/osqaadmin/nodeman.html b/forum/skins/default/templates/osqaadmin/nodeman.html index d9576e5..5c5c44e 100644 --- a/forum/skins/default/templates/osqaadmin/nodeman.html +++ b/forum/skins/default/templates/osqaadmin/nodeman.html @@ -40,6 +40,65 @@ $boxes.removeAttr('checked'); } }); + + $('#author-selector').autocomplete('{% url matching_users %}', { + minChars: 1, + matchContains: true, + max: 10, + + formatItem: function(row, i, max, value) { + return row[1] + ' (' + row[2] + ' {% trans "rep" %})'; + }, + + formatResult: function(row, i, max, value){ + return row[1]; + } + }); + + $('#author-selector').result(function(event, data, formatted) { + if ($('#author-filter-container').find('input[value=' + data[0] + ']').length == 0) { + $('#author-filter-container').append($("")); + $form.submit(); + } + }); + + $('.author-filter-remover').click(function() { + var id = $(this).attr('rel'); + if ($('#author-filter-container').find('input[value=' + id + ']').length > 0) { + $('#author-filter-container').find('input[value=' + id + ']').remove(); + $form.submit(); + } + }); + + $('#tag-selector').autocomplete('{% url matching_tags %}', { + minChars: 1, + matchContains: true, + max: 10, + + formatItem: function(row, i, max, value) { + return row[1] + ' (' + row[2] + ' {% trans "uses" %})'; + }, + + formatResult: function(row, i, max, value){ + return row[1]; + } + }); + + $('#tag-selector').result(function(event, data, formatted) { + if ($('#tag-filter-container').find('input[value=' + data[0] + ']').length == 0) { + $('#tag-filter-container').append($("")); + $form.submit(); + } + }); + + $('.tag-filter-remover').click(function() { + var id = $(this).attr('rel'); + if ($('#tag-filter-container').find('input[value=' + id + ']').length > 0) { + $('#tag-filter-container').find('input[value=' + id + ']').remove(); + $form.submit(); + } + }); + }); + + + + {% endblock %} {% block subtitle %} @@ -63,12 +169,24 @@