Home project-list

This commit is contained in:
Klaas van Schelven
2024-02-03 21:10:26 +01:00
parent d71231b401
commit 1891cbcd12
2 changed files with 24 additions and 3 deletions

View File

@@ -4,19 +4,23 @@ from django.conf import settings
from django.views.decorators.http import require_GET
from django.views.decorators.cache import cache_control
from django.http import FileResponse, HttpRequest, HttpResponse
from django.shortcuts import render
from projects.models import Project
from issues.views import issue_list
def home(request):
# TODO if count() == 0 it's time to do onboarding :-)
if Project.objects.count() == 0:
raise NotImplementedError("Onboarding not implemented yet")
if Project.objects.count() == 1:
elif Project.objects.count() == 1:
project = Project.objects.get()
return redirect(issue_list, project_id=project.id)
raise NotImplementedError() # some kind of Project-list
return render(request, "bugsink/home_project_list.html", {
# user_projecs is in the context_processor, we don't need to pass it here
})
def trigger_error(request):

View File

@@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block title %}Projects · {{ site_title }}{% endblock %}
{% block content %}
<div class="m-4">
<h1 class="text-4xl mt-4">Projects</h1>
{% for project in user_projects %}
<a href="/issues/{{ project.id }}/"><div class="p-4 hover:bg-slate-400">{{ project.name }}</div></a>
{% endfor %}
</div>
{% endblock %}