diff --git a/templates/common_macros.html.j2 b/templates/common_macros.html.j2 index f47952e..a6c44f3 100644 --- a/templates/common_macros.html.j2 +++ b/templates/common_macros.html.j2 @@ -66,8 +66,12 @@ {% macro description(obj) %} {% if obj.description %} - {{ obj.description | safe }} +

{{ obj.description | safe }}

{% else %}

No description available.

{% endif %} +{% endmacro %} + +{% macro typed_name(object) %} +{{ object.__class__.__name__ }} {{ object.name }} {% endmacro %} \ No newline at end of file diff --git a/templates/logical-component.html.j2 b/templates/logical-component.html.j2 index bc8ebbd..b7893ab 100644 --- a/templates/logical-component.html.j2 +++ b/templates/logical-component.html.j2 @@ -2,18 +2,10 @@ Copyright DB InfraGO AG and contributors SPDX-License-Identifier: Apache-2.0 #} -{% from 'common_macros.html.j2' import show_other_attributes %} - -{% macro description(obj) %} - {% if obj.description %} -

{{ obj.description }}

- {% else %} -

No description available.

- {% endif %} -{% endmacro %} +{% from 'common_macros.html.j2' import show_other_attributes, description %}

{{ object.name }}

-{{ description(object) }} +{{ description(object) | safe }}

Logical Component Context

diff --git a/templates/operational-activity.html.j2 b/templates/operational-activity.html.j2 new file mode 100644 index 0000000..fce863d --- /dev/null +++ b/templates/operational-activity.html.j2 @@ -0,0 +1,31 @@ +{# + Copyright DB InfraGO AG and contributors + SPDX-License-Identifier: Apache-2.0 +#} +{% from 'common_macros.html.j2' import show_other_attributes, description %} + +

{{ object.name }}

+{{ description(object) | safe }} + +{% if object.owner %} +

This activity is performed by + {{ object.owner.__class__.__name__}} + {{ object.owner.name }}. +

+ {%%} +{% else %} +

No entity is responsible for performing this activity at the moment.

+{% endif %} + + +

Operational Activity Context

+ +

+The figure below provides an overview of the interactions between the activity of interest and other activities. +

+ +{{ object.context_diagram.as_svg|safe }} + +

Other properties of "{{ object.name }}"

+{% set excluded = ["name", "context_diagram", "xtype", "parent"] %} +{{ show_other_attributes(object, excluded) | safe }} \ No newline at end of file diff --git a/templates/operational-activity.yaml b/templates/operational-activity.yaml new file mode 100644 index 0000000..262dcd7 --- /dev/null +++ b/templates/operational-activity.yaml @@ -0,0 +1,11 @@ +# Copyright DB InfraGO AG and contributors +# SPDX-License-Identifier: Apache-2.0 + +template: operational-activity.html.j2 +name: Operational Activity +description: Specifies an operational activity. +category: oa +variable: + name: object + type: OperationalActivity + below: oa diff --git a/templates/operational-entity.html.j2 b/templates/operational-entity.html.j2 index 0638bf9..a0f3b86 100644 --- a/templates/operational-entity.html.j2 +++ b/templates/operational-entity.html.j2 @@ -1,12 +1,12 @@ -{% from 'common_macros.html.j2' import show_other_attributes, description, render_reqs_by_type %} +{% from 'common_macros.html.j2' import show_other_attributes, description, render_reqs_by_type, typed_name %}

{{ object.name }}

{{ description(object) | safe }} -

Parent: {{object.parent._short_html_()}}

+

Parent: {{ typed_name(object.parent) | safe }}

{% if object.capabilities %} -

{{ object.name }} is involved in the following operational capabilities: +

{{ object.name }} {% if object.is_human %}(human){% endif %} is involved in the following operational capabilities: {%- for cap in object.capabilities -%} {{ cap.name }}; {%- endfor -%} @@ -14,8 +14,8 @@ {% endif %} {% if object.state_machines %} -

State Machines

-

The following state machines describe the entity modes and states:

+

States and Modes

+

The following state machines describe modes and states of {{ object.name }}:

{% for stm in object.state_machines %}

{{ stm.name }}

{% if stm.regions | length > 1 %} @@ -28,8 +28,8 @@ {% elif stm.regions | length == 1 %} {% set region = stm.regions | first %} {% else %} @@ -39,18 +39,26 @@ {% endif %} {% if object.activities %} -

Operational Activities

-

{{object.name}} is responsible for the following operational activities:

+

Activities

+

{{object.name}} is responsible for the following operational activities:

{% endif %} -{% set filtered = ["description", "xtype", "entities", "owner", "parent", "parts", "requirements", "state_machines", "activities", "capabilities", "name"]%} +{% if object.realizing_system_components %} +

Realizations of {{ object.name }}

+

{{object.name}} is realized by the following system components:

+