{% load i18n %}
{% load static %}
{% load humanize %}
{% load compress %}
{% load site_url %}
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE }}" dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>{{ subject }}</title>
{% compress css inline %}
  <style>
    {% include "mail/style.css" %}
  </style>
{% endcompress %}
 </head>

 <body>
 {% filter add_site_url %}
    <div class="content">
    <div class="container">
        <div class="box">
            {% if change %}
            <h1>
                <img src="{% if request %}{% static "email-logo.png" %}{% else %}cid:email-logo.png@cid.weblate.org{% endif %}" />
                {{ change.get_action_display }}
            </h1>
            <div class="nav">
                {% if change.author %}{{ change.author.profile.get_user_display_link }}: {% endif %}
                <a href="{{ current_site_url }}">{{ site_title }}</a>
                {% if project %}/ <a href="{{ project.get_absolute_url }}">{{ project.name }}</a>{% endif %}
                {% if component %}/ <a href="{{ component.get_absolute_url }}">{{ component.name }}</a>{% endif %}
                {% if translation %}/ <a href="{{ translation.get_absolute_url }}">{{ translation.language.name }}</a>{% endif %}
            </div>
            {% else %}
            <h1>
                <img src="{% if request %}{% static "email-logo.png" %}{% else %}cid:email-logo.png@cid.weblate.org{% endif %}" />
                {{ subject }}
            </h1>
            {% endif %}
            {% block content %}
            {% endblock %}
        </div>
{% if translation %}
        <h2>
            {% trans "Translation Info" %}
        </h2>
        <table>
            {% include "mail/snippets/stats.html" with stats=translation.stats url=translation.get_translate_url %}
        </table>
        <div class="buttons">
            <a class="button" href="{{ translation_url }}">{% trans "View" %}</a>
        </div>
{% elif component %}
        <h2>
            {% trans "Component Information" %}
        </h2>
        <table>
            <tr>
                <td>{% trans "Languages" %}</td>
                <td><a href="{{ component.get_absolute_url }}">{{ component.stats.languages|intcomma }}</a></td>
                <td></td>
            </tr>
            {% include "mail/snippets/stats.html" with stats=component.stats %}
        </table>
        <div class="buttons">
            <a class="button" href="{{ component.get_absolute_url  }}">{% trans "View" %}</a>
        </div>
{% elif project %}
        <h2>
            {% trans "Project Information" %}
        </h2>
        <table>
            <tr>
                <td>{% trans "Components" %}</td>
                <td><a href="{{ project.get_absolute_url }}">{{ project.component_set.count|intcomma }}</a></td>
                <td></td>
            </tr>
            <tr>
                <td>{% trans "Languages" %}</td>
                <td><a href="{{ project.get_absolute_url }}#languages">{{ project.stats.languages|intcomma }}</td>
                <td></td>
            </tr>
            {% include "mail/snippets/stats.html" with stats=project.stats %}
        </table>
        <div class="buttons">
            <a class="button" href="{{ project.get_absolute_url  }}">{% trans "View" %}</a>
        </div>
{% endif %}
        <div class="footer" style="clear:both">
			<p>
                <img src="{% if request %}{% static "email-logo-footer.png" %}{% else %}cid:email-logo-footer.png@cid.weblate.org{% endif %}" /><br />
                <a href="https://weblate.org/">{% trans "Weblate, the libre continuous localization system." %}</a>
            </p>
            {% if unsubscribe_nonce %}
            <p>
                ▸ <a href="{% url 'profile' %}#notifications">{% trans "Notification settings" %}</a>
            </p>
            <p>
                ▸ <a href="{% url 'unsubscribe' %}?i={{ unsubscribe_nonce }}">{% trans "Turn off this notification" %}</a>
            </p>
            {% elif unsubscribe_note %}
            <p>
                ▸ {{ unsubscribe_note }}
            </p>
            {% endif %}
        </div>
        {% comment %}This avoids Gmail hiding the footer, as it finds unique content here{% endcomment %}
        {% now "DATETIME_FORMAT" as timestamp %}
        <p style="opacity: 0" class="text-muted">{% blocktrans %}Generated on {{ timestamp }}.{% endblocktrans %}</p>
    </div>
    </div>
{% endfilter %}
 </body>
</html>
