feat: change entire downloads

This commit is contained in:
mohamad
2026-05-16 19:13:32 +03:30
parent eb880e3e8b
commit f0a9d5832b
26 changed files with 1283 additions and 213 deletions
+1 -19
View File
@@ -6,7 +6,7 @@ from django.views import View
from django.views.generic import ListView, TemplateView
from .forms import ContactForm
from .models import ContactSubmission, DownloadItem, FAQEntry
from .models import ContactSubmission, FAQEntry
class HomeView(TemplateView):
@@ -17,24 +17,6 @@ class AboutView(TemplateView):
template_name = "pages/about.html"
class DownloadsView(ListView):
template_name = "pages/downloads.html"
context_object_name = "download_items"
def get_queryset(self):
return DownloadItem.objects.filter(is_active=True).order_by("order", "platform")
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
all_items = DownloadItem.objects.order_by("order", "platform")
context["windows_items"] = all_items.filter(
platform=DownloadItem.PLATFORM_WINDOWS
)
context["macos_items"] = all_items.filter(platform=DownloadItem.PLATFORM_MACOS)
context["linux_items"] = all_items.filter(platform=DownloadItem.PLATFORM_LINUX)
return context
class FAQView(ListView):
model = FAQEntry
template_name = "pages/faq.html"