{% extends "layout_bs4.html" %}
{% from "overview/utils.html" import institute_macro %}

{% block title %}
  {{ super() }} - Institutes
{% endblock %}

{% block top_nav %}
  {{ super() }}
  <li class="nav-item active">
    <span class="navbar-text">Institutes</span>
  </li>
{% endblock %}

{% block content_main %}
<div class="container-float">
  <div class="card-columns">
  <!-- visualize first users's institutes and make info editable -->
  {% for institute in institutes if institute.internal_id in current_user.institutes %}
    {{ institute_macro(institute, current_user) }}
  {% endfor %}

  <!-- Then show all other institutes -->
  {% for institute in institutes if institute.internal_id not in current_user.institutes %}
    {{ institute_macro(institute, current_user) }}
  {% endfor %}
  </div>
</div>
{% endblock %}
