{% comment %} One approval row per Post (bundled actions on post.id). Matches the approved "ApprovalRow" design. Context: post (+ post.visible_comments), workspace, can_approve, display_timezone, and the parent Alpine scope (selectedPosts, diffOpen). {% endcomment %} {% load tz approval_extras %}
{% if can_approve and post.is_actionable %} {% endif %} {# media thumbnail #} {% with att=post.media_attachments.all.0 %} {% if att.media_asset.thumbnail %} {% elif att.media_asset.file and att.media_asset.media_type == 'image' %} {% else %}
{% endif %} {% endwith %}
{% status_badge post.status %}
{% for pp in post.platform_posts.all %} {% include "partials/_platform_icon.html" with platform=pp.social_account.platform size="sm" %} {% endfor %}
{% if post.scheduled_at %}{% timezone display_timezone %}{{ post.scheduled_at|date:"M j, g:i A" }}{% endtimezone %} {% elif post.proposed_publish_at %}Proposed {% timezone display_timezone %}{{ post.proposed_publish_at|date:"M j, g:i A" }}{% endtimezone %}{% endif %}

{{ post.title|default:post.caption_snippet|default:"(no caption)" }}

{{ post.author.display_name|default:"?"|make_list|first|upper }} by {{ post.author.display_name|default:"Unknown" }}
{# expanded preview #}

{{ post.caption }}

{% if post.media_attachments.all %}
{% for pm in post.media_attachments.all %} {% if pm.media_asset.thumbnail %} {% elif pm.media_asset.file and pm.media_asset.media_type == 'image' %} {% else %}
{% endif %} {% endfor %}
{% endif %} {% if post.visible_comments %}
{% for c in post.visible_comments %}
{{ c.author.display_name|default:"?"|make_list|first|upper }}
{{ c.author.display_name|default:"Unknown" }} {% if c.visibility == 'external' %}shared with client{% endif %} {{ c.created_at|timesince }} ago

{{ c.body }}

{% endfor %}
{% endif %} {% if post.versions.all|length >= 2 %} {% endif %}
{# right-hand actions #} {% if can_approve and post.is_actionable %} {% url 'approvals:approve' workspace_id=workspace.id post_id=post.id as approve_url %}
{% elif post.status == 'changes_requested' or post.status == 'rejected' or post.status == 'approved' %} {% elif post.status == 'on_hold' and can_approve %}
{% endif %}
{# inline review panel (request changes / reject) #} {% if can_approve and post.is_actionable %}
A comment is required
{% endif %}