Skip to content

Commit

Permalink
changed observedProperties to macro
Browse files Browse the repository at this point in the history
  • Loading branch information
phtrceh committed Nov 7, 2024
1 parent f75968a commit 9de22f0
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions templates/html/document/_tags.ftlh
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,30 @@
</#if>

<#if observedProperty?has_content>
<@displayObservedProperties observedProperty />
</#if>

<#macro displayObservedProperties op>
<dt>Observed properties</dt>
<dd>
<#list observedProperty?sort_by("value") as item>
<#assign opLabel="unknown">
<#if item.title?has_content>
<#assign opLabel=item.title?trim>
<#elseif item.value?has_content>
<#assign opLabel=item.value?trim>
</#if>
<#list op?sort_by("value") as item>
<#local opLabel="unknown">
<#if item.title?has_content>
<#local opLabel=item.title?trim>
<#elseif item.value?has_content>
<#local opLabel=item.value?trim>
</#if>

<#if item.uri?has_content>
<span><abbr title="${item.uri?trim}">${opLabel}</abbr></span>
<a href="${item.uri?trim}" target="_blank" rel="noopener noreferrer" class="externalVocabularyLink"><sup class="fa-solid fa-xs fa-arrow-up-right-from-square"></sup></a>
<#else>
<span>${opLabel}</span>
</#if>
<#sep><br></#sep>
</#list>
</#if>
<#if item.uri?has_content>
<span><abbr title="${item.uri?trim}">${opLabel}</abbr></span>
<a href="${item.uri?trim}" target="_blank" rel="noopener noreferrer" class="externalVocabularyLink"><sup class="fa-solid fa-xs fa-arrow-up-right-from-square"></sup></a>
<#else>
<span>${opLabel}</span>
</#if>
<#sep><br></#sep>
</#list>
</dd>
</#macro>

<#macro keywordList list listTitle="Keywords" commaseparated=false>
<dt>${listTitle}</dt>
Expand Down

0 comments on commit 9de22f0

Please sign in to comment.