[AttachmentToNote][Attachment] Add title getter to Attachment

This commit is contained in:
2021-08-12 03:43:11 +01:00
committed by Hugo Sales
parent 5fd91bf3a2
commit d076781c74
8 changed files with 50 additions and 8 deletions

View File

@@ -78,7 +78,11 @@ class VideoEncoder extends Plugin
*/
public function onViewAttachmentVideo(array $vars, array &$res): bool
{
$res[] = Formatting::twigRenderFile('videoEncoder/videoEncoderView.html.twig', ['attachment' => $vars['attachment'], 'thumbnail_parameters' => $vars['thumbnail_parameters']]);
$res[] = Formatting::twigRenderFile('videoEncoder/videoEncoderView.html.twig',
['attachment' => $vars['attachment'],
'thumbnail_parameters' => $vars['thumbnail_parameters'],
'note' => $vars['note'],
]);
return Event::stop;
}

View File

@@ -3,7 +3,7 @@
<video class="u-video" src="{{ path('attachment_view', {'id': attachment.getId()}) }}" controls poster="{{ path('attachment_thumbnail', thumbnail_parameters) }}">
</video>
<figcaption><a
href="{{ path('attachment_show', {'id': attachment.getId()}) }}">{{ attachment.getFilename() }}</a>
href="{{ path('attachment_show', {'id': attachment.getId()}) }}">{{ attachment.getBestTitle(note) }}</a>
</figcaption>
</figure>
</div>