-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: additional template examples for testing
- Loading branch information
Showing
7 changed files
with
175 additions
and
86 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{# | ||
Copyright DB InfraGO AG and contributors | ||
SPDX-License-Identifier: Apache-2.0 | ||
#} | ||
|
||
{% from 'common_macros.html.j2' import show_other_attributes, linked_name, linked_name_with_icon, description, display_property_label %} | ||
|
||
{% macro properties_table(props, obj) %} | ||
{% for property in props %} | ||
{{ display_property_label(obj, property) | safe }} | ||
<div style="margin-left: 20px;"> | ||
{% if property.kind != "UNSET" %} | ||
<p>KIND: {{ property.kind }}</p> | ||
{% endif %} | ||
{{ description(property) | safe}} | ||
</div> | ||
<hr> | ||
{% endfor %} | ||
{% endmacro %} | ||
|
||
<p>Parent: <a href="{{ object.parent | make_href }}">{{ object.parent.name }}</a></p> | ||
{% if object.description %} | ||
<p>{{ object.description }}</p> | ||
{% else %} | ||
<p style="color:red">No description available.</p> | ||
{% endif %} | ||
|
||
{% set props = [] %} | ||
{% if object.super %} | ||
{% set props = props | list + object.super.properties | list %} | ||
{% endif %} | ||
{% set props = props + object.owned_properties | list %} | ||
|
||
<span style="font-weight: bold;font-size: 12pt;line-height: 1.5;">Properties</span> | ||
<br> | ||
{% if props %} | ||
<p>The object owns the properties listed below; We use the following format to describe property: name : type [min .. max (instances of type)] or [ fixed number]; if no multiplicity is shown assume its 1 (single instance).</p> | ||
{{ properties_table(props, object) | safe }} | ||
{% else %} | ||
<p style="color:red">No properties are owned by this object.</p> | ||
{% endif %} |
This file was deleted.
Oops, something went wrong.
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,37 @@ | ||
{# | ||
Copyright DB InfraGO AG and contributors | ||
SPDX-License-Identifier: Apache-2.0 | ||
#} | ||
|
||
{% from 'common_macros.html.j2' import show_other_attributes, description, typed_name, linked_name, linked_name_with_icon, display_property_label %} | ||
|
||
{% macro render_usage(object) %} | ||
<span style="font-weight: bold;font-size: 12pt;line-height: 1.5;">Usage</span> | ||
{% if object.exchanges %} | ||
<p>The exchange item "{{ object.name }}" is produced and used across the model in the following cases:</p> | ||
<ul> | ||
{%- for exchange in object.exchanges -%} | ||
{%- set src = exchange.source.owner.owner if exchange.source.owner.owner else None -%} | ||
{%- set tgt = exchange.target.owner.owner if exchange.target.owner.owner else None -%} | ||
<li> | ||
{{ linked_name_with_icon(exchange) | safe }} | ||
, produced by {{ linked_name_with_icon(exchange.source.owner) | safe }} of {{ linked_name_with_icon(src) | safe if src else "Unassigned" }} | ||
and consumed by {{ linked_name_with_icon(exchange.target.owner) | safe }} of {{ linked_name_with_icon(tgt) | safe if tgt else "Unassigned" }}</li> | ||
{%- endfor -%} | ||
</ul> | ||
{% else %} | ||
<p style="color: red;">The exchange item "{{ object.name }}" is not used in any exchanges.</p> | ||
{% endif %} | ||
{% endmacro %} | ||
|
||
{{ description(object) | safe }} | ||
|
||
{% if object.elements %} | ||
<span style="font-weight: bold;font-size: 12pt;line-height: 1.5;">Composition</span> | ||
<p>The exchange item "{{ object.name }}" is composed of the following elements:</p> | ||
<ul> | ||
{%- for element in object.elements -%} | ||
<li>{{ display_property_label(object, element) | safe }}</li> | ||
{%- endfor -%} | ||
</ul> | ||
{% endif %} |
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,24 @@ | ||
{# | ||
Copyright DB InfraGO AG and contributors | ||
SPDX-License-Identifier: Apache-2.0 | ||
#} | ||
|
||
{% from 'common_macros.html.j2' import show_other_attributes, description, typed_name, linked_name, linked_name_with_icon, display_property_label %} | ||
|
||
{%- set source_function = object.source.owner -%} | ||
{%- set target_function = object.target.owner -%} | ||
{%- set source = source_function.owner -%} | ||
{%- set target = target_function.owner -%} | ||
The {{ linked_name(source) | safe }} shall provide {{ linked_name_with_icon(object) | safe }} to {{ linked_name_with_icon(target) | safe }} so that the {{ linked_name_with_icon(target) | safe }} could {{ linked_name_with_icon(target_function)|safe }}. | ||
{% if object.exchange_items %} | ||
{% if object.exchange_items | length > 1 %} | ||
<p>{{ object.name }} is further specified via the following Exchange Items:</p> | ||
<ul> | ||
{% for item in object.exchange_items %} | ||
<li>{{ linked_name_with_icon(item) | safe }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% else %} | ||
<p>This interaction is further specified via {{ linked_name_with_icon(object.exchange_items[0]) | safe}} Exchange Item</p> | ||
{% endif %} | ||
{% endif %} |
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,2 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: Apache-2.0 |
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