diff --git a/config/__pycache__/__init__.cpython-311.pyc b/config/__pycache__/__init__.cpython-311.pyc index 423a636..aaa952e 100644 Binary files a/config/__pycache__/__init__.cpython-311.pyc and b/config/__pycache__/__init__.cpython-311.pyc differ diff --git a/config/__pycache__/settings.cpython-311.pyc b/config/__pycache__/settings.cpython-311.pyc index 96bce55..cc38441 100644 Binary files a/config/__pycache__/settings.cpython-311.pyc and b/config/__pycache__/settings.cpython-311.pyc differ diff --git a/config/__pycache__/urls.cpython-311.pyc b/config/__pycache__/urls.cpython-311.pyc index 0b85e94..0debe38 100644 Binary files a/config/__pycache__/urls.cpython-311.pyc and b/config/__pycache__/urls.cpython-311.pyc differ diff --git a/config/__pycache__/wsgi.cpython-311.pyc b/config/__pycache__/wsgi.cpython-311.pyc index 9c49e09..6e80bb7 100644 Binary files a/config/__pycache__/wsgi.cpython-311.pyc and b/config/__pycache__/wsgi.cpython-311.pyc differ diff --git a/core/__pycache__/__init__.cpython-311.pyc b/core/__pycache__/__init__.cpython-311.pyc index 74b1112..20e9ee9 100644 Binary files a/core/__pycache__/__init__.cpython-311.pyc and b/core/__pycache__/__init__.cpython-311.pyc differ diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index a5ed392..3c0ebca 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/apps.cpython-311.pyc b/core/__pycache__/apps.cpython-311.pyc index 6f131d4..e3a68b3 100644 Binary files a/core/__pycache__/apps.cpython-311.pyc and b/core/__pycache__/apps.cpython-311.pyc differ diff --git a/core/__pycache__/context_processors.cpython-311.pyc b/core/__pycache__/context_processors.cpython-311.pyc index 75bf223..2d7677b 100644 Binary files a/core/__pycache__/context_processors.cpython-311.pyc and b/core/__pycache__/context_processors.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index e061640..0d1a714 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 5a69659..fd1a42d 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 2a36fd6..43e6e7d 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..8feab91 --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,39 @@ +# Generated by Django 5.2.7 on 2026-02-23 09:58 + +import django.db.models.deletion +import django.utils.timezone +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Job', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('job_number', models.CharField(editable=False, max_length=20, unique=True)), + ('client_name', models.CharField(max_length=255)), + ('description', models.TextField(blank=True)), + ('status', models.CharField(choices=[('draft', 'Draft'), ('active', 'Active'), ('completed', 'Completed'), ('cancelled', 'Cancelled')], default='draft', max_length=20)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ], + ), + migrations.CreateModel( + name='Agreement', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('agreement_date', models.DateField(default=django.utils.timezone.now)), + ('terms', models.TextField()), + ('scope_of_work', models.TextField()), + ('total_value', models.DecimalField(decimal_places=2, default=0.0, max_digits=12)), + ('job', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='agreement', to='core.job')), + ], + ), + ] 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..9705431 Binary files /dev/null and b/core/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/core/migrations/__pycache__/__init__.cpython-311.pyc b/core/migrations/__pycache__/__init__.cpython-311.pyc index 9c833c8..e0c00e3 100644 Binary files a/core/migrations/__pycache__/__init__.cpython-311.pyc and b/core/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 71a8362..26a3db5 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,44 @@ from django.db import models +from django.utils import timezone -# Create your models here. +class Job(models.Model): + STATUS_CHOICES = [ + ('draft', 'Draft'), + ('active', 'Active'), + ('completed', 'Completed'), + ('cancelled', 'Cancelled'), + ] + + job_number = models.CharField(max_length=20, unique=True, editable=False) + client_name = models.CharField(max_length=255) + description = models.TextField(blank=True) + status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='draft') + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + def save(self, *args, **kwargs): + if not self.job_number: + last_job = Job.objects.order_by('-id').first() + if last_job and last_job.job_number.startswith('AIS'): + try: + last_num = int(last_job.job_number[3:]) + new_num = last_num + 1 + except ValueError: + new_num = 1 + else: + new_num = 1 + self.job_number = f"AIS{new_num:04d}" + super().save(*args, **kwargs) + + def __str__(self): + return f"{self.job_number} - {self.client_name}" + +class Agreement(models.Model): + job = models.OneToOneField(Job, on_delete=models.CASCADE, related_name='agreement') + agreement_date = models.DateField(default=timezone.now) + terms = models.TextField() + scope_of_work = models.TextField() + total_value = models.DecimalField(max_digits=12, decimal_places=2, default=0.00) + + def __str__(self): + return f"Agreement for {self.job.job_number}" \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..f45fe2d 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,25 +1,54 @@ - - - {% block title %}Knowledge Base{% endblock %} - {% if project_description %} - - - - {% endif %} - {% if project_image_url %} - - - {% endif %} - {% load static %} - - {% block head %}{% endblock %} + + + {% block title %}Aitken Spence Industrial Solutions{% endblock %} + + + + + + + + + + {% load static %} + + + {% block head %}{% endblock %} - - {% block content %}{% endblock %} - + - +
+ {% block content %}{% endblock %} +
+ + + + + + \ No newline at end of file diff --git a/core/templates/core/agreement_print.html b/core/templates/core/agreement_print.html new file mode 100644 index 0000000..ef84625 --- /dev/null +++ b/core/templates/core/agreement_print.html @@ -0,0 +1,110 @@ +{% extends "base.html" %} + +{% block head %} + +{% endblock %} + +{% block content %} +
+
+

Print Preview: This layout is optimized for A4 paper printing.

+ + Back to Job +
+
+ + +{% endblock %} diff --git a/core/templates/core/index.html b/core/templates/core/index.html index faec813..6caf322 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,89 @@ {% extends "base.html" %} - -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} - - - - -{% endblock %} +{% load static %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… +
+
+

Industrial Operations Control

+

Manage jobs, agreements, and industrial solutions for Aitken Spence with precision and speed.

+
-

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 +
+
+ + + + +
+
+ + +
+
+
+

{{ jobs_count }}

+

Total Jobs

+
+
+
+
+

{{ active_jobs }}

+

Active Agreements

+
+
+
+
+

100%

+

SLA Compliance

+
+
+
+ +
+
+
+
+

Recent Job Orders

+ View All +
+
+ + + + + + + + + + + + {% for job in recent_jobs %} + + + + + + + + {% empty %} + + + + {% endfor %} + +
Job IDClientStatusCreatedAction
{{ job.job_number }}{{ job.client_name }} + + {{ job.get_status_display }} + + {{ job.created_at|date:"M d, Y" }} + Manage +
No jobs found. Start by creating one.
+
+
+
+
+{% endblock %} diff --git a/core/templates/core/job_detail.html b/core/templates/core/job_detail.html new file mode 100644 index 0000000..8ab78b4 --- /dev/null +++ b/core/templates/core/job_detail.html @@ -0,0 +1,71 @@ +{% extends "base.html" %} + +{% block title %}Job {{ job.job_number }} - AIS Portal{% endblock %} + +{% block content %} +
+
+
+
+
+ Job Profile +

{{ job.job_number }}

+

{{ job.client_name }}

+
+ {{ job.get_status_display }} +
+ +
+
+

Creation Date

+

{{ job.created_at|date:"d F Y, H:i" }}

+
+
+

Last Update

+

{{ job.updated_at|date:"d F Y, H:i" }}

+
+
+ +
+ +

Job Description

+
+ {{ job.description|linebreaks|default:"No description provided." }} +
+
+ +
+

Agreement Status

+ {% if job.agreement %} +
+
+

Commercial Agreement Generated

+

Dated: {{ job.agreement.agreement_date }}

+
+ Preview & Print +
+ {% else %} +
+

No agreement linked to this job yet.

+ +
+ {% endif %} +
+
+ +
+
+

Workflow Actions

+
+ + +
+ +
+
+

"Ensure all client data matches the physical purchase order before printing the agreement."

+
+
+
+
+{% endblock %} diff --git a/core/templates/core/job_form.html b/core/templates/core/job_form.html new file mode 100644 index 0000000..fd21901 --- /dev/null +++ b/core/templates/core/job_form.html @@ -0,0 +1,31 @@ +{% extends "base.html" %} + +{% block title %}New Job - AIS Portal{% endblock %} + +{% block content %} +
+
+
+

Register New Industrial Job

+
+ {% csrf_token %} +
+ + +
+
+ + +
+
+ + Cancel +
+
+
+

Note: Job Number (AISXXXX) will be automatically generated upon submission.

+
+
+
+
+{% endblock %} diff --git a/core/templates/core/job_list.html b/core/templates/core/job_list.html new file mode 100644 index 0000000..df33101 --- /dev/null +++ b/core/templates/core/job_list.html @@ -0,0 +1,50 @@ +{% extends "base.html" %} + +{% block title %}All Jobs - AIS Portal{% endblock %} + +{% block content %} +
+

Job Inventory

+ + New Job +
+ +
+
+ + + + + + + + + + + + {% for job in jobs %} + + + + + + + + {% empty %} + + + + {% endfor %} + +
Job IDClient NameStatusDate CreatedActions
{{ job.job_number }}{{ job.client_name }} + + {{ job.get_status_display }} + + {{ job.created_at|date:"M d, Y" }} +
+ View + Print +
+
No jobs available.
+
+
+{% endblock %} diff --git a/core/urls.py b/core/urls.py index 6299e3d..90736d4 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,10 @@ from django.urls import path - -from .views import home +from .views import home, job_list, job_create, job_detail, agreement_print urlpatterns = [ path("", home, name="home"), -] + path("jobs/", job_list, name="job_list"), + path("jobs/new/", job_create, name="job_create"), + path("jobs//", job_detail, name="job_detail"), + path("jobs//print/", agreement_print, name="agreement_print"), +] \ No newline at end of file diff --git a/core/views.py b/core/views.py index c9aed12..a4c4702 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 django.shortcuts import render, get_object_or_404, redirect from django.utils import timezone - +from .models import Job, Agreement +from django.contrib.auth.decorators import login_required 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() - + """Modern Dashboard Landing Page""" + jobs_count = Job.objects.count() + active_jobs = Job.objects.filter(status='active').count() + recent_jobs = Job.objects.order_by('-created_at')[:5] + context = { - "project_name": "New Style", - "agent_brand": agent_brand, + "project_name": "Aitken Spence Industrial Solutions", + "jobs_count": jobs_count, + "active_jobs": active_jobs, + "recent_jobs": recent_jobs, "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) + +def job_list(request): + jobs = Job.objects.all().order_by('-created_at') + return render(request, "core/job_list.html", {"jobs": jobs}) + +def job_create(request): + if request.method == "POST": + client_name = request.POST.get("client_name") + description = request.POST.get("description") + job = Job.objects.create(client_name=client_name, description=description) + # Automatically create an empty agreement + Agreement.objects.create(job=job, terms="Standard Terms Apply", scope_of_work=description) + return redirect('job_detail', pk=job.pk) + return render(request, "core/job_form.html") + +def job_detail(request, pk): + job = get_object_or_404(Job, pk=pk) + return render(request, "core/job_detail.html", {"job": job}) + +def agreement_print(request, pk): + agreement = get_object_or_404(Agreement, job__pk=pk) + return render(request, "core/agreement_print.html", {"agreement": agreement}) \ No newline at end of file diff --git a/static/css/custom.css b/static/css/custom.css index 925f6ed..d8f0b01 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,73 @@ -/* Custom styles for the application */ -body { - font-family: system-ui, -apple-system, sans-serif; +:root { + --primary-color: #003366; /* Deep Industrial Blue */ + --accent-color: #FF8C00; /* Safety Orange */ + --bg-color: #F8F9FA; + --text-color: #212529; + --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); } + +body { + background-color: var(--bg-color); + color: var(--text-color); + font-family: 'Inter', sans-serif; +} + +h1, h2, h3, h4, h5, h6 { + font-family: 'Outfit', sans-serif; + color: var(--primary-color); +} + +.navbar { + background-color: var(--primary-color) !important; +} + +.navbar-brand, .nav-link { + color: white !important; +} + +.btn-primary { + background-color: var(--primary-color); + border-color: var(--primary-color); +} + +.btn-accent { + background-color: var(--accent-color); + color: white; + border: none; +} + +.btn-accent:hover { + background-color: #e67e00; + color: white; +} + +.card { + border: none; + border-radius: 12px; + box-shadow: var(--card-shadow); + transition: transform 0.2s; +} + +.card:hover { + transform: translateY(-5px); +} + +/* Print Styling */ +@media print { + .no-print { + display: none !important; + } + body { + background: white; + } + .print-container { + width: 100%; + margin: 0; + padding: 20px; + } + .agreement-header { + border-bottom: 2px solid var(--primary-color); + margin-bottom: 20px; + padding-bottom: 10px; + } +} \ No newline at end of file