Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added combined card-accordion component #165

Merged
merged 2 commits into from
Jun 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions templates/embeds/collapsible.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{% extends '@Tabler/embeds/card.html.twig' %}
{% set collapsed = false %}
kevinpapst marked this conversation as resolved.
Show resolved Hide resolved
{% set fullsize = true %}
kevinpapst marked this conversation as resolved.
Show resolved Hide resolved
{% block box_title %}{% endblock %}
{% block box_body %}
{% set _id = id ?? tabler_unique_id('collapsible_') %}
{% set _open = open ?? false %}
{% set _id_collapse = _id ~ '_item' %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put that on top?
(part of me want that 😄)


<div id="{{ _id }}" class="accordion accordion-flush{% block class %} {% endblock %}">
<div class="accordion-item {% block item_class %} {% endblock %}">
<div class="accordion-header" id="{{ _id }}_heading">
<button class="accordion-button {% if not _open %}collapsed{% endif %}"
type="button" data-bs-toggle="collapse" data-bs-target="#{{ _id_collapse }}"
aria-expanded="true">
{% block title %}{% endblock %}
</button>
</div>

<div id="{{ _id_collapse }}" class="accordion-collapse collapse {% if _open %}show{% endif %}">
<div class="accordion-body {% block body_class %}pt-0{% endblock %}">
{% block body %}{% endblock %}
</div>
</div>
</div>
</div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that the accordion component is scary and not easy to manipulate/use.
But isn't it more "Maintainers" friendly to use it?
The less duplicate code we have to maintain, the happier we are?

{% endblock %}