{# fortunaisk/templates/fortunaisk/base.html #}
{% extends "allianceauth/base-bs5.html" %}
{% load i18n navactive static %}

{% block page_title %}
  {% trans "FortunaIsk" %}
{% endblock page_title %}

{% block head %}
  {{ block.super }}
  <link rel="stylesheet" href="{% static 'css/styles.css' %}?v=3"/>
  <link rel="stylesheet" href="{% static 'css/clover.css' %}"/>
  <!-- Font Awesome -->
  <link rel="stylesheet"
        href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"
        integrity="sha512-Fo3rlrQkTyI9rELK9M0VyrCIe4gLLlRdZo8U+qJ1jNfl3zV3eV3UZ6+dJ4uCZfV+1AAhCKZPpbfwS5IsVnP0Mg=="
        crossorigin="anonymous"
        referrerpolicy="no-referrer" />
{% endblock head %}

{% block header_nav_brand %}
  <a class="navbar-brand" href="{% url 'fortunaisk:lottery' %}">
    <i class="fas fa-clover me-2 text-success"></i>
    {% trans "FortunaIsk" %}
  </a>
{% endblock header_nav_brand %}

{% block header_nav_collapse_left %}
  <ul class="navbar-nav">
    {# Lottery & ses sous-pages #}
    <li class="nav-item
        {% navactive request 'fortunaisk:lottery' %}
        {% navactive request 'fortunaisk:lottery_history' %}
        {% navactive request 'fortunaisk:lottery_detail' %}
        {% navactive request 'fortunaisk:lottery_participants' %}
        {% navactive request 'fortunaisk:create_lottery' %}">
      <a class="nav-link" href="{% url 'fortunaisk:lottery' %}">
        <i class="fas fa-ticket-alt me-1"></i> {% trans "Lottery" %}
      </a>
    </li>

    {# Winners #}
    {% if perms.fortunaisk.can_access_app %}
    <li class="nav-item {% navactive request 'fortunaisk:winner_list' %}">
      <a class="nav-link" href="{% url 'fortunaisk:winner_list' %}">
        <i class="fas fa-trophy me-1"></i> {% trans "Winners" %}
      </a>
    </li>
    {% endif %}

    {# History #}
    <li class="nav-item {% navactive request 'fortunaisk:lottery_history' %}">
      <a class="nav-link" href="{% url 'fortunaisk:lottery_history' %}">
        <i class="fas fa-history me-1"></i> {% trans "Lottery History" %}
      </a>
    </li>

    {# Admin Dashboard #}
    {% if perms.fortunaisk.can_admin_app %}
    <li class="nav-item {% navactive request 'fortunaisk:admin_dashboard' %}">
      <a class="nav-link" href="{% url 'fortunaisk:admin_dashboard' %}">
        <i class="fas fa-cogs me-1"></i> {% trans "Admin Dashboard" %}
      </a>
    </li>
    {% endif %}

    {# User Dashboard #}
    <li class="nav-item {% navactive request 'fortunaisk:user_dashboard' %}">
      <a class="nav-link" href="{% url 'fortunaisk:user_dashboard' %}">
        <i class="fas fa-wallet me-1"></i> {% trans "User Dashboard" %}
      </a>
    </li>
  </ul>
{% endblock header_nav_collapse_left %}

{% block content %}
  <div class="fortunaisk-app">
    {% block details %}{% endblock details %}
  </div>
{% endblock content %}

{% block scripts %}
  {{ block.super }}
  <script src="{% static 'js/clover.js' %}"></script>
  <script src="{% static 'js/loader.js' %}"></script>
  <script src="{% static 'js/sparkle.js' %}"></script>
{% endblock scripts %}
