This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(submission_page): submissions list
- Loading branch information
1 parent
24e1e63
commit a47836d
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from django.urls import path | ||
|
||
from apps.submissions.views import SubmissionListView | ||
|
||
urlpatterns = [ | ||
path("submissions/", SubmissionListView.as_view(), name="submission_list") | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block title %}Lista de Submissões{% endblock title %} | ||
|
||
{% block content %} | ||
<div> | ||
<h3>Lista de Submissões</h3> | ||
|
||
<div class="gap-3" style="display: grid;"> | ||
{% for submission in submissions %} | ||
<div class="g-col-6 card"> | ||
<div class="card-header"> | ||
<a href="{% url 'submission_detail' submission.id %}"> | ||
Submissão #{{ submission.id }} | ||
</a> | ||
<span class="text-muted align-middle" style="font-size: 0.90rem;"> | ||
Autor: {{ submission.author.username }} | ||
</span> | ||
<span class="badge bg-info float-end mt-1"> | ||
Status: {{ submission.get_status_display }} | ||
</span> | ||
</div> | ||
<div class="card-body"> | ||
<p>Tarefa: {{ submission.task.title }}</p> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
{% endblock content %} |