Skip to content

Commit

Permalink
update breadcrumb
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Sep 25, 2024
1 parent eb09bec commit 1cbaca2
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
<nav aria-label="Fil d'ariane" class="c-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">

<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="topics_breadcrumb" href="/topics/">Espace d'échanges</a>

</li>

<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="documentation_breadcrumb" href="/documentation/">Documentation</a>
</li>

</ol>
</nav>
Expand All @@ -25,13 +23,13 @@




<section class="s-title-01 mt-lg-5">
<div class="s-title-01__container container">
<div class="s-title-01__row row">
<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 @@ -134,12 +132,10 @@
<nav aria-label="Fil d'ariane" class="c-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">

<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="topics_breadcrumb" href="/topics/">Espace d'échanges</a>

</li>

<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="documentation_breadcrumb" href="/documentation/">Documentation</a>
</li>

</ol>
</nav>
Expand All @@ -148,13 +144,13 @@




<section class="s-title-01 mt-lg-5">
<div class="s-title-01__container container">
<div class="s-title-01__row row">
<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 @@ -259,12 +255,10 @@
<nav aria-label="Fil d'ariane" class="c-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">

<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="topics_breadcrumb" href="/topics/">Espace d'échanges</a>

</li>

<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="documentation_breadcrumb" href="/documentation/">Documentation</a>
</li>

</ol>
</nav>
Expand All @@ -273,13 +267,13 @@




<section class="s-title-01 mt-lg-5">
<div class="s-title-01__container container">
<div class="s-title-01__row row">
<div class="s-title-01__col col-12">
<h1>Test Category</h1>


<h2 class="mt-3">Test short description</h2>
</div>
</div>
Expand Down
94 changes: 47 additions & 47 deletions lacommunaute/forum/tests/__snapshots__/tests_views.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<nav aria-label="Fil d'ariane" class="c-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">

<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="topics_breadcrumb" href="/topics/">Espace d'échanges</a>
</li>

<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="documentation_breadcrumb" href="/documentation/">Documentation</a>

</li>


</ol>
</nav>
Expand All @@ -20,18 +20,18 @@
<nav aria-label="Fil d'ariane" class="c-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">

<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="documentation_breadcrumb" href="/documentation/">Documentation</a>

</li>

<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="topics_breadcrumb" href="/topics/">Espace d'échanges</a>
</li>


<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/a-category-[PK of Forum]/">A Category</a>
</li>


<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/a-category-[PK of Forum]/">A Category</a>
</li>



</ol>
</nav>
Expand All @@ -42,12 +42,12 @@
<nav aria-label="Fil d'ariane" class="c-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">


<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="topics_breadcrumb" href="/topics/">Espace d'échanges</a>
</li>


</li>


</ol>
</nav>
Expand All @@ -58,25 +58,25 @@
<nav aria-label="Fil d'ariane" class="c-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">

<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="documentation_breadcrumb" href="/documentation/">Documentation</a>

</li>

<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="topics_breadcrumb" href="/topics/">Espace d'échanges</a>
</li>

<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/b-category-[PK of Forum]/">B Category</a>
</li>

<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/b-category-[PK of Forum]/">B Category</a>
</li>




<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/b-category-forum-[PK of Forum]/">B Category - Forum</a>
</li>


<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/b-category-forum-[PK of Forum]/">B Category - Forum</a>
</li>



</ol>
</nav>
'''
Expand All @@ -86,14 +86,14 @@
<nav aria-label="Fil d'ariane" class="c-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">


<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="topics_breadcrumb" href="/topics/">Espace d'échanges</a>
</li>



</li>




</ol>
</nav>
Expand All @@ -104,19 +104,19 @@
<nav aria-label="Fil d'ariane" class="c-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">


<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="topics_breadcrumb" href="/topics/">Espace d'échanges</a>
</li>

</li>


<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/b-forum-[PK of Forum]/">B Forum</a>
</li>


<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/b-forum-[PK of Forum]/">B Forum</a>
</li>



</ol>
</nav>
'''
Expand Down Expand Up @@ -174,12 +174,12 @@
<nav aria-label="Fil d'ariane" class="c-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">

<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="topics_breadcrumb" href="/topics/">Espace d'échanges</a>
</li>

<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="documentation_breadcrumb" href="/documentation/">Documentation</a>

</li>


</ol>
</nav>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,18 +200,18 @@
<nav aria-label="Fil d'ariane" class="c-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">

<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="topics_breadcrumb" href="/topics/">Espace d'échanges</a>

</li>




<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/forum-b-[PK of Forum]/">Forum B</a>
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="topics_breadcrumb" href="/topics/">Espace d'échanges</a>
</li>




<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/forum-b-[PK of Forum]/">Forum B</a>
</li>


</ol>
</nav>
Expand All @@ -222,12 +222,12 @@
<nav aria-label="Fil d'ariane" class="c-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">


<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="topics_breadcrumb" href="/topics/">Espace d'échanges</a>
</li>


</li>


</ol>
</nav>
Expand All @@ -238,23 +238,23 @@
<nav aria-label="Fil d'ariane" class="c-breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">Retourner vers</li>
<li class="breadcrumb-item">

<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="topics_breadcrumb" href="/topics/">Espace d'échanges</a>
</li>

<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="documentation_breadcrumb" href="/documentation/">Documentation</a>

<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/d-category-[PK of Forum]/">D Category</a>
</li>


</li>


<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/d-category-[PK of Forum]/">D Category</a>
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/d-category-forum-[PK of Forum]/">D Category - Forum</a>
</li>



<li class="breadcrumb-item">
<a class="matomo-event" data-matomo-action="view" data-matomo-category="engagement" data-matomo-option="forum" href="/forum/d-category-forum-[PK of Forum]/">D Category - Forum</a>
</li>

</ol>
</nav>
'''
Expand Down
35 changes: 24 additions & 11 deletions lacommunaute/templates/partials/breadcrumb.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,36 @@
<nav class="c-breadcrumb" aria-label="Fil d'ariane">
<ol class="breadcrumb">
<li class="breadcrumb-item">{% trans "Back to" %}</li>
<li class="breadcrumb-item">
{% if forum.is_in_documentation_area %}
{% if document %}
<li class="breadcrumb-item">
<a href="{% url 'documentation:category_list' %}" class="matomo-event" data-matomo-category="engagement" data-matomo-action="view" data-matomo-option="documentation_breadcrumb">{% trans "Documents" %}</a>
{% else %}
</li>
<li class="breadcrumb-item">
<a href="{% url 'documentation:category_detail' document.category.slug document.category.pk %}"
class="matomo-event"
data-matomo-category="engagement"
data-matomo-action="view"
data-matomo-option="document">{{ document.category.name }}</a>
</li>
{% elif forum %}
<li class="breadcrumb-item">
<a href="{% url 'forum_conversation_extension:topics' %}" class="matomo-event" data-matomo-category="engagement" data-matomo-action="view" data-matomo-option="topics_breadcrumb">{% trans "Discussion area" %}</a>
{% endif %}
</li>
{% for ancestor in forum.get_ancestors %}
{% if not ancestor.is_toplevel_discussion_area %}
</li>
{% for ancestor in forum.get_ancestors %}
{% if not ancestor.is_toplevel_discussion_area %}
<li class="breadcrumb-item">
<a href="{% url 'forum_extension:forum' ancestor.slug ancestor.id %}" class="matomo-event" data-matomo-category="engagement" data-matomo-action="view" data-matomo-option="forum">{{ ancestor.name }}</a>
</li>
{% endif %}
{% endfor %}
{% if topic and not forum.is_toplevel_discussion_area %}
<li class="breadcrumb-item">
<a href="{% url 'forum_extension:forum' ancestor.slug ancestor.id %}" class="matomo-event" data-matomo-category="engagement" data-matomo-action="view" data-matomo-option="forum">{{ ancestor.name }}</a>
<a href="{% url 'forum_extension:forum' forum.slug forum.id %}" class="matomo-event" data-matomo-category="engagement" data-matomo-action="view" data-matomo-option="forum">{{ forum.name }}</a>
</li>
{% endif %}
{% endfor %}
{% if topic and not forum.is_toplevel_discussion_area %}
{% else %}
<li class="breadcrumb-item">
<a href="{% url 'forum_extension:forum' forum.slug forum.id %}" class="matomo-event" data-matomo-category="engagement" data-matomo-action="view" data-matomo-option="forum">{{ forum.name }}</a>
<a href="{% url 'documentation:category_list' %}" class="matomo-event" data-matomo-category="engagement" data-matomo-action="view" data-matomo-option="documentation_breadcrumb">{% trans "Documents" %}</a>
</li>
{% endif %}
</ol>
Expand Down

0 comments on commit 1cbaca2

Please sign in to comment.