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 23fa3e6
Showing
11 changed files
with
1,050 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{% macro render_include_path(path) -%} | ||
{{ path.urlpath.split("/")[-1].split(".")[0]}} | ||
{%- endmacro %} | ||
|
||
{% macro render_attribute(attribute) -%} | ||
{{attribute.capitalize().replace("_", " ")}} | ||
{%- endmacro %} | ||
|
||
{% macro render_value(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(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 %} | ||
{{ value }} | ||
{% 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,56 @@ | ||
{% extends 'layouts/base.html.j2' %} | ||
{% import 'macros/cards.html.j2' as render with context %} | ||
|
||
{% block content %} | ||
<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(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> | ||
{% 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,52 @@ | ||
{% extends 'layouts/base.html.j2' %} | ||
{% import 'macros/cards.html.j2' as render with context %} | ||
|
||
{% block content %} | ||
<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(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(value,0)}} </td> | ||
</tr> | ||
{% endif %} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
{% endfor %} | ||
{% endblock %} |
Oops, something went wrong.