Skip to content

Commit

Permalink
Ajout du breadcrumb (#913)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarchois authored Aug 8, 2024
1 parent 2a1ab14 commit 1a4d4aa
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion templates/common/breadcrumb.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</li>
{% else %}
<li>
<a class="fr-breadcrumb__link" href="{{ path(item.path) }}">{{ item.title }}</a>
<a class="fr-breadcrumb__link" href="{{ item.url is defined ? item.url : path(item.path) }}">{{ item.title }}</a>
</li>
{% endif %}
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion templates/organization/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{% block body %}
<section class="fr-container fr-py-5w" aria-labelledby="organization-list">
<h3 id="organization-list">{{ 'organization.list.title'|trans }}</h3>
<h2 id="organization-list">{{ 'organization.list.title'|trans }}</h2>
<div class="fr-grid-row fr-grid-row--gutters" data-testid="organization-list">
{% for organization in organizations %}
<div class="fr-col-12 fr-col-md-4 fr-col-lg-4" data-testid="organization-detail">
Expand Down
6 changes: 6 additions & 0 deletions templates/organization/user/form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
{% include 'organization/_menu.html.twig' with { organization } only %}
</div>
<div class="fr-col-12 fr-col-md-9">
{% include "common/breadcrumb.html.twig" with { items: [
{ title: 'user.myarea'|trans, path: 'app_organizations_list'},
{ title: organization.name, url: path('app_users_list', {uuid: organization.uuid}), generatedPath: true },
{ title: 'user.list.title'|trans, url: path('app_users_list', {uuid: organization.uuid}), generatedPath: true },
{ title: metaTitle },
]} %}
<h2 class="fr-mb-0">{{ metaTitle }}</h2>
<p class="fr-text--sm fr-x-text--uppercase">{{ organization.name }}</p>
{{ form_start(form) }}
Expand Down
5 changes: 5 additions & 0 deletions templates/organization/user/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
{% include 'organization/_menu.html.twig' with { organization } only %}
</div>
<div class="fr-col-12 fr-col-md-9">
{% include "common/breadcrumb.html.twig" with { items: [
{ title: 'user.myarea'|trans, path: 'app_organizations_list'},
{ title: organization.name, url: path('app_users_list', {uuid: organization.uuid}), generatedPath: true },
{ title: 'user.list.title'|trans },
]} %}
<div class="fr-grid-row">
<h2 id="user-list" class="fr-col fr-mb-0">{{ 'user.list.title'|trans }}</h2>
{% if is_granted(constant('App\\Infrastructure\\Security\\Voter\\OrganizationVoter::EDIT'), organization) %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function testIndex(): void

$this->assertResponseStatusCodeSame(200);
$this->assertSecurityHeaders();
$this->assertSame('Mes organisations', $crawler->filter('h3')->text());
$this->assertSame('Mes organisations', $crawler->filter('h2')->text());
$this->assertMetaTitle('Mes organisations - DiaLog', $crawler);

$organizations = $crawler->filter('[data-testid="organization-list"]');
Expand Down
4 changes: 4 additions & 0 deletions translations/messages.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2066,6 +2066,10 @@
<source>user.add.title</source>
<target>Ajouter un utilisateur</target>
</trans-unit>
<trans-unit id="user.myarea">
<source>user.myarea</source>
<target>Mon espace</target>
</trans-unit>
</body>
</file>
</xliff>

0 comments on commit 1a4d4aa

Please sign in to comment.