Skip to content

Commit

Permalink
Merge pull request #2760 from insiders/media-info
Browse files Browse the repository at this point in the history
[MediaBundle] Add width and height to media show
  • Loading branch information
acrobat committed Sep 22, 2020
2 parents be2ea70 + faf5232 commit f78d8dc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Expand Up @@ -28,6 +28,8 @@ media:
mediainfo:
name: Name
contenttype: Content-type
width: Width
height: Height
createdat: Added
updatedat: Updated
downloadlink: Download link
Expand Down
13 changes: 13 additions & 0 deletions src/Kunstmaan/MediaBundle/Resources/views/Media/show.html.twig
Expand Up @@ -116,6 +116,19 @@
<dd>{{ media.name }}</dd>
<dt>{{ 'media.media.mediainfo.contenttype'|trans }}:</dt>
<dd>{{ media.contentType }}</dd>

{% set originalWidth = media.metadata.original_width|default %}
{% if originalWidth %}
<dt>{{ 'media.media.mediainfo.width'|trans }}:</dt>
<dd>{{ originalWidth }}px</dd>
{% endif %}

{% set originalHeight = media.metadata.original_height|default %}
{% if originalHeight %}
<dt>{{ 'media.media.mediainfo.height'|trans }}:</dt>
<dd>{{ originalHeight }}px</dd>
{% endif %}

<dt>{{ 'media.media.mediainfo.createdat'|trans }}:</dt>
<dd>{{ media.createdat|date|escape }}</dd>
<dt>{{ 'media.media.mediainfo.updatedat'|trans }}:</dt>
Expand Down

0 comments on commit f78d8dc

Please sign in to comment.