Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions events/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ def save(self, commit: bool = True) -> Event:
instance.is_published = False
if commit:
instance.save()
self.save_m2m()
return instance
27 changes: 27 additions & 0 deletions events/templates/events/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{% load static %}
<!DOCTYPE html>
<html lang="en" class="scroll-smooth h-full">

<head>
{% include 'events/includes/head.html' %}
{% block extra_head %}{% endblock %}
</head>

<body class="bg-slate-950 text-slate-100 flex flex-col min-h-full">
{% block header %}
<header class="relative overflow-hidden bg-gradient-to-br from-purple-900 via-indigo-900 to-slate-900">
<div class="absolute inset-0 bg-grid opacity-40"></div>
<div class="relative mx-auto max-w-5xl px-6 py-20 text-center">
{% block header_content %}{% endblock %}
</div>
</header>
{% endblock %}

<main class="{% block main_class %}mx-auto max-w-6xl px-6 py-16{% endblock %} flex-grow">
{% block content %}{% endblock %}
</main>

{% include 'events/includes/footer.html' %}
</body>

</html>
114 changes: 46 additions & 68 deletions events/templates/events/home.html
Original file line number Diff line number Diff line change
@@ -1,66 +1,51 @@
{% load static %}
<!DOCTYPE html>
<html lang="en" class="scroll-smooth">
{% extends 'events/base.html' %}

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Eventator | Hacktoberfest 2025 x Django Cameroon</title>
<script src="https://cdn.tailwindcss.com"></script>
<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=Poppins:wght@400;600;700&display=swap" rel="stylesheet" />
<style>
body {
font-family: 'Poppins', ui-sans-serif, system-ui;
}
{% block header_content %}
<div
class="inline-flex items-center gap-2 rounded-full bg-white/10 px-4 py-2 text-xs font-semibold uppercase tracking-[.2em] text-indigo-200">
Hacktoberfest 2025 • Django Cameroon</div>
{% if messages %}
<div class="space-y-4">
{% for message in messages %}
<div class="rounded-lg border border-green-400/40 bg-green-500/10 px-4 py-3 text-sm text-green-200">
{{ message }}
</div>
{% endfor %}
</div>
{% endif %}
<h1 class="mt-6 text-4xl font-bold sm:text-5xl lg:text-6xl">
Eventator keeps our community inspired.
</h1>
<p class="mx-auto mt-6 max-w-2xl text-lg text-slate-200">
Browse upcoming gatherings, coding nights, and contribution sprints. Submit your idea and let's grow the Django
Cameroon footprint during Hacktoberfest 2025.
</p>
<div class="mt-10 flex flex-wrap items-center justify-center gap-4 text-sm text-indigo-200">
<span class="inline-flex items-center gap-2 rounded-full border border-indigo-400/40 px-4 py-2">
<span class="inline-flex h-2 w-2 rounded-full bg-green-400"></span>
<strong>{{ events|length }}</strong>
live events
</span>
<span class="inline-flex items-center gap-2 rounded-full border border-indigo-400/40 px-4 py-2">
<span class="inline-flex h-2 w-2 rounded-full bg-amber-400"></span>
<strong>{{ pending_count }}</strong>
ideas in review
</span>
<a href="{% url 'events:submissions' %}"
class="inline-flex items-center gap-2 rounded-full border border-indigo-400/40 px-4 py-2 transition hover:bg-white/10">
View all submissions
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="h-4 w-4">
<path fill-rule="evenodd"
d="M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z"
clip-rule="evenodd" />
</svg>
</a>
</div>
{% endblock %}

.bg-grid {
background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.2) 1px, transparent 0);
background-size: 24px 24px;
}
</style>
</head>
{% block main_class %}mx-auto flex max-w-6xl flex-col gap-16 px-6 py-16{% endblock %}

<body class="bg-slate-950 text-slate-100">
<header class="relative overflow-hidden bg-gradient-to-br from-purple-900 via-indigo-900 to-slate-900">
<div class="absolute inset-0 bg-grid opacity-40"></div>
<div class="relative mx-auto max-w-5xl px-6 py-20 text-center">
<div
class="inline-flex items-center gap-2 rounded-full bg-white/10 px-4 py-2 text-xs font-semibold uppercase tracking-[.2em] text-indigo-200">
Hacktoberfest 2025 • Django Cameroon</div>
{% if messages %}
<div class="space-y-4">
{% for message in messages %}
<div class="rounded-lg border border-green-400/40 bg-green-500/10 px-4 py-3 text-sm text-green-200">
{{ message }}
</div>
{% endfor %}
</div>
{% endif %}
<h1 class="mt-6 text-4xl font-bold sm:text-5xl lg:text-6xl">
Eventator keeps our community inspired.
</h1>
<p class="mx-auto mt-6 max-w-2xl text-lg text-slate-200">
Browse upcoming events, coding nights, and contribution sprints. Submit your idea and let's grow the Django
Cameroon footprint during Hacktoberfest 2025.
</p>
<div class="mt-10 flex flex-wrap items-center justify-center gap-4 text-sm text-indigo-200">
<span class="inline-flex items-center gap-2 rounded-full border border-indigo-400/40 px-4 py-2">
<span class="inline-flex h-2 w-2 rounded-full bg-green-400"></span>
<strong>{{ events|length }}</strong>
live events
</span>
<span class="inline-flex items-center gap-2 rounded-full border border-indigo-400/40 px-4 py-2">
<span class="inline-flex h-2 w-2 rounded-full bg-amber-400"></span>
<strong>{{ pending_count }}</strong>
ideas in review
</span>
</div>
</div>
</header>

<main class="mx-auto flex max-w-6xl flex-col gap-16 px-6 py-16">
{% block content %}
<section>
<div class="flex items-center justify-between gap-4">
<h2 class="text-2xl font-semibold text-white">Upcoming &amp; Featured Events</h2>
Expand Down Expand Up @@ -175,11 +160,4 @@ <h2 class="text-2xl font-semibold text-white">Share your event idea</h2>
</form>
</div>
</section>
</main>

<footer class="bg-slate-900/90 py-8 text-center text-xs text-indigo-200">
Built for the communuitu by the Django Cameroon community — Hacktoberfest 2025 edition.
</footer>
</body>

</html>
{% endblock %}
3 changes: 3 additions & 0 deletions events/templates/events/includes/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<footer class="bg-slate-900/90 py-8 text-center text-xs text-indigo-200">
Built for the community by the Django Cameroon community — Hacktoberfest 2025 edition.
</footer>
17 changes: 17 additions & 0 deletions events/templates/events/includes/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{% block title %}Eventator | Hacktoberfest 2025 x Django Cameroon{% endblock %}</title>
<script src="https://cdn.tailwindcss.com"></script>
<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=Poppins:wght@400;600;700&display=swap" rel="stylesheet" />
<style>
body {
font-family: 'Poppins', ui-sans-serif, system-ui;
}

.bg-grid {
background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.2) 1px, transparent 0);
background-size: 24px 24px;
}
</style>
80 changes: 80 additions & 0 deletions events/templates/events/submissions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{% extends 'events/base.html' %}

{% block title %}Submissions | Eventator{% endblock %}

{% block header_content %}
<div
class="inline-flex items-center gap-2 rounded-full bg-white/10 px-4 py-2 text-xs font-semibold uppercase tracking-[.2em] text-indigo-200">
Hacktoberfest 2025 • Django Cameroon</div>
<h1 class="mt-6 text-4xl font-bold sm:text-5xl lg:text-6xl">
All Submissions & Review Status
</h1>
<p class="mx-auto mt-6 max-w-2xl text-lg text-slate-200">
Track all submitted event ideas and their current review status.
</p>
<div class="mt-10 flex items-center justify-center gap-4">
<a href="{% url 'events:home' %}"
class="inline-flex items-center gap-2 rounded-full border border-indigo-400/40 px-4 py-2 text-sm text-indigo-200 transition hover:bg-white/10">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="h-4 w-4">
<path fill-rule="evenodd"
d="M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z"
clip-rule="evenodd" />
</svg>
Back to Home
</a>
</div>
{% endblock %}

{% block content %}
<section>
<div class="overflow-hidden rounded-3xl border border-white/5 bg-white/5 shadow-2xl shadow-indigo-900/40">
<div class="overflow-x-auto">
<table class="w-full">
<thead class="border-b border-white/10 bg-white/5">
<tr>
<th class="px-6 py-4 text-left text-xs font-semibold uppercase tracking-widest text-indigo-200">Title</th>
<th class="px-6 py-4 text-left text-xs font-semibold uppercase tracking-widest text-indigo-200">Date</th>
<th class="px-6 py-4 text-left text-xs font-semibold uppercase tracking-widest text-indigo-200">Location</th>
<th class="px-6 py-4 text-left text-xs font-semibold uppercase tracking-widest text-indigo-200">Status</th>
<th class="px-6 py-4 text-left text-xs font-semibold uppercase tracking-widest text-indigo-200">Submitted</th>
</tr>
</thead>
<tbody class="divide-y divide-white/5">
{% for submission in submissions %}
<tr class="transition hover:bg-white/5">
<td class="px-6 py-4">
<div class="font-semibold text-white">{{ submission.title }}</div>
<div class="mt-1 text-xs text-slate-200/60 line-clamp-2">{{ submission.description }}</div>
</td>
<td class="px-6 py-4 text-sm text-slate-200">{{ submission.event_date|date:"M d, Y" }}</td>
<td class="px-6 py-4 text-sm text-slate-200">{{ submission.location }}</td>
<td class="px-6 py-4">
{% if submission.is_published %}
<span
class="inline-flex items-center gap-2 rounded-full bg-green-500/20 px-3 py-1 text-xs font-semibold text-green-300">
<span class="inline-flex h-2 w-2 rounded-full bg-green-400"></span>
Published
</span>
{% else %}
<span
class="inline-flex items-center gap-2 rounded-full bg-amber-500/20 px-3 py-1 text-xs font-semibold text-amber-300">
<span class="inline-flex h-2 w-2 rounded-full bg-amber-400"></span>
Under Review
</span>
{% endif %}
</td>
<td class="px-6 py-4 text-sm text-slate-200/70">{{ submission.created_at|date:"M d, Y" }}</td>
</tr>
{% empty %}
<tr>
<td colspan="5" class="px-6 py-12 text-center text-sm text-indigo-100/80">
No submissions yet. Be the first to share an idea!
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</section>
{% endblock %}
1 change: 1 addition & 0 deletions events/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@

urlpatterns = [
path("", views.home, name="home"),
path("submissions/", views.submissions, name="submissions"),
]
11 changes: 11 additions & 0 deletions events/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,14 @@ def home(request):
"form": form,
}
return render(request, "events/home.html", context)


def submissions(request):
"""Page showing all submitted content with review status."""

all_events = Event.objects.all().order_by("-created_at")

context = {
"submissions": all_events,
}
return render(request, "events/submissions.html", context)