- Add custom border, background, and spacing utilities to base template - Enhance message notification styling and layout - Update delete modal button appearance and behavior - Refine comment card component with Tailwind classes and responsive behavior - Adjust sidebar responsiveness for mobile view
70 lines
4.4 KiB
HTML
70 lines
4.4 KiB
HTML
{% extends "base_authenticated.html" %}
|
|
{% block title %}Projects{% endblock %}
|
|
{% block content_inner %}
|
|
<div class="flex items-center justify-between mb-6">
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-primary">Projects</h1>
|
|
<p class="text-tertiary mt-1">Manage and track all your projects.</p>
|
|
</div>
|
|
<a href="{% url 'project_create' %}" class="px-3 py-1.5 rounded-lg text-sm font-medium bg-blue-600 text-white hover:bg-blue-700 transition-colors">
|
|
<svg class="w-4 h-4 mr-1 inline" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
|
|
New Project
|
|
</a>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 lg:grid-cols-4 gap-4 mb-6">
|
|
{% for s in status_counts %}
|
|
<div class="stat-card">
|
|
<p class="text-sm text-tertiary">{{ s.status|title }}</p>
|
|
<p class="text-2xl font-bold text-primary">{{ s.count }}</p>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<div class="grid gap-4">
|
|
{% for project in projects %}
|
|
<div class="card-surface hover:border-blue-300 transition-colors">
|
|
<div class="p-5">
|
|
<div class="flex items-start justify-between">
|
|
<div class="flex items-start gap-4">
|
|
<div class="w-10 h-10 rounded-xl bg-blue-600 flex items-center justify-center text-white font-bold text-sm flex-shrink-0">
|
|
{{ project.name|first|upper }}
|
|
</div>
|
|
<div>
|
|
<a href="{% url 'project_detail' project.pk %}" class="text-lg font-semibold text-primary hover:text-blue-600 transition-colors">{{ project.name }}</a>
|
|
<div class="flex items-center gap-3 mt-1">
|
|
<span class="text-xs px-2 py-1 rounded-full font-medium border {% if project.status == 'active' %}bg-green-50 text-green-700 border-green-200{% elif project.status == 'planning' %}bg-blue-50 text-blue-700 border-blue-200{% elif project.status == 'review' %}bg-amber-50 text-amber-700 border-amber-200{% else %}bg-gray-50 text-gray-700 border-gray-200{% endif %}">
|
|
{{ project.get_status_display }}
|
|
</span>
|
|
<span class="text-xs text-tertiary">Client: {{ project.client.username }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="flex gap-2">
|
|
<a href="{% url 'project_detail' project.pk %}" class="px-3 py-1.5 rounded-lg text-sm font-medium text-secondary hover:bg-hover border border-soft transition-colors">View</a>
|
|
{% if user.is_admin %}
|
|
<a href="{% url 'project_edit' project.pk %}" class="px-3 py-1.5 rounded-lg text-sm font-medium text-secondary hover:bg-hover border border-soft transition-colors">Edit</a>
|
|
<label for="delete-project-{{ project.pk }}" class="px-3 py-1.5 rounded-lg text-sm font-medium bg-red-50 text-red-700 hover:bg-red-100 border border-red-200 transition-colors cursor-pointer">Delete</label>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% empty %}
|
|
<div class="card-surface p-12 text-center">
|
|
<svg class="w-12 h-12 text-muted mx-auto mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"/></svg>
|
|
<p class="text-tertiary">No projects yet.</p>
|
|
<a href="{% url 'project_create' %}" class="inline-block mt-3 px-3 py-1.5 rounded-lg text-sm font-medium bg-blue-600 text-white hover:bg-blue-700 transition-colors">Create your first project</a>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% if user.is_admin %}
|
|
{% for project in projects %}
|
|
{% with project_id=project.pk|stringformat:"s" %}
|
|
{% url 'project_delete' project.pk as delete_url %}
|
|
{% include "components/delete_modal.html" with modal_id="delete-project-"|add:project_id title="Delete Project" message="Are you sure you want to delete this project? This action cannot be undone." delete_url=delete_url %}
|
|
{% endwith %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endblock %}
|