aboutsummaryrefslogtreecommitdiff
path: root/src/ee/order/templates
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-03-28 16:38:50 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2019-03-28 16:43:14 +0100
commitfa85d46af0b91477cf354947df628af0dc0d2800 (patch)
treeb18b775d232560f57eaeb3f43d0861b98201d4ef /src/ee/order/templates
parent52401b170d8f1c9deaa153acca76e7d6060a06df (diff)
downloadee-python-fa85d46af0b91477cf354947df628af0dc0d2800.tar.gz
ee-python-fa85d46af0b91477cf354947df628af0dc0d2800.tar.bz2
ee-python-fa85d46af0b91477cf354947df628af0dc0d2800.tar.xz
ee-python-fa85d46af0b91477cf354947df628af0dc0d2800.zip
ee.xsd:
o Renaming <part-uri> to <part-reference>. o Adding <supplier> on <part>, removing from <supplier-part-number>. 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.
Diffstat (limited to 'src/ee/order/templates')
-rw-r--r--src/ee/order/templates/order.rst.j228
1 files changed, 20 insertions, 8 deletions
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 }} <ref-{{ 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 %}