update
This commit is contained in:
7 files changed
+2303
-16
No files matched your search
@@ -0,0 +1,187 @@
|
||||
{% extends "shared/base.html" %}
|
||||
{% load static %}
|
||||
{% block content %}
|
||||
{% include "shared/navbar.html" %}
|
||||
|
||||
<div class="pt-20 pb-50">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<h1 class="text-3xl font-bold text-heading mb-2">Dashboard</h1>
|
||||
<p class="text-body mb-8">Welcome back! {{ request.user.username }}</p>
|
||||
|
||||
<!-- Top Stats -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
||||
<div class="stat bg-neutral-secondary-soft rounded-lg shadow-sm border border-default">
|
||||
<div class="stat-figure text-brand">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
class="inline-block w-8 h-8 stroke-current">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z">
|
||||
</path>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="stat-title text-body">Total Clients</div>
|
||||
<div class="stat-value text-heading">{{ total_clients }}</div>
|
||||
<div class="stat-desc text-body-secondary">Lifetime total</div>
|
||||
</div>
|
||||
|
||||
<div class="stat bg-neutral-secondary-soft rounded-lg shadow-sm border border-default">
|
||||
<div class="stat-figure text-info">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
class="inline-block w-8 h-8 stroke-current">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01">
|
||||
</path>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="stat-title text-body">Active Projects</div>
|
||||
<div class="stat-value text-heading">{{ active_projects }}</div>
|
||||
<div class="stat-desc text-body-secondary">In progress</div>
|
||||
</div>
|
||||
|
||||
<div class="stat bg-neutral-secondary-soft rounded-lg shadow-sm border border-default">
|
||||
<div class="stat-figure text-warning">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
class="inline-block w-8 h-8 stroke-current">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="stat-title text-body">Pending Tasks</div>
|
||||
<div class="stat-value text-heading">{{ pending_tasks }}</div>
|
||||
<div class="stat-desc text-body-secondary">Needs attention</div>
|
||||
</div>
|
||||
|
||||
<div class="stat bg-neutral-secondary-soft rounded-lg shadow-sm border border-default">
|
||||
<div class="stat-figure text-success">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
class="inline-block w-8 h-8 stroke-current">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z">
|
||||
</path>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="stat-title text-body">Revenue</div>
|
||||
<div class="stat-value text-heading">Rs.{{ total_income|floatformat:0 }}</div>
|
||||
<div class="stat-desc text-body-secondary">Total paid invoices</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
||||
<!-- Left Column: Recent Activity -->
|
||||
<div class="lg:col-span-2 space-y-8">
|
||||
<!-- Recent Projects -->
|
||||
<div class="bg-neutral-secondary-soft rounded-lg shadow-sm border border-default p-6">
|
||||
<h2 class="text-xl font-bold text-heading mb-4">Recent Projects</h2>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table w-full">
|
||||
<thead>
|
||||
<tr class="text-body border-b border-default">
|
||||
<th>Project</th>
|
||||
<th>Client</th>
|
||||
<th>Status</th>
|
||||
<th>Updated</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for project in recent_projects %}
|
||||
<tr class="hover:bg-neutral-tertiary border-b border-default last:border-0">
|
||||
<td class="font-medium text-heading">{{ project.name }}</td>
|
||||
<td class="text-body">{{ project.client.name }}</td>
|
||||
<td>
|
||||
<span
|
||||
class="badge {% if project.status == 'In_PROGRESS' %}badge-info{% elif project.status == 'COMPLETED' %}badge-success{% else %}badge-ghost{% endif %} badge-sm">
|
||||
{{ project.get_status_display }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-body-secondary text-sm">{{ project.updated_at|date:"M d" }}</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="4" class="text-center text-body-secondary py-4">No recent projects</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Recent Tasks -->
|
||||
<div class="bg-neutral-secondary-soft rounded-lg shadow-sm border border-default p-6">
|
||||
<h2 class="text-xl font-bold text-heading mb-4">Recent Tasks</h2>
|
||||
<ul class="space-y-3">
|
||||
{% for task in recent_tasks %}
|
||||
<li
|
||||
class="flex items-center justify-between p-3 bg-neutral-primary rounded-lg border border-default">
|
||||
<div class="flex items-center space-x-3">
|
||||
<div
|
||||
class="badge {% if task.status == 'TODO' %}badge-warning{% elif task.status == 'IN_PROGRESS' %}badge-info{% else %}badge-success{% endif %} badge-xs">
|
||||
</div>
|
||||
<div>
|
||||
<p class="font-medium text-heading">{{ task.title }}</p>
|
||||
<p class="text-xs text-body-secondary">{{ task.project.name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<span class="text-xs text-body-secondary">{{ task.updated_at|timesince }} ago</span>
|
||||
</li>
|
||||
{% empty %}
|
||||
<li class="text-center text-body-secondary py-2">No recent tasks</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right Column: Overview & Alerts -->
|
||||
<div class="space-y-8">
|
||||
<!-- Financial Overview -->
|
||||
<div class="bg-neutral-secondary-soft rounded-lg shadow-sm border border-default p-6">
|
||||
<h2 class="text-xl font-bold text-heading mb-4">Financial Overview</h2>
|
||||
<div class="space-y-4">
|
||||
<div class="flex justify-between items-center">
|
||||
<span class="text-body">Pending Income</span>
|
||||
<span class="font-bold text-warning">Rs.{{ pending_income|floatformat:2 }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between items-center">
|
||||
<span class="text-body">Monthly Expenses</span>
|
||||
<span class="font-bold text-error">Rs.{{ monthly_expenses|floatformat:2 }}</span>
|
||||
</div>
|
||||
<div class="flex justify-between items-center">
|
||||
<span class="text-body">Overdue Invoices</span>
|
||||
<span class="badge badge-error">{{ overdue_invoices }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Upcoming Deadlines -->
|
||||
<div class="bg-neutral-secondary-soft rounded-lg shadow-sm border border-default p-6">
|
||||
<h2 class="text-xl font-bold text-heading mb-4">Upcoming Deadlines</h2>
|
||||
<ul class="space-y-3">
|
||||
{% for project in upcoming_deadlines %}
|
||||
<li class="flex items-center justify-between">
|
||||
<span class="text-body truncate max-w-[60%]">{{ project.name }}</span>
|
||||
<span class="text-xs font-medium text-error">{{ project.deadline|date:"M d" }}</span>
|
||||
</li>
|
||||
{% empty %}
|
||||
<li class="text-center text-body-secondary py-2">No upcoming deadlines</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Expiring Services -->
|
||||
<div class="bg-neutral-secondary-soft rounded-lg shadow-sm border border-default p-6">
|
||||
<h2 class="text-xl font-bold text-heading mb-4">Expiring Services</h2>
|
||||
<ul class="space-y-3">
|
||||
{% for service in expiring_services %}
|
||||
<li class="flex items-center justify-between">
|
||||
<span class="text-body truncate max-w-[60%]">{{ service.name }}</span>
|
||||
<span class="text-xs font-medium text-warning">{{ service.expiry_date|date:"M d" }}</span>
|
||||
</li>
|
||||
{% empty %}
|
||||
<li class="text-center text-body-secondary py-2">No expiring services</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
+23
-11
@@ -3,23 +3,35 @@
|
||||
{% block content %}
|
||||
<div class="hero bg-base-200 min-h-screen">
|
||||
<div class="hero-content flex-col w-full">
|
||||
<div class="text-center">
|
||||
<div class="text-center max-w-md mx-auto">
|
||||
<img src="{% static 'img/devsuite.png' %}" alt="DevSuite" class="h-32 mx-auto mb-2">
|
||||
<p class="py-2">
|
||||
comprehensive management system designed for developers and agencies to streamline client management, project tracking, finance, and productivity.
|
||||
|
||||
<p class="py-2 text-balance">
|
||||
comprehensive management system designed for developers and agencies
|
||||
to streamline client management, project tracking, finance, and productivity.
|
||||
</p>
|
||||
</div>
|
||||
<div class="card bg-base-100 w-full max-w-sm shrink-0 shadow-2xl rounded-md">
|
||||
<div class="card-body">
|
||||
<fieldset class="fieldset">
|
||||
<label class="label">Username</label>
|
||||
<input type="email" class="input" placeholder="Username" />
|
||||
<label class="label">Password</label>
|
||||
<input type="password" class="input" placeholder="Password" />
|
||||
<button class="btn btn-neutral mt-4">Login</button>
|
||||
</fieldset>
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div role="alert" class="alert alert-{{ message.tags }} mb-4">
|
||||
<span>{{ message }}</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<fieldset class="fieldset">
|
||||
<label class="label">Username</label>
|
||||
<input type="text" name="username" class="input" placeholder="Username" required />
|
||||
<label class="label">Password</label>
|
||||
<input type="password" name="password" class="input" placeholder="Password" required />
|
||||
<button type="submit" class="btn btn-neutral mt-4">Login</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,98 @@
|
||||
{% load static %}
|
||||
|
||||
<nav class="bg-neutral-primary fixed w-full z-20 top-0 start-0 border-b border-default">
|
||||
<div class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4">
|
||||
<a href="{% url 'dashboard' %}" class="flex items-center space-x-3 rtl:space-x-reverse">
|
||||
<span class="self-center text-2xl font-semibold whitespace-nowrap text-heading">DevSuite</span>
|
||||
</a>
|
||||
<div class="flex md:order-2 space-x-3 md:space-x-0 rtl:space-x-reverse">
|
||||
<button type="button"
|
||||
class="text-white bg-brand hover:bg-brand-strong focus:ring-4 focus:outline-none focus:ring-brand-medium font-medium rounded-lg text-sm px-4 py-2 text-center transition-colors duration-200"
|
||||
onclick="window.location.href = '{% url 'logout' %}';">
|
||||
Logout
|
||||
</button>
|
||||
<button data-collapse-toggle="navbar-sticky" type="button"
|
||||
class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-body rounded-lg md:hidden hover:bg-neutral-secondary-soft focus:outline-none focus:ring-2 focus:ring-neutral-tertiary"
|
||||
aria-controls="navbar-sticky" aria-expanded="false">
|
||||
<span class="sr-only">Open main menu</span>
|
||||
<svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 17 14">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M1 1h15M1 7h15M1 13h15" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="items-center justify-between hidden w-full md:flex md:w-auto md:order-1" id="navbar-sticky">
|
||||
<ul
|
||||
class="flex flex-col p-4 md:p-0 mt-4 font-medium border border-default rounded-lg bg-neutral-secondary-soft md:space-x-8 rtl:space-x-reverse md:flex-row md:mt-0 md:border-0 md:bg-neutral-primary">
|
||||
<li>
|
||||
<a href="{% url 'dashboard' %}"
|
||||
class="flex items-center py-2 px-3 text-white bg-brand rounded md:bg-transparent md:text-fg-brand md:p-0"
|
||||
aria-current="page">
|
||||
<svg class="w-5 h-5 me-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24"
|
||||
height="24" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M4 4.5V19a1 1 0 0 0 1 1h15M7 14l4-4 4 4 5-5m0 0h-3.207M20 9v3.207" />
|
||||
</svg>
|
||||
Dashboard
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
class="flex items-center py-2 px-3 text-heading rounded hover:bg-neutral-tertiary md:hover:bg-transparent md:hover:text-fg-brand md:p-0 md:dark:hover:bg-transparent transition-colors duration-200">
|
||||
<svg class="w-5 h-5 me-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24"
|
||||
height="24" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-width="2"
|
||||
d="M16 19h4a1 1 0 0 0 1-1v-1a3 3 0 0 0-3-3h-2m-2.236-4a3 3 0 1 0 0-4M3 18v-1a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v1a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1Zm8-10a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
|
||||
</svg>
|
||||
Clients
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
class="flex items-center py-2 px-3 text-heading rounded hover:bg-neutral-tertiary md:hover:bg-transparent md:hover:text-fg-brand md:p-0 md:dark:hover:bg-transparent transition-colors duration-200">
|
||||
<svg class="w-5 h-5 me-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24"
|
||||
height="24" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M10 3v4a1 1 0 0 1-1 1H5m4 8h6m-6-4h6m4-8v10h0l-6 6h-8a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h8.5L20 5Z" />
|
||||
</svg>
|
||||
Projects
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
class="flex items-center py-2 px-3 text-heading rounded hover:bg-neutral-tertiary md:hover:bg-transparent md:hover:text-fg-brand md:p-0 md:dark:hover:bg-transparent transition-colors duration-200">
|
||||
<svg class="w-5 h-5 me-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24"
|
||||
height="24" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M12 6v13m0-13 4 4m-4-4-4 4" />
|
||||
</svg>
|
||||
Productivity
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
class="flex items-center py-2 px-3 text-heading rounded hover:bg-neutral-tertiary md:hover:bg-transparent md:hover:text-fg-brand md:p-0 md:dark:hover:bg-transparent transition-colors duration-200">
|
||||
<svg class="w-5 h-5 me-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24"
|
||||
height="24" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M8 17.345a4.76 4.76 0 0 0 2.558 1.618c2.274.589 4.512-.446 4.999-2.31.487-1.866-1.273-3.9-3.546-4.49-2.273-.59-4.034-2.623-3.547-4.488.486-1.865 2.724-2.899 4.998-2.31.982.236 1.87.793 2.538 1.592m-3.879 12.171V21m0-18v2.2" />
|
||||
</svg>
|
||||
Finance
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"
|
||||
class="flex items-center py-2 px-3 text-heading rounded hover:bg-neutral-tertiary md:hover:bg-transparent md:hover:text-fg-brand md:p-0 md:dark:hover:bg-transparent transition-colors duration-200">
|
||||
<svg class="w-5 h-5 me-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24"
|
||||
height="24" fill="none" viewBox="0 0 24 24">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M12 5.365V3m0 2.365a5.338 5.338 0 0 1 5.133 5.368v1.8c0 2.386 1.867 2.982 1.867 4.175C19 17.4 19 18 18.462 18H5.538C5 18 5 17.4 5 16.708c0-1.193 1.867-1.789 1.867-4.175v-1.8A5.338 5.338 0 0 1 12 5.365ZM8.733 18c.094.852.306 1.54.944 2.112a3.48 3.48 0 0 0 4.646 0c.638-.572 1.236-1.26 1.33-2.112h-6.92Z" />
|
||||
</svg>
|
||||
Notifications
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
Reference in new issue
Block a user