{% macro followee_icon(type) -%}
  {% if type == 'dataset' %}
    <i class="fa fa-sitemap"></i>
  {% elif type == 'user' %}
    <i class="fa fa-user"></i>
  {% elif type == 'group' %}
    <i class="fa fa-users"></i>
  {% elif type == 'organization' %}
    <i class="fa fa-building"></i>
  {% endif %}
{%- endmacro %}

<div id="followee-filter">
  <div class="dropdown">
    <a href="#" id="followee-popover" class="followee-toggle"
      aria-label="{{ _('Activity from:') }} {{ context.context }}">
      <span class="dropdown-content">
        <span class="label">{{ _('Activity from:') }}</span> {{ context.context }}
      </span>
      <span class="caret"><i class="fa-solid fa-angle-down"></i></span>
    </a>
  </div>

  <form id="followee-content" action="/dashboard" style=" display:none;">
    <div class="popover-header">
      <div class="input-group">
        <span class="input-group-text"><i class="fa fa-search"></i></span>
        <input type="text" class="form-control" name="q" placeholder="{{ _('Search list...') }}" value="{{context.q}}"
          autocomplete="off" aria-label="{{ _('Search followee') }}">
      </div>
    </div>
    {% if followees %}
      <ul class="nav flex-column">
        <li class="nav-item everything {% if context.selected_id == False %} active{% endif %}">
          <a class="nav-link" href="{{ h.url_for('activity.dashboard') }}">
            <i class="fa fa-star"></i>
            <span>Everything</span>
          </a>
        </li>
        {% for followee in followees %}
          <li {% if context.selected_id==followee.dict.id %} class="nav-item active" {% endif %}
            data-search="{{followee.display_name|lower}}">
            <a class="nav-link" href="{{ h.url_for('activity.dashboard', type=followee.type, name=followee.dict.name) }}"
              aria-label="{{followee.display_name}}">
              {{followee_icon(followee.type)}}
              <span>{{followee.display_name}}</span>
            </a>
          </li>
        {% endfor %}
      </ul>
    {% else %}
      <p class="empty">{{ _('You are not following anything') }}</p>
    {% endif %}
  </form>
</div>