aboutsummaryrefslogtreecommitdiff
path: root/src/ee/order/templates
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/order/templates')
-rw-r--r--src/ee/order/templates/order.rst.j234
1 files changed, 28 insertions, 6 deletions
diff --git a/src/ee/order/templates/order.rst.j2 b/src/ee/order/templates/order.rst.j2
index 8dad217..b46600c 100644
--- a/src/ee/order/templates/order.rst.j2
+++ b/src/ee/order/templates/order.rst.j2
@@ -1,8 +1,13 @@
-{% set order_part_uri_idx = order_parts.index("partUri") -%}
+{% set order_part_uri_idx = order_parts.index("uri") -%}
Order
=====
-Has unresolved parts: {{ "yes" if has_unresolved_parts else "no" }}.
+{% if unresolved_parts %}
+Unresolved parts:
+{% for op in unresolved_parts %}
+* `{{ op.ref }} <ref-{{ op.ref }}_>`_
+{%- endfor %}
+{%- endif %}
Parts for Order
===============
@@ -11,13 +16,30 @@ Parts for Order
{{ op.ref | subsection }}
{% if op.available_from|length == 0 %}
-Part not resolved.
+Could not find part.
+
+{% if op.part.get_mpns()|length == 1 -%}
+MPN: {{ op.part.get_mpns()[0].valueProp }}
+{% elif op.part.get_mpns()|length > 1 -%}
+{%- for mpn in op.part.get_mpns() %}
+MPNs:
+* {{ mpn.valueProp }}
+{%- endfor %}
+{%- endif -%}
+{% if op.part.get_spns()|length == 1 -%}
+SPN: {{ op.part.get_spns()[0].valueProp }}
+{% elif op.part.get_spns()|length > 1 -%}
+{%- for spn in op.part.get_spns() %}
+SPNs:
+* {{ spn.valueProp }}
+{%- endfor %}
+{%- endif -%}
+
{% elif op.available_from|length == 1 %}
-{%- set from=op.available_from[0] %}
-{%- set part=from[1] %}
+{%- set part=op.available_from.values()|first %}
{%- set pn=part|first_pn %}
{%- set spn=part|first_spn %}
-Selected supplier: {{ from[0] }}{{ (", pn: " + pn.valueProp) if pn else "" }}{{ (", spn: " + spn.valueProp) if spn else "" }}.
+Selected supplier: {{ part.supplier }}{{ (", pn: " + pn.valueProp) if pn else "" }}{{ (", spn: " + spn.valueProp) if spn else "" }}.
Part: `{{pn.valueProp}} <part-{{pn.valueProp}}_>`_
{% else %}
MANY