ALLES FÜR EINE FEUCHTE VAGINA
This commit is contained in:
parent
dc7da099d3
commit
6f2d0adfff
|
|
@ -21,9 +21,9 @@ var data = [
|
||||||
{ 'id': 'parent', 'role': "", 'name': 'Agentur {{request.user.profile.agency.name}}', 'color': '#71AF17', "imageUrl": ""},
|
{ 'id': 'parent', 'role': "", 'name': 'Agentur {{request.user.profile.agency.name}}', 'color': '#71AF17', "imageUrl": ""},
|
||||||
{% for u in agencyuser %}
|
{% for u in agencyuser %}
|
||||||
{% if u.profile.parent == u %}
|
{% if u.profile.parent == u %}
|
||||||
{ 'id': '{{u.pk}}' , 'name': "{{u.first_name}} {{u.last_name}}",'role': '{{u.profile.get_func_display}}\n{{u.profile.compfunc}}', 'manager': 'parent', 'color': '#1859B7', "imageUrl": "{{u.profile.image.url}}", 'userid' : '{{u.pk}}' },
|
{ 'id': '{{u.pk}}' , 'name': "{{u.first_name}} {{u.last_name}}",'role': '{{u.profile.get_func_display}}\n{{u.profile.compfunc}}', 'manager': 'parent', 'color': '#1859B7', "imageUrl": "{{u.profile.image.get_photo_url}}", 'userid' : '{{u.pk}}' },
|
||||||
{% else %}
|
{% else %}
|
||||||
{ 'id': '{{u.pk}}', 'name': "{{u.first_name}} {{u.last_name}}", 'role': '{{u.profile.get_func_display}}\n{{u.profile.compfunc}}', 'manager': '{{u.profile.parent.pk}}', 'color': '#1859B7', "imageUrl": "{{u.profile.image.url }}", 'userid' : '{{u.pk}}'},
|
{ 'id': '{{u.pk}}', 'name': "{{u.first_name}} {{u.last_name}}", 'role': '{{u.profile.get_func_display}}\n{{u.profile.compfunc}}', 'manager': '{{u.profile.parent.pk}}', 'color': '#1859B7', "imageUrl": "{{u.profile.image.get_photo_url }}", 'userid' : '{{u.pk}}'},
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
{% for area in areas %}
|
{% for area in areas %}
|
||||||
<td class="text-center" style="background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 0.3)">
|
<td class="text-center" style="background-color: rgba({{area.color.0}},{{area.color.1}},{{area.color.2}}, 0.3)">
|
||||||
|
|
@ -70,7 +69,6 @@
|
||||||
border-collapse: separate;
|
border-collapse: separate;
|
||||||
border-spacing: 25px 0px;
|
border-spacing: 25px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
Binary file not shown.
|
|
@ -31,7 +31,7 @@ class Agency(models.Model):
|
||||||
city = models.CharField(default="", max_length=200, blank=True)
|
city = models.CharField(default="", max_length=200, blank=True)
|
||||||
email = models.EmailField(default="", blank=True)
|
email = models.EmailField(default="", blank=True)
|
||||||
phone = models.CharField(default="", max_length=20, blank=True)
|
phone = models.CharField(default="", max_length=20, blank=True)
|
||||||
agencypic = models.ImageField(default='default.jpg', upload_to='agencymain', blank=True)
|
agencypic = models.ImageField(default='default.jpg', upload_to='agencymain', blank=True, null="default.jpg")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'{self.name}'
|
return f'{self.name}'
|
||||||
|
|
@ -40,6 +40,13 @@ class Agency(models.Model):
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse('agency-update', kwargs={'pk':self.pk})
|
return reverse('agency-update', kwargs={'pk':self.pk})
|
||||||
|
|
||||||
|
@property
|
||||||
|
def get_photo_url(self):
|
||||||
|
if self.agencypic and hasattr(self.agencypic, 'url'):
|
||||||
|
return self.agencypic.url
|
||||||
|
else:
|
||||||
|
return "/media/default.jpg"
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Class Profile
|
Class Profile
|
||||||
|
|
||||||
|
|
@ -77,7 +84,7 @@ class Profile(models.Model):
|
||||||
func = models.CharField(choices=agency_task, default="", max_length=50)
|
func = models.CharField(choices=agency_task, default="", max_length=50)
|
||||||
# Wenn dieses Profil gelöscht wird, wird NICHT die Agency geslöscht
|
# Wenn dieses Profil gelöscht wird, wird NICHT die Agency geslöscht
|
||||||
agency = models.ForeignKey(Agency, on_delete=models.PROTECT)
|
agency = models.ForeignKey(Agency, on_delete=models.PROTECT)
|
||||||
image = models.ImageField(default='default.jpg', upload_to='userprofilepics', blank=True)
|
image = models.ImageField(default='default.jpg', upload_to='userprofilepics', blank=True, null="default.jpg")
|
||||||
compfunc = models.CharField(max_length=60, blank=True)
|
compfunc = models.CharField(max_length=60, blank=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -106,6 +113,12 @@ class Profile(models.Model):
|
||||||
img = img.resize((wsize, baseheight), Image.ANTIALIAS)
|
img = img.resize((wsize, baseheight), Image.ANTIALIAS)
|
||||||
img.save(self.image.path)
|
img.save(self.image.path)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def get_photo_url(self):
|
||||||
|
if self.image and hasattr(self.image, 'url'):
|
||||||
|
return self.image.url
|
||||||
|
else:
|
||||||
|
return "/media/default.jpg"
|
||||||
|
|
||||||
# PERMISSIONS - Über alle Modelle hinweg, in der url.py wird dann die route verhindert!
|
# PERMISSIONS - Über alle Modelle hinweg, in der url.py wird dann die route verhindert!
|
||||||
# Im template: if perms.users.PERMISSION
|
# Im template: if perms.users.PERMISSION
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
</p>
|
</p>
|
||||||
<h6><b>Agenturbild</b></h6>
|
<h6><b>Agenturbild</b></h6>
|
||||||
<p>
|
<p>
|
||||||
<img class="img-profile" width="75%" src="{{ request.user.profile.agency.agencypic.url }}">
|
<img class="img-profile" width="75%" src="{{ request.user.profile.agency.agencypic.get_photo_url }}">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{% if perms.users.agency_change %}
|
{% if perms.users.agency_change %}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
<div class="card ml-2 mb-2 col-3">
|
<div class="card ml-2 mb-2 col-3">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<img width="100%" src="{{ request.user.profile.agency.agencypic.url }}">
|
<img width="100%" src="{{ request.user.profile.get_photo_url }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="content-section">
|
<div class="content-section">
|
||||||
<div class="media">
|
<div class="media">
|
||||||
<img class="img-profile" width="17%" src="{{ user.profile.image.url }}">
|
<img class="img-profile " width="17%" src="{{ prof_user.profile.get_photo_url }}">
|
||||||
<div class="media-body col-5">
|
<div class="media-body col-5">
|
||||||
<h2 class="account-heading">Profil von {{ user.first_name }} {{ user.last_name }}</h2>
|
<h2 class="account-heading">Profil von {{ user.first_name }} {{ user.last_name }}</h2>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="content-section">
|
<div class="content-section">
|
||||||
<div class="media">
|
<div class="media">
|
||||||
<img class="img-profile " width="17%" src="{{ prof_user.profile.image.url }}">
|
<img class="img-profile " width="17%" src="{{ prof_user.profile.get_photo_url }}">
|
||||||
<div class="media-body col-5">
|
<div class="media-body col-5">
|
||||||
<h2 class="account-heading">Profil von {{ prof_user.first_name }} {{ prof_user.last_name }}</h2>
|
<h2 class="account-heading">Profil von {{ prof_user.first_name }} {{ prof_user.last_name }}</h2>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue