{% from "macros/box.html" import m_box, m_box_menu with context %}

{% call m_box_menu() %}
  <ul class="nav nav-list">
  <ul class="nav nav-list">
    <li><a href="{{ url_for("social.home") }}">{{ _("My feed") }}</a></li>
    <li><a href="{{ url_for(current_user) }}">{{ _("My profile") }}</a></li>
    <li><a href="{{ url_for("social.users") }}">{{ _("User directory") }}</a></li>
  </ul>
{% endcall %}


{% call m_box(_("My communities"), color="orange") %}
  <ul class="nav nav-list">
    {% set communities = g.sidebars.my_communities %}
    {% for community in communities %}
      <li><a
          href="{{ url_for("communities.community", community_id=community.slug) }}">{{ community.name }}</a>
      </li>
    {% endfor %}
  </ul>
{% endcall %}


{% call m_box(_("Latest visitors"), color="orange") %}
  <ul class="latest-visitors">
    {%- set img_online = url_for('abilian_sbe_static', filename='img/greendot.png') %}
    {%- for user in g.sidebars.latest_visitors %}
      <li><a href="{{ url_for(user) }}">
        <img class="avatar" src="{{ user_photo_url(user, size=20) }}" alt=""/>
        {{ user.name }}
      </a>
        {%- if user.is_online %}
          <img src="{{ img_online }}" alt=""/>
        {%- endif %}
      </li>
    {%- endfor %}
  </ul>
{%- endcall %}
