diff --git a/config/__pycache__/settings.cpython-311.pyc b/config/__pycache__/settings.cpython-311.pyc index 96bce55..439576c 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..fd844e6 100644 Binary files a/config/__pycache__/urls.cpython-311.pyc and b/config/__pycache__/urls.cpython-311.pyc differ diff --git a/config/settings.py b/config/settings.py index 291d043..53ba80a 100644 --- a/config/settings.py +++ b/config/settings.py @@ -180,3 +180,7 @@ if EMAIL_USE_SSL: # https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + +MEDIA_URL = 'media/' +MEDIA_ROOT = BASE_DIR / 'media' + diff --git a/config/urls.py b/config/urls.py index bcfc074..a0b2ff5 100644 --- a/config/urls.py +++ b/config/urls.py @@ -27,3 +27,8 @@ urlpatterns = [ if settings.DEBUG: urlpatterns += static("/assets/", document_root=settings.BASE_DIR / "assets") urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) +else: + # Always serve assets in this environment as they are stored in BASE_DIR / "assets" + urlpatterns += static("/assets/", document_root=settings.BASE_DIR / "assets") + urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) \ No newline at end of file diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index a5ed392..a4f604c 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 e061640..e2681fe 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..300fa03 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..ad9e325 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..29f3fcb 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,14 @@ from django.contrib import admin +from .models import Letter, Student -# Register your models here. +@admin.register(Letter) +class LetterAdmin(admin.ModelAdmin): + list_display = ('letter_number', 'subject', 'type', 'date', 'sender_receiver') + list_filter = ('type', 'date') + search_fields = ('letter_number', 'subject', 'sender_receiver') + +@admin.register(Student) +class StudentAdmin(admin.ModelAdmin): + list_display = ('nisn', 'full_name', 'gender', 'is_active') + list_filter = ('gender', 'is_active') + search_fields = ('nisn', 'full_name') \ 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..8b35b3a --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,45 @@ +# Generated by Django 5.2.7 on 2026-02-01 01:49 + +import django.utils.timezone +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Letter', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('type', models.CharField(choices=[('IN', 'Surat Masuk'), ('OUT', 'Surat Keluar')], default='IN', max_length=3)), + ('subject', models.CharField(max_length=255)), + ('letter_number', models.CharField(max_length=100, unique=True)), + ('date', models.DateField(default=django.utils.timezone.now)), + ('sender_receiver', models.CharField(help_text='Pengirim untuk Surat Masuk, Penerima untuk Surat Keluar', max_length=255)), + ('description', models.TextField(blank=True, null=True)), + ('file_attachment', models.FileField(blank=True, null=True, upload_to='letters/')), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('updated_at', models.DateTimeField(auto_now=True)), + ], + ), + migrations.CreateModel( + name='Student', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('nisn', models.CharField(max_length=20, unique=True)), + ('full_name', models.CharField(max_length=255)), + ('gender', models.CharField(choices=[('M', 'Laki-laki'), ('F', 'Perempuan')], max_length=1)), + ('birth_place', models.CharField(max_length=100)), + ('birth_date', models.DateField()), + ('address', models.TextField()), + ('is_active', models.BooleanField(default=True)), + ('photo', models.ImageField(blank=True, null=True, upload_to='students/')), + ('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..baea715 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..55f6696 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,40 @@ from django.db import models +from django.utils import timezone -# Create your models here. +class Letter(models.Model): + LETTER_TYPE_CHOICES = [ + ('IN', 'Surat Masuk'), + ('OUT', 'Surat Keluar'), + ] + + type = models.CharField(max_length=3, choices=LETTER_TYPE_CHOICES, default='IN') + subject = models.CharField(max_length=255) + letter_number = models.CharField(max_length=100, unique=True) + date = models.DateField(default=timezone.now) + sender_receiver = models.CharField(max_length=255, help_text="Pengirim untuk Surat Masuk, Penerima untuk Surat Keluar") + description = models.TextField(blank=True, null=True) + file_attachment = models.FileField(upload_to='letters/', blank=True, null=True) + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + def __str__(self): + return f"[{self.get_type_display()}] {self.letter_number} - {self.subject}" + +class Student(models.Model): + GENDER_CHOICES = [ + ('M', 'Laki-laki'), + ('F', 'Perempuan'), + ] + + nisn = models.CharField(max_length=20, unique=True) + full_name = models.CharField(max_length=255) + gender = models.CharField(max_length=1, choices=GENDER_CHOICES) + birth_place = models.CharField(max_length=100) + birth_date = models.DateField() + address = models.TextField() + is_active = models.BooleanField(default=True) + photo = models.ImageField(upload_to='students/', blank=True, null=True) + created_at = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return f"{self.nisn} - {self.full_name}" \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..d3809c7 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,9 +1,11 @@ - - + +{% load static %} - {% block title %}Knowledge Base{% endblock %} + + {% block title %}SIMSBI - Sistem Informasi Manajemen Surat & Buku Induk{% endblock %} + {% if project_description %} @@ -13,13 +15,53 @@ {% endif %} - {% load static %} + + + + + + + + + + + {% block head %}{% endblock %} - {% block content %}{% endblock %} + + +
+ {% block content %}{% endblock %} +
+ + + + + {% block scripts %}{% endblock %} diff --git a/core/templates/core/index.html b/core/templates/core/index.html index faec813..1197e4c 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,110 @@ -{% extends "base.html" %} - -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} - - - - -{% endblock %} +{% extends 'base.html' %} +{% load static %} {% 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" }} -

+
+
+

Selamat Datang di SIMSBI

+

Sistem Informasi Manajemen Surat & Buku Induk Siswa Digital Terintegrasi

-
- -{% endblock %} \ No newline at end of file + + +
+
+
+
+

{{ total_letters }}

+

Total Surat

+
+
+
+
+

{{ letters_in }}

+

Surat Masuk

+
+
+
+
+

{{ letters_out }}

+

Surat Keluar

+
+
+
+
+

{{ total_students }}

+

Total Siswa

+
+
+
+ +
+
+
+
+

Surat Terbaru

+ + Input Surat +
+
+ + + + + + + + + + + + {% for letter in recent_letters %} + + + + + + + + {% empty %} + + + + {% endfor %} + +
No. SuratPerihalTipeTanggalAksi
{{ letter.letter_number }}{{ letter.subject }} + + {{ letter.get_type_display }} + + {{ letter.date|date:"d M Y" }} + Detail +
Belum ada data surat.
+
+
+
+ +
+
+{% endblock %} diff --git a/core/urls.py b/core/urls.py index 6299e3d..34bd639 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,6 @@ from django.urls import path - -from .views import home +from .views import index urlpatterns = [ - path("", home, name="home"), -] + path("", index, name="index"), +] \ No newline at end of file diff --git a/core/views.py b/core/views.py index c9aed12..aa6fd52 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,28 @@ import os import platform - -from django import get_version as django_version from django.shortcuts import render from django.utils import timezone +from .models import Letter, Student - -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" +def index(request): + """Render the SIMSBI dashboard.""" now = timezone.now() - + + # Simple stats + total_letters = Letter.objects.count() + letters_in = Letter.objects.filter(type='IN').count() + letters_out = Letter.objects.filter(type='OUT').count() + total_students = Student.objects.count() + + recent_letters = Letter.objects.all().order_by('-created_at')[:5] + context = { - "project_name": "New Style", - "agent_brand": agent_brand, - "django_version": django_version(), - "python_version": platform.python_version(), + "project_name": "SIMSBI", + "total_letters": total_letters, + "letters_in": letters_in, + "letters_out": letters_out, + "total_students": total_students, + "recent_letters": recent_letters, "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) + 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..98975b6 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,74 @@ -/* Custom styles for the application */ -body { - font-family: system-ui, -apple-system, sans-serif; +/* SIMSBI Custom Styles */ +:root { + --primary-color: #10b981; /* Emerald 500 */ + --primary-hover: #059669; /* Emerald 600 */ + --secondary-color: #1e293b; /* Slate 800 */ + --accent-color: #3b82f6; /* Blue 500 */ + --bg-light: #f8fafc; /* Slate 50 */ + --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); } + +body { + font-family: 'Inter', sans-serif; + background-color: var(--bg-light); + color: var(--secondary-color); +} + +h1, h2, h3, h4, .brand-font { + font-family: 'Playfair Display', serif; + font-weight: 700; +} + +.navbar { + background-color: white; + border-bottom: 1px solid #e2e8f0; +} + +.navbar-brand { + color: var(--primary-color) !important; + font-weight: 800; + font-size: 1.5rem; +} + +.btn-primary { + background-color: var(--primary-color); + border-color: var(--primary-color); +} + +.btn-primary:hover { + background-color: var(--primary-hover); + border-color: var(--primary-hover); +} + +.card { + border: none; + border-radius: 12px; + box-shadow: var(--card-shadow); +} + +.stat-card { + transition: transform 0.2s; +} + +.stat-card:hover { + transform: translateY(-5px); +} + +.hero-section { + background: linear-gradient(135deg, #10b981 0%, #059669 100%); + color: white; + padding: 60px 0; + border-radius: 0 0 24px 24px; + margin-bottom: 40px; +} + +.table thead th { + background-color: #f1f5f9; + border-bottom: 2px solid #e2e8f0; + text-transform: uppercase; + font-size: 0.75rem; + letter-spacing: 0.05em; +} + +.badge-in { background-color: #dcfce7; color: #166534; } +.badge-out { background-color: #fee2e2; color: #991b1b; } \ No newline at end of file diff --git a/staticfiles/css/custom.css b/staticfiles/css/custom.css index 108056f..98975b6 100644 --- a/staticfiles/css/custom.css +++ b/staticfiles/css/custom.css @@ -1,21 +1,74 @@ - +/* SIMSBI Custom Styles */ :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-color: #10b981; /* Emerald 500 */ + --primary-hover: #059669; /* Emerald 600 */ + --secondary-color: #1e293b; /* Slate 800 */ + --accent-color: #3b82f6; /* Blue 500 */ + --bg-light: #f8fafc; /* Slate 50 */ + --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 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; + background-color: var(--bg-light); + color: var(--secondary-color); } + +h1, h2, h3, h4, .brand-font { + font-family: 'Playfair Display', serif; + font-weight: 700; +} + +.navbar { + background-color: white; + border-bottom: 1px solid #e2e8f0; +} + +.navbar-brand { + color: var(--primary-color) !important; + font-weight: 800; + font-size: 1.5rem; +} + +.btn-primary { + background-color: var(--primary-color); + border-color: var(--primary-color); +} + +.btn-primary:hover { + background-color: var(--primary-hover); + border-color: var(--primary-hover); +} + +.card { + border: none; + border-radius: 12px; + box-shadow: var(--card-shadow); +} + +.stat-card { + transition: transform 0.2s; +} + +.stat-card:hover { + transform: translateY(-5px); +} + +.hero-section { + background: linear-gradient(135deg, #10b981 0%, #059669 100%); + color: white; + padding: 60px 0; + border-radius: 0 0 24px 24px; + margin-bottom: 40px; +} + +.table thead th { + background-color: #f1f5f9; + border-bottom: 2px solid #e2e8f0; + text-transform: uppercase; + font-size: 0.75rem; + letter-spacing: 0.05em; +} + +.badge-in { background-color: #dcfce7; color: #166534; } +.badge-out { background-color: #fee2e2; color: #991b1b; } \ No newline at end of file