diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855..7a88848 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc new file mode 100644 index 0000000..ba490e0 Binary files /dev/null and b/core/__pycache__/forms.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 9aa598b..e90c69b 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..ff8e2b9 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..ba79e6d 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..8eb13df 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,4 @@ from django.contrib import admin +from .models import Contact -# Register your models here. +admin.site.register(Contact) \ No newline at end of file diff --git a/core/forms.py b/core/forms.py new file mode 100644 index 0000000..183f4cb --- /dev/null +++ b/core/forms.py @@ -0,0 +1,7 @@ +from django import forms +from .models import Contact + +class ContactForm(forms.ModelForm): + class Meta: + model = Contact + fields = ['first_name', 'last_name', 'email', 'phone', 'company', 'status'] diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..44b5db9 --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,28 @@ +# Generated by Django 5.2.7 on 2025-12-19 12:35 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Contact', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('first_name', models.CharField(max_length=100)), + ('last_name', models.CharField(max_length=100)), + ('email', models.EmailField(max_length=254)), + ('phone', models.CharField(blank=True, max_length=20)), + ('company', models.CharField(blank=True, max_length=100)), + ('status', models.CharField(choices=[('Lead', 'Lead'), ('Contacted', 'Contacted'), ('Customer', 'Customer'), ('Lost', 'Lost')], default='Lead', max_length=20)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ], + ), + ] 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..dd0a06a 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..9c7d86b 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,21 @@ from django.db import models -# Create your models here. +class Contact(models.Model): + STATUS_CHOICES = [ + ('Lead', 'Lead'), + ('Contacted', 'Contacted'), + ('Customer', 'Customer'), + ('Lost', 'Lost'), + ] + + first_name = models.CharField(max_length=100) + last_name = models.CharField(max_length=100) + email = models.EmailField() + phone = models.CharField(max_length=20, blank=True) + company = models.CharField(max_length=100, blank=True) + status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='Lead') + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + def __str__(self): + return f"{self.first_name} {self.last_name}" \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..ef53b17 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,25 +1,33 @@ - - - {% block title %}Knowledge Base{% endblock %} - {% if project_description %} - - - - {% endif %} - {% if project_image_url %} - - - {% endif %} - {% load static %} - - {% block head %}{% endblock %} + + + Contacts & Deals Manager + + + {% load static %} + - - {% block content %}{% endblock %} - + - +
+ {% block content %} + {% endblock %} +
+ + + + \ No newline at end of file diff --git a/core/templates/core/contact_confirm_delete.html b/core/templates/core/contact_confirm_delete.html new file mode 100644 index 0000000..0f1f547 --- /dev/null +++ b/core/templates/core/contact_confirm_delete.html @@ -0,0 +1,13 @@ +{% extends 'base.html' %} + +{% block content %} +
+

Delete Contact

+

Are you sure you want to delete {{ contact.first_name }} {{ contact.last_name }}?

+
+ {% csrf_token %} + + Cancel +
+
+{% endblock %} diff --git a/core/templates/core/contact_form.html b/core/templates/core/contact_form.html new file mode 100644 index 0000000..727b1d5 --- /dev/null +++ b/core/templates/core/contact_form.html @@ -0,0 +1,13 @@ +{% extends 'base.html' %} + +{% block content %} +
+

{% if form.instance.pk %}Edit Contact{% else %}Add Contact{% endif %}

+
+ {% csrf_token %} + {{ form.as_p }} + + Cancel +
+
+{% endblock %} diff --git a/core/templates/core/index.html b/core/templates/core/index.html index faec813..cb5d17a 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,48 @@ -{% extends "base.html" %} - -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} - - - - -{% endblock %} +{% extends 'base.html' %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… +
+

Contacts & Deals Manager

+
+

A lightweight back office to track contacts and deals. Add and edit records, filter and sort lists, and see simple status counters.

+
-

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

Contacts

+ + + + + + + + + + + + + {% for contact in contacts %} + + + + + + + + + {% empty %} + + + + {% endfor %} + +
NameEmailPhoneCompanyStatusActions
{{ contact.first_name }} {{ contact.last_name }}{{ contact.email }}{{ contact.phone }}{{ contact.company }}{{ contact.status }} + Edit + Delete +
No contacts found.
+
+{% endblock %} diff --git a/core/urls.py b/core/urls.py index 6299e3d..a9f1e92 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,14 @@ from django.urls import path - -from .views import home +from .views import ( + ContactListView, + ContactCreateView, + ContactUpdateView, + ContactDeleteView, +) urlpatterns = [ - path("", home, name="home"), -] + path('', ContactListView.as_view(), name='index'), + path('contact/new/', ContactCreateView.as_view(), name='contact_new'), + path('contact//edit/', ContactUpdateView.as_view(), name='contact_edit'), + path('contact//delete/', ContactDeleteView.as_view(), name='contact_delete'), +] \ No newline at end of file diff --git a/core/views.py b/core/views.py index c9aed12..675273e 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,27 @@ -import os -import platform - -from django import get_version as django_version from django.shortcuts import render -from django.utils import timezone +from django.urls import reverse_lazy +from django.views.generic import ListView, CreateView, UpdateView, DeleteView +from .models import Contact +from .forms import ContactForm +class ContactListView(ListView): + model = Contact + template_name = 'core/index.html' + context_object_name = 'contacts' -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() +class ContactCreateView(CreateView): + model = Contact + form_class = ContactForm + template_name = 'core/contact_form.html' + success_url = reverse_lazy('index') - 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 ContactUpdateView(UpdateView): + model = Contact + form_class = ContactForm + template_name = 'core/contact_form.html' + success_url = reverse_lazy('index') + +class ContactDeleteView(DeleteView): + model = Contact + template_name = 'core/contact_confirm_delete.html' + success_url = reverse_lazy('index') \ No newline at end of file diff --git a/static/css/custom.css b/static/css/custom.css index 925f6ed..d3facf2 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,41 @@ -/* Custom styles for the application */ body { - font-family: system-ui, -apple-system, sans-serif; + font-family: 'Lato', sans-serif; + background-color: #F8F9FA; } + +h1, h2, h3, h4, h5, h6, .navbar-brand, .display-5 { + font-family: 'Poppins', sans-serif; +} + +.btn-primary { + background-color: #4A90E2; + border-color: #4A90E2; +} + +.btn-primary:hover { + background-color: #357ABD; + border-color: #357ABD; +} + +.btn-outline-primary { + color: #4A90E2; + border-color: #4A90E2; +} + +.btn-outline-primary:hover { + background-color: #4A90E2; + color: #fff; +} + +.badge.bg-secondary { + background-color: #F5A623 !important; +} + +.table-hover tbody tr:hover { + background-color: #e9ecef; +} + +.navbar-light .navbar-brand { + color: #333; + font-weight: 600; +} \ No newline at end of file diff --git a/staticfiles/css/custom.css b/staticfiles/css/custom.css index 108056f..d3facf2 100644 --- a/staticfiles/css/custom.css +++ b/staticfiles/css/custom.css @@ -1,21 +1,41 @@ - -: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); -} body { - margin: 0; - 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; + font-family: 'Lato', sans-serif; + background-color: #F8F9FA; } + +h1, h2, h3, h4, h5, h6, .navbar-brand, .display-5 { + font-family: 'Poppins', sans-serif; +} + +.btn-primary { + background-color: #4A90E2; + border-color: #4A90E2; +} + +.btn-primary:hover { + background-color: #357ABD; + border-color: #357ABD; +} + +.btn-outline-primary { + color: #4A90E2; + border-color: #4A90E2; +} + +.btn-outline-primary:hover { + background-color: #4A90E2; + color: #fff; +} + +.badge.bg-secondary { + background-color: #F5A623 !important; +} + +.table-hover tbody tr:hover { + background-color: #e9ecef; +} + +.navbar-light .navbar-brand { + color: #333; + font-weight: 600; +} \ No newline at end of file