diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855..b50190b 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 9aa598b..803d053 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index 1f807fa..b441858 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 6867ddf..a9e07f0 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/admin.py b/core/admin.py index 8c38f3f..8e9da68 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,13 @@ from django.contrib import admin +from .models import Client, Case -# Register your models here. +@admin.register(Client) +class ClientAdmin(admin.ModelAdmin): + list_display = ('name', 'email', 'phone', 'created_at') + search_fields = ('name', 'email') + +@admin.register(Case) +class CaseAdmin(admin.ModelAdmin): + list_display = ('case_number', 'case_title', 'client', 'status', 'created_at') + list_filter = ('status', 'client') + search_fields = ('case_number', 'case_title') \ No newline at end of file diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..c278c98 --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,38 @@ +# Generated by Django 5.2.7 on 2025-12-21 18:03 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Client', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=200, verbose_name='Name')), + ('email', models.EmailField(max_length=254, unique=True, verbose_name='Email')), + ('phone', models.CharField(blank=True, max_length=20, null=True, verbose_name='Phone')), + ('address', models.TextField(blank=True, null=True, verbose_name='Address')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ], + ), + migrations.CreateModel( + name='Case', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('case_title', models.CharField(max_length=200, verbose_name='Case Title')), + ('case_number', models.CharField(max_length=50, unique=True, verbose_name='Case Number')), + ('status', models.CharField(choices=[('OPEN', 'Open'), ('CLOSED', 'Closed'), ('PENDING', 'Pending')], default='OPEN', max_length=10, verbose_name='Status')), + ('description', models.TextField(verbose_name='Description')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cases', to='core.client')), + ], + ), + ] diff --git a/core/migrations/__pycache__/0001_initial.cpython-311.pyc b/core/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 0000000..6e72eaa Binary files /dev/null and b/core/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 71a8362..e3d3850 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,33 @@ from django.db import models +from django.utils.translation import gettext_lazy as _ -# Create your models here. +class Client(models.Model): + name = models.CharField(_("Name"), max_length=200) + email = models.EmailField(_("Email"), max_length=254, unique=True) + phone = models.CharField(_("Phone"), max_length=20, blank=True, null=True) + address = models.TextField(_("Address"), blank=True, null=True) + created_at = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return self.name + +class Case(models.Model): + class CaseStatus(models.TextChoices): + OPEN = 'OPEN', _('Open') + CLOSED = 'CLOSED', _('Closed') + PENDING = 'PENDING', _('Pending') + + case_title = models.CharField(_("Case Title"), max_length=200) + case_number = models.CharField(_("Case Number"), max_length=50, unique=True) + client = models.ForeignKey(Client, on_delete=models.CASCADE, related_name='cases') + status = models.CharField( + _("Status"), + max_length=10, + choices=CaseStatus.choices, + default=CaseStatus.OPEN, + ) + description = models.TextField(_("Description")) + created_at = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return f"{self.case_number}: {self.case_title}" \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..f6fcb2b 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,25 +1,61 @@ - - - {% block title %}Knowledge Base{% endblock %} + + + + + {% block title %}PI Case Management{% endblock %} + + + + + + + + + + {% load static %} + + {% if project_description %} - - - + + {% endif %} {% if project_image_url %} - - + {% endif %} - {% load static %} - - {% block head %}{% endblock %} + - - {% block content %}{% endblock %} - - + + +
+ {% block content %} + {% endblock %} +
+ + + + + + \ No newline at end of file diff --git a/core/templates/core/index.html b/core/templates/core/index.html index faec813..5c4de71 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,39 @@ -{% extends "base.html" %} +{% extends 'base.html' %} +{% load static %} -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} - - - - -{% endblock %} +{% block title %}Dashboard - PI Case Management{% endblock %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… +
+

Case Dashboard

+

Welcome to your private investigation case management system.

+ Add New Case +
+ +

Active Cases

+ +
+ {% for case in cases %} +
+
+
+
{{ case.case_title }}
+
Case #{{ case.case_number }}
+

Client: {{ case.client.name }}

+

Status: {{ case.get_status_display }}

+

{{ case.description|truncatewords:20 }}

+
+ +
-

AppWizzy AI is collecting your requirements and applying the first changes.

-

This page will refresh automatically as the plan is implemented.

-

- Runtime: Django {{ django_version }} · Python {{ python_version }} - — UTC {{ current_time|date:"Y-m-d H:i:s" }} -

-
-
- -{% endblock %} \ No newline at end of file + {% empty %} +
+ +
+ {% endfor %} + +{% endblock %} diff --git a/core/urls.py b/core/urls.py index 6299e3d..ae08b9a 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,7 @@ from django.urls import path - -from .views import home +from .views import IndexView, ArticleDetailView urlpatterns = [ - path("", home, name="home"), -] + path("", IndexView.as_view(), name="index"), + path("article/", ArticleDetailView.as_view(), name="article_detail"), +] \ No newline at end of file diff --git a/core/views.py b/core/views.py index c9aed12..7a7a8cc 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,14 @@ -import os -import platform - -from django import get_version as django_version from django.shortcuts import render -from django.utils import timezone +from django.views.generic import TemplateView, DetailView +from .models import Case +class IndexView(TemplateView): + template_name = 'core/index.html' -def home(request): - """Render the landing screen with loader and environment details.""" - host_name = request.get_host().lower() - agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic" - now = timezone.now() + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context['cases'] = Case.objects.all().order_by('-created_at') + return context - context = { - "project_name": "New Style", - "agent_brand": agent_brand, - "django_version": django_version(), - "python_version": platform.python_version(), - "current_time": now, - "host_name": host_name, - "project_description": os.getenv("PROJECT_DESCRIPTION", ""), - "project_image_url": os.getenv("PROJECT_IMAGE_URL", ""), - } - return render(request, "core/index.html", context) +class ArticleDetailView(DetailView): + template_name = 'core/article_detail.html' \ No newline at end of file diff --git a/static/css/custom.css b/static/css/custom.css index 925f6ed..01273b1 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,173 @@ -/* Custom styles for the application */ -body { - font-family: system-ui, -apple-system, sans-serif; +:root { + --primary-color: #2F3C7E; + --secondary-color: #FBEAEB; + --accent-color: #F08A5D; + --text-color: #333333; + --bg-color: #FFFFFF; + --heading-font: 'Poppins', sans-serif; + --body-font: 'Lato', sans-serif; +} + +body { + font-family: var(--body-font); + color: var(--text-color); + background-color: var(--bg-color); + line-height: 1.6; + margin: 0; + padding: 0; +} + +h1, h2, h3, h4, h5, h6, .navbar-brand, .display-4 { + font-family: var(--heading-font); + font-weight: 600; +} + +/* Mobile-first adjustments */ +h1 { + font-size: 2.5rem; /* Base font size for mobile */ +} + +h2 { + font-size: 2rem; +} + +p { + font-size: 1rem; +} + +.navbar-brand { + font-weight: 700; + font-size: 1.25rem; /* Smaller on mobile */ + color: var(--primary-color) !important; +} + +.hero-section { + background-color: var(--secondary-color); + padding: 2rem 1rem; /* More padding on mobile */ + text-align: center; +} + +.hero-section h1 { + color: var(--primary-color); + margin-bottom: 1rem; +} + +.hero-section p { + font-size: 1.1rem; + margin-bottom: 1.5rem; +} + +.btn { + padding: 0.75rem 1.5rem; + font-size: 1rem; + border-radius: 0.3rem; +} + +.btn-primary { + background-color: var(--primary-color); + border-color: var(--primary-color); + color: white; +} + +.btn-primary:hover { + background-color: #1e2a60; + border-color: #1e2a60; +} + +.btn-secondary { + background-color: var(--accent-color); + border-color: var(--accent-color); + color: white; +} + +.btn-secondary:hover { + background-color: #d87140; + border-color: #d87140; +} + +.case-card { + transition: transform .2s ease-in-out, box-shadow .2s ease-in-out; + border: 1px solid #ddd; + margin-bottom: 1rem; /* Space between cards on mobile */ +} + +.case-card:hover { + transform: translateY(-5px); + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); +} + +.case-card .card-title { + color: var(--primary-color); + font-weight: 700; + font-size: 1.25rem; /* Smaller on mobile */ +} + +.case-card .card-text { + font-size: 0.9rem; +} + +.card-footer { + background-color: #f9f9f9; + border-top: 1px solid #eee; + font-size: 0.85rem; +} + +.status-open { + background-color: #28a745 !important; + color: white; +} + +.status-closed { + background-color: #6c757d !important; + color: white; +} + +.status-pending { + background-color: #ffc107 !important; + color: black; +} + +/* Medium devices (tablets, 768px and up) */ +@media (min-width: 768px) { + h1 { + font-size: 3.5rem; /* Larger on tablets */ + } + + h2 { + font-size: 2.5rem; + } + + .navbar-brand { + font-size: 1.5rem; /* Default size */ + } + + .hero-section { + padding: 3rem 2rem; + } + + .case-card { + margin-bottom: 1.5rem; + } + + .case-card .card-title { + font-size: 1.5rem; /* Default size */ + } +} + +/* Large devices (desktops, 992px and up) */ +@media (min-width: 992px) { + h1 { + font-size: 4rem; /* Even larger on desktops */ + } + + .hero-section { + padding: 4rem 3rem; + } +} + +/* Extra large devices (large desktops, 1200px and up) */ +@media (min-width: 1200px) { + .hero-section { + padding: 5rem 4rem; + } } diff --git a/staticfiles/css/custom.css b/staticfiles/css/custom.css index 108056f..01273b1 100644 --- a/staticfiles/css/custom.css +++ b/staticfiles/css/custom.css @@ -1,21 +1,173 @@ - :root { - --bg-color-start: #6a11cb; - --bg-color-end: #2575fc; - --text-color: #ffffff; - --card-bg-color: rgba(255, 255, 255, 0.01); - --card-border-color: rgba(255, 255, 255, 0.1); + --primary-color: #2F3C7E; + --secondary-color: #FBEAEB; + --accent-color: #F08A5D; + --text-color: #333333; + --bg-color: #FFFFFF; + --heading-font: 'Poppins', sans-serif; + --body-font: 'Lato', sans-serif; } + body { - margin: 0; - font-family: 'Inter', sans-serif; - background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end)); + font-family: var(--body-font); color: var(--text-color); - display: flex; - justify-content: center; - align-items: center; - min-height: 100vh; - text-align: center; - overflow: hidden; - position: relative; + background-color: var(--bg-color); + line-height: 1.6; + margin: 0; + padding: 0; +} + +h1, h2, h3, h4, h5, h6, .navbar-brand, .display-4 { + font-family: var(--heading-font); + font-weight: 600; +} + +/* Mobile-first adjustments */ +h1 { + font-size: 2.5rem; /* Base font size for mobile */ +} + +h2 { + font-size: 2rem; +} + +p { + font-size: 1rem; +} + +.navbar-brand { + font-weight: 700; + font-size: 1.25rem; /* Smaller on mobile */ + color: var(--primary-color) !important; +} + +.hero-section { + background-color: var(--secondary-color); + padding: 2rem 1rem; /* More padding on mobile */ + text-align: center; +} + +.hero-section h1 { + color: var(--primary-color); + margin-bottom: 1rem; +} + +.hero-section p { + font-size: 1.1rem; + margin-bottom: 1.5rem; +} + +.btn { + padding: 0.75rem 1.5rem; + font-size: 1rem; + border-radius: 0.3rem; +} + +.btn-primary { + background-color: var(--primary-color); + border-color: var(--primary-color); + color: white; +} + +.btn-primary:hover { + background-color: #1e2a60; + border-color: #1e2a60; +} + +.btn-secondary { + background-color: var(--accent-color); + border-color: var(--accent-color); + color: white; +} + +.btn-secondary:hover { + background-color: #d87140; + border-color: #d87140; +} + +.case-card { + transition: transform .2s ease-in-out, box-shadow .2s ease-in-out; + border: 1px solid #ddd; + margin-bottom: 1rem; /* Space between cards on mobile */ +} + +.case-card:hover { + transform: translateY(-5px); + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); +} + +.case-card .card-title { + color: var(--primary-color); + font-weight: 700; + font-size: 1.25rem; /* Smaller on mobile */ +} + +.case-card .card-text { + font-size: 0.9rem; +} + +.card-footer { + background-color: #f9f9f9; + border-top: 1px solid #eee; + font-size: 0.85rem; +} + +.status-open { + background-color: #28a745 !important; + color: white; +} + +.status-closed { + background-color: #6c757d !important; + color: white; +} + +.status-pending { + background-color: #ffc107 !important; + color: black; +} + +/* Medium devices (tablets, 768px and up) */ +@media (min-width: 768px) { + h1 { + font-size: 3.5rem; /* Larger on tablets */ + } + + h2 { + font-size: 2.5rem; + } + + .navbar-brand { + font-size: 1.5rem; /* Default size */ + } + + .hero-section { + padding: 3rem 2rem; + } + + .case-card { + margin-bottom: 1.5rem; + } + + .case-card .card-title { + font-size: 1.5rem; /* Default size */ + } +} + +/* Large devices (desktops, 992px and up) */ +@media (min-width: 992px) { + h1 { + font-size: 4rem; /* Even larger on desktops */ + } + + .hero-section { + padding: 4rem 3rem; + } +} + +/* Extra large devices (large desktops, 1200px and up) */ +@media (min-width: 1200px) { + .hero-section { + padding: 5rem 4rem; + } }