Add Django site, Docker packaging, and beta/prod Gitea deploys.
Unignore site/ (was blocked by mkdocs /site rule), add compose/Docker/uv tooling, and split deploys so push to main goes to beta while prod stays manual.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.shortcuts import render
|
||||
|
||||
from contacts.models import Contact
|
||||
from leads.models import Lead
|
||||
from messaging.models import Campaign
|
||||
from social.models import SocialPost
|
||||
|
||||
|
||||
@login_required
|
||||
def home(request):
|
||||
upcoming = Campaign.objects.exclude(
|
||||
status__in=[Campaign.Status.COMPLETED, Campaign.Status.CANCELLED]
|
||||
).order_by("scheduled_for", "-created_at")[:5]
|
||||
context = {
|
||||
"lead_count": Lead.objects.filter(status=Lead.Status.NEW).count(),
|
||||
"open_pipeline": Lead.objects.filter(
|
||||
status__in=[Lead.Status.NEW, Lead.Status.CONTACTED]
|
||||
).count(),
|
||||
"contact_count": Contact.objects.count(),
|
||||
"scheduled_posts": SocialPost.objects.filter(
|
||||
status__in=[SocialPost.Status.SCHEDULED, SocialPost.Status.QUEUED]
|
||||
).count(),
|
||||
"recent_leads": Lead.objects.select_related("contact", "attribution").all()[:8],
|
||||
"upcoming_campaigns": upcoming,
|
||||
}
|
||||
return render(request, "dashboard/home.html", context)
|
||||
Reference in New Issue
Block a user