From fa85d46af0b91477cf354947df628af0dc0d2800 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 28 Mar 2019 16:38:50 +0100 Subject: ee.xsd: o Renaming to . o Adding on , removing from . A part can have exactly one part. create-order: o Creating anonymous part objects, with two references, one schematic reference and one part-uri reference to the selected part. o Redoing how the order is calculated with the new ObjDb structure. ee.part.Part: o Absorbing bom_file_utils into Part. Much better wrapper object around the xml goop. --- src/ee/order/templates/order.rst.j2 | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 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 bc382a2..8dad217 100644 --- a/src/ee/order/templates/order.rst.j2 +++ b/src/ee/order/templates/order.rst.j2 @@ -1,3 +1,4 @@ +{% set order_part_uri_idx = order_parts.index("partUri") -%} Order ===== @@ -6,6 +7,8 @@ Has unresolved parts: {{ "yes" if has_unresolved_parts else "no" }}. Parts for Order =============== {% for op in order_parts %} +.. _ref-{{ op.ref }}: + {{ op.ref | subsection }} {% if op.available_from|length == 0 %} Part not resolved. @@ -23,30 +26,39 @@ MANY Part details ============ -{% for supplier, parts in parts_by_supplier.items() %} +{%- set part_by_uri=supplier_parts.index("uri") %} +{% for supplier, partUris in order_parts.index("supplier,part").items() %} {{ ("From " + supplier) | subsection }} -{% for part in parts %} +{% for partUri in partUris %} +{%- set part=part_by_uri.get_single(partUri) %} {%- 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 }} -{#- +=========== === +{%- if part.description %} +Description {{ part.description }} +{%- endif %} +MPN {{ pn.value }} +SPN {{ spn.value }} +Used by: {% for op in order_part_uri_idx.get(part.uriProp) %}`{{ op.ref }} `_{{ ", " if not loop.last }}{% endfor %} +=========== === +{# Facts ..... {% for f in part.facts.fact %} f={{f}} {% endfor %} -#} -Media -..... +#} +Documentation +............. -{% for l in links %} +{% for l in part.get_links() %} {%- if l.relationProp == "http://purl.org/ee/link-relation#documentation" %} * `{{ l.title }} <{{ l.url }}>`__ {%- endif %} -- cgit v1.2.3