<div class="page-renders"
     id="document-previews"
     tal:switch="here/content_type"
     i18n:domain="ploneintranet"
>

  <tal:case case="string:text/x-uri-video">
    <video controls
           poster="${python: preview_url if has_img else None}"
           preload="${python: 'none' if has_img else 'metadata'}"
           tal:define="
             has_img here/image|nothing;
             preview_url string:${here/absolute_url}/@@images/image/large;
           "
    >
      <source src="${here/remoteUrl}" />
    </video>
  </tal:case>

  <tal:case tal:case="string:text/x-uri-youtube">
    <div class="youtube-player">
      <img class="placeholder-image"
           alt=""
           src="${here/portal_url}/++theme++ploneintranet.theme/generated/assets/quaive/placeholders/placeholder-youtube.png"
      />
      <iframe allowfullscreen="true"
              frameborder="0"
              src="${view/youtube_url}"
              type="text/html"
      ></iframe>
    </div>
  </tal:case>


  <tal:default case="default">
    <p i18n:translate="">
    You are about to enter
      <tal:link i18n:name="URL">${context/@@link_redirect_view/absolute_target_url|context/remoteUrl|nothing}</tal:link>.
    </p>

    <p>
      <a class="pat-button default central-cta icon-link-ext"
         href="${context/@@link_redirect_view/absolute_target_url|context/remoteUrl|nothing}"
         i18n:translate=""
      >Open this site</a>
    </p>
  </tal:default>

</div>
