This commit is contained in:
Ross
2022-03-21 16:49:04 +00:00
parent 15aa29533b
commit 7577a031c1
4 changed files with 32 additions and 0 deletions
@@ -0,0 +1,9 @@
{% extends 'atlas/base.html' %}
{% block content %}
<ul>
{% for case in collection %}
<li>{{case.title}}: {{case.descriptions}}</li>
{% endfor %}
</ul>
{% endblock %}
@@ -0,0 +1,9 @@
{% extends 'atlas/base.html' %}
{% block content %}
<ul>
{% for collection in collections %}
<li>{{collection.name}}</li>
{% endfor %}
</ul>
{% endblock %}
+2
View File
@@ -10,6 +10,8 @@ urlpatterns = [
path("author/<int:pk>/", views.author_detail, name="author_detail"),
path("author/", views.author_list, name="author_list"),
path("case/", views.CaseView.as_view(), name="case_view"),
path("collection/", views.collection_index_view, name="collection_index_view"),
path("collections/<int:pk>", views.collection_detail_view, name="collection_detail_view"),
path("condition/", views.ConditionView.as_view(), name="condition_view"),
path("categories/", views.categories_list, name="categories_list"),
path("condition/<int:pk>", views.condition_detail, name="condition_detail"),
+12
View File
@@ -39,6 +39,7 @@ from .forms import (
)
from .models import (
Case,
CaseCollection,
Condition,
PathologicalProcess,
Presentation,
@@ -891,3 +892,14 @@ def categories_list(request):
# "condition": condition,
# },
)
def collection_index_view(request):
collections = CaseCollection.objects.all()
return render(request, "atlas/collection_index.html", {"collections": collections})
def collection_detail_view(request, pk):
collection = get_object_or_404(CaseCollection, pk)
return render(request, "atlas/collection_index.html", {"collection": collection})