{% extends "docbow/base_user.html" %}
{% load i18n %}
{% load cache %}
{% load docbow %}

{% block main-column %}
{% block box_title %}
<h3>{% trans "MailingLists" %}</h3>
{% endblock %}

<ul id="mailing-lists-index">
  <h4>{% trans "Lists index" %}</h1>
  {% for ml in mailing_lists %}
  <li>
      <a href="#{{ ml.name|slugify }}">
        {{ ml.name }}
      </a>
  </li>
  {% endfor %}
</ul>
<div id="mailing-lists">
  {% for ml in mailing_lists %}
  <div id="{{ ml.name|slugify }}">
    <h4>{{ ml.name }}</h4>
    <ul class="members">
      {% for user in ml.members|order_by:"last_name,first_name" %}
      <li>{{ user.first_name}} {{ user.last_name }}{% if not user.first.name and not user.last_name %}({{ user.username }}){% endif %}</li>
      {% endfor %}
    </ul>
    <ul class="mailing-list-members">
      {% with ml.mailing_list_members|order_by:"name" as ml_members %}
        {% for ml in ml_members %}
          <li>
            <a href="#{{ ml.name|slugify }}">
              {{ ml.name }}
            </a>
          </li>
        {% endfor %}
      {% endwith %}
    </ul>
  </div>
  {% endfor %}
</div>
{% endblock %}
