diff --git a/adserver/models.py b/adserver/models.py index 6009e53a..7fdbac30 100644 --- a/adserver/models.py +++ b/adserver/models.py @@ -1065,6 +1065,11 @@ def get_exclude_countries_display(self): def get_days_display(self): return [day.capitalize() for day in self.days] + def get_analyzed_urls_display(self): + if "adserver.analyzer" not in settings.INSTALLED_APPS: + return [] + return [aau.url for aau in self.analyzedadvertiserurl_set.all()] + def show_to_geo(self, geo_data): """ Check if a flight is valid for a given country code. diff --git a/adserver/templates/adserver/includes/flight-metadata.html b/adserver/templates/adserver/includes/flight-metadata.html index 4aeef4a2..4a5502db 100644 --- a/adserver/templates/adserver/includes/flight-metadata.html +++ b/adserver/templates/adserver/includes/flight-metadata.html @@ -134,6 +134,11 @@ {% if flight.targeting_parameters.days %}
  • {% blocktrans with value=flight.get_days_display|join:', ' %}Days: {{ value }}{% endblocktrans %}
  • {% endif %} + {% if flight.targeting_parameters.niche_targeting %} + {% with flight.get_analyzed_urls_display|join:', ' as urls %} +
  • {% blocktrans with value=flight.niche_targeting|floatformat:2 %}Niche: Similarity {{ value }} to {{ urls }}{% endblocktrans %}
  • + {% endwith %} + {% endif %} {% endif %}