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

{% block title %}Dashboard - webFirma{% endblock %}

{% block content %}
<div class="main-header">
  <h1>Dashboard</h1>
  <div class="header-actions">
    <div class="search-bar">
        <i data-feather="search"></i>
        <input type="text" placeholder="Search projects...">
    </div>
    <a href="{% url 'add_project' %}" class="btn btn-primary"><i data-feather="plus"></i> Dodaj projekt</a>
  </div>
</div>

<div class="content-grid">
    {% if projects %}
        {% for project in projects %}
            <div class="project-card">
                <div class="card-header">
                    <h3>{{ project.name }}</h3>
                    <span class="badge status-{{ project.status|lower }}">{{ project.get_status_display }}</span>
                </div>
                <div class="card-body">
                    <p><strong>Klient:</strong> {{ project.client }}</p>
                    <p><strong>Okres:</strong> {{ project.start_date|date:"d M Y" }} - {{ project.end_date|date:"d M Y" }}</p>
                </div>
                <div class="card-footer">
                    <div class="participants">
                        <span>Uczestnicy</span>
                        <div class="avatars">
                            <!-- Placeholder avatars -->
                            <img src="https://i.pravatar.cc/32?u=a" alt="Avatar">
                            <img src="https://i.pravatar.cc/32?u=b" alt="Avatar">
                            <img src="https://i.pravatar.cc/32?u=c" alt="Avatar">
                        </div>
                    </div>
                    <a href="#" class="btn-view">Zobacz projekt</a>
                </div>
            </div>
        {% endfor %}
    {% else %}
    <div class="empty-state">
        <div class="empty-state-icon">
            <i data-feather="briefcase"></i>
        </div>
        <h2>Brak projektów</h2>
        <p>Nie masz jeszcze żadnych projektów. Dodaj swój pierwszy projekt, aby rozpocząć.</p>
        <a href="{% url 'add_project' %}" class="btn btn-primary">Dodaj projekt</a>
    </div>
    {% endif %}
</div>
{% endblock %}
