Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
feat(submission_page): submissions list
Browse files Browse the repository at this point in the history
  • Loading branch information
LuizaMaluf committed Nov 29, 2023
1 parent 24e1e63 commit a47836d
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/submissions/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.urls import path

Check warning on line 1 in apps/submissions/urls.py

View check run for this annotation

Codecov / codecov/patch

apps/submissions/urls.py#L1

Added line #L1 was not covered by tests

from apps.submissions.views import SubmissionListView

Check warning on line 3 in apps/submissions/urls.py

View check run for this annotation

Codecov / codecov/patch

apps/submissions/urls.py#L3

Added line #L3 was not covered by tests

urlpatterns = [

Check warning on line 5 in apps/submissions/urls.py

View check run for this annotation

Codecov / codecov/patch

apps/submissions/urls.py#L5

Added line #L5 was not covered by tests
path("submissions/", SubmissionListView.as_view(), name="submission_list")
]
9 changes: 9 additions & 0 deletions apps/submissions/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.views.generic import ListView

Check warning on line 1 in apps/submissions/views.py

View check run for this annotation

Codecov / codecov/patch

apps/submissions/views.py#L1

Added line #L1 was not covered by tests

from apps.submissions.models import Submission

Check warning on line 3 in apps/submissions/views.py

View check run for this annotation

Codecov / codecov/patch

apps/submissions/views.py#L3

Added line #L3 was not covered by tests


class SubmissionListView(ListView[Submission]):
model = Submission
template_name = "submission_list.html"
context_object_name = "submissions"

Check warning on line 9 in apps/submissions/views.py

View check run for this annotation

Codecov / codecov/patch

apps/submissions/views.py#L6-L9

Added lines #L6 - L9 were not covered by tests
30 changes: 30 additions & 0 deletions templates/submission/submission_list.html
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 %}

0 comments on commit a47836d

Please sign in to comment.