diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855..1d2d514 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..988a7a5 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..4ef3c7b 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..916fb0b 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..4956b13 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..3133884 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,5 @@ from django.contrib import admin +from .models import Product, TankOrder -# Register your models here. +admin.site.register(Product) +admin.site.register(TankOrder) \ No newline at end of file diff --git a/core/forms.py b/core/forms.py new file mode 100644 index 0000000..e359fb5 --- /dev/null +++ b/core/forms.py @@ -0,0 +1,7 @@ +from django import forms +from .models import TankOrder + +class TankOrderForm(forms.ModelForm): + class Meta: + model = TankOrder + fields = ['name', 'address', 'phone', 'tank_size'] \ 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..6d1f8ce --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,24 @@ +# Generated by Django 5.2.7 on 2026-01-18 08:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Product', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('description', models.TextField()), + ('capacity', models.IntegerField()), + ('price', models.DecimalField(decimal_places=2, max_digits=10)), + ], + ), + ] diff --git a/core/migrations/0002_tankorder.py b/core/migrations/0002_tankorder.py new file mode 100644 index 0000000..f8e0170 --- /dev/null +++ b/core/migrations/0002_tankorder.py @@ -0,0 +1,24 @@ +# Generated by Django 5.2.7 on 2026-01-18 08:46 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='TankOrder', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=100)), + ('address', models.CharField(max_length=255)), + ('phone', models.CharField(max_length=20)), + ('tank_size', models.CharField(max_length=50)), + ('created_at', models.DateTimeField(auto_now_add=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..f1d7dbf Binary files /dev/null and b/core/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/core/migrations/__pycache__/0002_tankorder.cpython-311.pyc b/core/migrations/__pycache__/0002_tankorder.cpython-311.pyc new file mode 100644 index 0000000..18b16d7 Binary files /dev/null and b/core/migrations/__pycache__/0002_tankorder.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 71a8362..b654481 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,21 @@ from django.db import models -# Create your models here. +class Product(models.Model): + name = models.CharField(max_length=255) + description = models.TextField() + capacity = models.IntegerField() # In liters + price = models.DecimalField(max_digits=10, decimal_places=2) + # image = models.ImageField(upload_to='products/', null=True, blank=True) + + def __str__(self): + return self.name + +class TankOrder(models.Model): + name = models.CharField(max_length=100) + address = models.CharField(max_length=255) + phone = models.CharField(max_length=20) + tank_size = models.CharField(max_length=50) + created_at = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return f"Order for {self.name} at {self.address}" \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..8d6fe78 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -13,13 +13,51 @@ {% endif %} + + + + {% load static %} {% block head %}{% endblock %} - {% block content %}{% endblock %} +
+ +
+ +
+ {% block content %}{% endblock %} +
+ + + + diff --git a/core/templates/core/index.html b/core/templates/core/index.html index faec813..1bf8bcc 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,49 @@ -{% extends "base.html" %} +{% extends 'base.html' %} +{% load static %} -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} - - - - -{% endblock %} +{% block title %}Pesan Air Tangki{% endblock %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… +
+
+
+

Pesan Air Tangki Bersih, Cepat & Mudah

+

Kami menyediakan layanan pengiriman air tangki berkualitas tinggi untuk kebutuhan rumah tangga dan bisnis Anda. Pesan sekarang dan nikmati air bersih tanpa repot.

+ +
+ {% csrf_token %} +

Formulir Pemesanan

+ {{ form.as_p }} + +
+
+
+ Tangki Air +
-

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

Kualitas Terjamin

+

Air bersih dan higienis langsung dari sumber terpercaya.

+
+
+
+ +
+

Pengiriman Cepat

+

Armada kami siap mengantar pesanan Anda tepat waktu.

+
+
+
+ +
+

Layanan Pelanggan

+

Tim kami siap membantu Anda dengan ramah dan responsif.

+
+
+ +{% endblock %} diff --git a/core/templates/core/order_list.html b/core/templates/core/order_list.html new file mode 100644 index 0000000..fd51240 --- /dev/null +++ b/core/templates/core/order_list.html @@ -0,0 +1,41 @@ +{% extends "base.html" %} +{% block content %} +
+

Daftar Pesanan Tangki Air

+
+ + + + + + + + + + + + + + {% for order in orders %} + + + + + + + + + + {% empty %} + + + + {% endfor %} + +
Tanggal PesanNama PelangganNo. TeleponAlamatKapasitas Tangki (L)JumlahCatatan
{{ order.order_date|date:"d M Y, H:i" }}{{ order.customer_name }}{{ order.phone_number }}{{ order.address }}{{ order.tank_capacity }}{{ order.quantity }}{{ order.notes|default:"-" }}
Belum ada pesanan.
+
+
+ Kembali ke Beranda +
+
+{% endblock %} diff --git a/core/templates/core/order_success.html b/core/templates/core/order_success.html new file mode 100644 index 0000000..1df7e21 --- /dev/null +++ b/core/templates/core/order_success.html @@ -0,0 +1,13 @@ +{% extends 'base.html' %} + +{% block content %} +
+
+
+

Pesanan Berhasil!

+

Terima kasih telah memesan. Kami akan segera menghubungi Anda untuk konfirmasi lebih lanjut.

+ Kembali ke Halaman Utama +
+
+
+{% endblock %} diff --git a/core/urls.py b/core/urls.py index 6299e3d..5ee3536 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,9 @@ from django.urls import path -from .views import home +from .views import index, order_success, order_list urlpatterns = [ - path("", home, name="home"), + path("", index, name="index"), + path("order-success/", order_success, name="order_success"), + path("orders/", order_list, name="order_list"), ] diff --git a/core/views.py b/core/views.py index c9aed12..861e832 100644 --- a/core/views.py +++ b/core/views.py @@ -2,24 +2,60 @@ import os import platform from django import get_version as django_version -from django.shortcuts import render +from django.shortcuts import render, redirect from django.utils import timezone -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() +from .models import Product, TankOrder +from .forms import TankOrderForm + +def index(request): + if request.method == 'POST': + form = TankOrderForm(request.POST) + if form.is_valid(): + form.save() + return redirect('order_success') + else: + form = TankOrderForm() + + products = [ + { + 'name': 'Tangki Air 500L', + 'capacity': 500, + 'price': 150000, + 'description': 'Cocok untuk kebutuhan rumah tangga kecil.' + }, + { + 'name': 'Tangki Air 1000L', + 'capacity': 1000, + 'price': 250000, + 'description': 'Ideal untuk keluarga sedang atau bisnis kecil.' + }, + { + 'name': 'Tangki Air 2000L', + 'capacity': 2000, + 'price': 450000, + 'description': 'Pilihan tepat untuk kebutuhan air yang lebih besar.' + }, + ] 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, + "form": form, + "products": products, "project_description": os.getenv("PROJECT_DESCRIPTION", ""), "project_image_url": os.getenv("PROJECT_IMAGE_URL", ""), } return render(request, "core/index.html", context) + +from django.contrib.admin.views.decorators import staff_member_required + +def order_success(request): + return render(request, 'core/order_success.html') + +@staff_member_required +def order_list(request): + orders = TankOrder.objects.all().order_by('-order_date') + context = { + 'orders': orders, + } + return render(request, 'core/order_list.html', context) diff --git a/static/css/custom.css b/static/css/custom.css index 925f6ed..d913856 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,49 @@ -/* Custom styles for the application */ -body { - font-family: system-ui, -apple-system, sans-serif; +:root { + --primary-color: #0D6EFD; + --accent-color: #00BFFF; + --base-color: #F8F9FA; + --text-color: #343A40; + --heading-font: 'Poppins', sans-serif; + --body-font: 'Lato', sans-serif; } + +body { + font-family: var(--body-font); + color: var(--text-color); + background-color: var(--base-color); +} + +h1, h2, h3, h4, h5, h6 { + font-family: var(--heading-font); + font-weight: 600; +} + +.btn-primary { + background-color: var(--primary-color); + border-color: var(--primary-color); +} + +.btn-accent { + background-color: var(--accent-color); + border-color: var(--accent-color); + color: #fff; +} + +.hero { + padding: 4rem 0; + background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); + color: #fff; +} + +.product-card { + border: 1px solid #dee2e6; + border-radius: .25rem; + padding: 1.5rem; + text-align: center; + background-color: #fff; + margin-bottom: 1.5rem; +} + +.product-card h3 { + margin-top: 1rem; +} \ No newline at end of file