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 %}