diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..a9de7d4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,25 @@ +--- +name: Bug report +about: Help us squash defects in Eventator +labels: bug +--- + +## Description +A clear and concise description of the issue. + +## Steps to reproduce +1. +2. +3. + +## Expected behaviour +What you expected to happen. + +## Screenshots / logs +Optional but helpful context. Attach logs, stack traces, or screenshots if available. + +## Environment +- OS: +- Browser (if UI related): +- Python version: +- Additional context: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..e417e87 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: true +contact_links: + - name: Django Cameroon Community Discord + url: https://discord.gg/EhFc7hqpbk + about: Join the community to chat about ideas before filing an issue. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..146be7c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an enhancement to Eventator +labels: enhancement +--- + +## Summary +Describe the feature or improvement you have in mind. + +## Motivation +Explain the problem this feature solves or the value it delivers. + +## Proposed solution +Outline how you think the feature should behave (UI, workflow, etc.). + +## Alternatives considered +List any alternative approaches you explored. + +## Additional context +Anything else we should know? Links, references, or related issues. diff --git a/.github/ISSUE_TEMPLATE/hacktoberfest.md b/.github/ISSUE_TEMPLATE/hacktoberfest.md new file mode 100644 index 0000000..20de58b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/hacktoberfest.md @@ -0,0 +1,20 @@ +--- +name: Hacktoberfest idea +about: Pitch a Hacktoberfest contribution opportunity or collaboration +labels: hacktoberfest +--- + +## Idea summary +Provide an overview of the idea you want to work on during Hacktoberfest. + +## Impact +Why is this valuable for the Django Cameroon community or Eventator users? + +## Tasks +Break down the work into actionable steps if possible. + +## Skills required +List any specific skills, tools, or knowledge helpful for contributors. + +## Additional context +Anything else participants should know? Link to resources or related discussions. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..65571c7 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,23 @@ +## Summary + +Provide a concise overview of the problem and the solution. Bullet the key points so reviewers can skim quickly. + +## Related Issues + +Reference related issues using closing keywords so they auto-link. Example: `Closes #123`. + +## Testing + +List commands or steps used to verify the change. +- [ ] `uv run python manage.py test` +- [ ] Other: + +## Screenshots + +Attach only if the change alters the UI. + +## Checklist + +- [ ] Added or updated documentation when needed +- [ ] Included database migrations or seed updates when required +- [ ] Confirmed the description explains any follow-up work left out of this PR diff --git a/.github/workflows/add_star.yml b/.github/workflows/add_star.yml new file mode 100644 index 0000000..04233fe --- /dev/null +++ b/.github/workflows/add_star.yml @@ -0,0 +1,29 @@ +name: Check if PR author starred the repo + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + check-star: + runs-on: ubuntu-latest + steps: + - name: Check if user starred repo + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + USER: ${{ github.actor }} + OWNER: ${{ github.repository_owner }} + REPO: ${{ github.event.repository.name }} + run: | + echo "Checking if $USER starred $OWNER/$REPO" + curl -s -H "Authorization: token $GH_TOKEN" \ + https://api.github.com/repos/$OWNER/$REPO/stargazers?per_page=100 \ + | jq -r '.[].login' > stargazers.txt + + if grep -q "^$USER$" stargazers.txt; then + echo "User $USER has starred the repo 🎉" + else + echo "::error::User $USER has not starred the repo. Please star it before merging." + exit 1 + fi + diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/DjangoBox.iml b/.idea/DjangoBox.iml new file mode 100644 index 0000000..b0bc4f6 --- /dev/null +++ b/.idea/DjangoBox.iml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/copilot.data.migration.agent.xml b/.idea/copilot.data.migration.agent.xml new file mode 100644 index 0000000..4ea72a9 --- /dev/null +++ b/.idea/copilot.data.migration.agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/copilot.data.migration.ask.xml b/.idea/copilot.data.migration.ask.xml new file mode 100644 index 0000000..7ef04e2 --- /dev/null +++ b/.idea/copilot.data.migration.ask.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/copilot.data.migration.ask2agent.xml b/.idea/copilot.data.migration.ask2agent.xml new file mode 100644 index 0000000..1f2ea11 --- /dev/null +++ b/.idea/copilot.data.migration.ask2agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/copilot.data.migration.edit.xml b/.idea/copilot.data.migration.edit.xml new file mode 100644 index 0000000..8648f94 --- /dev/null +++ b/.idea/copilot.data.migration.edit.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2d0192e --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..b775a8f --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e69de29 diff --git a/DjangoBox/__init__.py b/DjangoBox/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/DjangoBox/asgi.py b/DjangoBox/asgi.py new file mode 100644 index 0000000..a13848e --- /dev/null +++ b/DjangoBox/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for DjangoBox project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'DjangoBox.settings') + +application = get_asgi_application() diff --git a/DjangoBox/settings.py b/DjangoBox/settings.py new file mode 100644 index 0000000..ba9889f --- /dev/null +++ b/DjangoBox/settings.py @@ -0,0 +1,128 @@ +""" +Django settings for DjangoBox project. + +Generated by 'django-admin startproject' using Django 4.2.25. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.2/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-t063yoyj@=y&-)2*$exi1krt%jp2xe%bt=$4r=iunb1#d1llq3' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'core.apps.CoreConfig', + 'markdownfield' +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'DjangoBox.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [BASE_DIR / 'templates'] + , + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'DjangoBox.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.2/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/4.2/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.2/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' + +SITE_URL = 'http://localhost:8000' diff --git a/DjangoBox/urls.py b/DjangoBox/urls.py new file mode 100644 index 0000000..c25bfbf --- /dev/null +++ b/DjangoBox/urls.py @@ -0,0 +1,23 @@ +""" +URL configuration for DjangoBox project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/4.2/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path, include + +urlpatterns = [ + path('admin/', admin.site.urls), + path('', include('core.urls', namespace='core')), +] diff --git a/DjangoBox/wsgi.py b/DjangoBox/wsgi.py new file mode 100644 index 0000000..1c58a5c --- /dev/null +++ b/DjangoBox/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for DjangoBox project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'DjangoBox.settings') + +application = get_wsgi_application() diff --git a/core/__init__.py b/core/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/admin.py b/core/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/core/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/core/apps.py b/core/apps.py new file mode 100644 index 0000000..8115ae6 --- /dev/null +++ b/core/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class CoreConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'core' diff --git a/core/forms.py b/core/forms.py new file mode 100644 index 0000000..d7d1252 --- /dev/null +++ b/core/forms.py @@ -0,0 +1,28 @@ +from django import forms +from .models import Feedback + +class FeedbackForm(forms.ModelForm): + topic = forms.CharField( + max_length=100, + widget=forms.TextInput(attrs={ + 'class': 'block w-full px-3 py-2 bg-slate-800 text-white border-blue-700 focus:border-indigo-400 focus:ring-indigo-400 rounded-xl shadow-sm focus:outline-none', + 'placeholder': 'Select or enter a topic', + 'list': 'topic-list', + 'autocomplete': 'off', + }) + ) + + class Meta: + model = Feedback + fields = ['user_name', 'topic', 'content'] + widgets = { + 'user_name': forms.TextInput(attrs={ + 'class': 'block w-full px-3 py-2 bg-slate-800 text-white border-blue-700 focus:border-indigo-400 focus:ring-indigo-400 rounded-xl shadow-sm focus:outline-none', + 'placeholder': 'Your Name', + }), + 'content': forms.Textarea(attrs={ + 'class': 'block w-full px-3 py-2 bg-slate-800 text-white border-blue-700 focus:border-indigo-400 focus:ring-indigo-400 rounded-xl shadow-sm focus:outline-none', + 'placeholder': 'Your feedback...', + 'rows': 6, + }), + } diff --git a/core/management/__init__.py b/core/management/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/management/commands/__init__.py b/core/management/commands/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..172a49e --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,34 @@ +# Generated by Django 4.2.25 on 2025-10-04 00:09 + +from django.db import migrations, models +import django.db.models.deletion +import markdownfield.models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Topic', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=100)), + ], + ), + migrations.CreateModel( + name='Feedback', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('user_name', models.CharField(max_length=100)), + ('content', markdownfield.models.MarkdownField(rendered_field='content_rendered')), + ('content_rendered', markdownfield.models.RenderedMarkdownField()), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('topic', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.topic')), + ], + ), + ] diff --git a/core/migrations/__init__.py b/core/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/core/models.py b/core/models.py new file mode 100644 index 0000000..ad416c1 --- /dev/null +++ b/core/models.py @@ -0,0 +1,18 @@ +from django.db import models + +# Create your models here. + +class Topic(models.Model): + name = models.CharField(max_length=100) + + def __str__(self): + return self.name + +class Feedback(models.Model): + user_name = models.CharField(max_length=100) + topic = models.ForeignKey(Topic, on_delete=models.CASCADE) + content = models.TextField() + created_at = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return f"Feedback by {self.user_name} on {self.topic.name}" diff --git a/core/tests.py b/core/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/core/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/core/urls.py b/core/urls.py new file mode 100644 index 0000000..5244a9a --- /dev/null +++ b/core/urls.py @@ -0,0 +1,10 @@ +from django.urls import path +from . import views + +# Create your URL patterns here. + +app_name = 'core' + +urlpatterns = [ + path('', views.feedback_view, name='home'), +] \ No newline at end of file diff --git a/core/views.py b/core/views.py new file mode 100644 index 0000000..c9a9f07 --- /dev/null +++ b/core/views.py @@ -0,0 +1,36 @@ +from django.shortcuts import render, redirect +from django.contrib import messages +from django.urls import reverse +from django.http import JsonResponse + +from .forms import FeedbackForm +from .models import Topic, Feedback + + +def feedback_view(request): + topics = Topic.objects.values_list('name', flat=True) + if request.method == 'POST': + form = FeedbackForm(request.POST) + if form.is_valid(): + topic_name = form.cleaned_data.get('topic') + topic_obj, _ = Topic.objects.get_or_create(name=topic_name) + feedback = Feedback( + user_name=form.cleaned_data['user_name'], + topic=topic_obj, + content=form.cleaned_data['content'] + ) + feedback.save() + if request.headers.get('x-requested-with') == 'XMLHttpRequest': + return JsonResponse({'success': True, 'message': 'Thank you for your feedback!'}) + messages.success(request, 'Thank you for your feedback!') + return redirect(reverse('core:home')) + else: + if request.headers.get('x-requested-with') == 'XMLHttpRequest': + return JsonResponse({'success': False, 'errors': form.errors.as_json()}) + else: + form = FeedbackForm() + return render( + request, + 'core/home.html', + {'form': form, 'topics': topics}, + ) diff --git a/data/feedbacks.json b/data/feedbacks.json new file mode 100644 index 0000000..3a4c997 --- /dev/null +++ b/data/feedbacks.json @@ -0,0 +1,21 @@ +[ + { + "user_name": "Alice", + "topic": "Events", + "content": "Great job on the last Django meetup! Learned a lot about Django signals.", + "created_at": "2025-10-01T14:23:00Z" + }, + { + "user_name": "Bob", + "topic": "Core Team", + "content": "The core team is very responsive and helpful. Keep up the good work!", + "created_at": "2025-10-02T09:15:00Z" + }, + { + "user_name": "Chantal", + "topic": "Technology", + "content": "Would love to see more sessions on Django REST Framework and deployment best practices.", + "created_at": "2025-10-03T18:45:00Z" + } +] + diff --git a/manage.py b/manage.py new file mode 100644 index 0000000..08c22cb --- /dev/null +++ b/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'DjangoBox.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/templates/core/home.html b/templates/core/home.html new file mode 100644 index 0000000..b9beb60 --- /dev/null +++ b/templates/core/home.html @@ -0,0 +1,235 @@ +{% load static %} + + + + + + + DjangoBox Feedbacks | Hacktoberfest 2025 + + + + + + + + + +
+
+ + + + + + + + + + + + +
+
+
+

+ DjangoBox Community Feedback +

+

+ Your voice shapes our future! Share your thoughts about Django Cameroon, our events, people, and technology. + Let's make Hacktoberfest 2025 unforgettable together. +

+
+ + +
+ {% if messages %} +
+ {% for message in messages %} +
+ {{ message }} +
+ {% endfor %} +
+ {% endif %} +
+
+ + + + + + +
+

Community Feedbacks

+
+ {% for feedback in page_obj %} +
+
+ {{ feedback.user_name }} + on {{ feedback.topic.name }} + {{ feedback.created_at|date:'M d, Y H:i' }} +
+
{{ feedback.content_rendered|safe }}
+
+ {% empty %} +
No feedbacks yet. Be the first to share your thoughts!
+ {% endfor %} +
+ + {% if page_obj.has_other_pages %} + + {% endif %} +
+ + + + + + + + + +