Skip to content

Commit

Permalink
thanks to tests, fix content_summary template
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Oct 9, 2024
1 parent 1d32abe commit 506d51b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@
<div class="text-center tag-group">


<button aria-label="Filtrer par tag1" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="document" hx-get="/documentation/test-category-[PK of Category]/?tag=tag1" hx-push-url="true" hx-swap="outerHTML" hx-target="#documents_area" id="filterdocument-tag1">tag1</button>
<button aria-label="Filtrer par tag1" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="document" hx-get="[Category detail view url]?tag=tag1" hx-push-url="true" hx-swap="outerHTML" hx-target="#documents_area" id="filterdocument-tag1">tag1</button>



<button aria-label="Filtrer par tag2" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="document" hx-get="/documentation/test-category-[PK of Category]/?tag=tag2" hx-push-url="true" hx-swap="outerHTML" hx-target="#documents_area" id="filterdocument-tag2">tag2</button>
<button aria-label="Filtrer par tag2" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="document" hx-get="[Category detail view url]?tag=tag2" hx-push-url="true" hx-swap="outerHTML" hx-target="#documents_area" id="filterdocument-tag2">tag2</button>


</div>
Expand Down Expand Up @@ -101,7 +101,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="/documentation/[PK of Category]/test-category-[PK of Document]/">
<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="[Document detail view url]">
<span>Consulter la fiche</span>
<i class="ri-arrow-right-line ri-lg"></i>
</a>
Expand All @@ -127,7 +127,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="/documentation/[PK of Category]/test-category-[PK of Document]/">
<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="[Document detail view url]">
<span>Consulter la fiche</span>
<i class="ri-arrow-right-line ri-lg"></i>
</a>
Expand Down Expand Up @@ -215,13 +215,13 @@
<div class="text-center tag-group">


<button aria-label="Supprimer ce filtre" class="tag bg-info text-white matomo-event" data-bs-placement="top" data-bs-title="Supprimer ce filtre" data-bs-toggle="tooltip" data-matomo-action="unfilter" data-matomo-category="engagement" data-matomo-option="document" hx-get="/documentation/test-category-[PK of Category]/" hx-push-url="true" hx-swap="outerHTML" hx-target="#documents_area" id="filterdocument-tag1">
<button aria-label="Supprimer ce filtre" class="tag bg-info text-white matomo-event" data-bs-placement="top" data-bs-title="Supprimer ce filtre" data-bs-toggle="tooltip" data-matomo-action="unfilter" data-matomo-category="engagement" data-matomo-option="document" hx-get="[Category detail view url]" hx-push-url="true" hx-swap="outerHTML" hx-target="#documents_area" id="filterdocument-tag1">
<i class="ri-close-fill ri-xs"></i>tag1
</button>



<button aria-label="Filtrer par tag2" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="document" hx-get="/documentation/test-category-[PK of Category]/?tag=tag2" hx-push-url="true" hx-swap="outerHTML" hx-target="#documents_area" id="filterdocument-tag2">tag2</button>
<button aria-label="Filtrer par tag2" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="document" hx-get="[Category detail view url]?tag=tag2" hx-push-url="true" hx-swap="outerHTML" hx-target="#documents_area" id="filterdocument-tag2">tag2</button>


</div>
Expand Down Expand Up @@ -253,7 +253,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="/documentation/[PK of Category]/test-category-[PK of Document]/">
<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="[Document detail view url]">
<span>Consulter la fiche</span>
<i class="ri-arrow-right-line ri-lg"></i>
</a>
Expand Down Expand Up @@ -341,11 +341,11 @@
<div class="text-center tag-group">


<button aria-label="Filtrer par tag1" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="document" hx-get="/documentation/test-category-[PK of Category]/?tag=tag1" hx-push-url="true" hx-swap="outerHTML" hx-target="#documents_area" id="filterdocument-tag1">tag1</button>
<button aria-label="Filtrer par tag1" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="document" hx-get="[Category detail view url]?tag=tag1" hx-push-url="true" hx-swap="outerHTML" hx-target="#documents_area" id="filterdocument-tag1">tag1</button>



<button aria-label="Filtrer par tag2" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="document" hx-get="/documentation/test-category-[PK of Category]/?tag=tag2" hx-push-url="true" hx-swap="outerHTML" hx-target="#documents_area" id="filterdocument-tag2">tag2</button>
<button aria-label="Filtrer par tag2" class="tag bg-info-lighter text-info matomo-event" data-matomo-action="filter" data-matomo-category="engagement" data-matomo-option="document" hx-get="[Category detail view url]?tag=tag2" hx-push-url="true" hx-swap="outerHTML" hx-target="#documents_area" id="filterdocument-tag2">tag2</button>


</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def test_category_detail_view_with_tagged_documents(client, db, category, active
response,
selector="main",
replace_img_src=True,
replace_in_href=[category] + [doc for doc in category.documents.all()],
replace_in_href=[(category.get_absolute_url(), "[Category detail view url]")]
+ [(doc.get_absolute_url(), "[Document detail view url]") for doc in category.documents.all()],
)
assert str(content) == snapshot(name=snapshot_name)

Expand Down
4 changes: 2 additions & 2 deletions lacommunaute/templates/documentation/document_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
<div class="s-section__row row">
<div class="s-section__col col-12">
<div class="row mt-4" id="documents">
{% for obj in documents %}
{% include 'documentation/partials/content_summary.html' with obj=obj category=category only %}
{% for document in documents %}
{% include 'documentation/partials/content_summary.html' with obj=document category=category only %}
{% endfor %}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</div>
<div class="card-footer text-end">
{% if category %}
<a href="{% url 'documentation:document_detail' category.pk category.slug obj.pk %}"
<a href="{% url 'documentation:document_detail' 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"
Expand Down

0 comments on commit 506d51b

Please sign in to comment.