{# # Copyright 2006 - 2015 TubePress LLC (http://tubepress.com) # # This file is part of TubePress (http://tubepress.com) # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. #} {# The following block prints out each attribute label (e.g. Ratings, Views, Comment Count, etc). #} {% block metaLabelDt %}
{%- if (attributeName == 'authorDisplayName') -%} {{ 'by'|trans }} {%- endif -%} {%- if (attributeLabels[attributeName] is defined) and (attributeName not in ['authorDisplayName'] ) -%} {{ attributeLabels[attributeName]|trans }} {%- endif -%}
{% endblock %}{# end block "metaLabel" #} {#The following
prints out each attribute value. #} {% block metaValueDd %}
{% spaceless %} {# The title gets special treatment because we want users to be able to click on it to start the video. #} {%- if attributeName == 'title' -%} {% block metaValueTitle %} {% set anchorContent %} {{- mediaItem.title|length > 35 ? mediaItem.title|slice(0, 35) ~ ' ...' : mediaItem.title -}} {% endset %} {% include 'gallery/players/fragments/invoking_anchor.html.twig'%} {% endblock %} {%- endif -%} {# Are we showing the URL for this video? If so, let's wrap it in an anchor and change the text. #} {%- if attributeName == 'homeUrl' -%} {%- block metaValueHomeUrl -%} URL {%- endblock -%} {%- endif -%} {# Do we have an author URL? If so, let's make it an anchor. #} {%- if attributeName == 'authorDisplayName' -%} {% block metaValueAuthorDisplayName %} {%- if mediaItem.authorUrl is defined -%} {{ mediaItem.authorDisplayName }} {%- else -%} {{ mediaItem.authorDisplayName }} {%- endif -%} {% endblock %} {%- endif -%} {%- if attributeName == 'viewCount' -%} {{- mediaItem.viewCount }} {{ 'views'|trans -}} {%- endif -%} {%- if attributeName == 'description' -%} {% block metaValueDescription %} {{- mediaItem.description|raw -}} {% endblock %} {%- endif -%} {# Print out the attribute value. #} {%- if attributeName not in ['title', 'homeUrl', 'authorDisplayName', 'description', 'viewCount'] -%} {% block metaValueSimple %} {{- attribute(mediaItem, attributeName) -}} {% endblock %} {%- endif -%} {% endspaceless %}
{% endblock %}{# end block "metaValue" #}