{% extends 'base.html' %}
{% load static %}



{% block content %}
      <!--end::Sidebar-->
      <!--begin::App Main-->
      <div class="container">
        <div class="row m-4">

          {% if messages %}
          {% for message in messages %}
            <div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
              {{ message }}
              <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
          {% endfor %}
        {% endif %}

         
          <div class="alert alert-info d-flex justify-content-between align-items-center mb-4">
            <div>
            <h5 class="mb-1">Registration Countdown</h5>
            <p class="mb-0">
              {% if days_remaining > 0 %}
                {{ days_remaining }} day{{ days_remaining|pluralize }} remaining until registration closes.
              {% else %}
                Registration deadline has passed.
              {% endif %}
            </p>
          </div>
            <div>
              {% if club.status == "Unapproved" %}
                <span class="badge bg-warning text-dark fs-6">Pending Approval</span>
              {%  elif club.status == "Rejected"  %}
                <div>
                <span class="badge bg-danger fs-6">Registration Rejected</span>
                <a href="{% url 'club_resubmit' %}">here</a> to update your registration details.
                
              </div>
              
              {% elif club.status == "Approved" %}
                <p> Match starts on the {{season.match_start}}. Good luck!</p>
              {% endif %}

            </div>
          </div>
        {% comment %} {% endif %} {% endcomment %}

        </div>
          <div class="row mb-5">
            <div class="col-md-6">
                <h2 class="text-center">Officials</h2>
                <div class="row">
                  <div class="col-md-6 offset-3">
                      <div class="card">
                          <img class="card-img-top" src="{% static 'assets/img/pngtree-football.png' %}" alt="Card image cap" height="300">
                    
                         <div class="card-footer">
                          <div class="d-grid gap-2">
                            <button
                              class="btn btn-primary btn-lg"
                              onclick="window.location.href='{% url 'club_official_list' %}'"
                              {% if not request.user.is_club_approved %}disabled{% endif %}
                            >
                              View Officials
                            </button>
                          </div>
                        </div>
                        </div>
                  </div>
                </div>
                
            </div>
            


            <div class="col-md-6">
                <h2 class="text-center">Players</h2>
                <div class="row">
                  <div class="col-md-6 offset-3">
                      <div class="card">
                          <img class="card-img-top" src="{% static 'assets/img/woman-soccer.webp' %}" alt="Card image cap" height="300">
                        
                          <div class="card-footer">
                            {% comment %} <div class="d-grid gap-2">
                                <a href="{% url "club_players_list" %}" class="btn btn-primary btn-lg">View Players</a>
                            </div> {% endcomment %}

                            <div class="d-grid gap-2">
                            <button
                              class="btn btn-primary btn-lg"
                              onclick="window.location.href='{% url "club_players_list" %}'"
                              {% if not request.user.is_club_approved %}disabled{% endif %}
                            >
                              View Players
                            </button>
                          </div>
                            
                          </div>

                        </div>
                  </div>
                </div>
            </div>
        </div>
      </div>
   
     
      
      

{% endblock content %}

    