]> Raphaël G. Git Repositories - airbundle/commitdiff
Add subscribe and edit templates
authorRaphaël Gertz <git@rapsys.eu>
Mon, 16 Aug 2021 23:05:48 +0000 (01:05 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Mon, 16 Aug 2021 23:05:48 +0000 (01:05 +0200)
Resources/views/form/_subscribe.html.twig [new file with mode: 0644]
Resources/views/form/edit.html.twig [new file with mode: 0644]
Resources/views/mail/subscribe.html.twig [new file with mode: 0644]
Resources/views/mail/subscribe.text.twig [new file with mode: 0644]

diff --git a/Resources/views/form/_subscribe.html.twig b/Resources/views/form/_subscribe.html.twig
new file mode 100644 (file)
index 0000000..2d52544
--- /dev/null
@@ -0,0 +1,13 @@
+<section>
+       <h2><a href="{{ path('rapsys_user_subscribe') }}">{% trans %}Subscribe{% endtrans %}</a></h2>
+       {{ form_start(forms.subscribe) }}
+               <div>
+                       {{ form_row(forms.subscribe.mail) }}
+
+                       {{ form_row(forms.subscribe.submit) }}
+               </div>
+
+               {# Render CSRF token etc .#}
+               <footer style="display:none">{{ form_rest(forms.subscribe) }}</footer>
+       {{ form_end(forms.subscribe) }}
+</section>
diff --git a/Resources/views/form/edit.html.twig b/Resources/views/form/edit.html.twig
new file mode 100644 (file)
index 0000000..8540c46
--- /dev/null
@@ -0,0 +1,58 @@
+{% extends '@RapsysAir/body.html.twig' %}
+{% block title %}{{ site.title }} - {{ title }}{% endblock %}
+{% block content %}
+       <section id="form">
+               <h2><a href="{{ path('rapsys_user_edit', {'mail': app.user.mail|short, 'hash': app.user.mail|short|hash}) }}">{{ title }}</a></h2>
+               {{ form_start(edit) }}
+                       <div>
+                               {% if edit.mail is defined %}
+                                       {{ form_row(edit.mail) }}
+                               {% endif %}
+
+                               {% if edit.civility is defined %}
+                                       {{ form_row(edit.civility) }}
+                               {% endif %}
+
+                               {% if edit.forename is defined %}
+                                       {{ form_row(edit.forename) }}
+                               {% endif %}
+
+                               {% if edit.surname is defined %}
+                                       {{ form_row(edit.surname) }}
+                               {% endif %}
+
+                               {% if edit.pseudonym is defined %}
+                                       {{ form_row(edit.pseudonym) }}
+                               {% endif %}
+
+                               {% if edit.phone is defined %}
+                                       {{ form_row(edit.phone) }}
+                               {% endif %}
+
+                               {{ form_row(edit.submit) }}
+                       </div>
+
+                       {# Render CSRF token etc .#}
+                       <footer style="display:none">{{ form_rest(edit) }}</footer>
+               {{ form_end(edit) }}
+       </section>
+       {% if reset is defined %}
+               <section id="form">
+                       <h2><a href="{{ path('rapsys_user_register') }}">{{ password }}</a></h2>
+                       {{ form_start(reset) }}
+                               <div>
+                                       {% if reset.password is defined %}
+                                               {{ form_row(reset.password.first) }}
+
+                                               {{ form_row(reset.password.second) }}
+                                       {% endif %}
+
+                                       {{ form_row(reset.submit) }}
+                               </div>
+
+                               {# Render CSRF token etc .#}
+                               <footer style="display:none">{{ form_rest(reset) }}</footer>
+                       {{ form_end(reset) }}
+               </section>
+       {% endif %}
+{% endblock %}
diff --git a/Resources/views/mail/subscribe.html.twig b/Resources/views/mail/subscribe.html.twig
new file mode 100644 (file)
index 0000000..fd0ae29
--- /dev/null
@@ -0,0 +1,17 @@
+{% extends '@RapsysAir/mail/body.html.twig' %}
+{% block title %}{{ subject }}{% endblock %}
+{% block content %}
+       <table class="content">
+               <tr>
+                       <td>&nbsp;</td>
+                       <td>
+                               <h2>{{ 'Subject: %subject%'|trans({'%subject%': 'welcome to %site.title%'|trans({'%site.title%': site.title})|raw}) }}</h2>
+                               <h3>{{ 'Hi %recipient_name%,'|trans({'%recipient_name%': recipient_name}) }}</h3>
+                               <p>{{ 'Thanks so much for joining %site.title%, the space reservation program.'|trans({'%site.title%': site.title}) }}</p>
+                               <p>{% trans %}To create your account you can follow this link:{% endtrans %}</p>
+                               <p><a href="{{ subscribe_url|escape('html_attr') }}" class="link">{{ subscribe_url }}</a></p>
+                       </td>
+                       <td>&nbsp;</td>
+               </tr>
+       </table>
+{% endblock %}
diff --git a/Resources/views/mail/subscribe.text.twig b/Resources/views/mail/subscribe.text.twig
new file mode 100644 (file)
index 0000000..620352b
--- /dev/null
@@ -0,0 +1,11 @@
+{{ subject }}
+{% for i in range(1, subject|length) %}={% endfor %}
+
+
+*{{ 'Thanks so much for joining %site.title%, the space reservation program.'|trans({'%site.title%': site.title}) }}*
+
+{{ 'To create your account you must follow this link: %subscribe_url%'|trans({'%subscribe_url%': subscribe_url}) }}
+
+--
+
+{{ copy.long }} - {{ copy.short }}