<tr id="article-{{ a.id }}">
  <td onclick="event.stopPropagation()">
    <input type="checkbox" class="article-checkbox" data-id="{{ a.id }}"
           onchange="toggleArticleSelect({{ a.id }}, this.checked)">
  </td>
  <td style="max-width:280px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap"
      title="{{ a.url_path }}">{{ a.title }}</td>
  <td>
    {% if a.display_status == 'live' %}
      <span class="badge-success">Live</span>
    {% elif a.display_status == 'scheduled' %}
      <span class="badge-warning">Scheduled</span>
    {% else %}
      <span class="badge">Draft</span>
    {% endif %}
    {% if a.noindex %}<span class="badge" style="background:#FEF3C7;color:#92400E;font-size:0.6rem">noindex</span>{% endif %}
  </td>
  <td class="mono">{{ a.published_at[:10] if a.published_at else '-' }}</td>
  <td>{{ a.language | upper if a.language else '-' }}</td>
  {% if current_article_type == 'generated' %}<td class="text-slate">{{ a.template_slug or '-' }}</td>{% endif %}
  <td class="text-right" style="white-space:nowrap">
    {% if a.display_status == 'live' %}
    <a href="/{{ a.language or 'en' }}{{ a.url_path }}" target="_blank" class="btn-outline btn-sm">View</a>
    {% endif %}
    <a href="{{ url_for('admin.article_edit', article_id=a.id) }}" class="btn-outline btn-sm">Edit</a>
    <button hx-post="{{ url_for('admin.article_publish', article_id=a.id) }}"
            hx-target="#article-{{ a.id }}" hx-swap="outerHTML"
            hx-headers='{"X-CSRF-Token": "{{ csrf_token() }}"}'
            class="btn-outline btn-sm">
      {% if a.display_status != 'draft' %}Unpublish{% else %}Publish{% endif %}
    </button>
    <button hx-post="{{ url_for('admin.article_delete', article_id=a.id) }}"
            hx-target="#article-{{ a.id }}" hx-swap="outerHTML swap:200ms"
            hx-confirm="Delete this article?"
            hx-headers='{"X-CSRF-Token": "{{ csrf_token() }}"}'
            class="btn-outline btn-sm">Delete</button>
  </td>
</tr>
