Updates for templates

This commit is contained in:
Georgy Litvinov 2020-08-03 17:30:00 +02:00
parent 102de0c3fd
commit 9e1df433c9
2 changed files with 23 additions and 8 deletions

View file

@ -125,12 +125,17 @@
</div>
</#if>
</#if>
<#assign htmlExcerpt = propertyGroups.pullProperty("https://iph.ras.ru/text_structures#htmlExcerpt")!>
<#if htmlExcerpt.statements?has_content && htmlExcerpt.type == "data">
<div class="htmlExcerpt" style="list-style:none;">
<@p.dataPropertyList htmlExcerpt editable />
<#-- object property -->
</div>
<#if htmlExcerpt?has_content >
<#if htmlExcerpt.statements?has_content && htmlExcerpt.type == "data">
<div class="htmlExcerpt" style="list-style:none;">
<@p.dataPropertyList htmlExcerpt editable />
<#-- object property -->
</div>
<#else>
<div class="label">Текст отрывка: <@p.addLink htmlExcerpt editable /> <@p.verboseDisplay htmlExcerpt /> </div>
</#if>
</#if>
<#assign works = propertyGroups.pullProperty("https://iph.ras.ru/text_structures#works")!>

View file

@ -2,7 +2,7 @@
<#if !rubric.parentUri??>
<#assign childs = rubric.childs?number>
<button type="button" style="border:none;padding: 15px;text-align:left; width:100%;" class="collapsible">
<#if childs &gt; 0>+</#if><a style="padding-left:15px;" href="individual?uri=${rubric.uri?url}">${rubric.name}</a></button>
<@openButton childs=childs/><a style="padding-left:15px;" href="individual?uri=${rubric.uri?url}">${rubric.name}</a></button>
<div class="rubricContents" style="display:none;">
<#if (childs &gt; 0) >
<@nestedRubrics allrubrics=rubrics parentUri=rubric.uri deep=10 level=1 />
@ -20,22 +20,32 @@
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.display === "block") {
if (content.style.display === "block") {
content.style.display = "none";
$(this).children('.collapsibleSign').text('+');
} else {
content.style.display = "block";
$(this).children('.collapsibleSign').text('');
}
});
}
</script>
<#macro openButton childs>
<#if childs &gt; 0>
<div class="collapsibleSign" style="display:inline-block;width:10px;">+</div>
<#else>
<div style="display:inline-block;width:10px;"></div>
</#if>
</#macro>
<#macro nestedRubrics allrubrics parentUri deep level>
<#assign count = 0>
<#list allrubrics as innerRubric>
<#if innerRubric.parentUri?? && innerRubric.parentUri == parentUri>
<#assign childs = innerRubric.childs?number>
<#assign count = count + 1 >
<button type="button" style="border:none;padding: 15px 0px 15px ${15+15*level}px;width: 100%; text-align:left;" class="collapsible"><#if childs &gt; 0>+</#if><a style="padding-left:15px;" href="individual?uri=${innerRubric.uri?url}">${innerRubric.name}</a></button>
<button type="button" style="border:none;padding: 15px 0px 15px ${15+15*level}px;width: 100%; text-align:left;" class="collapsible"><@openButton childs=childs /><a style="padding-left:15px;" href="individual?uri=${innerRubric.uri?url}">${innerRubric.name}</a></button>
<div class="rubricContents" style="display:none;">
<#if (deep &gt; 1) && (childs &gt; 0)>
<@nestedRubrics allrubrics=rubrics parentUri=innerRubric.uri deep=deep-1 level=level+1 />