mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
Home project-list
This commit is contained in:
@@ -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):
|
||||
|
||||
17
templates/bugsink/home_project_list.html
Normal file
17
templates/bugsink/home_project_list.html
Normal 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 %}
|
||||
Reference in New Issue
Block a user