mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix adding quick menus to list_with_period.html.twig
- update twig namespaces - move twig file within Resources
This commit is contained in:
parent
d60ba3ecb2
commit
cc0030c1cd
@ -1,11 +1,11 @@
|
||||
{% if menus|length > 0 %}
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle btn btn-sm btn-create"
|
||||
<a class="dropdown-toggle btn btn-sm btn-outline-primary"
|
||||
href="#"
|
||||
role="button"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
{{ 'Create'|trans }}
|
||||
<i class="fa fa-flash"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu">
|
||||
{% for menu in menus %}
|
@ -11,8 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Routing;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Twig\Environment;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
@ -20,10 +18,8 @@ use Twig\TwigFunction;
|
||||
/**
|
||||
* Add the filter 'chill_menu'.
|
||||
*/
|
||||
class MenuTwig extends AbstractExtension implements ContainerAwareInterface
|
||||
class MenuTwig extends AbstractExtension
|
||||
{
|
||||
private ?ContainerInterface $container = null;
|
||||
|
||||
/**
|
||||
* the default parameters for chillMenu.
|
||||
*
|
||||
@ -86,9 +82,4 @@ class MenuTwig extends AbstractExtension implements ContainerAwareInterface
|
||||
{
|
||||
return 'chill_menu';
|
||||
}
|
||||
|
||||
public function setContainer(?ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
}
|
||||
|
@ -20,9 +20,5 @@ services:
|
||||
|
||||
chill.main.twig.chill_menu:
|
||||
class: Chill\MainBundle\Routing\MenuTwig
|
||||
arguments:
|
||||
- "@chill.main.menu_composer"
|
||||
calls:
|
||||
- [setContainer, ["@service_container"]]
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
|
@ -1,3 +1,10 @@
|
||||
{% macro button_person_before(person) %}
|
||||
{{ chill_menu('person_quick_menu', {
|
||||
'layout': '@ChillMain/Menu/quick_menu.html.twig',
|
||||
'args' : { 'person': person }
|
||||
}) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro button_person_after(person) %}
|
||||
{% set household = person.getCurrentHousehold %}
|
||||
{% if household is not null and is_granted('CHILL_PERSON_HOUSEHOLD_SEE', household) %}
|
||||
@ -9,12 +16,6 @@
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{{ chill_menu('person_quick_menu', {
|
||||
'layout': '@ChillMainBundle/Menu/quick_menu.html.twig',
|
||||
'args' : { 'person': person }
|
||||
}) }}
|
||||
|
||||
{% endmacro %}
|
||||
|
||||
{% macro accompanying_period(acp, person) %}
|
||||
@ -190,6 +191,11 @@
|
||||
{% endif %}
|
||||
|
||||
<ul class="record_actions">
|
||||
{{ chill_menu('accompanying_course_quick_menu', {
|
||||
'layout': '@ChillMain/Menu/quick_menu.html.twig',
|
||||
'args' : { 'accompanying-course': acp }
|
||||
}) }}
|
||||
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': acp.id }) }}"
|
||||
class="btn btn-sm btn-primary"
|
||||
@ -197,12 +203,7 @@
|
||||
><i class="fa fa-random fa-fw"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{{ chill_menu('accompanying_course_quick_menu', {
|
||||
'layout': '@ChillMainBundle/Menu/quick_menu.html.twig',
|
||||
'args' : { 'accompanying-course': acp }
|
||||
}) }}
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@ -259,7 +260,7 @@
|
||||
'addAltNames': true,
|
||||
'addCenter': true,
|
||||
'address_multiline': false,
|
||||
'customButtons': { 'after': _self.button_person_after(person) }
|
||||
'customButtons': { 'after': _self.button_person_after(person), 'before': _self.button_person_before((person)) }
|
||||
}) }}
|
||||
|
||||
{#- 'acps' is for AcCompanyingPeriodS #}
|
||||
|
Loading…
x
Reference in New Issue
Block a user