feat: implement Story 4.1 - Access Registration Page
Allows potential participants to view exchange details and access the registration form via unique slug URLs. Implementation: - Added ParticipantRegistrationForm with name, email, gift_ideas, and reminder fields - Created GET /exchange/<slug>/register route - Built responsive registration template with exchange details - Exempted participant routes from admin setup requirement - Comprehensive test coverage for all scenarios Acceptance Criteria Met: - Valid slug displays registration form with exchange details - Invalid slug returns 404 - Form includes all required fields with CSRF protection - Registration deadline is displayed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
72
src/templates/participant/register.html
Normal file
72
src/templates/participant/register.html
Normal file
@@ -0,0 +1,72 @@
|
||||
{% extends "layouts/base.html" %}
|
||||
|
||||
{% block title %}Register for {{ exchange.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<article>
|
||||
<header>
|
||||
<h1>{{ exchange.name }}</h1>
|
||||
{% if exchange.description %}
|
||||
<p>{{ exchange.description }}</p>
|
||||
{% endif %}
|
||||
</header>
|
||||
|
||||
<section>
|
||||
<h2>Exchange Details</h2>
|
||||
<dl>
|
||||
<dt>Budget</dt>
|
||||
<dd>{{ exchange.budget }}</dd>
|
||||
|
||||
<dt>Gift Exchange Date</dt>
|
||||
<dd>{{ exchange.exchange_date.strftime('%Y-%m-%d') }}</dd>
|
||||
|
||||
<dt>Registration Deadline</dt>
|
||||
<dd>{{ exchange.registration_close_date.strftime('%Y-%m-%d') }}</dd>
|
||||
</dl>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Register</h2>
|
||||
<form method="POST">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
<label for="name">
|
||||
{{ form.name.label }}
|
||||
{{ form.name(placeholder="Your name") }}
|
||||
{% if form.name.errors %}
|
||||
<small>{{ form.name.errors[0] }}</small>
|
||||
{% endif %}
|
||||
</label>
|
||||
|
||||
<label for="email">
|
||||
{{ form.email.label }}
|
||||
{{ form.email(placeholder="your.email@example.com") }}
|
||||
{% if form.email.errors %}
|
||||
<small>{{ form.email.errors[0] }}</small>
|
||||
{% endif %}
|
||||
</label>
|
||||
|
||||
<label for="gift_ideas">
|
||||
{{ form.gift_ideas.label }}
|
||||
{{ form.gift_ideas(placeholder="Things you like, hobbies, interests...", rows="4") }}
|
||||
{% if form.gift_ideas.description %}
|
||||
<small>{{ form.gift_ideas.description }}</small>
|
||||
{% endif %}
|
||||
{% if form.gift_ideas.errors %}
|
||||
<small>{{ form.gift_ideas.errors[0] }}</small>
|
||||
{% endif %}
|
||||
</label>
|
||||
|
||||
<label for="reminder_enabled">
|
||||
{{ form.reminder_enabled() }}
|
||||
{{ form.reminder_enabled.label }}
|
||||
{% if form.reminder_enabled.description %}
|
||||
<small>{{ form.reminder_enabled.description }}</small>
|
||||
{% endif %}
|
||||
</label>
|
||||
|
||||
<button type="submit">Register</button>
|
||||
</form>
|
||||
</section>
|
||||
</article>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user