{#---------------------------------UML----------------------------------------#}
{#
Generate a help page for a entity.
Input:
    topic: properties defining the entity
    properties: all properties of the wiki.
Output: Generates uml diagram representing the usage of the entity in the wiki.
#}
{#---------------------------------Import-------------------------------------#}
{% from 'macros/utils.jinja' import render_entity %}
{#-------------------------------Template-------------------------------------#}
<uml>
title {{ topic.name }}

note as {{ topic.name }}Note
{{  topic.documentation }}
end note
class {{ topic.name }} {
{%  for property in Property.get_primitive_properties(topic.name,topic.properties) -%}
  {{ property.type.replace("Special:Types/","") }}: {{ property.label }}
{% endfor -%}
}
{{ topic.name }}Note .. {{ topic.name }}
{# Set outgoing edges #}
{%-  for edge in UML.get_outgoing_edges(topic.name,topic.properties) %}
  "{{ edge.source }}" "{{ edge.source_cardinality }}" --> "{{ edge.target_cardinality }}" "{{ edge.target }}" : "{{ edge.property.name }}"
{%- endfor -%}
{# Set incoming edges #}
{%  for edge in UML.get_incoming_edges(topic.name,topic.properties) %}
  "{{ edge.target }}" "{{ edge.target_cardinality }}" <-- "{{ edge.source_cardinality }}" "{{ edge.source }}" : "{{ edge.property.name }}"
{%- endfor %}

skinparam note {
  BackGroundColor #FFFFFF
  FontSize 12
  ArrowColor #FF8000
  BorderColor #FF8000
  FontColor black
  FontName Technical
}
skinparam component {
  BackGroundColor #FFFFFF
  FontSize 12
  ArrowColor #FF8000
  BorderColor #FF8000
  FontColor black
  FontName Technical
}
skinparam package {
  BackGroundColor #FFFFFF
  FontSize 12
  ArrowColor #FF8000
  BorderColor #FF8000
  FontColor black
  FontName Technical
}
skinparam usecase {
  BackGroundColor #FFFFFF
  FontSize 12
  ArrowColor #FF8000
  BorderColor #FF8000
  FontColor black
  FontName Technical
}
skinparam activity {
  BackGroundColor #FFFFFF
  FontSize 12
  ArrowColor #FF8000
  BorderColor #FF8000
  FontColor black
  FontName Technical
}
skinparam classAttribute {
  BackGroundColor #FFFFFF
  FontSize 12
  ArrowColor #FF8000
  BorderColor #FF8000
  FontColor black
  FontName Technical
}
skinparam interface {
  BackGroundColor #FFFFFF
  FontSize 12
  ArrowColor #FF8000
  BorderColor #FF8000
  FontColor black
  FontName Technical
}
skinparam class {
  BackGroundColor #FFFFFF
  FontSize 12
  ArrowColor #FF8000
  BorderColor #FF8000
  FontColor black
  FontName Technical
}
skinparam object {
  BackGroundColor #FFFFFF
  FontSize 12
  ArrowColor #FF8000
  BorderColor #FF8000
  FontColor black
  FontName Technical
}
hide Circle
' end of skinparams '
</uml>