{% import 'macros/links.html' as links %}

{# Associated Posts - vertical on mobile, horizontal with arrows on desktop #}
<div class="flex flex-col sm:flex-row sm:items-center gap-2 border-r border-stone-200 mr-2 sm:max-w-2xl"
     id="entry-posts-nav-wrapper">
  {% from 'macros/scrolling_menu.html' import scrolling_menu with context %}
  {% call(entry_post) scrolling_menu('entry-posts-container', entry_posts) %}
    <a
      href="{{ coop_url('/' + entry_post.slug + '/') }}"
      class="flex items-center gap-2 px-3 py-2 hover:bg-stone-100 rounded transition text-sm border sm:whitespace-nowrap sm:flex-shrink-0">
      {% if entry_post.feature_image %}
        <img src="{{ entry_post.feature_image }}"
             alt="{{ entry_post.title }}"
             class="w-8 h-8 rounded-full object-cover flex-shrink-0" />
      {% else %}
        <div class="w-8 h-8 rounded-full bg-stone-200 flex-shrink-0"></div>
      {% endif %}
      <div class="flex-1 min-w-0">
        <div class="font-medium truncate">{{ entry_post.title }}</div>
      </div>
    </a>
  {% endcall %}
</div>

{# Admin link #}
{% if g.rights.admin %}

    {% from 'macros/admin_nav.html' import admin_nav_item %}
    {{admin_nav_item(
      url_for(
        'calendars.calendar.day.calendar_entries.calendar_entry.admin.admin',
        slug=post.slug,
        calendar_slug=calendar.slug,
        day=day,
        month=month,
        year=year,
        entry_id=entry.id
      )
    )}}
{% endif %}
