feat: change entire downloads
This commit is contained in:
+1
-19
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user