Skip to content

Commit

Permalink
link DocumentDetailView in CategoryDetailView
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Sep 30, 2024
1 parent 60497b6 commit 6ecbc48
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<div class="s-title-01__col col-12">
<h1>Test Category</h1>


<h2 class="mt-3">Test short description</h2>
</div>
</div>
Expand Down Expand Up @@ -99,7 +100,7 @@
</div>
<div class="card-footer text-end">

<a class="btn btn-sm btn-ico btn-link stretched-link matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="document" href="#">
<a class="btn btn-sm btn-ico btn-link stretched-link matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="document" href="/documentation/[PK of Category]/test-document-[PK of Document]/">
<span>Consulter la fiche</span>
<i class="ri-arrow-right-line ri-lg"></i>
</a>
Expand Down Expand Up @@ -149,6 +150,7 @@
<div class="s-title-01__col col-12">
<h1>Test Category</h1>


<h2 class="mt-3">Test short description</h2>
</div>
</div>
Expand Down Expand Up @@ -221,7 +223,7 @@
</div>
<div class="card-footer text-end">

<a class="btn btn-sm btn-ico btn-link stretched-link matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="document" href="#">
<a class="btn btn-sm btn-ico btn-link stretched-link matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="document" href="/documentation/[PK of Category]/test-document-[PK of Document]/">
<span>Consulter la fiche</span>
<i class="ri-arrow-right-line ri-lg"></i>
</a>
Expand Down Expand Up @@ -271,6 +273,7 @@
<div class="s-title-01__col col-12">
<h1>Test Category</h1>


<h2 class="mt-3">Test short description</h2>
</div>
</div>
Expand Down Expand Up @@ -341,7 +344,7 @@
</div>
<div class="card-footer text-end">

<a class="btn btn-sm btn-ico btn-link stretched-link matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="document" href="#">
<a class="btn btn-sm btn-ico btn-link stretched-link matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="document" href="/documentation/[PK of Category]/test-document-[PK of Document]/">
<span>Consulter la fiche</span>
<i class="ri-arrow-right-line ri-lg"></i>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ def test_category_detail_view_with_tagged_documents(client, db, category, active
url = f"{category.get_absolute_url()}?tag={active_tag}" if active_tag else category.get_absolute_url()
response = client.get(url)
assert response.status_code == 200
content = parse_response_to_soup(response, selector="main", replace_img_src=True, replace_in_href=[category])
content = parse_response_to_soup(
response,
selector="main",
replace_img_src=True,
replace_in_href=[category] + [doc for doc in category.documents.all()],
)
assert str(content) == snapshot(name=snapshot_name)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
</div>
<div class="card-footer text-end">
{% if kind == "document" %}
<a href="#" class="btn btn-sm btn-ico btn-link stretched-link matomo-event" data-matomo-category="engagement" data-matomo-action="view" data-matomo-option="document">
<a href="{% url 'documentation:document_detail' obj.category.pk obj.slug obj.pk %}"
class="btn btn-sm btn-ico btn-link stretched-link matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="document">
<span>Consulter la fiche</span>
<i class="ri-arrow-right-line ri-lg"></i>
</a>
Expand Down

0 comments on commit 6ecbc48

Please sign in to comment.