SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
83923f42
"README.rst" did not exist on "e5b4aaf05e4ae16cbe2cab80e9f578bd37bcc70d"
Commit
83923f42
authored
3 months ago
by
George Katsikas
Browse files
Options
Downloads
Patches
Plain Diff
add tasklist table view
parent
4708fae0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scipost_django/tasks/templates/tasks/tasklist_new.html
+49
-26
49 additions, 26 deletions
scipost_django/tasks/templates/tasks/tasklist_new.html
scipost_django/tasks/views.py
+7
-1
7 additions, 1 deletion
scipost_django/tasks/views.py
with
56 additions
and
27 deletions
scipost_django/tasks/templates/tasks/tasklist_new.html
+
49
−
26
View file @
83923f42
...
...
@@ -15,32 +15,55 @@
<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 %}
<table
class=
"table"
>
<thead>
<tr>
<th
scope=
"col"
>
Type
</th>
<th
scope=
"col"
>
Name
</th>
<th
scope=
"col"
>
Due
</th>
<th
scope=
"col"
>
Actions
</th>
</tr>
</thead>
<tbody>
{% for task_type, tasks in kinds_with_tasks.items %}
{% for task in tasks %}
<tr>
<td>
{{ task.kind.name }}
</td>
<td>
{{ task.title }}
</td>
<td>
{{ task.due_date }}
</td>
<td>
{% for action in task.actions|slice:":2" %}{{ action.as_html|safe }}{% endfor %}
{% if task.actions|length > 2 %}
<div
class=
"btn-group"
role=
"group"
>
<button
class=
"btn btn-sm btn-light dropdown-toggle"
type=
"button"
data-bs-toggle=
"dropdown"
aria-expanded=
"false"
>
<span>
More
</span>
</button>
<ul
class=
"dropdown-menu dropdown-menu-end"
>
{% for action in task.actions|slice:"2:" %}
<li
class=
"dropdown-item"
>
{{ action.element|safe }}
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
This diff is collapsed.
Click to expand it.
scipost_django/tasks/views.py
+
7
−
1
View file @
83923f42
...
...
@@ -45,4 +45,10 @@ def tasklist_new_grouped(request):
@login_required
@user_passes_test
(
is_edadmin_or_active_fellow
)
def
tasklist_new
(
request
):
return
HttpResponse
(
""
)
context
=
{
"
kinds_with_tasks
"
:
{
task_type
:
task_type
.
get_tasks
()
for
task_type
in
get_all_task_kinds
(
request
.
user
)
}
}
return
render
(
request
,
"
tasks/tasklist_new.html
"
,
context
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment