feat: add public homepage and downloads

This commit is contained in:
QiuSW
2026-07-06 23:18:08 +08:00
parent 8283573ddc
commit f158a08b9d
18 changed files with 1166 additions and 96 deletions
+17
View File
@@ -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"