Skip to content

Commit

Permalink
badge sur sous listes
Browse files Browse the repository at this point in the history
  • Loading branch information
sebheitzmann committed Oct 27, 2023
1 parent 6e42475 commit 9b32ca5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/Resources/views/brick/sublist_items/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
<div class="card-header py-1">
{% if tab is defined %}
{% include("@LleCrudit/brick/list_items/_pager.html.twig") with { tab: tab } %}
<script>
window.addEventListener('load', function () {
var badge = document.getElementById("{{ tab.id }}-badge");
badge.textContent ="{{ view.config.datasource_params.count }}";
});
</script>
{% else %}
{% include("@LleCrudit/brick/list_items/_pager.html.twig") %}
{% endif %}
Expand Down
6 changes: 4 additions & 2 deletions src/Resources/views/brick/tab/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
) %}
{% set active = true %}
active
{% endif %}"
{% endif %} position-relative"
data-bs-toggle="tab"
href="#{{ tab.id }}"
role="tab" type="button">{{ tab.label|trans(domain=view.config.translation_domain) }}</a>
role="tab" type="button">{{ tab.label|trans(domain=view.config.translation_domain) }}
<span id="{{ tab.id }}-badge" class="position-absolute top-0 start-200 translate-middle badge rounded-pill bg-primary"></span>
</a>
</li>
{% endif %}
{% endfor %}
Expand Down

0 comments on commit 9b32ca5

Please sign in to comment.