parent
52768c0cee
commit
0529367e0c
|
|
@ -1,6 +1,7 @@
|
|||
media/agencymain/*
|
||||
!media/agencymain/default.jpg
|
||||
!media/agencymain/linkdefault.jpg
|
||||
!media/agencymain/linkdefault.png
|
||||
|
||||
media/userprofilepics/*
|
||||
!media/userprofilepics/default.jpg
|
||||
media/uploadsCK/*
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
|
@ -22,7 +22,7 @@ class QuickLinks(models.Model):
|
|||
agency = models.ForeignKey(Agency, on_delete=models.PROTECT)
|
||||
name = models.CharField(max_length=200, blank=False)
|
||||
link = models.CharField(max_length=200, blank=False)
|
||||
logo = models.ImageField(default='agencymain/default.jpg', upload_to='agencymain', blank=True)
|
||||
logo = models.ImageField(default='agencymain/linkdefault.png', upload_to='agencymain', blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.name}'
|
||||
|
|
@ -35,5 +35,5 @@ class QuickLinks(models.Model):
|
|||
if self.logo and hasattr(self.logo, 'url'):
|
||||
return self.logo.url
|
||||
else:
|
||||
return "/media/agencymain/linkdefault.jpg"
|
||||
return "/media/agencymain/linkdefault.png"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<div class="content-section col-6">
|
||||
<h3>Quicklink aktualisieren</h3>
|
||||
<hr>
|
||||
<form method="POST">
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<hr>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -38,4 +38,14 @@
|
|||
{% else %}
|
||||
<p>Keine Ergebnisse in Personen</p>
|
||||
{% endif %}
|
||||
|
||||
<hr>
|
||||
<h4>Quicklinks</h4>
|
||||
{% if links|length > 0 %}
|
||||
{% for s in links %}
|
||||
<i class="fas fa-external-link-alt"></i> <a href="{{ s.link }}" target="_blank"><b>{{s.name}}</b></a><br /><br />
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p>Keine Ergebnisse in Quicklinks</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
|
@ -12,6 +12,7 @@ from django.core.mail import send_mail
|
|||
from django.http import HttpResponseRedirect,HttpResponse, JsonResponse
|
||||
from areas.models import Areas
|
||||
from tasks.models import Tasks
|
||||
from quicklinks.models import QuickLinks
|
||||
from .priomodel import Prio
|
||||
from standards.models import Standards
|
||||
from datetime import datetime
|
||||
|
|
@ -404,7 +405,8 @@ 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)
|
||||
html = render_to_string('users/searchres.html', {'res_standard': res_standard, 'res_areas': res_areas, 'res_tasks': res_tasks, 'res_pers': res_pers})
|
||||
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})
|
||||
return HttpResponse(html)
|
||||
else:
|
||||
return HttpResponse("Request method is not a GET")
|
||||
|
|
|
|||
Loading…
Reference in New Issue