Commit b72fe332 authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch '290-error-after-download-as-html-is-selected' into 'master'

Resolve "Error after Download as HTML is selected"

Closes #290

See merge request genesys-pgr/genesys-server!163
parents 263b4a5a 6f56750b
<#macro isPublished published what>
<#if published>
<#else>
<div class="alert not-published"><b>Note:</b> This ${what} is not published.</div><#lt>
</#if>
</#macro>
<#assign vocabprinted = { "dummy":true } />
<#macro printVocabulary vocabulary>
<#compress>
**Note:** This descriptor uses the **${vocabulary.title}** controlled vocabulary
<#if vocabulary.publisher??>
published by **${vocabulary.publisher}**
<#else>
maintained by **${vocabulary.owner.name}**
</#if>.
</#compress>
<#if vocabprinted[vocabulary.uuid]??>
<#else>
${vocabulary.description!}<#lt>
<#assign vocabprinted = vocabprinted + { vocabulary.uuid:true } />
</#if>
</#macro>
<#macro printDescriptor descriptor>
# ${descriptor.title} <#if descriptor.uom??>[${descriptor.uom}]</#if><#lt>
<@isPublished published=descriptor.published what="descriptor" />
<#if descriptor.description??>
${descriptor.description}<#lt>
<#else>
> No description.<#lt>
</#if>
<#list descriptor.terms>
<#compress>
|Code|Term|Description|
|---|---|---|
<#items as term>
|**${term.code}**|${term.title}|${term.description!}|
</#items>
</#compress>
</#list>
<#if descriptor.vocabulary??>
<@printVocabulary vocabulary=descriptor.vocabulary />
</#if>
</#macro>
<div class="documenttitle">
${descriptorList.title} <#lt>
<div><small>
${descriptorList.versionTag}<br />
<#if descriptorList.publisher??>
**${descriptorList.publisher}** <#lt>
<#else>
${descriptorList.owner.name} <#lt>
</#if>
</small></div>
</div>
${descriptorList.description!}
<@isPublished published=descriptorList.published what="descriptor list" />
Version: ${descriptorList.versionTag} <#lt>
<#if descriptorList.publisher??>
Published by: **${descriptorList.publisher}** <#lt>
<#else>
Maintained by: ${descriptorList.owner.name} <#lt>
</#if>
Last modified: ${descriptorList.lastModifiedDate?date} <#lt>
Date registered: ${descriptorList.createdDate?date} <#lt>
Record: ${descriptorList.uuid} v${descriptorList.version} <#lt>
<#list descriptorList.descriptors>
<#items as descriptor>
<@printDescriptor descriptor=descriptor />
</#items>
<#else>
> The descriptor list does not declare any descriptors.
</#list>
<!DOCTYPE html>
<html>
<head>
<title>${title}</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes" />
<meta name="author" content="${author!'Genesys <helpdesk@genesys-pgr.org>'}" />
<style>
html {
font-size: 10pt;
font-family: Arial;
}
.disclaimer {
text-align: center;
color: Red;
font-size: 1.5rem;
margin: 0 0 2rem 0;
}
.documenttitle {
text-align: center;
font-size: 2rem;
}
.documenttitle small {
font-size: 1rem;
font-weight: bold;
}
h1 { font-size: 1.2rem; margin: 1.4rem 0 0.6rem; }
h2 { font-size: 1.2rem; margin: 1.2rem 0 0.6rem; }
h3 { font-size: 1.1rem; margin: 1rem 0 0.5rem; }
h4 { font-size: 1rem; margin: 0.8rem 0 0.4rem; }
pre { font-size: 0.8rem; }
body {
counter-reset: h1counter;
}
footer {
margin-top: 2rem;
text-align: center;
font-size: .8rem;
color: #a0a0a0;
}
blockquote {
border-left: .3rem solid gray;
margin: .2rem;
padding: .1rem 1rem;
}
table {
}
table th, table td {
text-align: left;
font-size: 0.9rem;
padding: .2rem .5rem;
}
h1:before {
content: counter(h1counter) ".\0000a0\0000a0";
counter-increment: h1counter;
counter-reset: h2counter;
}
h2:before {
content: counter(h1counter) "." counter(h2counter) ".\0000a0\0000a0";
counter-increment: h2counter;
counter-reset: h3counter;
}
h3:before {
content: counter(h1counter) "." counter(h2counter) "." counter(h3counter) ".\0000a0\0000a0";
counter-increment: h3counter;
}
div.alert.not-published {
color: Red;
margin: .3rem 0;
padding: .2rem 0;
}
</style>
</head>
<body>
<div class="disclaimer">
For internal use only. Do not distribute.
</div>
${html}
<footer>
Generated ${.now} from Genesys Catalog data.
</footer>
</body>
</html>
......@@ -23,6 +23,7 @@
<mime-type>text/html</mime-type>
<mapping path="/html/*" exclude="true" />
<mapping path="/api/*" exclude="true" />
<mapping path="/swagger-ui.html*" exclude="true" />
<mapping path="/swagger-resources*" exclude="true" />
<mapping path="/webjars/*" exclude="true" />
......
Markdown is supported
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