mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
pass options in twig extension filter
This commit is contained in:
parent
232e71f46c
commit
06b3d63133
@ -50,15 +50,21 @@
|
|||||||
<li>
|
<li>
|
||||||
{{ m.download_button(document.object, document.title) }}
|
{{ m.download_button(document.object, document.title) }}
|
||||||
</li>
|
</li>
|
||||||
|
{% if chill_document_is_editable(document.object) %}
|
||||||
|
<li>
|
||||||
|
{{ document.object|chill_document_edit_button({
|
||||||
|
'changeIcon': 'fa-paragraph',
|
||||||
|
'changeClass': 'btn-update',
|
||||||
|
'noText': false
|
||||||
|
}) }}
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %}
|
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('accompanying_course_document_edit', {'id': document.id, 'course': accompanyingCourse.id}) }}"
|
<a href="{{ path('accompanying_course_document_edit', {'id': document.id, 'course': accompanyingCourse.id}) }}"
|
||||||
class="btn btn-edit" title="{{ 'Edit' | trans }}"></a>
|
class="btn btn-edit" title="{{ 'Edit' | trans }}"></a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if chill_document_is_editable(document.object) %}
|
|
||||||
<li>{{ document.object|chill_document_edit_button }}</li>
|
|
||||||
{% endif %}
|
|
||||||
{% set workflows_frame = chill_entity_workflow_list('Chill\\DocStoreBundle\\Entity\\AccompanyingCourseDocument', document.id) %}
|
{% set workflows_frame = chill_entity_workflow_list('Chill\\DocStoreBundle\\Entity\\AccompanyingCourseDocument', document.id) %}
|
||||||
{% if workflows_frame is not empty %}
|
{% if workflows_frame is not empty %}
|
||||||
<li>
|
<li>
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
{% set button = {
|
|
||||||
'changeIcon': 'fa-magic',
|
|
||||||
'changeClass': 'btn-primary'
|
|
||||||
} %}{#
|
|
||||||
'noText': false
|
|
||||||
#}
|
|
||||||
<span data-module="wopi-link"
|
<span data-module="wopi-link"
|
||||||
data-wopi-url="{{ path('chill_wopi_file_edit', {'fileId': document.uuid}) }}"
|
data-wopi-url="{{ path('chill_wopi_file_edit', {'fileId': document.uuid}) }}"
|
||||||
data-doc-type="{{ document.type|e('html_attr') }}"
|
data-doc-type="{{ document.type|e('html_attr') }}"
|
||||||
data-button="{{ button|json_encode }}"
|
data-button="{{ options|json_encode }}"
|
||||||
></span>
|
></span>
|
||||||
|
|
||||||
|
@ -20,10 +20,11 @@ class WopiEditTwigExtensionRuntime implements RuntimeExtensionInterface
|
|||||||
|
|
||||||
public const TEMPLATE = '@ChillDocStore/Button/wopi_edit_document.html.twig';
|
public const TEMPLATE = '@ChillDocStore/Button/wopi_edit_document.html.twig';
|
||||||
|
|
||||||
public function renderEditButton(Environment $environment, StoredObject $document): string
|
public function renderEditButton(Environment $environment, StoredObject $document, ?Array $options = null): string
|
||||||
{
|
{
|
||||||
return $environment->render(self::TEMPLATE, [
|
return $environment->render(self::TEMPLATE, [
|
||||||
'document' => $document
|
'document' => $document,
|
||||||
|
'options' => $options
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user