Skip to content

Commit

Permalink
feat(table): check view.route and add button visibilty
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxes3 committed Oct 7, 2024
1 parent 671846d commit df9fcc9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Resources/views/tailwind_2/_header.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@

{% macro add_button(content, view, isOnShow) %}
{% set createUrl = content.createUrl(view.data) %}
{% if createUrl and (content.addVoterAttribute is null or is_granted(content.addVoterAttribute, view.data)) %}
{% if createUrl
and (content.addVoterAttribute is null or is_granted(content.addVoterAttribute, view.data))
and view.route in content.option(constant('araise\\CrudBundle\\Content\\RelationContent::OPT_ADD_VISIBILITY'))
%}


{% set additionalClass = (not isOnShow) ? (content.option('attr')['class'] ?? '') : '' %}
Expand Down

0 comments on commit df9fcc9

Please sign in to comment.