Remove sequential duplicates in literature and sources lists

This commit is contained in:
Georgy Litvinov 2021-03-18 12:52:17 +01:00
parent eee56d606f
commit 7f106d949b

View file

@ -126,8 +126,10 @@
<#if sources?? && sources?has_content && counter &gt; 0> <#if sources?? && sources?has_content && counter &gt; 0>
<button type="button" class="collapsible" style="border: none; color: #8B4513; padding: 18px;width: 100%;text-align:left; background-color: #ffffff; background-image: url(${urls.base}/themes/iph/images/book_icon.png); background-repeat: no-repeat; background-position: left center;">Источники</button> <button type="button" class="collapsible" style="border: none; color: #8B4513; padding: 18px;width: 100%;text-align:left; background-color: #ffffff; background-image: url(${urls.base}/themes/iph/images/book_icon.png); background-repeat: no-repeat; background-position: left center;">Источники</button>
<div class="autoExpand documentPart works" id="anchor-${identifier}-sources" style="display:block;"> <div class="autoExpand documentPart works" id="anchor-${identifier}-sources" style="display:block;">
<#assign lastSource = ""/>
<#list sources as source> <#list sources as source>
<#if filter == "none" || source.excerpt == filter > <#if filter == "none" && lastSource != source.works || source.excerpt == filter >
<#assign lastSource = source.works/>
<div class="work" style="display:list-item;list-style-image:url(${urls.base}/themes/iph/images/bullet_icon.png); font-style: italic; font-family: PT Serif;"> <div class="work" style="display:list-item;list-style-image:url(${urls.base}/themes/iph/images/bullet_icon.png); font-style: italic; font-family: PT Serif;">
<p> ${source.works} </p> <p> ${source.works} </p>
</div> </div>
@ -141,8 +143,10 @@
<#if literature?? && literature?has_content && counter &gt; 0> <#if literature?? && literature?has_content && counter &gt; 0>
<button type="button" class="collapsible" style="border:none; color: #8B4513; padding: 18px;width: 100%; text-align: left; background-color: #ffffff; background-image: url(${urls.base}/themes/iph/images/book_icon.png); background-repeat: no-repeat; background-position: left center;">Литература</button> <button type="button" class="collapsible" style="border:none; color: #8B4513; padding: 18px;width: 100%; text-align: left; background-color: #ffffff; background-image: url(${urls.base}/themes/iph/images/book_icon.png); background-repeat: no-repeat; background-position: left center;">Литература</button>
<div class="autoExpand documentPart bibliography" id="anchor-${identifier}-literature" style="display:block;"> <div class="autoExpand documentPart bibliography" id="anchor-${identifier}-literature" style="display:block;">
<#assign lastLiterature = ""/>
<#list literature as literatureItem> <#list literature as literatureItem>
<#if filter == "none" || literatureItem.excerpt == filter > <#if filter == "none" && lastLiterature != literatureItem.bibliography || literatureItem.excerpt == filter >
<#assign lastLiterature = literatureItem.bibliography/>
<div class="bibliography_entry" style="display:list-item;list-style-image:url(${urls.base}/themes/iph/images/bullet_icon.png); font-style: italic; font-family: PT Serif;"> <div class="bibliography_entry" style="display:list-item;list-style-image:url(${urls.base}/themes/iph/images/bullet_icon.png); font-style: italic; font-family: PT Serif;">
<p> ${literatureItem.bibliography} </p> <p> ${literatureItem.bibliography} </p>
</div> </div>