{% set link_checker_result = h.ckanext_deadoralive_get(resource_id) %} {# Important! Don't show results if link_checker_result.alive is None, that just means we have a pending result but not an actual result yet. #} {% if link_checker_result and link_checker_result.broken != None %}
{% if link_checker_result.broken %}

{{ _("This resource link is broken") }}

{{ _("This resource link was broken when we last checked it on {0}:").format(h.render_datetime(link_checker_result.last_checked)) }}

  • {{ _("The file could not be downloaded.") }}
  • {% if link_checker_result.status or link_checker_result.reason %}
  • {{ _("The server returned an error: {0} {1} {1}.").format(link_checker_result.status, link_checker_result.reason) }}
  • {% endif %}
  • {# Comment - this assumes that links won't be marked as broken unless they've been broken for multiple consecutive checks, so we assume that "{{ num_fails }} checks" is plural here. #} {{ _("The link has been broken for the last {0} times that we've checked it.").format(link_checker_result.num_fails) }}
  • {% if link_checker_result.last_successful %}
  • {{ _("The link was last working when we checked it on {0}").format(h.render_datetime(link_checker_result.last_successful)) }}
  • {% endif %}

{% set url = h.url_for(controller='ckanext.deadoralive.controllers:BrokenLinksController', action='broken_links_by_organization') %} {{ _("View a report of all broken resource links on this site") }}

{% else %}
{{ _("This resource link is working") }} · {{ _("Last checked on") }} {{ h.render_datetime(link_checker_result.last_successful) }}.
{% endif %}
{% endif %}