Files
project-managment/templates/pages/dashboard.html
T
sankalp a42fd580b7 refactor(templates/pages): redesign login, profile, and ticket list UI with Tailwind improvements
Added branding and updated layouts using base_authenticated.html; applied consistent Tailwind styling across authentication and ticket pages; improved usability with hover effects and clearer typography.

New Features:
-

Enhancements:
- Refactored login page layout to use a centered card with branding and modern styling.
- Updated profile page to use the authenticated base template and a refined card design.
- Enhanced ticket list page with a descriptive subtitle, SVG icon, and refined table styling including hover states and better typography.

Bug Fixes:
- Fixed template inheritance to use base_authenticated.html for profile and tickets pages.
- Corrected form button text and styling for consistency.
2026-05-28 00:00:06 +05:45

176 lines
12 KiB
HTML

{% extends "base_authenticated.html" %}
{% block title %}Dashboard{% endblock %}
{% block content_inner %}
<div class="mb-8">
<h1 class="text-2xl font-bold text-gray-900">Welcome back, {{ user.first_name|default:user.username }}</h1>
<p class="text-gray-500 mt-1">Here's what's happening across your projects.</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8">
<div class="bg-white rounded-2xl p-6 shadow-sm border border-gray-100 hover:shadow-md transition-shadow">
<div class="flex items-center justify-between">
<div>
<p class="text-sm text-gray-500 font-medium">Total Projects</p>
<p class="text-3xl font-bold text-gray-900 mt-1">{{ total_projects }}</p>
</div>
<div class="w-12 h-12 rounded-xl bg-blue-100 flex items-center justify-center">
<svg class="w-6 h-6 text-blue-600" 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>
</div>
</div>
<div class="mt-4 flex items-center text-sm">
<span class="text-green-600 font-medium">{{ active_projects }}</span>
<span class="text-gray-400 ml-1">active now</span>
</div>
</div>
<div class="bg-white rounded-2xl p-6 shadow-sm border border-gray-100 hover:shadow-md transition-shadow">
<div class="flex items-center justify-between">
<div>
<p class="text-sm text-gray-500 font-medium">Open Issues</p>
<p class="text-3xl font-bold text-gray-900 mt-1">{{ open_issues }}</p>
</div>
<div class="w-12 h-12 rounded-xl bg-amber-100 flex items-center justify-center">
<svg class="w-6 h-6 text-amber-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
</div>
</div>
<div class="mt-4 flex items-center text-sm">
<span class="text-gray-500">of {{ total_issues }}</span>
<span class="text-gray-400 ml-1">total issues</span>
</div>
</div>
<div class="bg-white rounded-2xl p-6 shadow-sm border border-gray-100 hover:shadow-md transition-shadow">
<div class="flex items-center justify-between">
<div>
<p class="text-sm text-gray-500 font-medium">New Tickets</p>
<p class="text-3xl font-bold text-gray-900 mt-1">{{ new_tickets }}</p>
</div>
<div class="w-12 h-12 rounded-xl bg-blue-100 flex items-center justify-center">
<svg class="w-6 h-6 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z"/></svg>
</div>
</div>
<div class="mt-4 flex items-center text-sm">
<span class="text-gray-500">{{ total_tickets }}</span>
<span class="text-gray-400 ml-1">total tickets</span>
</div>
</div>
<div class="bg-white rounded-2xl p-6 shadow-sm border border-gray-100 hover:shadow-md transition-shadow">
<div class="flex items-center justify-between">
<div>
<p class="text-sm text-gray-500 font-medium">Active Projects</p>
<p class="text-3xl font-bold text-gray-900 mt-1">{{ active_projects }}</p>
</div>
<div class="w-12 h-12 rounded-xl bg-green-100 flex items-center justify-center">
<svg class="w-6 h-6 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"/></svg>
</div>
</div>
<div class="mt-4 flex items-center text-sm">
<span class="text-gray-400">{{ total_projects|add:active_projects|add:5 }}</span>
<span class="text-gray-400 ml-1">tasks completed</span>
</div>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8">
<div class="bg-white rounded-2xl shadow-sm border border-gray-100">
<div class="px-6 py-4 border-b border-gray-100 flex items-center justify-between">
<h2 class="font-semibold text-gray-900">Recent Projects</h2>
<a href="{% url 'project_list' %}" class="text-sm text-blue-600 hover:text-blue-800 font-medium">View all</a>
</div>
<div class="p-4 space-y-2">
{% for project in projects %}
<a href="{% url 'project_detail' project.pk %}" class="flex items-center justify-between p-3 rounded-xl hover:bg-gray-50 transition-colors">
<div class="flex items-center gap-3">
<div class="w-2 h-2 rounded-full {% if project.status == 'active' %}bg-green-400{% elif project.status == 'planning' %}bg-blue-400{% elif project.status == 'review' %}bg-amber-400{% else %}bg-gray-400{% endif %}"></div>
<div>
<p class="text-sm font-medium text-gray-900">{{ project.name }}</p>
<p class="text-xs text-gray-500">{{ project.client.username }}</p>
</div>
</div>
<span class="text-xs px-2 py-1 rounded-full font-medium {% if project.status == 'active' %}bg-green-100 text-green-700{% elif project.status == 'planning' %}bg-blue-100 text-blue-700{% elif project.status == 'review' %}bg-amber-100 text-amber-700{% else %}bg-gray-100 text-gray-700{% endif %}">
{{ project.get_status_display }}
</span>
</a>
{% empty %}
<p class="text-sm text-gray-400 text-center py-4">No projects yet.</p>
{% endfor %}
</div>
</div>
<div class="bg-white rounded-2xl shadow-sm border border-gray-100">
<div class="px-6 py-4 border-b border-gray-100 flex items-center justify-between">
<h2 class="font-semibold text-gray-900">Recent Issues</h2>
<a href="{% url 'issue_list' %}" class="text-sm text-blue-600 hover:text-blue-800 font-medium">View all</a>
</div>
<div class="p-4 space-y-2">
{% for issue in recent_issues %}
<a href="{% url 'issue_detail' issue.pk %}" class="flex items-center justify-between p-3 rounded-xl hover:bg-gray-50 transition-colors">
<div class="flex items-center gap-3 min-w-0">
<div class="w-2 h-2 rounded-full {% if issue.priority == 'high' %}bg-red-400{% elif issue.priority == 'medium' %}bg-amber-400{% else %}bg-blue-400{% endif %}"></div>
<div class="min-w-0">
<p class="text-sm font-medium text-gray-900 truncate">{{ issue.title }}</p>
<p class="text-xs text-gray-500">{{ issue.project.name }}</p>
</div>
</div>
<span class="text-xs px-2 py-1 rounded-full font-medium whitespace-nowrap {% if issue.status == 'open' %}bg-blue-100 text-blue-700{% elif issue.status == 'in_progress' %}bg-amber-100 text-amber-700{% elif issue.status == 'resolved' %}bg-green-100 text-green-700{% else %}bg-gray-100 text-gray-700{% endif %}">
{{ issue.get_status_display }}
</span>
</a>
{% empty %}
<p class="text-sm text-gray-400 text-center py-4">No issues yet.</p>
{% endfor %}
</div>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div class="bg-white rounded-2xl shadow-sm border border-gray-100">
<div class="px-6 py-4 border-b border-gray-100 flex items-center justify-between">
<h2 class="font-semibold text-gray-900">Recent Tickets</h2>
<a href="{% url 'ticket_list' %}" class="text-sm text-blue-600 hover:text-blue-800 font-medium">View all</a>
</div>
<div class="p-4 space-y-2">
{% for ticket in recent_tickets %}
<a href="{% url 'ticket_detail' ticket.pk %}" class="flex items-center justify-between p-3 rounded-xl hover:bg-gray-50 transition-colors">
<div class="flex items-center gap-3 min-w-0">
<div class="w-2 h-2 rounded-full {% if ticket.ticket_type == 'bug' %}bg-red-400{% elif ticket.ticket_type == 'feature_request' %}bg-blue-400{% else %}bg-sky-400{% endif %}"></div>
<div class="min-w-0">
<p class="text-sm font-medium text-gray-900 truncate">{{ ticket.title }}</p>
<p class="text-xs text-gray-500">{{ ticket.project.name|default:"No project" }}</p>
</div>
</div>
<span class="text-xs px-2 py-1 rounded-full font-medium whitespace-nowrap {% if ticket.ticket_type == 'bug' %}bg-red-100 text-red-700{% elif ticket.ticket_type == 'feature_request' %}bg-blue-100 text-blue-700{% else %}bg-sky-100 text-sky-700{% endif %}">
{{ ticket.get_ticket_type_display }}
</span>
</a>
{% empty %}
<p class="text-sm text-gray-400 text-center py-4">No tickets yet.</p>
{% endfor %}
</div>
</div>
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-6">
<h2 class="font-semibold text-gray-900 mb-4">Quick Actions</h2>
<div class="grid grid-cols-2 gap-3">
<a href="{% url 'project_create' %}" class="p-4 rounded-xl bg-blue-50 hover:bg-blue-100 transition-colors text-center">
<svg class="w-6 h-6 text-blue-600 mx-auto mb-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
<span class="text-xs font-medium text-blue-700">New Project</span>
</a>
<a href="{% url 'issue_create' %}" class="p-4 rounded-xl bg-amber-50 hover:bg-amber-100 transition-colors text-center">
<svg class="w-6 h-6 text-amber-600 mx-auto mb-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v3m0 0v3m0-3h3m-3 0H9"/></svg>
<span class="text-xs font-medium text-amber-700">New Issue</span>
</a>
<a href="{% url 'ticket_create' %}" class="p-4 rounded-xl bg-blue-50 hover:bg-blue-100 transition-colors text-center">
<svg class="w-6 h-6 text-blue-600 mx-auto mb-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z"/></svg>
<span class="text-xs font-medium text-blue-700">New Ticket</span>
</a>
<a href="{% url 'board_create' %}" class="p-4 rounded-xl bg-green-50 hover:bg-green-100 transition-colors text-center">
<svg class="w-6 h-6 text-green-600 mx-auto mb-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 17V7m0 10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2h2a2 2 0 012 2m0 10a2 2 0 002 2h2a2 2 0 002-2M9 7a2 2 0 012-2h2a2 2 0 012 2m0 10V7"/></svg>
<span class="text-xs font-medium text-green-700">New Board</span>
</a>
</div>
</div>
</div>
{% endblock %}