heheh
This commit is contained in:
parent
7f20785621
commit
5697d35f91
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +1,21 @@
|
||||
from django.contrib import admin
|
||||
from .models import School, Event, Registration
|
||||
|
||||
# Register your models here.
|
||||
@admin.register(School)
|
||||
class SchoolAdmin(admin.ModelAdmin):
|
||||
list_display = ('name', 'slug', 'created_at')
|
||||
prepopulated_fields = {'slug': ('name',)}
|
||||
search_fields = ('name',)
|
||||
|
||||
@admin.register(Event)
|
||||
class EventAdmin(admin.ModelAdmin):
|
||||
list_display = ('title', 'school', 'event_type', 'start_date', 'is_published')
|
||||
list_filter = ('school', 'event_type', 'is_published')
|
||||
search_fields = ('title', 'description', 'location')
|
||||
date_hierarchy = 'start_date'
|
||||
|
||||
@admin.register(Registration)
|
||||
class RegistrationAdmin(admin.ModelAdmin):
|
||||
list_display = ('user', 'event', 'registered_at', 'attended')
|
||||
list_filter = ('event', 'attended')
|
||||
search_fields = ('user__username', 'event__title')
|
||||
57
core/migrations/0001_initial.py
Normal file
57
core/migrations/0001_initial.py
Normal file
@ -0,0 +1,57 @@
|
||||
# Generated by Django 5.2.7 on 2026-01-31 10:14
|
||||
|
||||
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='School',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255)),
|
||||
('slug', models.SlugField(blank=True, unique=True)),
|
||||
('description', models.TextField(blank=True)),
|
||||
('logo_url', models.URLField(blank=True, help_text='URL to the school logo', null=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Event',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('title', models.CharField(max_length=255)),
|
||||
('description', models.TextField()),
|
||||
('event_type', models.CharField(choices=[('assembly', 'Assembly'), ('field_trip', 'Field Trip'), ('parent_teacher', 'Parent-Teacher Night'), ('sports', 'Sports Event'), ('performance', 'Performance/Arts'), ('other', 'Other')], default='other', max_length=50)),
|
||||
('start_date', models.DateTimeField()),
|
||||
('end_date', models.DateTimeField()),
|
||||
('location', models.CharField(max_length=255)),
|
||||
('capacity', models.PositiveIntegerField(default=100)),
|
||||
('is_published', models.BooleanField(default=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('school', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events', to='core.school')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Registration',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('registered_at', models.DateTimeField(auto_now_add=True)),
|
||||
('attended', models.BooleanField(default=False)),
|
||||
('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='registrations', to='core.event')),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'unique_together': {('event', 'user')},
|
||||
},
|
||||
),
|
||||
]
|
||||
BIN
core/migrations/__pycache__/0001_initial.cpython-311.pyc
Normal file
BIN
core/migrations/__pycache__/0001_initial.cpython-311.pyc
Normal file
Binary file not shown.
@ -1,3 +1,53 @@
|
||||
from django.db import models
|
||||
from django.conf import settings
|
||||
from django.utils.text import slugify
|
||||
|
||||
# Create your models here.
|
||||
class School(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
slug = models.SlugField(unique=True, blank=True)
|
||||
description = models.TextField(blank=True)
|
||||
logo_url = models.URLField(blank=True, null=True, help_text="URL to the school logo")
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if not self.slug:
|
||||
self.slug = slugify(self.name)
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
class Event(models.Model):
|
||||
EVENT_TYPES = [
|
||||
('assembly', 'Assembly'),
|
||||
('field_trip', 'Field Trip'),
|
||||
('parent_teacher', 'Parent-Teacher Night'),
|
||||
('sports', 'Sports Event'),
|
||||
('performance', 'Performance/Arts'),
|
||||
('other', 'Other'),
|
||||
]
|
||||
school = models.ForeignKey(School, on_delete=models.CASCADE, related_name='events')
|
||||
title = models.CharField(max_length=255)
|
||||
description = models.TextField()
|
||||
event_type = models.CharField(max_length=50, choices=EVENT_TYPES, default='other')
|
||||
start_date = models.DateTimeField()
|
||||
end_date = models.DateTimeField()
|
||||
location = models.CharField(max_length=255)
|
||||
capacity = models.PositiveIntegerField(default=100)
|
||||
is_published = models.BooleanField(default=True)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.title} ({self.school.name})"
|
||||
|
||||
class Registration(models.Model):
|
||||
event = models.ForeignKey(Event, on_delete=models.CASCADE, related_name='registrations')
|
||||
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
|
||||
registered_at = models.DateTimeField(auto_now_add=True)
|
||||
attended = models.BooleanField(default=False)
|
||||
|
||||
class Meta:
|
||||
unique_together = ('event', 'user')
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.user.username} - {self.event.title}"
|
||||
@ -3,23 +3,78 @@
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Knowledge Base{% endblock %}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}School Event Hub{% endblock %}</title>
|
||||
|
||||
{% if project_description %}
|
||||
<meta name="description" content="{{ project_description }}">
|
||||
<meta property="og:description" content="{{ project_description }}">
|
||||
<meta property="twitter:description" content="{{ project_description }}">
|
||||
{% endif %}
|
||||
{% if project_image_url %}
|
||||
<meta property="og:image" content="{{ project_image_url }}">
|
||||
<meta property="twitter:image" content="{{ project_image_url }}">
|
||||
{% endif %}
|
||||
|
||||
{% load static %}
|
||||
<!-- Google Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Playfair+Display:wght@700&display=swap" rel="stylesheet">
|
||||
|
||||
<!-- Bootstrap 5 -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Custom Styles -->
|
||||
<link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
|
||||
|
||||
{% block head %}{% endblock %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% block content %}{% endblock %}
|
||||
<nav class="navbar navbar-expand-lg sticky-top">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{% url 'home' %}">
|
||||
<span class="text-accent">Edu</span>Events
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav ms-auto align-items-center">
|
||||
<li class="nav-item px-2">
|
||||
<a class="nav-link fw-semibold" href="{% url 'home' %}">Explore Events</a>
|
||||
</li>
|
||||
{% if user.is_authenticated %}
|
||||
<li class="nav-item px-2">
|
||||
<a class="nav-link fw-semibold" href="/admin/">Dashboard</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item px-2">
|
||||
<a class="nav-link fw-semibold" href="/admin/">Login</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="nav-item ms-lg-3">
|
||||
<a class="btn btn-primary" href="/admin/core/event/add/">Create Event</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-md-6 text-center text-md-start">
|
||||
<h4 class="brand-font mb-0"><span class="text-accent">Edu</span>Events</h4>
|
||||
<p class="text-muted mt-2">Connecting schools, parents, and students through meaningful events.</p>
|
||||
</div>
|
||||
<div class="col-md-6 text-center text-md-end">
|
||||
<p class="text-muted mb-0">© 2026 EduEvents Management. All rights reserved.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
71
core/templates/core/event_detail.html
Normal file
71
core/templates/core/event_detail.html
Normal file
@ -0,0 +1,71 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}{{ event.title }} - EduEvents{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container py-5">
|
||||
<nav aria-label="breadcrumb" class="mb-4">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{% url 'home' %}" class="text-accent text-decoration-none">Events</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{{ event.title }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="row g-5">
|
||||
<div class="col-lg-8">
|
||||
<div class="bg-white p-4 p-md-5 rounded-4 shadow-sm mb-4">
|
||||
<span class="event-type-badge badge-{{ event.event_type }} mb-3">{{ event.get_event_type_display }}</span>
|
||||
<h1 class="display-5 mb-4">{{ event.title }}</h1>
|
||||
|
||||
<div class="d-flex flex-wrap gap-4 mb-5 pb-4 border-bottom">
|
||||
<div>
|
||||
<p class="text-muted small mb-1 text-uppercase fw-bold">When</p>
|
||||
<p class="fw-semibold mb-0">{{ event.start_date|date:"l, F j, Y" }}<br>{{ event.start_date|date:"g:i A" }} - {{ event.end_date|date:"g:i A" }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-muted small mb-1 text-uppercase fw-bold">Where</p>
|
||||
<p class="fw-semibold mb-0">{{ event.location }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-muted small mb-1 text-uppercase fw-bold">Organizer</p>
|
||||
<p class="fw-semibold mb-0">{{ event.school.name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="event-description">
|
||||
<h3 class="h5 mb-3">About this Event</h3>
|
||||
<div class="text-muted">
|
||||
{{ event.description|linebreaks }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
<div class="sticky-top" style="top: 100px;">
|
||||
<div class="bg-white p-4 rounded-4 shadow-sm border-top border-5 border-accent">
|
||||
<h3 class="h4 mb-4">Registration</h3>
|
||||
|
||||
<div class="d-flex justify-content-between mb-3">
|
||||
<span class="text-muted">Capacity</span>
|
||||
<span class="fw-bold">{{ event.capacity }} slots</span>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between mb-4">
|
||||
<span class="text-muted">Available</span>
|
||||
<span class="fw-bold text-accent">{{ event.capacity }} slots left</span>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary w-100 btn-lg mb-3">Register Now</button>
|
||||
<p class="text-center small text-muted">You must be logged in to register.</p>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 bg-white p-4 rounded-4 shadow-sm">
|
||||
<h4 class="h6 mb-3">Need Help?</h4>
|
||||
<p class="small text-muted mb-0">Contact {{ event.school.name }} administrative office for any queries regarding this event.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@ -1,145 +1,112 @@
|
||||
{% extends "base.html" %}
|
||||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}{{ project_name }}{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
: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);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'><path d='M-10 10L110 10M10 -10L10 110' stroke-width='1' stroke='rgba(255,255,255,0.05)'/></svg>");
|
||||
animation: bg-pan 20s linear infinite;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
@keyframes bg-pan {
|
||||
0% {
|
||||
background-position: 0% 0%;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-position: 100% 100%;
|
||||
}
|
||||
}
|
||||
|
||||
main {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--card-bg-color);
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 16px;
|
||||
padding: 2.5rem 2rem;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: clamp(2.2rem, 3vw + 1.2rem, 3.2rem);
|
||||
font-weight: 700;
|
||||
margin: 0 0 1.2rem;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1.1rem;
|
||||
opacity: 0.92;
|
||||
}
|
||||
|
||||
.loader {
|
||||
margin: 1.5rem auto;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
border: 4px solid rgba(255, 255, 255, 0.25);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.runtime code {
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
padding: 0.15rem 0.45rem;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
border: 0;
|
||||
}
|
||||
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 0.85rem;
|
||||
opacity: 0.75;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block title %}EduEvents - School Event Management{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your app…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
<!-- Hero Section -->
|
||||
<section class="hero-section">
|
||||
<div class="container">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-lg-6 mb-5 mb-lg-0" style="z-index: 1;">
|
||||
<h1 class="display-3 mb-4">Manage School Events with <span class="text-accent">Ease.</span></h1>
|
||||
<p class="lead text-muted mb-5">The all-in-one platform for schools to create, manage, and track event registrations and attendance. Join the community today.</p>
|
||||
<div class="d-flex gap-3">
|
||||
<a href="#events" class="btn btn-primary btn-lg">Browse Events</a>
|
||||
<a href="/admin/" class="btn btn-outline-dark btn-lg">School Portal</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 text-center">
|
||||
<!-- Modern Graphic / Illustration Placeholder -->
|
||||
<div class="position-relative">
|
||||
<div class="bg-accent rounded-circle position-absolute top-50 start-50 translate-middle opacity-10" style="width: 400px; height: 400px;"></div>
|
||||
<img src="https://img.freepik.com/free-vector/calendar-concept-illustration_114360-3277.jpg" alt="School Events" class="img-fluid rounded-4 shadow-lg position-relative" style="max-height: 450px;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="hint">AppWizzy AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will refresh automatically as the plan is implemented.</p>
|
||||
<p class="runtime">
|
||||
Runtime: Django <code>{{ django_version }}</code> · Python <code>{{ python_version }}</code>
|
||||
— UTC <code>{{ current_time|date:"Y-m-d H:i:s" }}</code>
|
||||
</p>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: {{ current_time|date:"Y-m-d H:i:s" }} (UTC)
|
||||
</footer>
|
||||
{% endblock %}
|
||||
</section>
|
||||
|
||||
<!-- Events Section -->
|
||||
<section id="events" class="py-5 mt-5">
|
||||
<div class="container">
|
||||
<div class="d-flex justify-content-between align-items-end mb-5">
|
||||
<div>
|
||||
<h2 class="section-title">Upcoming Events</h2>
|
||||
<p class="text-muted">Stay informed about the latest assemblies, field trips, and school nights.</p>
|
||||
</div>
|
||||
<div class="mb-3 d-none d-md-block">
|
||||
<select class="form-select border-0 shadow-sm" style="border-radius: 10px; padding: 10px 20px; min-width: 200px;">
|
||||
<option>All Schools</option>
|
||||
{% for school in schools %}
|
||||
<option>{{ school.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-4">
|
||||
{% for event in events %}
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="event-card p-4 d-flex flex-column">
|
||||
<div class="mb-2">
|
||||
<span class="event-type-badge badge-{{ event.event_type }}">{{ event.get_event_type_display }}</span>
|
||||
</div>
|
||||
<h3 class="h4 mb-3">{{ event.title }}</h3>
|
||||
<p class="text-muted small mb-4">{{ event.description|truncatewords:20 }}</p>
|
||||
|
||||
<div class="mb-4">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-calendar-event me-2 text-accent" viewBox="0 0 16 16">
|
||||
<path d="M11 6.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1z"/>
|
||||
<path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/>
|
||||
</svg>
|
||||
<span class="small fw-semibold">{{ event.start_date|date:"M d, Y @ H:i" }}</span>
|
||||
</div>
|
||||
<div class="d-flex align-items-center">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-geo-alt me-2 text-accent" viewBox="0 0 16 16">
|
||||
<path d="M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"/>
|
||||
</svg>
|
||||
<span class="small text-muted">{{ event.location }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="border-top pt-4 mt-auto">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<span class="small text-muted fw-bold">{{ event.school.name }}</span>
|
||||
<a href="{% url 'event_detail' event.id %}" class="btn btn-sm btn-link text-accent fw-bold text-decoration-none p-0">View Details →</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-12 text-center py-5">
|
||||
<div class="p-5 bg-white rounded-4 shadow-sm">
|
||||
<p class="text-muted mb-0">No upcoming events scheduled at the moment. Please check back later!</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Stats Section -->
|
||||
<section class="py-5 bg-white border-top border-bottom">
|
||||
<div class="container">
|
||||
<div class="row text-center g-4">
|
||||
<div class="col-md-4">
|
||||
<h2 class="display-4 text-accent">50+</h2>
|
||||
<p class="text-muted fw-semibold">Schools Registered</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2 class="display-4 text-accent">10k+</h2>
|
||||
<p class="text-muted fw-semibold">Events Managed</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h2 class="display-4 text-accent">100k+</h2>
|
||||
<p class="text-muted fw-semibold">Tickets Issued</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
from django.urls import path
|
||||
|
||||
from .views import home
|
||||
from .views import home, event_detail
|
||||
|
||||
urlpatterns = [
|
||||
path("", home, name="home"),
|
||||
]
|
||||
path("event/<int:event_id>/", event_detail, name="event_detail"),
|
||||
]
|
||||
@ -1,25 +1,18 @@
|
||||
import os
|
||||
import platform
|
||||
|
||||
from django import get_version as django_version
|
||||
from django.shortcuts import render
|
||||
from django.utils import timezone
|
||||
|
||||
from django.shortcuts import render, get_object_or_404
|
||||
from .models import Event, School
|
||||
|
||||
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 upcoming events."""
|
||||
events = Event.objects.filter(is_published=True).order_by('start_date')[:6]
|
||||
schools = School.objects.all()
|
||||
|
||||
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", ""),
|
||||
"events": events,
|
||||
"schools": schools,
|
||||
}
|
||||
return render(request, "core/index.html", context)
|
||||
|
||||
def event_detail(request, event_id):
|
||||
"""Render the detailed view for a specific school event."""
|
||||
event = get_object_or_404(Event, id=event_id)
|
||||
return render(request, "core/event_detail.html", {"event": event})
|
||||
@ -1,4 +1,131 @@
|
||||
/* Custom styles for the application */
|
||||
body {
|
||||
font-family: system-ui, -apple-system, sans-serif;
|
||||
:root {
|
||||
--primary-color: #2D3436;
|
||||
--accent-color: #00B894;
|
||||
--bg-light: #F9FAFB;
|
||||
--text-muted: #636E72;
|
||||
--white: #ffffff;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
background-color: var(--bg-light);
|
||||
color: var(--primary-color);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, .brand-font {
|
||||
font-family: 'Playfair Display', serif;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.text-accent {
|
||||
color: var(--accent-color) !important;
|
||||
}
|
||||
|
||||
.bg-accent {
|
||||
background-color: var(--accent-color) !important;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: var(--accent-color);
|
||||
border-color: var(--accent-color);
|
||||
padding: 0.75rem 1.75rem;
|
||||
font-weight: 600;
|
||||
border-radius: 10px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background-color: #009476;
|
||||
border-color: #009476;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0, 184, 148, 0.2);
|
||||
}
|
||||
|
||||
.navbar {
|
||||
background: var(--white);
|
||||
box-shadow: 0 2px 15px rgba(0,0,0,0.04);
|
||||
padding: 1.25rem 0;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
font-weight: 700;
|
||||
font-size: 1.6rem;
|
||||
letter-spacing: -0.5px;
|
||||
}
|
||||
|
||||
.hero-section {
|
||||
padding: 100px 0;
|
||||
background: radial-gradient(circle at top right, #e3fcf7, var(--bg-light));
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.hero-section::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -10%;
|
||||
right: -5%;
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
background: rgba(0, 184, 148, 0.05);
|
||||
border-radius: 50%;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.event-card {
|
||||
border: none;
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
|
||||
background: var(--white);
|
||||
height: 100%;
|
||||
box-shadow: 0 4px 6px rgba(0,0,0,0.02);
|
||||
}
|
||||
|
||||
.event-card:hover {
|
||||
transform: translateY(-10px);
|
||||
box-shadow: 0 20px 40px rgba(0,0,0,0.08);
|
||||
}
|
||||
|
||||
.event-type-badge {
|
||||
font-size: 0.75rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
font-weight: 700;
|
||||
padding: 6px 12px;
|
||||
border-radius: 30px;
|
||||
display: inline-block;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.badge-assembly { background: #e3fcf7; color: #00b894; }
|
||||
.badge-field_trip { background: #fff4e6; color: #fd7e14; }
|
||||
.badge-parent_teacher { background: #f0f0ff; color: #6c5ce7; }
|
||||
.badge-sports { background: #fff0f0; color: #ff7675; }
|
||||
.badge-performance { background: #fdf2ff; color: #a29bfe; }
|
||||
.badge-other { background: #f1f2f6; color: #2d3436; }
|
||||
|
||||
.section-title {
|
||||
margin-bottom: 3rem;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.section-title::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -10px;
|
||||
left: 0;
|
||||
width: 40px;
|
||||
height: 4px;
|
||||
background: var(--accent-color);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
padding: 4rem 0;
|
||||
background: var(--white);
|
||||
border-top: 1px solid #eee;
|
||||
margin-top: 5rem;
|
||||
}
|
||||
@ -1,21 +1,131 @@
|
||||
|
||||
: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: #2D3436;
|
||||
--accent-color: #00B894;
|
||||
--bg-light: #F9FAFB;
|
||||
--text-muted: #636E72;
|
||||
--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;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background-color: var(--bg-light);
|
||||
color: var(--primary-color);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, .brand-font {
|
||||
font-family: 'Playfair Display', serif;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.text-accent {
|
||||
color: var(--accent-color) !important;
|
||||
}
|
||||
|
||||
.bg-accent {
|
||||
background-color: var(--accent-color) !important;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: var(--accent-color);
|
||||
border-color: var(--accent-color);
|
||||
padding: 0.75rem 1.75rem;
|
||||
font-weight: 600;
|
||||
border-radius: 10px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background-color: #009476;
|
||||
border-color: #009476;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0, 184, 148, 0.2);
|
||||
}
|
||||
|
||||
.navbar {
|
||||
background: var(--white);
|
||||
box-shadow: 0 2px 15px rgba(0,0,0,0.04);
|
||||
padding: 1.25rem 0;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
font-weight: 700;
|
||||
font-size: 1.6rem;
|
||||
letter-spacing: -0.5px;
|
||||
}
|
||||
|
||||
.hero-section {
|
||||
padding: 100px 0;
|
||||
background: radial-gradient(circle at top right, #e3fcf7, var(--bg-light));
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.hero-section::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -10%;
|
||||
right: -5%;
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
background: rgba(0, 184, 148, 0.05);
|
||||
border-radius: 50%;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.event-card {
|
||||
border: none;
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
|
||||
background: var(--white);
|
||||
height: 100%;
|
||||
box-shadow: 0 4px 6px rgba(0,0,0,0.02);
|
||||
}
|
||||
|
||||
.event-card:hover {
|
||||
transform: translateY(-10px);
|
||||
box-shadow: 0 20px 40px rgba(0,0,0,0.08);
|
||||
}
|
||||
|
||||
.event-type-badge {
|
||||
font-size: 0.75rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
font-weight: 700;
|
||||
padding: 6px 12px;
|
||||
border-radius: 30px;
|
||||
display: inline-block;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.badge-assembly { background: #e3fcf7; color: #00b894; }
|
||||
.badge-field_trip { background: #fff4e6; color: #fd7e14; }
|
||||
.badge-parent_teacher { background: #f0f0ff; color: #6c5ce7; }
|
||||
.badge-sports { background: #fff0f0; color: #ff7675; }
|
||||
.badge-performance { background: #fdf2ff; color: #a29bfe; }
|
||||
.badge-other { background: #f1f2f6; color: #2d3436; }
|
||||
|
||||
.section-title {
|
||||
margin-bottom: 3rem;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.section-title::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -10px;
|
||||
left: 0;
|
||||
width: 40px;
|
||||
height: 4px;
|
||||
background: var(--accent-color);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
padding: 4rem 0;
|
||||
background: var(--white);
|
||||
border-top: 1px solid #eee;
|
||||
margin-top: 5rem;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user