summaryrefslogtreecommitdiff
path: root/templates/team.html
blob: e7098beb1c0a46b146755630536839f2c523b0c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{% extends "base.html" %}

{% block content %}
    <h2>Team Management: {{ current_user.team_name }}</h2>
    
    {% if current_user.team_icon %}
        <div style="margin-bottom: 1rem;">
            <img src="{{ url_for('static', filename='uploads/' + current_user.team_icon) }}" alt="Team Icon" style="max-width: 150px; border: 1px solid var(--deco-border);">
        </div>
    {% endif %}

    <div style="display: flex; gap: 2rem; flex-wrap: wrap;">
        <div style="flex: 1; min-width: 300px;">
            <h3>Update Profile</h3>
            <form method="POST" enctype="multipart/form-data">
                <div>
                    <label for="team_name">Team Name:</label>
                    <input type="text" id="team_name" name="team_name" value="{{ current_user.team_name }}">
                </div>
                <div>
                    <label for="new_password">New Password (leave blank to keep current):</label>
                    <input type="password" id="new_password" name="new_password">
                </div>
                <div>
                    <label for="team_icon">Upload Team Icon:</label>
                    <input type="file" id="team_icon" name="team_icon" accept="image/*">
                </div>
                <button type="submit">Save Changes</button>
            </form>
        </div>
        
        <div style="flex: 1; min-width: 300px;">
            <h3>Seasons</h3>
            {% if seasons %}
                <ul style="list-style: none; padding: 0;">
                {% for season in seasons %}
                    <li style="background: var(--bg-primary); padding: 1rem; margin-bottom: 0.5rem; border: 1px solid var(--deco-border); display: flex; justify-content: space-between; align-items: center;">
                        <span><strong>{{ season.name }}</strong> ({{ season.status }})</span>
                        
                        {% if not current_user.is_admin %}
                            {% if season.id in my_seasons %}
                                {% if my_seasons[season.id] == 'Approved' %}
                                    <span style="color: green; font-weight: bold;">Joined</span>
                                {% else %}
                                    <span style="color: orange; font-weight: bold;">Pending Approval</span>
                                {% endif %}
                            {% else %}
                                <form method="POST" action="{{ url_for('join_season', season_id=season.id) }}" style="margin: 0;">
                                    <button type="submit" style="padding: 4px 8px; font-size: 0.8rem;">Request to Join</button>
                                </form>
                            {% endif %}
                        {% endif %}
                    </li>
                {% endfor %}
                </ul>
            {% else %}
                <p>No seasons available right now.</p>
            {% endif %}

            <h3 style="margin-top: 2rem;">Your Schedule</h3>
            <p>Below is your team's schedule for the active season.</p>
            <a href="{{ url_for('index', tab='schedule', team_id=current_user.id) }}" style="display: inline-block; background-color: var(--text-accent); color: white; padding: 8px 16px; text-decoration: none; font-weight: bold;">View Full Team Schedule</a>
        </div>
    </div>
{% endblock %}