{% set header_actions %} {{ _("Back to device") }} {% endset %} {% call page_header(_("Shared by %(device)s", device=device.display_name), actions=header_actions) %} {% if label %}{{ label }} — {% endif %} {%- if error -%} {{ _("Unavailable") }} {%- elif files|length > 0 -%} {% trans trimmed count=files|length, shown=files|length|format_integer, total=pagination.total_items|format_integer %} Showing {{ shown }} of {{ total }} shared file {% pluralize %} Showing {{ shown }} of {{ total }} shared files {% endtrans %} {%- else -%} {{ _("No shared files found") }} {%- endif -%} {% endcall %} {% include "sharing/_transfers_panel.html" %} {% if error %}

{{ _("Could not reach this device") }}

{{ error }}

{{ _("Try again") }}
{% elif files|length > 0 %} {% if download_dir %} {# "Select all" is every file matching the scope + filters, including the pages not rendered — the batch snapshots the manifest from the peer, so it is never limited to what is on screen. #} {% call selection_bar('remote-selection', selection, _('Select all %(count)s matching', count=pagination.total_items|format_integer)) %} {% endcall %} {% else %} {# Pulling needs somewhere to put the files, so without a download directory there is nothing to select. This sits in the selection bar's own slot and says so, rather than leaving the grid looking broken. #}
{{ _("Choose a download directory before you can pull files from this device.") }} {{ _("Set download directory") }}
{% endif %} {# No selection without a download directory: checkboxes that cannot lead anywhere are worse than none. #}
{% for file in files %}
{# Previews are live p2p calls, so the queue in remote_gallery.js loads them viewport-first with bounded concurrency — never the browser's own free-for-all. While pending, the transparent src shows the CSS skeleton plate; the real "not found" placeholder appears only after a load truly fails. #} {{ file.name }} {% if file.duration_seconds %} {{ file.duration_seconds | format_duration }} {% endif %}
{{ _("Name") }}
{{ file.name }}
{{ _("Folder") }}
{{ file.relative_path.rsplit('/', 1)[0] if '/' in file.relative_path else '' }}
{{ _("Taken") }}
{{ file.date_taken | format_date('datetime') if file.date_taken else _("Unknown date") }}
{% if file.location_name %}
{{ _("Location") }}
{{ file.location_name }}
{% endif %}
{{ _("Size") }}
{{ file.size | filesizeformat }}
{{ file.date_taken | format_date("date") if file.date_taken else _("Unknown date") }}
{% endfor %}
{# Scope + filters + selection, built once in the route. #} {{ render_pagination( pagination.current_page, pagination.total_items, pagination.page_size, pagination.page_sizes, url_for('sharing_device_files', device_id=device.device_id), page_params ) }} {% else %}

{{ _("No shared files found") }}

{{ _("Try adjusting your filters, or check what this device shares with you.") }}

{% endif %}