Files
gh-christianlouis-leagueledger/app/templates/teams/join_team.html
T
Christian Krakau-Louis 7323c12168 Implement team join request functionality with views and actions
- Added join_requests.html template for displaying pending join requests.
- Created join_team.html template for users to submit join requests.
- Implemented request_processed.html template to show the result of join request processing.
- Developed authentication utilities for user session management.
- Introduced convenience redirects for common URL patterns.
- Established team management routes and actions for creating, editing, and joining teams.
- Added functionality for approving and denying join requests with email notifications.
- Enhanced team views to include user permissions and team member details.
- Implemented utility functions for team-related operations such as calculating total points and team rank.
2025-04-14 17:00:57 +02:00

57 lines
2.1 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="max-w-md mx-auto my-8">
<div class="bg-white p-8 rounded-lg shadow-md">
<div class="flex justify-between items-center mb-6">
<h1 class="text-2xl font-bold">Join Request - {{ team.name }}</h1>
<a href="/teams/{{ team.id }}" class="text-irish-green hover:underline">Back to Team</a>
</div>
{% if error %}
<div class="bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6" role="alert">
<p>{{ error }}</p>
</div>
{% endif %}
{% if is_open %}
<div class="text-center">
<div class="bg-green-100 p-4 rounded-md mb-6">
<p class="text-green-800">
<i class="fas fa-info-circle mr-2"></i>
This is an open team. You can join immediately without approval.
</p>
</div>
<form action="/teams/join/{{ team.id }}" method="post">
<button type="submit" class="bg-irish-green text-white py-2 px-6 rounded-md hover:bg-opacity-90 transition w-full">
Join Now
</button>
</form>
</div>
{% else %}
<div class="mb-6">
<p class="text-gray-700 mb-4">You're requesting to join <strong>{{ team.name }}</strong>. Your request will need to be approved by a team captain.</p>
<form action="/teams/{{ team.id }}/join" method="post" class="space-y-4">
<div>
<label for="message" class="block text-sm font-medium text-gray-700 mb-1">Message (Optional)</label>
<textarea
id="message"
name="message"
rows="4"
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-irish-green"
placeholder="Tell the team why you'd like to join..."
></textarea>
</div>
<button type="submit" class="w-full bg-irish-green text-white py-2 px-6 rounded-md hover:bg-opacity-90 transition">
Send Join Request
</button>
</form>
</div>
{% endif %}
</div>
</div>
{% endblock %}