{# 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. #} {# Gate widened for failure surfacing: under deferred promotion (v37+), a v2+ edit can leave the entity approved at the prior version while the latest submission landed in `review_error` / `blocked_llm` / `blocked_inline`. The original `visibility_status != 'approved'` gate silently hid those failures from the owner. Render the banner whenever EITHER the entity itself is non-approved OR the latest submission carries a *failure* verdict the owner needs to see. Pending edits keep the original behavior — Edit button locks instead, no banner. #} {% if (is_owner or is_admin) and ( entity.visibility_status != 'approved' or (quarantine_sub and quarantine_sub.status in [ 'blocked_inline', 'blocked_llm', 'review_error', ]) ) %} {% 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' %} {% set _is_edit_review = entity.version_no and entity.version_no > 1 %} {% if _is_edit_review %}

⟳ Version {{ entity.version_no }} under review

Your edit is being checked. The previously approved version (v{{ entity.version_no - 1 }}) keeps serving to existing installers until v{{ entity.version_no }} passes review. The page refreshes automatically when the verdict lands.
{% else %}

⟳ 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.
{% endif %} {% elif st == 'blocked_inline' %} {% set _is_edit_review = entity.visibility_status == 'approved' %} {% if _is_edit_review %}

⚠ Latest edit failed automated checks

Your latest edit failed at least one automated check. The previously approved version (v{{ entity.version_no }}) keeps serving to existing installers. Fix the issues below and re-upload, or wait for an admin to resolve the quarantine.
{% else %}

⚠ 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.
{% endif %} {% 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 %} {% if ic.content and ic.content.issues %} {% include "_content_findings.html" with context %} {% endif %} {% endif %} {% elif st == 'blocked_llm' %} {% set _is_edit_review = entity.visibility_status == 'approved' %} {% if _is_edit_review %}

⚠ Latest edit failed review

The reviewer flagged your latest edit for security risk and/or weak component descriptions. The previously approved version (v{{ entity.version_no }}) keeps serving to existing installers. Address the findings below and re-upload, or wait for an admin to resolve the quarantine.
{% else %}

⚠ Quarantined — review flagged issues

The reviewer flagged this submission for security risk and/or weak component descriptions. 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.
{% endif %} {% if sub and sub.llm_findings %} {% if sub.llm_findings.summary %}
{{ sub.llm_findings.summary }}
{% endif %} {% if sub.llm_findings.findings %}
Security findings
{% endif %} {% if sub.llm_findings.content_quality and sub.llm_findings.content_quality.issues %}
Description quality — reviewer suggestions
{% endif %} {% endif %} {% elif st == 'review_error' %} {% set _is_edit_review = entity.visibility_status == 'approved' %} {% if _is_edit_review %}

⚠ Latest edit failed review

The security reviewer couldn't complete its check on your latest edit. The previously approved version (v{{ entity.version_no }}) keeps serving to existing installers. No action needed from you — an admin will retry.
{% else %}

⚠ 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.
{% endif %} {% 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 %} {# How-to-fix panel — render once below the per-tier findings whenever content-quality issues exist on either tier. Same guidance regardless of whether the inline mechanical check or the LLM substantive check rejected the submission. #} {% if sub and ((sub.inline_checks and sub.inline_checks.content and sub.inline_checks.content.issues) or (sub.llm_findings and sub.llm_findings.content_quality and sub.llm_findings.content_quality.issues)) %} {% include "_content_howto_fix.html" with context %} {% 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 %}