Improved document structure

This commit is contained in:
Georgy Litvinov 2021-03-03 20:46:02 +01:00
parent bc426ec4a1
commit 6617262a81

View file

@ -53,9 +53,9 @@
</#macro> </#macro>
<#macro arrangeDocumentParts > <#macro arrangeDocumentParts >
<div class="articleParts" style="display:block;"> <div class="complexDocument articleParts" style="display:block;">
<#assign lastLevel = 0 >
<#list paths as order> <#list paths as order>
<div class = "articleExcerpt">
<#-- ${order.path} --> <#-- ${order.path} -->
<#list excerpts as excerptProperties> <#list excerpts as excerptProperties>
<#if order.elenphExcerpt?has_content && excerptProperties.elenphExcerpt == order.elenphExcerpt> <#if order.elenphExcerpt?has_content && excerptProperties.elenphExcerpt == order.elenphExcerpt>
@ -65,22 +65,55 @@
<#assign bibliographyCounter = excerptProperties.bibliographyCounter > <#assign bibliographyCounter = excerptProperties.bibliographyCounter >
</#if> </#if>
</#list> </#list>
<@startDocumentPart order.level?number lastLevel/>
<#if excerptText?? && excerptTextName?? && excerptTextName?has_content && excerptText?has_content> <#if excerptText?? && excerptTextName?? && excerptTextName?has_content && excerptText?has_content>
<button type="button" style="border:none;padding: 18px;width: 100%; text-align:left;" class="collapsible">${excerptTextName}</button> <div class="htmlExcerpt" style="list-style:none;">
<div class="autoExpand htmlExcerpt" style="list-style:none; display:none;">
${excerptText} ${excerptText}
<@arrangeSources works worksCounter?number order.elenphExcerpt /> <@arrangeSources works worksCounter?number order.elenphExcerpt />
<@arrangeLiterature bibliography bibliographyCounter?number order.elenphExcerpt /> <@arrangeLiterature bibliography bibliographyCounter?number order.elenphExcerpt />
</div> </div>
</#if> </#if>
</div> <#assign lastLevel = order.level?number >
</#list> </#list>
<@endDocumentPart lastLevel />
</div> </div>
<@arrangeSources works works?size /> <@arrangeSources works works?size />
<@arrangeLiterature bibliography bibliography?size /> <@arrangeLiterature bibliography bibliography?size />
</#macro> </#macro>
<#macro startDocumentPart newLevel lastLevel=0 >
<#assign depth = newLevel - lastLevel >
<#if depth == 0>
<@closeDocPart 1 />
<@openDocPart 1 />
<#elseif depth &gt; 0>
<@openDocPart depth />
<#else >
<@closeDocPart -depth+1 />
<@openDocPart 1 />
</#if>
</#macro>
<#macro endDocumentPart lastLevel newLevel=0>
<#assign depth = lastLevel - newLevel >
<#if depth &gt; 0>
<@closeDocPart depth />
</#if>
</#macro>
<#macro closeDocPart count>
<#list 1..count as x>
</div>
</#list>
</#macro>
<#macro openDocPart count>
<#list 1..count as x>
<button type="button" style="border:none;padding: 18px;width: 100%; text-align:left;" class="collapsible">${excerptTextName}</button>
<div class = "documentPart autoExpand articleExcerpt" style="display:block;">
</#list>
</#macro>
<#macro arrangeSources sources counter filter="none"> <#macro arrangeSources sources counter filter="none">
<#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>