<%--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License.  You may obtain a copy of the License at
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  --%>

<%@ taglib prefix="ww" uri="/webwork" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %>

<c:forEach items="${mailingLists}" var="mailingList">
  <h3>
      ${mailingList.name}
  </h3>
  <%-- TODO: description
    <p>
      Description blah blah blah
    </p>
  --%>
  <ul>
    <c:if test="${!empty(mailingList.subscribeAddress)}">
      <li>
        <b>Subscribe:</b>
        <a href="mailto:${mailingList.subscribeAddress}">${mailingList.subscribeAddress}</a>
      </li>
    </c:if>
    <c:if test="${!empty(mailingList.postAddress)}">
      <li>
        <b>Post:</b>
        <a href="mailto:${mailingList.postAddress}">${mailingList.postAddress}</a>
      </li>
    </c:if>
    <c:if test="${!empty(mailingList.unsubscribeAddress)}">
      <li>
        <b>Unsubscribe:</b>
        <a href="mailto:${mailingList.unsubscribeAddress}">${mailingList.unsubscribeAddress}</a>
      </li>
    </c:if>
      <%-- TODO: not in the POM yet
          <li>
            <b>List owner:</b>
            <a href="mailto:${mailingList.owner}">${mailingList.owner}</a>
          </li>
      --%>
    <c:if test="${!empty(mailingList.mainArchiveUrl)}">
      <li>
        <b>Archive:</b>
        <ul>
          <li>
            <a href="${mailingList.mainArchiveUrl}">${mailingList.mainArchiveUrl}</a>
          </li>
        </ul>
      </li>
    </c:if>
    <%-- <c:if test="${!empty(mailingList.otherArchives)}">
      <li>
        <b>Other Archives:</b>
        <ul>
          <c:forEach items="${mailingList.otherArchives}" var="archive">
            <li>
              <a href="${archive}">${archive}</a>
            </li>
          </c:forEach>
        </ul>
      </li>
    </c:if> --%>
  </ul>
</c:forEach>
<c:if test="${empty(mailingLists)}">
  <strong>No mailing lists</strong>
</c:if>
