generated from MinBZK/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9106c7b
commit ea7763b
Showing
13 changed files
with
1,071 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{% macro render_include_path(path) -%} | ||
{{ path.urlpath.split("/")[-1].split(".")[0]}} | ||
{%- endmacro %} | ||
|
||
{% macro render_attribute(attribute) -%} | ||
{{attribute.capitalize().replace("_", " ")}} | ||
{%- endmacro %} | ||
|
||
{% macro render_value(key, value, depth) -%} | ||
{% if value.__class__.__name__ == 'dict'%} | ||
<div class="{% if depth == 1 %}margin-bottom-large{% endif%}"> | ||
{% for subkey, subvalue in value.items() %} | ||
<strong> {{render_attribute(subkey)}} </strong>: {{render_value(subkey, subvalue, depth+1)}} | ||
{% if not loop.last %}<br \>{% endif %} | ||
{% endfor %} | ||
</div> | ||
{% elif value.__class__.__name__ == 'list'%} | ||
<div style="margin-left: {{ depth * 10}}px"> | ||
{% for item in value %} | ||
{{render_value("", item, depth+1)}} | ||
{% endfor %} | ||
</div> | ||
{% elif value.__class__.__name__ == 'Data' %} | ||
{{ render_include_path(value) }} | ||
{% else %} | ||
{% if key == "uri" or key == "link" or key == "upl"%} | ||
<a class="rvo-link rvo-link--normal" href="{{value}}">{{value}}</a> | ||
{% elif key == "oin" %} | ||
<a class="rvo-link rvo-link--normal" href="{{value}}">https://oinregister.logius.nl/oin-register/{{value}}</a> | ||
{% elif key == "email" %} | ||
<a class="rvo-link rvo-link--normal" href="mailto:{{value}}">{{value}}</a> | ||
{% elif key == "urn" %} | ||
<a class="rvo-link rvo-link--normal" href="{{value}}">https://minbzk.github.io/instrument-registry/instruments/urn/{{value}}</a> | ||
{% else %} | ||
{{ value }} | ||
{% endif %} | ||
{% endif %} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{% extends 'layouts/base.html.j2' %} | ||
{% import 'macros/cards.html.j2' as render with context %} | ||
|
||
{% block content %} | ||
<div class="rvo-layout-column rvo-layout-gap--md"> | ||
<h2 class="utrecht-heading-2 rvo-heading--no-margins">Assessment card</h2> | ||
<span class="rvo-text"> Last updated 2 hours ago </span> | ||
|
||
<div class="rvo-table--responsive"> | ||
<table class="rvo-table"> | ||
<thead class="rvo-table-head"> | ||
<tr class="rvo-table-row"> | ||
<th scope="col" class="rvo-table-header">Attribute</th> | ||
<th scope="col" class="rvo-table-header">Value</th> | ||
</tr> | ||
</thead> | ||
{% for key, value in assessment_card.items() %} | ||
{% if key != "contents" %} | ||
<tbody class="rvo-table-body"> | ||
<tr class="rvo-table-row"> | ||
<td class="rvo-table-cell"><strong>{{key.capitalize().replace("_", " ")}}</strong></td> | ||
<td class="rvo-table-cell"> {{render.render_value(key, value,0)}} </td> | ||
</tr> | ||
{% endif %} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<h3 class="utrecht-heading-3">Content</h3> | ||
<div class="rvo-table--responsive"> | ||
<table class="rvo-table"> | ||
<thead class="rvo-table-head"> | ||
<tr class="rvo-table-row"> | ||
<th scope="col" class="rvo-table-header">Question</th> | ||
<th scope="col" class="rvo-table-header">Answer</th> | ||
</tr> | ||
</thead> | ||
{% for content in assessment_card["contents"]%} | ||
<tbody class="rvo-table-body"> | ||
<tr class="rvo-table-row"> | ||
<td class="rvo-table-cell"><strong>{{content["question"]}}</strong></td> | ||
<td class="rvo-table-cell"> | ||
{{content["answer"]}} | ||
{% set keys = ["urn", "remarks", "authors", "timestamp"] %} | ||
{% set metadata = {} %} | ||
{% for key in keys %} | ||
{% set _x=metadata.__setitem__(key, content[key])%} | ||
{% endfor %} | ||
{{ render.render_value("",metadata,0) }} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{% extends 'layouts/base.html.j2' %} | ||
{% import 'macros/cards.html.j2' as render with context %} | ||
|
||
{% block content %} | ||
<div class="rvo-layout-column rvo-layout-gap--md"> | ||
<h2 class="utrecht-heading-2 rvo-heading--no-margins">Model card</h2> | ||
<span class="rvo-text"> Last updated 2 hours ago </span> | ||
|
||
<div class="rvo-table--responsive"> | ||
<table class="rvo-table"> | ||
<thead class="rvo-table-head"> | ||
<tr class="rvo-table-row"> | ||
<th scope="col" class="rvo-table-header">Attribute</th> | ||
<th scope="col" class="rvo-table-header">Value</th> | ||
</tr> | ||
</thead> | ||
{% for key, value in model_card.items() %} | ||
{% if key != "model-index" %} | ||
<tbody class="rvo-table-body"> | ||
<tr class="rvo-table-row"> | ||
<td class="rvo-table-cell"><strong>{{key.capitalize().replace("_", " ")}}</strong></td> | ||
<td class="rvo-table-cell"> {{render.render_value(key, value,0)}} </td> | ||
</tr> | ||
{% endif %} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
{% for model in model_card["model-index"] %} | ||
<h3 class="utrecht-heading-3">{{model["name"]}}</h3> | ||
<div class="rvo-table--responsive"> | ||
<table class="rvo-table"> | ||
<thead class="rvo-table-head"> | ||
<tr class="rvo-table-row"> | ||
<th scope="col" class="rvo-table-header">Attribute</th> | ||
<th scope="col" class="rvo-table-header">Value</th> | ||
</tr> | ||
</thead> | ||
{% for key, value in model.items() %} | ||
{% if key != "name" %} | ||
<tbody class="rvo-table-body"> | ||
<tr class="rvo-table-row"> | ||
<td class="rvo-table-cell"><strong>{{key.capitalize().replace("_", " ")}}</strong></td> | ||
<td class="rvo-table-cell"> {{render.render_value(key, value,0)}} </td> | ||
</tr> | ||
{% endif %} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
{% endfor %} | ||
{% endblock %} |
Oops, something went wrong.