{# Detail-page Keep/Pass/Untrack action bar (ARG-184). Rendered both by item_detail.html (initial page load) and as the HTMX swap target for POST /items/{id}/keep|pass?context=detail, POST /assets/{id}/untrack?context=detail, and POST /assets/{id}/handoff?context=detail. Passing ``context=detail`` on those routes is what makes them return THIS partial instead of the feed's ``_feed_card.html`` — the detail page has exactly one card on screen, so it needs its own standalone fragment rather than a full card re-render. Every detail mutation swaps the whole ``#detail-actions-`` wrapper (banner + bar) via outerHTML, so the handoff banner and the action bar can never drift into an inconsistent state (ARG-209): a handoff archives the predecessor, and the re-rendered wrapper drops the banner and shows the Archived bar in one swap. The inner ``#item-actions-`` div is kept so existing selectors/tests still resolve. Once an item is Kept, the Keep button is replaced by Untrack (mirrors the portfolio's one-way "release from Keep" action) rather than staying a togglable ✓ Keep — Pass stays a toggle in both states, same as the feed. #} {# ``action_context`` is ``detail`` on the item page and ``event`` on the event page (ARG-243); it rides along on every POST so the response re-renders this bar for the right page (the event page has no 관련 신호 to refresh). #} {% set ctx = action_context | default('detail') %} {% set is_kept = item.status and item.status.value == 'Keep' %} {% set is_passed = item.status and item.status.value == 'Archived' %} {% set actions_target = '#detail-actions-' ~ item.id %} {% set untrack_params = ['context=' ~ ctx, 'tech_id=' ~ item.id] %} {% set pass_params = ['context=' ~ ctx] + (['active=1'] if is_passed else []) %} {# ARG-209 AC1/AC3: a Keep asset with a Replace successor gets a handoff banner. `item.successors` already carries relation_type for every successor (existing 🧬 genealogy query) — reused here as-is, no new query needed on the detail page. #} {% set replace_successor = (item.successors | selectattr('relation_type.value', 'equalto', 'Replace') | first) if (is_kept and item.successors) else None %}
{% if replace_successor %}

🔁 {{ replace_successor.title }}이(가) 이 기술을 대체합니다

{% endif %}
{% if is_kept %} {% else %} {% endif %}