Add contact page with form, email template, and tests
- Create ContactController with GET/POST handling and MailerService integration - Create contact page template with name, surname, email, message form - Create dedicated email template for contact messages - Update navbar links (desktop + mobile) to point to /contact route - Add ContactControllerTest with 5 tests covering form submission and validation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
74
templates/contact/index.html.twig
Normal file
74
templates/contact/index.html.twig
Normal file
@@ -0,0 +1,74 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Contact - E-Ticket{% endblock %}
|
||||
{% block description %}Contactez l'equipe E-Ticket pour toute question sur la plateforme de billetterie associative{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div style="max-width:50rem;margin:0 auto;padding:3rem 1rem;">
|
||||
<h1 class="text-3xl font-black uppercase tracking-tighter italic" style="border-bottom:4px solid #111827;display:inline-block;margin-bottom:0.5rem;">Contact</h1>
|
||||
<p class="font-bold text-gray-600 italic" style="margin-bottom:2rem;">Une question, une demande ? Ecrivez-nous.</p>
|
||||
|
||||
{% for message in app.flashes('success') %}
|
||||
<div style="border:4px solid #111827;padding:1rem 1.5rem;margin-bottom:2rem;background:#d1fae5;box-shadow:4px 4px 0 rgba(0,0,0,1);">
|
||||
<p class="font-black text-sm">{{ message }}</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% for message in app.flashes('error') %}
|
||||
<div style="border:4px solid #111827;padding:1rem 1.5rem;margin-bottom:2rem;background:#fee2e2;box-shadow:4px 4px 0 rgba(0,0,0,1);">
|
||||
<p class="font-black text-sm">{{ message }}</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<form method="post" action="{{ path('app_contact') }}" style="display:flex;flex-direction:column;gap:1.5rem;">
|
||||
<div style="display:flex;flex-wrap:wrap;gap:1.5rem;">
|
||||
<div style="flex:1;min-width:200px;">
|
||||
<label for="contact_name" class="text-xs font-black uppercase tracking-widest" style="display:block;margin-bottom:0.5rem;">Nom</label>
|
||||
<input type="text" id="contact_name" name="name" required
|
||||
style="width:100%;padding:0.75rem 1rem;border:3px solid #111827;font-weight:700;outline:none;"
|
||||
class="focus:border-indigo-600"
|
||||
placeholder="Dupont">
|
||||
</div>
|
||||
<div style="flex:1;min-width:200px;">
|
||||
<label for="contact_surname" class="text-xs font-black uppercase tracking-widest" style="display:block;margin-bottom:0.5rem;">Prenom</label>
|
||||
<input type="text" id="contact_surname" name="surname" required
|
||||
style="width:100%;padding:0.75rem 1rem;border:3px solid #111827;font-weight:700;outline:none;"
|
||||
class="focus:border-indigo-600"
|
||||
placeholder="Jean">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="contact_email" class="text-xs font-black uppercase tracking-widest" style="display:block;margin-bottom:0.5rem;">Email</label>
|
||||
<input type="email" id="contact_email" name="email" required
|
||||
style="width:100%;padding:0.75rem 1rem;border:3px solid #111827;font-weight:700;outline:none;"
|
||||
class="focus:border-indigo-600"
|
||||
placeholder="jean.dupont@exemple.fr">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="contact_message" class="text-xs font-black uppercase tracking-widest" style="display:block;margin-bottom:0.5rem;">Message</label>
|
||||
<textarea id="contact_message" name="message" required rows="6"
|
||||
style="width:100%;padding:0.75rem 1rem;border:3px solid #111827;font-weight:700;outline:none;resize:vertical;"
|
||||
class="focus:border-indigo-600"
|
||||
placeholder="Votre message..."></textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="submit"
|
||||
style="padding:0.75rem 2rem;border:3px solid #111827;box-shadow:4px 4px 0 rgba(0,0,0,1);cursor:pointer;"
|
||||
class="bg-yellow-400 font-black uppercase text-sm tracking-widest hover:bg-indigo-600 hover:text-white transition-all">
|
||||
Envoyer
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div style="border:4px solid #111827;padding:1.5rem;background:#f9fafb;box-shadow:6px 6px 0 rgba(0,0,0,1);margin-top:3rem;">
|
||||
<h2 class="text-lg font-black uppercase" style="margin-bottom:0.5rem;">Autres moyens de contact</h2>
|
||||
<ul style="list-style:disc;padding-left:1.5rem;" class="text-sm font-bold text-gray-700">
|
||||
<li>Email : <a href="mailto:contact@e-cosplay.fr" class="text-indigo-600 hover:underline">contact@e-cosplay.fr</a></li>
|
||||
<li>Adresse : 42 rue de Saint-Quentin, 02800 Beautor, France</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user