Skip to content

Commit

Permalink
Merge branch 'Sylius:2.0' into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bunnyshellcloud authored Nov 27, 2024
2 parents 2189522 + 6707762 commit cb55159
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{% set resource_id = hookable_metadata.context.resource.id %}
{% set resource_name = hookable_metadata.context.metadata.name %}
{% set url = 'sylius_admin_' ~ resource_name ~ '_update' %}
{% set configuration = hookable_metadata.context.configuration %}
{% set update_route_name = configuration.vars.update.route.name|default(configuration.getRouteName('update')) %}

<a class="btn" href="{{ path(url, {'id': resource_id}) }}" {{ sylius_test_html_attribute('edit-' ~ resource_name) }}>
{{ ux_icon('tabler:pencil') }}
{{ 'sylius.ui.edit'|trans }}
</a>
{% if sylius_route_exists(update_route_name) %}
{% set resource_id = hookable_metadata.context.resource.id %}
{% set resource_name = hookable_metadata.context.metadata.name %}

<a class="btn" href="{{ path(update_route_name, {'id': resource_id}) }}" {{ sylius_test_html_attribute('edit-' ~ resource_name) }}>
{{ ux_icon('tabler:pencil') }}
{{ 'sylius.ui.edit'|trans }}
</a>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
{% if sylius_route_exists(show_route_name) %}
{% set resource_id = hookable_metadata.context.resource.id %}
{% set resource_name = hookable_metadata.context.metadata.name %}
{% set url = 'sylius_admin_' ~ resource_name ~ '_show' %}

<a class="btn" href="{{ path(url, {'id': resource_id}) }}" {{ sylius_test_html_attribute('show-' ~ resource_name) }}>
<a class="btn" href="{{ path(show_route_name, {'id': resource_id}) }}" {{ sylius_test_html_attribute('show-' ~ resource_name) }}>
{{ ux_icon('tabler:eye') }}
{{ 'sylius.ui.show'|trans }}
</a>
Expand Down

0 comments on commit cb55159

Please sign in to comment.