]> Raphaël G. Git Repositories - userbundle/commitdiff
Import user templates
authorRaphaël Gertz <git@rapsys.eu>
Sat, 2 Nov 2024 03:08:15 +0000 (04:08 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Sat, 2 Nov 2024 03:08:15 +0000 (04:08 +0100)
templates/_footer.html.twig
templates/index.html.twig
templates/login.html.twig
templates/mail/_base.html.twig [new file with mode: 0644]
templates/mail/recover.html.twig [new file with mode: 0644]
templates/mail/recover.text.twig [new file with mode: 0644]
templates/mail/register.html.twig [new file with mode: 0644]
templates/mail/register.text.twig [new file with mode: 0644]
templates/recover.html.twig
templates/register.html.twig

index 8df1ba803f914bd74cacf630eba5cc2d9abd2435..843ac855112f387dc66a8e7948e309ff485a7ae0 100644 (file)
@@ -1,17 +1,20 @@
-<footer id="rapsysuser_footer">
-       {% if alternates is defined and alternates %}
-               {% set langs = alternates|keys|filter(v => v|length == 5) %}
-               {% if langs|length > 1 %}
-                       <ul>
-                               {% for lang in langs %}
-                                       <li><a href="{{ alternates[lang].relative }}" hreflang="{{ lang|replace({'_': '-'}) }}" title="{{ alternates[lang].title }}">{{ alternates[lang].translated }}</a></li>
-                               {% endfor %}
-                       </ul>
-               {% else %}
-                       {% set lang = langs|first %}
-                       <a href="{{ alternates[lang].relative }}" hreflang="{{ lang|replace({'_': '-'}) }}" title="{{ alternates[lang].title }}">{{ alternates[lang].translated }}</a>
+{% if (alternates is defined and alternates) or (copy is defined and copy) %}
+       <footer id="rapsysuser_footer">
+               {% if copy is defined and copy %}
+                       <span>{{ copy.long }} - {{ copy.short }}</span>
                {% endif %}
-       {% else %}
-               <span>&nbsp;</span>
-       {% endif %}
-</footer>
+               {% if alternates is defined and alternates %}
+                       {% set langs = alternates|keys|filter(v => v|length == 5) %}
+                       {% if langs|length > 1 %}
+                               <ul>
+                                       {% for lang in langs %}
+                                               <li><a href="{{ alternates[lang].relative }}" hreflang="{{ lang|replace({'_': '-'}) }}" title="{{ alternates[lang].title }}">{{ alternates[lang].translated }}</a></li>
+                                       {% endfor %}
+                               </ul>
+                       {% else %}
+                               {% set lang = langs|first %}
+                               <a href="{{ alternates[lang].relative }}" hreflang="{{ lang|replace({'_': '-'}) }}" title="{{ alternates[lang].title }}">{{ alternates[lang].translated }}</a>
+                       {% endif %}
+               {% endif %}
+       </footer>
+{% endif %}
index 2369d00f8e4917dce697cefb715dd5c91412591c..4c5eb51c3bdd3ba263dc69327a352d58ce581cb9 100644 (file)
@@ -1,4 +1,5 @@
-{% extends '@RapsysUser/base.html.twig' %}
+{% trans_default_domain 'rapsysuser' %}
+{% extends '@RapsysUser/_base.html.twig' %}
 {% block content %}
        <section>
                <header>
index c57fd6e8572526c3b4a51fffa2ca6d74a86ba9ff..cb1473c78e36f92e1fcbbedf239a4481af2fd89f 100644 (file)
@@ -1,4 +1,5 @@
-{% extends '@RapsysUser/base.html.twig' %}
+{% trans_default_domain 'rapsysuser' %}
+{% extends '@RapsysUser/_base.html.twig' %}
 {% block content %}
        <section id="rapsysuser_login">
                <header>
@@ -20,7 +21,7 @@
        {% if recover is defined %}
                <section id="rapsysuser_recover">
                        <header>
-                               <h2><a href="{{ recover_url }}">{% trans from "rapsysuser" %}Recover{% endtrans %}</a></h2>
+                               <h2><a href="{{ recover_url }}">{% trans %}Recover{% endtrans %}</a></h2>
                        </header>
                        {{ form_start(recover) }}
                                <div>
diff --git a/templates/mail/_base.html.twig b/templates/mail/_base.html.twig
new file mode 100644 (file)
index 0000000..dea7b17
--- /dev/null
@@ -0,0 +1,37 @@
+{% extends '@RapsysUser/_base.html.twig' %}
+{% block head %}
+       <meta name="viewport" content="width=device-width" />
+       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+       {% 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:#066}
+               a {text-decoration:none;color:#066}
+               a:hover {text-decoration:underline}
+               a.link {word-break:break-all;font-size:1.5rem}
+               h1 {margin: .5rem;font-size: 2rem}
+               table {width: 100%;border-radius: .5rem}
+               table.header {border:.1rem solid #00c3f9;text-align:center}
+               table.content {background:white;border:.1rem solid #00c3f9;margin:.5rem 0}
+               table.footer {border:.1rem solid #00c3f9;text-align:center;font-weight:bold}
+               table.footer summary:after {display:none}
+               table.footer summary::-webkit-details-marker {display:none}
+       </style>
+{% endblock %}
+{% block body %}
+       <table class="header">
+               <tr>
+                       {% if logo is defined and logo %}<td><a href="{{ home_url|escape('html_attr') }}"><img src="{{ email.image(logo.png) }}" alt="{{ logo.alt|escape('html_attr') }}" /></a></td>{% endif %}
+                       <td><h1><a href="{{ home_url|escape('html_attr') }}">{{ site }}</a></h1></td>
+               </tr>
+       </table>
+       {% block content %}{% endblock %}
+       {% if copy is defined and copy %}
+               <table class="footer">
+                       <tr>
+                               <td>{{ copy.long }} - {{ copy.short }}</td>
+                       </tr>
+               </table>
+       {% endif %}
+{% endblock %}
diff --git a/templates/mail/recover.html.twig b/templates/mail/recover.html.twig
new file mode 100644 (file)
index 0000000..8bc591e
--- /dev/null
@@ -0,0 +1,18 @@
+{% trans_default_domain 'rapsysuser' %}
+{% extends '@RapsysUser/mail/_base.html.twig' %}
+{% block content %}
+       <table class="content">
+               <tr>
+                       <td>&nbsp;</td>
+                       <td>
+                               <h2>{{ subject }}</h2>
+                               <h3>{% if recipient_name %}{{ 'Hi %recipient_name%,'|trans({'%recipient_name%': recipient_name}) }}{% else %}{% trans %}Hi,{% endtrans %}{% endif %}</h3>
+                               <p>{{ 'Thanks so much for rejoining %site%:'|trans({'%site%': site}) }}</p>
+                               <p><a href="{{ home_url|escape('html_attr') }}" class="link">{{ home_url }}</a></p>
+                               <p>{% trans %}To recover your account follow this link:{% endtrans %}</p>
+                               <p><a href="{{ recover_url|escape('html_attr') }}" class="link">{{ recover_url }}</a></p>
+                       </td>
+                       <td>&nbsp;</td>
+               </tr>
+       </table>
+{% endblock %}
diff --git a/templates/mail/recover.text.twig b/templates/mail/recover.text.twig
new file mode 100644 (file)
index 0000000..458cc8e
--- /dev/null
@@ -0,0 +1,17 @@
+{% trans_default_domain 'rapsysuser' %}
+{{ subject }}
+{% for i in range(1, subject|length) %}={% endfor %}
+
+
+{{ 'Thanks so much for rejoining %site%:'|trans({'%site%': site})|raw }}
+{{ home_url }}
+
+{% trans %}To recover your account follow this link:{% endtrans %}
+
+{{ recover_url }}
+{% if copy is defined and copy %}
+
+--
+
+{{ copy.long }} - {{ copy.short }}
+{% endif %}
diff --git a/templates/mail/register.html.twig b/templates/mail/register.html.twig
new file mode 100644 (file)
index 0000000..66fcf2c
--- /dev/null
@@ -0,0 +1,18 @@
+{% trans_default_domain 'rapsysuser' %}
+{% extends '@RapsysUser/mail/_base.html.twig' %}
+{% block content %}
+       <table class="content">
+               <tr>
+                       <td>&nbsp;</td>
+                       <td>
+                               <h2>{{ subject }}</h2>
+                               <h3>{% if recipient_name %}{{ 'Hi %recipient_name%,'|trans({'%recipient_name%': recipient_name}) }}{% else %}{% trans %}Hi,{% endtrans %}{% endif %}</h3>
+                               <p>{{ 'Thanks so much for joining %site%:'|trans({'%site%': site}) }}</p>
+                               <p><a href="{{ home_url|escape('html_attr') }}" class="link">{{ home_url }}</a></p>
+                               <p>{% trans %}To create your account you must follow this link:{% endtrans %}</p>
+                               <p><a href="{{ confirm_url|escape('html_attr') }}" class="link">{{ confirm_url }}</a></p>
+                       </td>
+                       <td>&nbsp;</td>
+               </tr>
+       </table>
+{% endblock %}
diff --git a/templates/mail/register.text.twig b/templates/mail/register.text.twig
new file mode 100644 (file)
index 0000000..52e8467
--- /dev/null
@@ -0,0 +1,17 @@
+{% trans_default_domain 'rapsysuser' %}
+{{ subject }}
+{% for i in range(1, subject|length) %}={% endfor %}
+
+
+{{ 'Thanks so much for joining %site%:'|trans({'%site%': site})|raw }}
+{{ home_url }}
+
+{% trans %}To create your account you must follow this link:{% endtrans %}
+
+{{ confirm_url }}
+{% if copy is defined and copy %}
+
+--
+
+{{ copy.long }} - {{ copy.short }}
+{% endif %}
index 3b7dab9ff700fe9c9544e7386fc43400b4543689..b67177f1d158dbc42a93eecdc2d8df0630558b6a 100644 (file)
@@ -1,28 +1,25 @@
-{% extends '@RapsysUser/base.html.twig' %}
+{% trans_default_domain 'rapsysuser' %}
+{% extends '@RapsysUser/_base.html.twig' %}
 {% block content %}
        <section id="rapsysuser_recover">
                <header>
                        <h2><a href="{{ self_url }}">{{ title }}</a></h2>
                </header>
-               {% if sent %}
-                       <p class="message notice">{% trans from "rapsysuser" %}Your recover account message has been sent{% endtrans %}</p>
-               {% else %}
-                       {{ form_start(recover) }}
-                               <div>
-                                       {% if recover.mail is defined %}
-                                               {{ form_row(recover.mail) }}
-                                       {% endif %}
+               {{ form_start(recover) }}
+                       <div>
+                               {% if recover.mail is defined %}
+                                       {{ form_row(recover.mail) }}
+                               {% endif %}
 
-                                       {% if recover.password is defined %}
-                                               {{ form_row(recover.password) }}
-                                       {% endif %}
+                               {% if recover.password is defined %}
+                                       {{ form_row(recover.password) }}
+                               {% endif %}
 
-                                       {{ form_row(recover.submit) }}
-                               </div>
+                               {{ form_row(recover.submit) }}
+                       </div>
 
-                               {# Render CSRF token etc .#}
-                               <footer style="display:none">{{ form_rest(recover) }}</footer>
-                       {{ form_end(recover) }}
-               {% endif %}
+                       {# Render CSRF token etc .#}
+                       <footer style="display:none">{{ form_rest(recover) }}</footer>
+               {{ form_end(recover) }}
        </section>
 {% endblock %}
index 222c90cce45642695d4f5472bc05098b28873059..df83ac2ea7b9de53c9c3ad5dfed063952d96615c 100644 (file)
@@ -1,14 +1,12 @@
-{% extends '@RapsysUser/base.html.twig' %}
+{% trans_default_domain 'rapsysuser' %}
+{% extends '@RapsysUser/_base.html.twig' %}
 {% block content %}
        <section id="rapsysuser_register">
                <header>
                        <h2><a href="{{ self_url }}">{{ title }}</a></h2>
                </header>
                {% if disabled is defined and disabled %}
-                       <p class="message error">{% trans from "rapsysuser" %}Your account has been disabled{% endtrans %}</p>
-               {% elseif sent is defined and sent %}
-                       <p class="message notice">{% trans from "rapsysuser" %}Your verification mail has been sent, to activate your account you must follow the confirmation link inside{% endtrans %}</p>
-                       <p class="message warning">{% trans from "rapsysuser" %}If you did not receive a verification mail, check your Spam or Junk mail folders{% endtrans %}</p>
+                       <p class="message error">{% trans %}Your account has been disabled{% endtrans %}</p>
                {% else %}
                        {{ form_start(register) }}
                                {% if register.mail is defined %}