{% extends "email/_base.html" %}
{% load i18n club_email %}

{% comment %}
    HTML sibling of notification.txt -- same content, same context (club,
    notification, request), laid out for an inbox. Same shell/branding as
    every other transactional email in this app (club/templates/club/email/*.html,
    members/.../claim_approved.html) -- see that convention before changing this.
{% endcomment %}

{% block title %}{% blocktrans with club=club.name title=notification.title %}{{ club }} — {{ title }}{% endblocktrans %}{% endblock title %}

{% block preheader %}{{ notification.title }}{% endblock preheader %}

{% block header %}
    {% absolute_media_url club.logo as logo_url %}
    <table role="presentation" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td valign="middle">
                {% if club.logo %}
                    <img src="{{ logo_url }}" alt="{{ club.name }}" width="48" height="48" style="display:block; width:48px; height:48px; border-radius:24px; object-fit:contain; background-color:#f3f4f6;">
                {% else %}
                    <table role="presentation" cellpadding="0" cellspacing="0" border="0" width="48" style="width:48px;">
                        <tr>
                            <td align="center" valign="middle" width="48" height="48" bgcolor="{{ club.secondary_color|default:"#ec4899" }}" style="width:48px; height:48px; border-radius:24px; background-color:{{ club.secondary_color|default:"#ec4899" }}; color:{{ club.secondary_color|default:"#ec4899"|contrast_color }}; font-family: Arial, Helvetica, sans-serif; font-size:16px; font-weight:bold;">
                                {{ club.initials }}
                            </td>
                        </tr>
                    </table>
                {% endif %}
            </td>
            <td style="padding-left:14px;" valign="middle">
                <span style="font-family: Arial, Helvetica, sans-serif; font-size:18px; font-weight:bold; color:#111827;">{{ club.name }}</span>
            </td>
        </tr>
    </table>
{% endblock header %}

{% block content %}
    <p style="margin:0 0 16px 0; font-size:18px; font-weight:bold; color:#111827;">{{ notification.title }}</p>
    <div style="margin:0;">{{ notification.body|linebreaks }}</div>
{% endblock content %}

{% block footer %}
    {% if club.contact_email %}
        <p style="margin:0 0 8px 0;">{% blocktrans with email=club.contact_email %}Questions? Reply to this note or write to {{ email }}.{% endblocktrans %}</p>
    {% endif %}
    <p style="margin:0;">{% blocktrans with club=club.name %}— {{ club }}{% endblocktrans %}</p>
{% endblock footer %}
