feat: Display only domain for further information link
This commit is contained in:
parent
c0a89c266a
commit
8c69bb8717
@ -191,6 +191,13 @@ class AdoptionNotice(models.Model):
|
|||||||
distance = geo.calculate_distance_between_coordinates(self.position, position)
|
distance = geo.calculate_distance_between_coordinates(self.position, position)
|
||||||
return distance < max_distance
|
return distance < max_distance
|
||||||
|
|
||||||
|
@property
|
||||||
|
def link_to_more_information(self):
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
|
domain = urlparse(self.further_information).netloc
|
||||||
|
return f"<a href='{self.further_information}'>{domain}</a>"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
<td>{{ adoption_notice.searching_since }}</td>
|
<td>{{ adoption_notice.searching_since }}</td>
|
||||||
{% if adoption_notice.further_information %}
|
{% if adoption_notice.further_information %}
|
||||||
<td>{{ adoption_notice.further_information }}</td>
|
<td>{{ adoption_notice.link_to_more_information | safe }}</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user