{# The user's Test of a service draft (sync_services.sync_service_test): what each hook returned and every web call, with whether it went out. Styled like the panel it sits in: section headings with info hovers, the web calls as the Access tab's rows. #} {% macro help_tip(text) %}{% endmacro %} {% macro heading(title, help=none) %}

{{ title }}

{% if help %}{{ help_tip(help) }}{% endif %}
{% endmacro %}
{% if report.ok %}{{ _("Passed") }}{% else %}{{ _("Problems") }}{% endif %} {{ _("Live reads") if report.live else _("No live reads") }} {{ help_tip(_("Reads went to the test account for real; nothing was sent or changed.") if report.live else _("Connect a test account to read live. Nothing was sent or changed.")) }}
{% if report.problems %} {% endif %} {% for option, items in report.choices.items() %} {{ heading(_("Choices for %(option)s", option=option), _("Copy an id into the field above to test with it.")) }} {% if items %} {% for item in items %}{% endfor %}
{{ _("Label") }}{{ _("Id") }}
{{ item.label }}{{ item.id }}
{% else %}

{{ _("None listed.") }}

{% endif %} {% endfor %} {% if report.role == 'source' %} {{ heading(ngettext("First page: %(num)d record", "First page: %(num)d records", report.record_count), _("More pages follow; a run lists them all.") if report.more else none) }} {% if report.records %} {% for record in report.records %} {% endfor %}
{{ _("File") }}{{ _("Size") }}{{ _("Taken") }}{{ _("Hash") }}
{{ record.filename }}{{ record.size or '' }} {{ (record.taken_at or {}).get('local') or (record.taken_at or {}).get('utc') or '' }} {{ _("yes") if record.hash else _("no") }}
{% endif %} {% elif report.role %} {{ heading(ngettext("Push of %(num)d photo", "Push of %(num)d photos", report.results | length), _("Uploads in a Test are recorded, not sent, so the service's real replies are missing; errors here can come from that.")) }} {% for result in report.results %} {% endfor %}
{{ _("Key") }}{{ _("Result") }}
{{ result.key }}{{ result.remote_id or (result.error or {}).get('code') or '' }}
{% endif %} {{ heading(_("Web calls")) }} {% if report.calls %} {% else %}

{{ _("None.") }}

{% endif %}