Skip to content

Commit

Permalink
load document from file table in modale suivi #1485
Browse files Browse the repository at this point in the history
  • Loading branch information
sfinx13 committed Jul 20, 2023
1 parent a03d909 commit 9584e41
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions templates/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@
editor.ui.registry.addMenuButton('mybutton', {
text: 'Partager un document',
fetch: function (callback) {
var items = [
{% for doc in signalement.documents %}
let items = [
{% for doc in signalement.files|filter(doc => doc.fileType == 'document') %}
{
type: 'menuitem',
text: '{{ doc.titre }}',
text: '{{ doc.title }}',
onAction: function () {
editor.insertContent('&nbsp;<a href="{{ asset('_up/'~doc.file) }}?t=___TOKEN___" class="fr-btn fr-fi-eye-fill fr-btn--icon-left" title="Afficher le document" target="_blank">Consulter "{{ doc.titre }}"</a>');
editor.insertContent('&nbsp;<a href="{{ asset('_up/'~doc.filename) }}?t=___TOKEN___" class="fr-btn fr-fi-eye-fill fr-btn--icon-left" title="Afficher le document" target="_blank">Consulter "{{ doc.title }}"</a>');
}
},
{% endfor %}
Expand Down Expand Up @@ -173,4 +173,4 @@
</script>
{% block javascripts %}{% endblock %}
</body>
</html>
</html>

0 comments on commit 9584e41

Please sign in to comment.