https und suche

This commit is contained in:
Holger Trampe 2019-12-16 16:55:24 +01:00
parent 89fa8910de
commit 5fddfc4b7c
3 changed files with 2 additions and 23 deletions

View File

@ -29,8 +29,8 @@
<link href='https://fonts.googleapis.com/css?family=Roboto&display=swap' rel='stylesheet' type='text/css'>
<!-- include summernote css/js -->
<link href="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.12/summernote.js"></script>
</head>

View File

@ -404,27 +404,6 @@ def GlobalSearch(request):
res_areas = Areas.objects.filter(agency__pk=ag).filter(name__icontains=searchfor)
res_tasks = Tasks.objects.filter(agency__pk=ag).filter(name__icontains=searchfor) |Tasks.objects.filter(agency__pk=ag).filter(area__name__icontains=searchfor)
res_pers = User.objects.filter(profile__agency__pk=ag).filter(first_name__icontains=searchfor) | User.objects.filter(profile__agency__pk=ag).filter(last_name__icontains=searchfor)
'''
results_st = list(results)
final_results_st = []
i = 0
for ele in results_st:
tempele = {}
tempele['id'] = ele.pk
tempele['name'] = ele.name
# First 100 chars of the Content
tempele['content'] = cleanhtml(ele.content[:100])
tempele['first_name'] = ele.created_standard_by.first_name
tempele['last_name'] = ele.created_standard_by.last_name
tempele['first_name_mod'] = ele.last_modified_by.first_name
tempele['last_name_mod'] = ele.last_modified_by.last_name
tempele['created'] = formats.date_format(ele.created_standard_date, "d.m.Y")
tempele['last_modified_on'] = formats.date_format(ele.last_modified_on, "d.m.Y")
final_results_st.append(tempele)
i += 1
'''
#return JsonResponse({'standards' : final_results_st})
html = render_to_string('users/searchres.html', {'res_standard': res_standard, 'res_areas': res_areas, 'res_tasks': res_tasks, 'res_pers': res_pers})
return HttpResponse(html)
else: