Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Dec 16, 2024
1 parent c2c5a66 commit bc46109
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 23 deletions.
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
"symfony/uid": "^5.4|^6.0|^7.0",
"symfony/ux-twig-component": "^2.21",
"symfony/validator": "^5.4|^6.0|^7.0",
"twig/extra-bundle": "^3.17",
"twig/html-extra": "^3.17",
"twig/twig": "^3.15"
},
"require-dev": {
Expand Down
13 changes: 2 additions & 11 deletions templates/components/ActionMenu/ActionList/Item.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,12 @@
renderLabelRaw = false,
icon = null,
url = null,
htmlAttributes = {},
%}

<li>
<a {{ attributes.defaults({class: 'dropdown-item', href: url}) }}>
<a {{ attributes.defaults({class: 'dropdown-item', href: url}|merge(htmlAttributes)) }}>
{%- if icon %}<twig:ea:Icon {{ ...attributes.nested('icon').defaults({name: icon}) }} /> {% endif -%}
{%- if label is not empty -%}<span {{ attributes.nested('label') }}>{{ renderLabelRaw ? label|raw : label }}</span>{%- endif -%}
</a>
</li>
{#
<li>
<a class="dropdown-item {{ action.cssClass }}"
href="{{ action.linkUrl }}"
{% for name, value in action.htmlAttributes %}{{ name }}="{{ (value.trans is defined ? value|trans : value)|e('html_attr') }}" {% endfor %}>
{%- if action.icon %}<twig:ea:Icon name="{{ action.icon }}" class="action-icon" /> {% endif -%}
{%- if action.label is not empty -%}<span class="action-label">{{ action.label|trans|raw }}</span>{%- endif -%}
</a>
</li>
#}
1 change: 1 addition & 0 deletions templates/crud/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@
<twig:ea:ActionMenu:ActionList:Item
class="{{ action.cssClass }}" url="{{ action.linkUrl }}"
icon="{{ action.icon }}" icon:class="action-icon"
htmlAttributes="{{ action.htmlAttributes }}"
label="{{ action.label|trans }}" label:class="action-label" renderLabelRaw />
{% endfor %}
</twig:ea:ActionMenu:ActionList>
Expand Down
8 changes: 4 additions & 4 deletions templates/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@
<twig:ea:ActionMenu:ActionList:Divider/>
{% else %}
<twig:ea:ActionMenu:ActionList:Item
label="{{ item.label|trans }}"
class="user-action {{ item.cssClass }}" icon="{{ item.icon }}"
url="{{ item.linkUrl }}" target="{{ item.linkTarget }}" rel="{{ item.linkRel }}"
referrerpolicy="origin-when-cross-origin"
label="{{ item.label|trans }}"
class="user-action {{ item.cssClass }}" icon="{{ item.icon }}"
url="{{ item.linkUrl }}" target="{{ item.linkTarget }}" rel="{{ item.linkRel }}"
referrerpolicy="origin-when-cross-origin" htmlAttributes="{{ item.htmlAttributes }}" />
/>
{% endif %}
{% endfor %}
Expand Down
10 changes: 6 additions & 4 deletions tests/PrettyUrlsTestApplication/src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\HttpKernel\Kernel as SymfonyKernel;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use Symfony\UX\TwigComponent\TwigComponentBundle;
use Twig\Extra\TwigExtraBundle\TwigExtraBundle;

final class Kernel extends SymfonyKernel
{
Expand All @@ -28,14 +29,15 @@ public function __construct()
public function registerBundles(): iterable
{
return [
new FrameworkBundle(),
new TwigBundle(),
new DebugBundle(),
new DoctrineBundle(),
new DoctrineFixturesBundle(),
new SecurityBundle(),
new DebugBundle(),
new EasyAdminBundle(),
new FrameworkBundle(),
new SecurityBundle(),
new TwigBundle(),
new TwigComponentBundle(),
new TwigExtraBundle(),
];
}

Expand Down
10 changes: 6 additions & 4 deletions tests/TestApplication/src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\HttpKernel\Kernel as SymfonyKernel;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use Symfony\UX\TwigComponent\TwigComponentBundle;
use Twig\Extra\TwigExtraBundle\TwigExtraBundle;

final class Kernel extends SymfonyKernel
{
Expand All @@ -28,14 +29,15 @@ public function __construct()
public function registerBundles(): iterable
{
return [
new FrameworkBundle(),
new TwigBundle(),
new DebugBundle(),
new DoctrineBundle(),
new DoctrineFixturesBundle(),
new SecurityBundle(),
new DebugBundle(),
new EasyAdminBundle(),
new FrameworkBundle(),
new SecurityBundle(),
new TwigBundle(),
new TwigComponentBundle(),
new TwigExtraBundle(),
];
}

Expand Down

0 comments on commit bc46109

Please sign in to comment.