{% extends "admin/base.html" %} {% block subtitle %}{{ _('Thumbnails') }} {{ g.template_title_delimiter }} {{ super() }}{% endblock %} {% block secondary_content %}

{{ _('Thumbnails') }}

{{ _("Every Website (Plus) and PDF (Plus) view's thumbnail and screenshot. Editors manage a dataset's own on its Thumbnails tab.") }}

{{ _("Your requests skip the wait between screenshots of a view, but a view still gets one at a time. A removed copy is made again at the view's next save or refresh, unless automatic thumbnails are off.") }}

{% endblock %} {% block primary_content_inner %} {% asset 'webpageviewplus/thumbnails-css' %} {% import 'webpageviewplus/manage_macros.html' as m with context %} {% set filter_labels = { 'all': _('All views'), 'failed': _('Failed screenshots'), 'stale': _('Old screenshots'), 'blocked': _('Refusing framing, no screenshot'), 'skipped': _('Skipped: private dataset, hosted service'), 'opted_out': _('Automatic thumbnails off'), } %} {% set reasons = { 'page_failed': _("the page didn't load"), 'unreachable': _("the page couldn't be reached"), 'backend_error': _('the screenshot service refused the request'), 'rate_limited': _("the screenshot service's allowance is used up for now"), 'no_image': _("the answer wasn't an image"), 'unsafe_backend': _("the screenshot service isn't set up safely"), } %}

{{ _('Thumbnails and screenshots') }}

{{ _('Screenshot service') }}

{% if backend.backend == 'none' %}

{{ _('Screenshots are off (ckanext.webpageviewplus.screenshot_backend is none).') }}

{% else %}
{{ _('Service') }}
{{ backend.backend }}
{{ _('Taken after saves and on request') }}
{%- if not backend.jobs -%}{{ _('No: only on the schedule (ckan webpageviewplus screenshots).') }} {%- elif backend.worker -%}{{ _('Yes, and a worker reads the queue.') }} {%- elif backend.worker is none -%}{{ _("Yes, but it couldn't be told whether a worker reads the queue.") }} {%- else -%}{{ _('Yes, but no worker reads the queue: run ckan jobs worker webpageviewplus.') }} {%- endif -%}
{{ _('Allowance') }}
{% if backend.limited_until %}{{ _('Used up until {date}.').format(date=h.render_datetime(backend.limited_until, with_hours=True)) }}{% else %}{{ _('Not used up.') }}{% endif %}
{{ _('Last screenshot') }}
{% if backend.last_success %}{{ h.render_datetime(backend.last_success, with_hours=True) }}{% else %}{{ _('None yet') }}{% endif %}
{{ _('Last failure') }}
{% if backend.last_failure %}{{ h.render_datetime(backend.last_failure.at, with_hours=True) }}: {{ reasons.get(backend.last_failure.kind, backend.last_failure.kind) }}{% else %}{{ _('None') }}{% endif %}
{% if backend.backend == 'gotenberg' %}
{{ _('Refuses private addresses') }}
{%- if backend.gotenberg_safe -%}{{ _('Yes, checked in the last hour.') }} {%- elif backend.gotenberg_safe is none -%}{{ _('Not checked recently.') }} {%- else -%}{{ _('No, so no screenshots are taken.') }} {%- endif -%}
{% endif %}
{% if backend.backend == 'gotenberg' %}
{{ h.csrf_input() }}
{% endif %} {% endif %}

{{ _('Views') }}

{{ ungettext('{count} view.', '{count} views.', status.count).format(count=status.count) }}

{% if status.rows %}
{{ h.csrf_input() }}
{{ _('For the ticked views') }}
{% for row in status.rows %} {% endfor %}
{{ filter_labels[args.filter] }}
{{ _('Tick') }} {{ _('View') }} {{ _('In the resource list') }} {{ _('Stored thumbnail') }} {{ _('Screenshot') }}
{{ row.title or row.resource_name }}
{{ row.dataset_title }}{% if row.private %} ({{ _('Private') }}){% endif %}
{{ m.shows(row) }} {{ m.stored(row) }} {{ m.screenshot(row.screenshot) }}
{{ h.csrf_input() }}
{{ ungettext('For the {count} view this filter shows', 'For all {count} views this filter shows', status.count).format(count=status.count) }} {% if status.count > max_ids %}

{% endif %}
{% if pages > 1 %} {% endif %} {% endif %}
{% endblock %}