{# Shared quarantine banner partial. Surfaces submission status (under review / quarantined / hidden / override-applied) to the entity owner + admins. Self-guarded so it's safe to {% include %} from any detail page — renders nothing when the entity is approved or the viewer isn't owner/admin. Required scope: entity — store_entities row (must carry visibility_status, visibility_status; entity.id surfaces in admin detail link) quarantine_sub — latest store_submissions row for entity, or None is_owner — bool, viewer == entity.owner_user_id is_admin — bool, viewer is in Admin group Mirror of the version that previously lived in store_detail.html. Wording stays consistent with the per-status messaging the user approved earlier — only the rendering location changed. #} {% if entity.visibility_status != 'approved' and (is_owner or is_admin) %} {% set sub = quarantine_sub %} {% set st = sub.status if sub else entity.visibility_status %} {% set bcls = 'pending' if st in ['pending_inline','pending_llm','pending'] else ('blocked' if st in ['blocked_inline','blocked_llm','review_error'] else 'hidden') %}
{% if st == 'pending_llm' or st == 'pending_inline' or st == 'pending' %}

⟳ Under review

Your submission is being checked. It is hidden from the public Store and from anyone else's view until all checks pass. Page refreshes automatically when the verdict lands — usually a few seconds.
{% elif st == 'blocked_inline' %}

⚠ Quarantined — automated checks failed

Your submission failed at least one automated check and has been quarantined. It is hidden from the public Store and from every other user; nobody can install it. Fix the issues below and re-upload to retry, or wait for an admin to resolve the quarantine.
{% if sub and sub.inline_checks %} {% set ic = sub.inline_checks %} {% if ic.manifest and ic.manifest.issues %} {% endif %} {% if ic.static_security and ic.static_security.findings %} {% endif %} {% endif %} {% elif st == 'blocked_llm' %}

⚠ Quarantined — security review flagged risk

The security reviewer flagged this submission. It is hidden from the public Store and from every other user; nobody can install it. Address the findings below and re-upload, or wait for an admin to resolve the quarantine.
{% if sub and sub.llm_findings %} {% if sub.llm_findings.summary %}
{{ sub.llm_findings.summary }}
{% endif %} {% if sub.llm_findings.findings %} {% endif %} {% endif %} {% elif st == 'review_error' %}

⚠ Under review — security check errored

The security reviewer couldn't complete its check. The submission stays hidden until an admin retries. No action needed from you.
{% if sub and sub.llm_findings and sub.llm_findings.error %}
Error: {{ sub.llm_findings.error }}
{% endif %} {# Surface any inline-check findings that were captured before the LLM step errored — gives the submitter something concrete to look at instead of a bare "errored" message. #} {% if sub and sub.inline_checks %} {% set ic = sub.inline_checks %} {% if ic.static_security and ic.static_security.findings %} {% endif %} {% endif %} {% elif st == 'overridden' %}

✓ Admin override applied

This submission was force-published by an admin.
{% if sub and sub.override_reason %}
Override reason: {{ sub.override_reason }}
{% endif %} {% else %} {# Fallback for hidden / unexpected lifecycle states. Surface whatever verdict context the submission row carries so an admin doesn't see a bare "Hidden" with no actionable detail. #}

Hidden

This entity is not visible in the public Store (visibility_status = "{{ entity.visibility_status }}").
{% if sub and sub.inline_checks %} {% set ic = sub.inline_checks %} {% if ic.manifest and ic.manifest.issues %} {% endif %} {% if ic.static_security and ic.static_security.findings %} {% endif %} {% endif %} {% if sub and sub.llm_findings %} {% if sub.llm_findings.summary %}
{{ sub.llm_findings.summary }}
{% endif %} {% if sub.llm_findings.findings %} {% endif %} {% endif %} {% endif %} {% if is_admin and sub %}
Open submission detail →
{% endif %}
{# Auto-refresh while the verdict is pending. Banner copy promises "page refreshes automatically when the verdict lands" — this is what does it. Polls the owner-accessible flea detail endpoint and reloads when EITHER visibility flips off 'pending' OR the submission verdict flips off 'pending_inline' / 'pending_llm'. Both signals are needed because `blocked_llm` keeps the entity at `visibility_status='pending'` (admin can override → publish), so visibility alone doesn't fire. Only emits the script while the verdict itself is still pending; terminal states render the final banner copy and don't need to reload. #} {% if quarantine_sub and quarantine_sub.status in ['pending_inline', 'pending_llm'] %} {% endif %} {% endif %}