Commit eaba0d79 authored by Tim Wagner's avatar Tim Wagner
Browse files

[BUGFIX] First video in playlist is rendered twice if more videos exist

parent 3b39545e
......@@ -5,51 +5,73 @@
{debugOutput -> f:format.raw()}
</f:if>
<f:if condition="{response.kind} == 'youtube#playlistItemListResponse'">
<f:if condition="{response.kind} == 'youtube#playlistItemListResponse' && {feed -> f:count() > 0}">
<f:then>
<div class="sg-youtube-playlist">
<f:for each="{feed}" as="feedItem" iteration="feedIterator">
<f:if condition="{feedIterator.isFirst} && {feedIterator.total} > 1">
<f:if condition="{feed -> f:count()} == 1">
<f:then>
<ul class="sg-youtube">
<li class="sg-youtube-item-container sg-youtube-item-single">
<a class="sg-youtube-item sg-card-shadow" href="{feed.0.url}&list={settings.id}" data-disable-lightbox="{settings.disableLightbox}" data-disable-lightbox-mobile="{settings.disableLightboxMobile}">
<f:if condition="{feed.0.thumbnail}">
<div class="sg-youtube-image">
<img src="{feed.0.thumbnail}" alt="{feed.0.title}"/>
</div>
</f:if>
<f:if condition="{feed.0.title}">
<div class="sg-youtube-title">
<h3 class="h3">
<f:format.htmlentitiesDecode>{feed.0.title}</f:format.htmlentitiesDecode>
</h3>
</div>
</f:if>
</a>
</li>
</ul>
</f:then>
<f:else>
<div class="sg-youtube">
<div class="sg-youtube-item-container">
<a class="sg-youtube-item sg-card-shadow" href="{feedItem.url}&list={settings.id}" data-disable-lightbox="{settings.disableLightbox}" data-disable-lightbox-mobile="{settings.disableLightboxMobile}">
<f:if condition="{feedItem.thumbnail}">
<a class="sg-youtube-item sg-card-shadow" href="{feed.0.url}&list={settings.id}" data-disable-lightbox="{settings.disableLightbox}" data-disable-lightbox-mobile="{settings.disableLightboxMobile}">
<f:if condition="{feed.0.thumbnail}">
<div class="sg-youtube-image">
<img src="{feedItem.thumbnail}" alt="{feedItem.title}"/>
<img src="{feed.0.thumbnail}" alt="{feed.0.title}"/>
</div>
</f:if>
<f:if condition="{feedItem.title}">
<f:if condition="{feed.0.title}">
<div class="sg-youtube-title">
<h3 class="h3">
<f:format.htmlentitiesDecode>{feedItem.title}</f:format.htmlentitiesDecode>
<f:format.htmlentitiesDecode>{feed.0.title}</f:format.htmlentitiesDecode>
</h3>
</div>
</f:if>
</a>
</div>
</div>
</f:if>
</f:for>
<ul class="sg-youtube">
<f:for each="{feed}" as="feedItem" iteration="feedIterator">
<li class="sg-youtube-item-container{f:if(condition: '{feedIterator.total} < 2', then: ' sg-youtube-item-single', else: ' sg-youtube-item-list')}">
<a class="sg-youtube-item sg-card-shadow" href="{feedItem.url}&list={settings.id}" data-disable-lightbox="{settings.disableLightbox}" data-disable-lightbox-mobile="{settings.disableLightboxMobile}">
<f:if condition="{feedItem.thumbnail}">
<div class="sg-youtube-image">
<img src="{feedItem.thumbnail}" alt="{feedItem.title}"/>
</div>
</f:if>
<f:if condition="{feedItem.title}">
<div class="sg-youtube-title">
<h3 class="h3">
<f:format.htmlentitiesDecode>{feedItem.title}</f:format.htmlentitiesDecode>
</h3>
</div>
<ul class="sg-youtube">
<f:for each="{feed}" as="feedItem" iteration="feedIterator">
<f:if condition="!{feedIterator.isFirst}">
<li class="sg-youtube-item-container sg-youtube-item-list">
<a class="sg-youtube-item sg-card-shadow" href="{feedItem.url}&list={settings.id}" data-disable-lightbox="{settings.disableLightbox}" data-disable-lightbox-mobile="{settings.disableLightboxMobile}">
<f:if condition="{feedItem.thumbnail}">
<div class="sg-youtube-image">
<img src="{feedItem.thumbnail}" alt="{feedItem.title}"/>
</div>
</f:if>
<f:if condition="{feedItem.title}">
<div class="sg-youtube-title">
<h3 class="h3">
<f:format.htmlentitiesDecode>{feedItem.title}</f:format.htmlentitiesDecode>
</h3>
</div>
</f:if>
</a>
</li>
</f:if>
</a>
</li>
</f:for>
</ul>
</f:for>
</ul>
</f:else>
</f:if>
</div>
</f:then>
<f:else>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment