From a47836db06d3c0c93aefce2397978c2c0d0d1a91 Mon Sep 17 00:00:00 2001 From: LuizaMaluf Date: Wed, 29 Nov 2023 08:46:56 -0300 Subject: [PATCH] feat(submission_page): submissions list --- apps/submissions/urls.py | 7 ++++++ apps/submissions/views.py | 9 +++++++ templates/submission/submission_list.html | 30 +++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 templates/submission/submission_list.html diff --git a/apps/submissions/urls.py b/apps/submissions/urls.py index e69de29..5070325 100644 --- a/apps/submissions/urls.py +++ b/apps/submissions/urls.py @@ -0,0 +1,7 @@ +from django.urls import path + +from apps.submissions.views import SubmissionListView + +urlpatterns = [ + path("submissions/", SubmissionListView.as_view(), name="submission_list") +] diff --git a/apps/submissions/views.py b/apps/submissions/views.py index e69de29..964f1f2 100644 --- a/apps/submissions/views.py +++ b/apps/submissions/views.py @@ -0,0 +1,9 @@ +from django.views.generic import ListView + +from apps.submissions.models import Submission + + +class SubmissionListView(ListView[Submission]): + model = Submission + template_name = "submission_list.html" + context_object_name = "submissions" diff --git a/templates/submission/submission_list.html b/templates/submission/submission_list.html new file mode 100644 index 0000000..67dcb99 --- /dev/null +++ b/templates/submission/submission_list.html @@ -0,0 +1,30 @@ +{% extends "base.html" %} + +{% block title %}Lista de Submissões{% endblock title %} + +{% block content %} +
+

Lista de Submissões

+ +
+ {% for submission in submissions %} +
+
+ + Submissão #{{ submission.id }} + + + Autor: {{ submission.author.username }} + + + Status: {{ submission.get_status_display }} + +
+
+

Tarefa: {{ submission.task.title }}

+
+
+ {% endfor %} +
+
+{% endblock content %}