mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 19:12:20 +01:00
Merge branch 'revert-7af71276' into 'marietje-zuid'
Revert "Merge branch 'oslomp/search_field' into 'marietje-zuid'" See merge request dsprenkels/MarietjeDjango!43
This commit is contained in:
@ -95,7 +95,8 @@ def songs(request):
|
|||||||
|
|
||||||
def search_songs():
|
def search_songs():
|
||||||
queries = [Q(deleted=False)]
|
queries = [Q(deleted=False)]
|
||||||
queries.extend([Q(Q(artist__icontains=word) | Q(title__icontains=word) | Q(user__name__icontains=word)) for word in request.POST.get('all', '').split()])
|
queries.extend([Q(Q(artist__icontains=word) | Q(title__icontains=word)) for word in request.POST.get('all', '').split()])
|
||||||
|
queries.extend([Q(user__name__icontains=word) for word in request.POST.get('uploader', '').split()])
|
||||||
|
|
||||||
filter_query = queries.pop()
|
filter_query = queries.pop()
|
||||||
for query in queries:
|
for query in queries:
|
||||||
|
|||||||
@ -310,9 +310,10 @@ function refreshSeconds(playNextAt, now) {
|
|||||||
|
|
||||||
function getSongs() {
|
function getSongs() {
|
||||||
var all = $('#search-all').val();
|
var all = $('#search-all').val();
|
||||||
|
var uploader = $('#search-uploader').val();
|
||||||
var page = $('.pagenum').val();
|
var page = $('.pagenum').val();
|
||||||
var pagesize = $('.pagesize').val();
|
var pagesize = $('.pagesize').val();
|
||||||
$.post('/api/songs', {all: all, page: page, pagesize: pagesize, csrfmiddlewaretoken: csrf_token}, function (result) {
|
$.post('/api/songs', {all: all, uploader: uploader, page: page, pagesize: pagesize, csrfmiddlewaretoken: csrf_token}, function (result) {
|
||||||
$('#request-table tbody').empty();
|
$('#request-table tbody').empty();
|
||||||
songs = result.data;
|
songs = result.data;
|
||||||
$.each(songs, function (id, song) {
|
$.each(songs, function (id, song) {
|
||||||
@ -412,4 +413,4 @@ function createAlert(type, message) {
|
|||||||
message +
|
message +
|
||||||
'</div>';
|
'</div>';
|
||||||
$('body > div.container > div.alert-location').prepend(alertText);
|
$('body > div.container > div.alert-location').prepend(alertText);
|
||||||
}
|
}
|
||||||
@ -60,7 +60,8 @@
|
|||||||
<th>Report</th>
|
<th>Report</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="5"><input id="search-all" class="search-input" type="text"></th>
|
<th colspan="2"><input id="search-all" class="search-input" type="text"></th>
|
||||||
|
<th colspan="3"><input id="search-uploader" class="search-input" type="text"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
|
|||||||
Reference in New Issue
Block a user