]> Raphaël G. Git Repositories - blogbundle/commitdiff
New mail base template
authorRaphaël Gertz <git@rapsys.eu>
Tue, 14 Oct 2025 11:29:40 +0000 (13:29 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Tue, 14 Oct 2025 11:29:40 +0000 (13:29 +0200)
New context layout

templates/mail/_base.html.twig

index 23eea6d61649958d20d3b2a6ab1e2e195344511c..5b2811c67df16ff0261cf5c95b0c03b3f7b1b722 100644 (file)
@@ -1,10 +1,11 @@
 {% extends '@RapsysBlog/_base.html.twig' %}
 {% block head %}
        <meta charset="UTF-8" />
 {% extends '@RapsysBlog/_base.html.twig' %}
 {% block head %}
        <meta charset="UTF-8" />
+       <meta name="viewport" content="width=device-width" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-       {% if head.locale is defined and head.locale %}<meta http-equiv="Content-Language" content="{{ head.locale }}" />{% endif %}
-       <meta name="viewport" content="width=device-width, initial-scale=1" />
-       <title>{{ subject }}</title>
+       {% if locale is defined and locale %}<meta http-equiv="Content-Language" content="{{ locale }}" />{% endif %}
+{% endblock %}
+{% block stylesheet %}
        <style type="text/css">
                body {background:white;color:#222}
                a {text-decoration:none;color:#15c}
        <style type="text/css">
                body {background:white;color:#222}
                a {text-decoration:none;color:#15c}
                a.link {word-break:break-all;font-size:1.5rem}
                h1 {margin: .5rem;font-size: 2rem}
                table {width: 100%;border-radius: .5rem}
                a.link {word-break:break-all;font-size:1.5rem}
                h1 {margin: .5rem;font-size: 2rem}
                table {width: 100%;border-radius: .5rem}
-               thead {border-top:.5rem solid #09c;background:#cff}
-               thead th {text-align:center}
-               tbody {border-top:.5rem solid #09c;background:#cff}
-               tbody td {margin:.5rem 0;padding:0 .5rem}
-               tfoot {border-top:.5rem solid #09c;background:#cff}
-               tfoot td {text-align:center}
-               tfoot summary:after {display:none}
-               tfoot summary::-webkit-details-marker {display:none}
+               table.header {border:.1rem solid #09c;text-align:center}
+               table.content {background:white;border:.1rem solid #09c;margin:.5rem 0}
+               table.footer {border:.1rem solid #09c;text-align:center;font-weight:bold}
+               table.footer summary:after {display:none}
+               table.footer summary::-webkit-details-marker {display:none}
        </style>
 {% endblock %}
        </style>
 {% endblock %}
-{% block header %}
-       <table>
-               <thead>
-                       <tr>
-                               {#<th><a href="{{ url(head.root) }}" title="{{ head.site }}"><img src="{{ source(head.logo.png)|data_uri }}" alt="{{ head.logo.alt }}" width="100" height="60" /></a></th>#}
-                               <th><a href="{{ url(head.root) }}" title="{{ head.site }}"><img src="{{ email.image(head.logo.png) }}" alt="{{ head.logo.alt }}" width="100" height="60" /></a></th>
-                               <th><h1><a href="{{ url(head.root) }}">{{ head.site }}</a></h1></th>
-                       </tr>
-               </thead>
-{% endblock %}
-{% block message %}{% endblock %}
-{% block footer %}
-               <tfoot>
+{% block body %}
+       <table class="header">
+               <tr>
+                       {% if logo is defined and logo %}<td><a href="{{ url(root)|escape('html_attr') }}"><img src="{{ email.image(logo.png) }}" alt="{{ logo.alt|escape('html_attr') }}" /></a></td>{% endif %}
+                       <td><h1><a href="{{ url(root)|escape('html_attr') }}">{{ title.site }}</a></h1></td>
+               </tr>
+       </table>
+       {% block content %}{% endblock %}
+       {% if copy is defined and copy %}
+               <table class="footer">
                        <tr>
                                <td colspan="2">{{ copy.long }} - {{ copy.short }}</td>
                        </tr>
                        <tr>
                                <td colspan="2">{{ copy.long }} - {{ copy.short }}</td>
                        </tr>
-               </tfoot>
-       </table>
+               </table>
+       {% endif %}
 {% endblock %}
 {% endblock %}