SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 4708fae0 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

move grouped tasklist view to new url

parent b966f58b
No related branches found
No related tags found
No related merge requests found
{% extends "scipost/base.html" %}
{% block pagetitle %}: Tasklist{% endblock %}
{% block content %}
<div class="bg-warning bg-opacity-10 border border-warning border-1 p-2 mb-4">
<span class="text-warning">{% include 'bi/cone-striped.html' %}</span>
This page is under construction.
It might not contain all your todo items.
</div>
<div class="d-flex gap-2 justify-content-between align-items-center">
<h1>Tasklist</h1>
</div>
<div class="d-flex flex-column gap-3">
{% for task_type, tasks in kinds_with_tasks.items %}
<details name="task-type" class="border border-primary border-1 rounded">
<summary class="p-2 bg-primary bg-opacity-10 d-flex justify-content-between align-items-center">
<div>
<h2>{{ task_type.name }}</h2>
<p class="m-0">{{ task_type.description }}</p>
</div>
<div class="d-flex flex-column">
<span class="fs-4">{{ tasks|length }}</span>
</div>
</summary>
<div class="p-3">
<ul class="list-unstyled d-flex flex-column align-items-stretch gap-4 m-0">
{% for task in tasks %}
<li>{{ task.as_html|safe }}</li>
{% empty %}
<li class="text-muted text-center fs-4">No tasks of this type</li>
{% endfor %}
</ul>
</div>
</details>
{% empty %}
<p class="text-muted text-center fs-4">No tasks found</p>
{% endfor %}
</div>
{% endblock %}
......@@ -11,5 +11,6 @@ app_name = "tasks"
urlpatterns = [
path("list", views.tasklist, name="tasklist"),
path("list/new/grouped", views.tasklist_new_grouped, name="tasklist_new_grouped"),
path("list/new", views.tasklist_new, name="tasklist_new"),
]
......@@ -2,6 +2,7 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)"
__license__ = "AGPL v3"
from django.contrib.auth.decorators import login_required, user_passes_test
from django.http import HttpResponse
from django.shortcuts import render
from colleges.permissions import is_edadmin_or_active_fellow
......@@ -29,7 +30,7 @@ def tasklist(request):
@login_required
@user_passes_test(is_edadmin_or_active_fellow)
def tasklist_new(request):
def tasklist_new_grouped(request):
"""Displays a grouped list of tasks"""
context = {
......@@ -38,4 +39,10 @@ def tasklist_new(request):
for task_type in get_all_task_kinds(request.user)
}
}
return render(request, "tasks/tasklist_new.html", context)
return render(request, "tasks/tasklist_new_grouped.html", context)
@login_required
@user_passes_test(is_edadmin_or_active_fellow)
def tasklist_new(request):
return HttpResponse("")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment