Use class_group instead of group in template

We generally refer to these groups as classes. class is a reserved name though, so have to use class_group instead, which is also the variable name used in the build script
This commit is contained in:
Peter Desmet 2017-10-12 12:28:17 -04:00
parent 20b9d8a0d0
commit 0d70d84d58
2 changed files with 15 additions and 15 deletions

View File

@ -251,7 +251,7 @@ class DwcDigester(object):
"""
data = {}
data["groups"] = self.template_data
data["class_groups"] = self.template_data
html = Template(file=html_template, searchList=[data])
index_page = open(html_output, "w")

View File

@ -47,9 +47,9 @@
<div class="col-md-3">
<nav id="sidebar" class="mb-4">
<ul class="nav flex-md-column nav-pills">
#for $group in $groups
#for $class_group in $class_groups
<li class="nav-item">
<a class="nav-link py-1" href="#$group.label">$group.label</a><!-- anchor to group -->
<a class="nav-link py-1" href="#$class_group.label">$class_group.label</a><!-- anchor to class_group -->
</li>
#end for
</ul>
@ -60,33 +60,33 @@
<h1>Darwin Core quick reference guide</h1>
<p class="lead">This page provides a list of all currently recommended terms of the Darwin Core standard. Categories such as <code>Occurrence</code>, <code>Event</code> correspond to Darwin Core classes, which group other terms. Convenient <a href="https://github.com/tdwg/dwc/tree/master/dist"> files of these terms</a> and <a href="https://github.com/tdwg/dwc/blob/master/vocabulary/term_versions.csv"> their full history</a> can be found in the <a href="https://github.com/tdwg/dwc">Darwin Core repository</a>.</p>
#for $group in $groups
<section id="$group.label" class="anchor mb-4"><!-- anchor to group -->
<h2>$group.label</h2>
#for $class_group in $class_groups
<section id="$class_group.label" class="anchor mb-4"><!-- anchor to class_group -->
<h2>$class_group.label</h2>
<div class="my-4">
#for $term in $group.terms
#for $term in $class_group.terms
<a class="btn btn-sm btn-outline-dark m-1" href="#$term.namespace:$term.label">$term.label</a><!-- link to term -->
#end for
</div>
#if $group.iri is not None
## The above will exclude the Record-level group
#if $class_group.iri is not None
## The above will exclude the Record-level class_group
<table class="table table-sm border mb-3">
<tbody>
<tr class="table-primary"><th colspan="2">$group.label <span class="badge badge-primary float-right">Class</span></th></tr>
<tr><td class="label">Identifier</td><td><a href="$group.iri">$group.iri</a></td></tr>
<tr><td class="label">Definition</td><td>$group.definition</td></tr>
<tr><td class="label">Comments</td><td>$group.comments</td></tr>
<tr class="table-primary"><th colspan="2">$class_group.label <span class="badge badge-primary float-right">Class</span></th></tr>
<tr><td class="label">Identifier</td><td><a href="$class_group.iri">$class_group.iri</a></td></tr>
<tr><td class="label">Definition</td><td>$class_group.definition</td></tr>
<tr><td class="label">Comments</td><td>$class_group.comments</td></tr>
</tbody>
</table>
#end if
#for $term in $group.terms
#for $term in $class_group.terms
<a id="$term.namespace:$term.label" class="anchor"></a><!-- anchor to term -->
<table class="table table-sm border mb-3">
<tbody>
<tr class="table-secondary"><th colspan="2">$term.label <span class="badge badge-secondary float-right">Property</span></th></tr>
<tr><td class="label">Identifier</td><td><a href="$group.iri">$term.iri</a></td></tr>
<tr><td class="label">Identifier</td><td><a href="$class_group.iri">$term.iri</a></td></tr>
<tr><td class="label">Definition</td><td>$term.definition</td></tr>
<tr><td class="label">Comments</td><td>$term.comments</td></tr>
</tbody>