From 689508e07dba890fff8d1cd06e0029eca1c30994 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 23 Mar 2019 07:29:49 +0100 Subject: xsd: o Adding list on . For media, datasheets etc. digikey: o Parsing out media. PartDb: o starting on a more generic object db with indexes. order: o Using the new object db for building data while resolving parts. o Creating a report from the order. --- src/ee/order/templates/order.rst.j2 | 60 ++++++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 7 deletions(-) (limited to 'src/ee/order/templates') diff --git a/src/ee/order/templates/order.rst.j2 b/src/ee/order/templates/order.rst.j2 index ea1dbdf..6616167 100644 --- a/src/ee/order/templates/order.rst.j2 +++ b/src/ee/order/templates/order.rst.j2 @@ -1,9 +1,55 @@ -Messages -======== -{% for o, messages in messages_by_object %} -{{ o | subsection }} -{% for m in messages %} -* {{ m.text }} -{% endfor %} +Order +===== + +Has unresolved parts: {{ "yes" if has_unresolved_parts else "no" }}. + +Parts for Order +=============== +{% for op in order_parts %} +{{ op.ref | subsection }} +{% if op.available_from|length == 0 %} +Part not resolved. +{% elif op.available_from|length == 1 %} +{%- set from=op.available_from[0] %} +{%- set part=from[1] %} +{%- 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 "" }}. +Part: part-{{pn.valueProp}}_ +{% else %} +MANY +{% endif %} +{%- endfor %} + +Part details +============ +{% for supplier, parts in parts_by_supplier.items() %} +{{ ("From " + supplier) | subsection }} +{% for part in parts %} +{%- set pn=part|first_pn %} +{%- set spn=part|first_spn %} +{%- set title=pn.valueProp if pn else (spn.valueProp if spn else "???") %} +{%- set links=part.linksProp.link %} +.. _part-{{title}}: + +{{ title|subsubsection }} +{#- + +"Facts" +....... + +{% for f in part.facts.fact %} +f={{f}} {% endfor %} +#} + +"Media" +....... +{% for l in links %} +{%- if l.relationProp == "http://purl.org/ee/link-relation#documentation" %} +* `{{ l.title }} <{{ l.url }}>`__ +{%- endif %} +{%- endfor %} +{% endfor %} +{% endfor %} -- cgit v1.2.3