Dateien noch in globale Suche aufgenommen

This commit is contained in:
holger.trampe 2020-04-23 16:44:24 +02:00
parent c3b6392e10
commit 8cdee5ebd7
5 changed files with 20 additions and 3 deletions

View File

@ -15,9 +15,11 @@ import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
############################################## DEV #####################################
BASE_URL = "https://dev01.digitale-agentur.com/"
CRONAPIKEY = "gCddsaz6NOnE9QbXZM5LasdEk122D"
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

View File

@ -9,7 +9,7 @@
</nav>
<h4>Standards aus dem Bereich {{areaname}}</h4>
<hr>
<div class="row ml-1">
<div class="row ml-1 col-12">
<table class="table hover" id="standardstable">
<thead>
<tr>

View File

@ -49,6 +49,16 @@
<p>Keine Ergebnisse bei Mitarbeitern</p>
{% endif %}
<hr>
<h4>Dateien</h4>
{% if res_files|length > 0 %}
{% for s in res_files %}
<i class="fas fa-fw fa-file"></i>&nbsp;&nbsp;<a href="{% url 'cloud-td' s.pk %}" target="_blank"><b>{{s.name}}</b></a></a><br /><br />
{% endfor %}
{% else %}
<p>Keine Ergebnisse bei Mitarbeitern</p>
{% endif %}
<hr>
<h4>Quicklinks</h4>
{% if links|length > 0 %}

View File

@ -19,6 +19,7 @@ from datetime import datetime
from django.utils import timezone
from django.utils import formats
from news.models import News
from cloud.models import DataFile
import requests
import json
import random
@ -519,7 +520,11 @@ def GlobalSearch(request):
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)
links = QuickLinks.objects.filter(agency__pk=ag).filter(name__icontains=searchfor) | QuickLinks.objects.filter(agency__pk=ag).filter(link__icontains=searchfor)
html = render_to_string('users/searchres.html', {'links': links, 'res_standard': res_standard, 'res_areas': res_areas, 'res_tasks': res_tasks, 'res_pers': res_pers, 'res_news' : res_news, 'res_pass' : res_pass, 'res_contacts' : res_contacts})
res_files = DataFile.objects.filter(agency__pk=ag).filter(name__icontains=searchfor)
print(res_files)
html = render_to_string('users/searchres.html', {'links': links, 'res_standard': res_standard, 'res_areas': res_areas, 'res_tasks': res_tasks, 'res_pers': res_pers, 'res_news' : res_news, 'res_pass' : res_pass, 'res_contacts' : res_contacts, 'res_files' : res_files})
return HttpResponse(html)
else:
return HttpResponse("Request method is not a GET")