feat: add public homepage and downloads
This commit is contained in:
@@ -19,6 +19,7 @@ from apps.billing.services import (
|
||||
from apps.users.models import ApiKey
|
||||
|
||||
from .forms import ApiKeyCreateForm, RechargeCreateForm
|
||||
from .models import DownloadRelease
|
||||
|
||||
|
||||
NEW_API_KEY_SESSION_KEY = "portal_new_api_key"
|
||||
@@ -88,6 +89,22 @@ def paginate_records(request, queryset):
|
||||
}
|
||||
|
||||
|
||||
class HomeView(TemplateView):
|
||||
template_name = "portal/home.html"
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["current_release"] = (
|
||||
DownloadRelease.objects.filter(
|
||||
platform=DownloadRelease.Platform.WINDOWS,
|
||||
is_current=True,
|
||||
)
|
||||
.order_by("-created_at", "-id")
|
||||
.first()
|
||||
)
|
||||
return context
|
||||
|
||||
|
||||
class DashboardView(LoginRequiredMixin, TemplateView):
|
||||
template_name = "portal/dashboard.html"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user