diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855..7d80990 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..ca4aa1e 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..c61ea0b 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..d947244 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..093feca 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,9 @@ from django.contrib import admin +from .models import Parcel -# Register your models here. +@admin.register(Parcel) +class ParcelAdmin(admin.ModelAdmin): + list_display = ('tracking_number', 'sender_name', 'recipient_name', 'status', 'assignee', 'received_date') + list_filter = ('status', 'assignee', 'received_date') + search_fields = ('tracking_number', 'sender_name', 'recipient_name', 'sender_email', 'recipient_email') + ordering = ('-received_date',) \ 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..71f4da9 --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,28 @@ +# Generated by Django 5.2.7 on 2026-01-11 15:58 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Parcel', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sender_name', models.CharField(max_length=255)), + ('sender_email', models.EmailField(max_length=254)), + ('recipient_name', models.CharField(max_length=255)), + ('recipient_email', models.EmailField(max_length=254)), + ('tracking_number', models.CharField(max_length=100, unique=True)), + ('status', models.CharField(choices=[('pending', 'Pending'), ('processed', 'Processed'), ('rejected', 'Rejected')], default='pending', max_length=20)), + ('assignee', models.CharField(blank=True, max_length=100, null=True)), + ('received_date', models.DateTimeField()), + ], + ), + ] 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..e01b424 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..4924dee 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,29 @@ from django.db import models -# Create your models here. +class Parcel(models.Model): + STATUS_CHOICES = [ + ('pending', 'Pending'), + ('processed', 'Processed'), + ('rejected', 'Rejected'), + ] + + sender_name = models.CharField(max_length=255) + sender_email = models.EmailField() + recipient_name = models.CharField(max_length=255) + recipient_email = models.EmailField() + tracking_number = models.CharField(max_length=100, unique=True) + status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='pending') + assignee = models.CharField(max_length=100, blank=True, null=True) + received_date = models.DateTimeField() + + def __str__(self): + return f"Parcel {self.tracking_number} for {self.recipient_name}" + + @property + def sender_initials(self): + if self.sender_name: + parts = self.sender_name.split() + if len(parts) > 1: + return (parts[0][0] + parts[-1][0]).upper() + return parts[0][0].upper() + return "?" \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..fc9862a 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,25 +1,60 @@ - - - {% block title %}Knowledge Base{% endblock %} - {% if project_description %} - - - - {% endif %} - {% if project_image_url %} - - - {% endif %} - {% load static %} - - {% block head %}{% endblock %} + + + {% block title %}PelipostPRO{% endblock %} + + + + + + + + + + + {% load static %} + + + + {% if project_description %} + + + + {% endif %} + {% if project_image_url %} + + + {% endif %} + + + - - {% 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..c2ad44c 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,72 @@ {% extends "base.html" %} +{% load static %} -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} - - - - +{% block title %} + {{ page_title }} - PelipostPRO {% endblock %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… -
-

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" }} -

+
+
+

Mail Portal

+ Add Parcel
-
- -{% endblock %} \ No newline at end of file + +
+
+
+ + + + + + + + + + + + + {% for parcel in parcels %} + + + + + + + + + {% empty %} + + + + {% endfor %} + +
SenderRecipientTracking #StatusAssigneeReceived
+
+
{{ parcel.sender_initials }}
+
+
{{ parcel.sender_name }}
+
{{ parcel.sender_email }}
+
+
+
+
{{ parcel.recipient_name }}
+
{{ parcel.recipient_email }}
+
{{ parcel.tracking_number }} + {% if parcel.status == 'processed' %} + Processed + {% elif parcel.status == 'rejected' %} + Rejected + {% else %} + Pending + {% endif %} + {{ parcel.assignee }}{{ parcel.received_date|date:"M d, Y, P" }}
+
No parcels found.
+

Click "Add Parcel" to get started.

+
+
+
+
+ +{% endblock %} diff --git a/core/urls.py b/core/urls.py index 6299e3d..cedf1bd 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,8 @@ from django.urls import path +from . import views -from .views import home +app_name = 'core' urlpatterns = [ - path("", home, name="home"), -] + path('', views.index, name='index'), +] \ No newline at end of file diff --git a/core/views.py b/core/views.py index c9aed12..29407ed 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,45 @@ -import os -import platform - -from django import get_version as django_version from django.shortcuts import render +from .models import Parcel from django.utils import timezone +import datetime +def index(request): + # If no parcels, create some demo data. + if not Parcel.objects.exists(): + Parcel.objects.create( + sender_name='John Doe', + sender_email='john.doe@example.com', + recipient_name='Jane Smith', + recipient_email='jane.smith@example.com', + tracking_number='JD123456789', + status='pending', + assignee='Operator 1', + received_date=timezone.now() - datetime.timedelta(days=1) + ) + Parcel.objects.create( + sender_name='Peter Jones', + sender_email='peter.jones@example.com', + recipient_name='Mary Williams', + recipient_email='mary.williams@example.com', + tracking_number='PJ987654321', + status='processed', + assignee='Admin', + received_date=timezone.now() - datetime.timedelta(hours=5) + ) + Parcel.objects.create( + sender_name='Susan Brown', + sender_email='susan.brown@example.com', + recipient_name='David Miller', + recipient_email='david.miller@example.com', + tracking_number='SB112233445', + status='rejected', + assignee='Operator 2', + received_date=timezone.now() - datetime.timedelta(days=2) + ) -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() - + parcels = Parcel.objects.all().order_by('-received_date') 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", ""), + 'parcels': parcels, + 'page_title': 'Mail Screening Portal' } - return render(request, "core/index.html", context) + return render(request, 'core/index.html', context) \ No newline at end of file diff --git a/static/css/custom.css b/static/css/custom.css index 925f6ed..1e04186 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,99 @@ -/* Custom styles for the application */ +/* General Body and Typography */ body { - font-family: system-ui, -apple-system, sans-serif; + background-color: #F3F4F6; /* Cool Gray 100 */ + font-family: 'Inter', sans-serif; + color: #1F2937; /* Cool Gray 800 */ } + +h1, h2, h3, h4, h5, h6 { + font-weight: 700; +} + +.btn-primary { + background-color: #4F46E5; + border-color: #4F46E5; + font-weight: 600; + transition: background-color 0.2s; +} + +.btn-primary:hover { + background-color: #4338CA; + border-color: #4338CA; +} + +/* Avatars */ +.avatar { + display: inline-flex; + align-items: center; + justify-content: center; + width: 2.5rem; + height: 2.5rem; + border-radius: 50%; + font-weight: 600; + color: #fff; + background-color: #A5B4FC; /* Indigo 300 */ +} + +.avatar-indigo { + background-color: #818CF8; + color: #3730A3; +} + + +/* Status Pills */ +.status-pill { + padding: 0.3em 0.8em; + font-size: 0.75rem; + font-weight: 600; + border-radius: 9999px; +} + +.status-pending { + color: #92400E; /* Amber 800 */ + background-color: #FDE68A; /* Amber 200 */ +} + +.status-processed { + color: #065F46; /* Emerald 800 */ + background-color: #A7F3D0; /* Emerald 200 */ +} + +.status-rejected { + color: #991B1B; /* Red 800 */ + background-color: #FECACA; /* Red 200 */ +} + +/* Table styling */ +.table { + border-collapse: separate; + border-spacing: 0; + min-width: 800px; +} + +.table thead th { + border-bottom-width: 1px; + font-weight: 600; + text-transform: uppercase; + font-size: 0.75rem; + letter-spacing: 0.05em; + color: #6B7280; /* Cool Gray 500 */ +} + +.table tbody tr { + transition: background-color 0.15s ease-in-out; +} + +.table tbody tr:hover { + background-color: #F9FAFB; /* Cool Gray 50 */ +} + +.table td, .table th { + vertical-align: middle; + padding-top: 1rem; + padding-bottom: 1rem; + border-bottom: 1px solid #E5E7EB; /* Cool Gray 200 */ +} + +.card { + border: none; +} \ No newline at end of file diff --git a/staticfiles/css/custom.css b/staticfiles/css/custom.css index 108056f..1e04186 100644 --- a/staticfiles/css/custom.css +++ b/staticfiles/css/custom.css @@ -1,21 +1,99 @@ - -: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); -} +/* General Body and Typography */ body { - margin: 0; + background-color: #F3F4F6; /* Cool Gray 100 */ font-family: 'Inter', sans-serif; - background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end)); - color: var(--text-color); - display: flex; - justify-content: center; - align-items: center; - min-height: 100vh; - text-align: center; - overflow: hidden; - position: relative; + color: #1F2937; /* Cool Gray 800 */ } + +h1, h2, h3, h4, h5, h6 { + font-weight: 700; +} + +.btn-primary { + background-color: #4F46E5; + border-color: #4F46E5; + font-weight: 600; + transition: background-color 0.2s; +} + +.btn-primary:hover { + background-color: #4338CA; + border-color: #4338CA; +} + +/* Avatars */ +.avatar { + display: inline-flex; + align-items: center; + justify-content: center; + width: 2.5rem; + height: 2.5rem; + border-radius: 50%; + font-weight: 600; + color: #fff; + background-color: #A5B4FC; /* Indigo 300 */ +} + +.avatar-indigo { + background-color: #818CF8; + color: #3730A3; +} + + +/* Status Pills */ +.status-pill { + padding: 0.3em 0.8em; + font-size: 0.75rem; + font-weight: 600; + border-radius: 9999px; +} + +.status-pending { + color: #92400E; /* Amber 800 */ + background-color: #FDE68A; /* Amber 200 */ +} + +.status-processed { + color: #065F46; /* Emerald 800 */ + background-color: #A7F3D0; /* Emerald 200 */ +} + +.status-rejected { + color: #991B1B; /* Red 800 */ + background-color: #FECACA; /* Red 200 */ +} + +/* Table styling */ +.table { + border-collapse: separate; + border-spacing: 0; + min-width: 800px; +} + +.table thead th { + border-bottom-width: 1px; + font-weight: 600; + text-transform: uppercase; + font-size: 0.75rem; + letter-spacing: 0.05em; + color: #6B7280; /* Cool Gray 500 */ +} + +.table tbody tr { + transition: background-color 0.15s ease-in-out; +} + +.table tbody tr:hover { + background-color: #F9FAFB; /* Cool Gray 50 */ +} + +.table td, .table th { + vertical-align: middle; + padding-top: 1rem; + padding-bottom: 1rem; + border-bottom: 1px solid #E5E7EB; /* Cool Gray 200 */ +} + +.card { + border: none; +} \ No newline at end of file