{% extends postorius_base_template %}
{% load url from future %}
{% load i18n %}
{% load nav_helpers %}

{% block body_class %}list_summary{% endblock %}

{% block main %}
    {% if user.is_superuser %}
        {% include 'postorius/menu/list_nav.html' %}
    {% endif %}
    <h1>{{list.display_name}}</h1>


    <h2>{% trans 'Description' %}</h2>
    <p>{{list.settings.description }}</p>
  
    <h2>{% trans 'Subscribe to this list' %}</h2>
    {% if user.is_authenticated %}
    <form action="{% url 'list_subscribe' list.fqdn_listname %}" method="post" class="list_subscribe"> {% csrf_token %}
        {{subscribe_form.as_p}}
        <input class="btn btn-success" type="submit" value="{% trans 'Subscribe' %}" />
        <a href="{% url 'list_unsubscribe' list.fqdn_listname user.email %}" class="btn btn-danger">Unsubscribe</a>
    </form>
    {% else %}
        <p>To subscribe or unsubscribe this list you have to be logged in.</p>
        <p><a href="{% url 'user_login' %}"class="btn btn-primary">Log In</a></p>
    {% endif %}
{% endblock %}
