diff --git a/config/__pycache__/__init__.cpython-311.pyc b/config/__pycache__/__init__.cpython-311.pyc index 423a636..5486eea 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..71ccc71 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..b73e6ca 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..f59fa44 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..af42e64 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..5b346eb 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..02a8211 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..de5dcfa 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..ff67477 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..9046927 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..eefb7bf 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..c1618be 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,13 @@ from django.contrib import admin +from .models import CarAuction, Bid -# Register your models here. +@admin.register(CarAuction) +class CarAuctionAdmin(admin.ModelAdmin): + list_display = ('title', 'make', 'model', 'year', 'current_bid', 'end_date', 'seller') + list_filter = ('make', 'year', 'end_date') + search_fields = ('title', 'make', 'model', 'description') + +@admin.register(Bid) +class BidAdmin(admin.ModelAdmin): + list_display = ('auction', 'user', 'amount', 'created_at') + list_filter = ('created_at',) \ 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..94b6d60 --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,47 @@ +# Generated by Django 5.2.7 on 2026-02-12 16:44 + +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='CarAuction', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=200)), + ('make', models.CharField(max_length=100)), + ('model', models.CharField(max_length=100)), + ('year', models.IntegerField()), + ('description', models.TextField()), + ('image_url', models.URLField(blank=True, max_length=500, null=True)), + ('starting_bid', models.DecimalField(decimal_places=2, max_digits=10)), + ('current_bid', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('end_date', models.DateTimeField()), + ('seller', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='auctions', to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='Bid', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('amount', models.DecimalField(decimal_places=2, max_digits=10)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ('auction', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bids', to='core.carauction')), + ], + options={ + 'ordering': ['-amount'], + }, + ), + ] 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..cc12f47 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..b4a7897 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..c0961e9 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,46 @@ from django.db import models +from django.contrib.auth.models import User +from django.utils import timezone +from datetime import timedelta -# Create your models here. +class CarAuction(models.Model): + title = models.CharField(max_length=200) + make = models.CharField(max_length=100) + model = models.CharField(max_length=100) + year = models.IntegerField() + description = models.TextField() + image_url = models.URLField(max_length=500, blank=True, null=True) + starting_bid = models.DecimalField(max_digits=10, decimal_places=2) + current_bid = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) + seller = models.ForeignKey(User, on_delete=models.CASCADE, related_name='auctions') + created_at = models.DateTimeField(auto_now_add=True) + end_date = models.DateTimeField() + + def is_active(self): + return timezone.now() < self.end_date + + def time_left(self): + if not self.is_active(): + return "Closed" + delta = self.end_date - timezone.now() + days = delta.days + hours = delta.seconds // 3600 + minutes = (delta.seconds // 60) % 60 + if days > 0: + return f"{days}d {hours}h" + return f"{hours}h {minutes}m" + + def __str__(self): + return f"{self.year} {self.make} {self.model}" + +class Bid(models.Model): + auction = models.ForeignKey(CarAuction, on_delete=models.CASCADE, related_name='bids') + user = models.ForeignKey(User, on_delete=models.CASCADE) + amount = models.DecimalField(max_digits=10, decimal_places=2) + created_at = models.DateTimeField(auto_now_add=True) + + class Meta: + ordering = ['-amount'] + + def __str__(self): + return f"{self.user.username} - {self.amount} on {self.auction.title}" \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..5845dc1 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,25 +1,75 @@ +{% load static %} - - - {% block title %}Knowledge Base{% endblock %} - {% if project_description %} - - - - {% endif %} - {% if project_image_url %} - - - {% endif %} - {% load static %} - - {% block head %}{% endblock %} + + + {% block title %}AutoBid - Premium Car Auctions{% endblock %} + + + + + + + + + + + + + + + + {% block extra_css %}{% endblock %} - - {% block content %}{% endblock %} - + +
+ {% block content %}{% endblock %} +
+ + + + + + {% block extra_js %}{% endblock %} + diff --git a/core/templates/core/auction_detail.html b/core/templates/core/auction_detail.html new file mode 100644 index 0000000..7159415 --- /dev/null +++ b/core/templates/core/auction_detail.html @@ -0,0 +1,119 @@ +{% extends "base.html" %} +{% load static %} + +{% block title %}{{ auction.title }} | AutoBid{% endblock %} + +{% block content %} +
+
+ + +
+ +
+
+ {% if auction.image_url %} + {{ auction.title }} + {% else %} + Car Placeholder + {% endif %} +
+ +
+

Specifications

+
+
+
+ Make + {{ auction.make }} +
+
+
+
+ Model + {{ auction.model }} +
+
+
+
+ Year + {{ auction.year }} +
+
+
+
+ Bids + {{ bids.count }} +
+
+
+
+ +
+

Description

+

{{ auction.description|linebreaks }}

+
+
+ + +
+
+
+

{{ auction.title }}

+

Listed by {{ auction.seller.username }}

+ +
+
+ Current Bid + ${{ auction.current_bid|default:auction.starting_bid }} +
+
+ Ends In + {{ auction.time_left }} +
+
+ +
+ {% if user.is_authenticated %} +
+ {% csrf_token %} +
+ $ + +
+ +
+

Enter at least ${{ auction.current_bid|default:auction.starting_bid|add:100 }}

+ {% else %} +
+

Log in to place a bid on this car.

+ Login to Bid +
+ {% endif %} +
+ +
+ +
+
Recent Bids
+ {% for bid in bids|slice:":5" %} +
+ {{ bid.user.username }} + ${{ bid.amount }} +
+ {% empty %} +

No bids yet. Be the first!

+ {% endfor %} +
+
+
+
+
+
+
+{% endblock %} diff --git a/core/templates/core/index.html b/core/templates/core/index.html index faec813..7c5c599 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,65 @@ {% extends "base.html" %} - -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} - - - - -{% endblock %} +{% load static %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… + +
+
+

Find Your Next Masterpiece

+

Exclusive car auctions. Real-time bidding. Trusted sellers.

+ +
+
+ + +
+
-

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

Featured Auctions

+

Discover top deals closing soon.

+
+ View All +
+ +
+ {% for auction in auctions %} +
+
+
+ {% if auction.image_url %} + {{ auction.title }} + {% else %} + Car Placeholder + {% endif %} + ${{ auction.current_bid|default:auction.starting_bid }} + {{ auction.time_left }} +
+
+
{{ auction.title }}
+

{{ auction.make }} • {{ auction.year }} • {{ auction.model }}

+ +
+
+
+ {% empty %} +
+
+ +
+

No active auctions found

+

Try searching for something else or check back later.

+
+ {% endfor %} +
+
+
+{% endblock %} diff --git a/core/urls.py b/core/urls.py index 6299e3d..f1bc50e 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 home, auction_detail urlpatterns = [ path("", home, name="home"), -] + path("auction//", auction_detail, name="auction_detail"), +] \ No newline at end of file diff --git a/core/views.py b/core/views.py index c9aed12..fa2e223 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,29 @@ -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 CarAuction, Bid +from django.db.models import Max 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() - + """Render the landing screen with featured auctions.""" + query = request.GET.get('q') + if query: + auctions = CarAuction.objects.filter(title__icontains=query, end_date__gt=timezone.now()) + else: + auctions = CarAuction.objects.filter(end_date__gt=timezone.now()).order_by('end_date')[:6] + 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", ""), + "auctions": auctions, + "query": query, } return render(request, "core/index.html", context) + +def auction_detail(request, pk): + """Render the auction detail page.""" + auction = get_object_or_404(CarAuction, pk=pk) + bids = auction.bids.all() + + context = { + "auction": auction, + "bids": bids, + } + return render(request, "core/auction_detail.html", context) \ No newline at end of file diff --git a/static/css/custom.css b/static/css/custom.css index 925f6ed..fa1d3c5 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,154 @@ -/* Custom styles for the application */ -body { - font-family: system-ui, -apple-system, sans-serif; +:root { + --primary-dark: #121212; + --accent-red: #D90429; + --accent-red-hover: #EF233C; + --text-silver: #8D99AE; + --bg-light: #EDF2F4; + --white: #ffffff; } + +body { + font-family: 'Inter', sans-serif; + background-color: var(--bg-light); + color: var(--primary-dark); + line-height: 1.6; +} + +h1, h2, h3, h4, .navbar-brand { + font-family: 'Montserrat', sans-serif; + font-weight: 800; +} + +/* Navbar */ +.navbar { + background-color: var(--primary-dark); + padding: 1rem 0; + box-shadow: 0 4px 12px rgba(0,0,0,0.1); +} + +.navbar-brand { + font-size: 1.5rem; + letter-spacing: -1px; +} + +.brand-auto { color: var(--white); } +.brand-bid { color: var(--accent-red); } + +/* Hero Section */ +.hero { + background: linear-gradient(135deg, var(--primary-dark) 0%, #2b2d42 100%); + padding: 100px 0; + color: var(--white); + position: relative; + overflow: hidden; +} + +.hero::after { + content: ''; + position: absolute; + top: -50%; + right: -10%; + width: 600px; + height: 600px; + background: radial-gradient(circle, rgba(217, 4, 41, 0.15) 0%, transparent 70%); + z-index: 0; +} + +.hero-content { + position: relative; + z-index: 1; +} + +/* Cards & Glassmorphism */ +.auction-card { + border: none; + border-radius: 16px; + overflow: hidden; + transition: transform 0.3s ease, box-shadow 0.3s ease; + background: var(--white); + box-shadow: 0 10px 30px rgba(0,0,0,0.05); +} + +.auction-card:hover { + transform: translateY(-8px); + box-shadow: 0 20px 40px rgba(0,0,0,0.1); +} + +.card-img-container { + height: 200px; + overflow: hidden; + position: relative; +} + +.card-img-top { + width: 100%; + height: 100%; + object-fit: cover; +} + +.badge-bid { + position: absolute; + top: 15px; + right: 15px; + background: rgba(217, 4, 41, 0.9); + backdrop-filter: blur(4px); + color: white; + padding: 6px 12px; + border-radius: 8px; + font-weight: 600; + font-size: 0.85rem; +} + +.badge-time { + position: absolute; + bottom: 15px; + left: 15px; + background: rgba(18, 18, 18, 0.7); + backdrop-filter: blur(4px); + color: white; + padding: 4px 10px; + border-radius: 6px; + font-size: 0.75rem; +} + +/* Buttons */ +.btn-primary { + background-color: var(--accent-red); + border-color: var(--accent-red); + font-weight: 600; + border-radius: 8px; + padding: 10px 24px; +} + +.btn-primary:hover { + background-color: var(--accent-red-hover); + border-color: var(--accent-red-hover); +} + +/* Search Bar */ +.search-container { + background: rgba(255, 255, 255, 0.05); + backdrop-filter: blur(10px); + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: 12px; + padding: 8px; + max-width: 600px; +} + +.search-input { + background: transparent; + border: none; + color: white; + padding-left: 15px; +} + +.search-input:focus { + background: transparent; + color: white; + box-shadow: none; +} + +footer { + background-color: var(--primary-dark); + color: var(--text-silver); +} \ No newline at end of file diff --git a/staticfiles/css/custom.css b/staticfiles/css/custom.css index 108056f..fa1d3c5 100644 --- a/staticfiles/css/custom.css +++ b/staticfiles/css/custom.css @@ -1,21 +1,154 @@ - :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-dark: #121212; + --accent-red: #D90429; + --accent-red-hover: #EF233C; + --text-silver: #8D99AE; + --bg-light: #EDF2F4; + --white: #ffffff; } + 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; + background-color: var(--bg-light); + color: var(--primary-dark); + line-height: 1.6; +} + +h1, h2, h3, h4, .navbar-brand { + font-family: 'Montserrat', sans-serif; + font-weight: 800; +} + +/* Navbar */ +.navbar { + background-color: var(--primary-dark); + padding: 1rem 0; + box-shadow: 0 4px 12px rgba(0,0,0,0.1); +} + +.navbar-brand { + font-size: 1.5rem; + letter-spacing: -1px; +} + +.brand-auto { color: var(--white); } +.brand-bid { color: var(--accent-red); } + +/* Hero Section */ +.hero { + background: linear-gradient(135deg, var(--primary-dark) 0%, #2b2d42 100%); + padding: 100px 0; + color: var(--white); + position: relative; + overflow: hidden; +} + +.hero::after { + content: ''; + position: absolute; + top: -50%; + right: -10%; + width: 600px; + height: 600px; + background: radial-gradient(circle, rgba(217, 4, 41, 0.15) 0%, transparent 70%); + z-index: 0; +} + +.hero-content { + position: relative; + z-index: 1; +} + +/* Cards & Glassmorphism */ +.auction-card { + border: none; + border-radius: 16px; + overflow: hidden; + transition: transform 0.3s ease, box-shadow 0.3s ease; + background: var(--white); + box-shadow: 0 10px 30px rgba(0,0,0,0.05); +} + +.auction-card:hover { + transform: translateY(-8px); + box-shadow: 0 20px 40px rgba(0,0,0,0.1); +} + +.card-img-container { + height: 200px; overflow: hidden; position: relative; } + +.card-img-top { + width: 100%; + height: 100%; + object-fit: cover; +} + +.badge-bid { + position: absolute; + top: 15px; + right: 15px; + background: rgba(217, 4, 41, 0.9); + backdrop-filter: blur(4px); + color: white; + padding: 6px 12px; + border-radius: 8px; + font-weight: 600; + font-size: 0.85rem; +} + +.badge-time { + position: absolute; + bottom: 15px; + left: 15px; + background: rgba(18, 18, 18, 0.7); + backdrop-filter: blur(4px); + color: white; + padding: 4px 10px; + border-radius: 6px; + font-size: 0.75rem; +} + +/* Buttons */ +.btn-primary { + background-color: var(--accent-red); + border-color: var(--accent-red); + font-weight: 600; + border-radius: 8px; + padding: 10px 24px; +} + +.btn-primary:hover { + background-color: var(--accent-red-hover); + border-color: var(--accent-red-hover); +} + +/* Search Bar */ +.search-container { + background: rgba(255, 255, 255, 0.05); + backdrop-filter: blur(10px); + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: 12px; + padding: 8px; + max-width: 600px; +} + +.search-input { + background: transparent; + border: none; + color: white; + padding-left: 15px; +} + +.search-input:focus { + background: transparent; + color: white; + box-shadow: none; +} + +footer { + background-color: var(--primary-dark); + color: var(--text-silver); +} \ No newline at end of file