{% extends 'base.html' %}
<!---->
{% block title %}Ligi | pdlzbs{% endblock %}
<!---->
{% load static tailwind_tags %} {% block content %}
<!---->

{% if leagues %}
<div class="flex flex-col lg:flex-row justify-around gap-8">
  {% for name, league in leagues.items %}
  <div>
    <h1 class="text-center mb-4">{{ name }}</h1>
    <ul class="flex flex-col items-center gap-4">
      {% for score in league %}
      <li>
        <a
          href="{{ score.link }}"
          target="_blank"
          rel="noreferrer noopener"
          class="button {% if forloop.counter0|divisibleby:2 %} sky color {% else %} green color {% endif %}"
        >
          Wyniki {{score.rank}} ligi DMP {{score.year}}-{{score.year|add:"1"}}
        </a>
      </li>
      {% empty %}
      <h2>Brak wyników</h2>
      {% endfor %}
    </ul>
  </div>
  {% endfor %}
</div>
{% else %}
<h2>Brak wyników</h2>
{% endif %} {% endblock %}
