From 0f5c67ef095228cde6a8a19b06f110d3fd14a0ad Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Wed, 15 Mar 2023 22:37:47 +0100 Subject: [PATCH] html visualization: also allow screenshots and references on targetproduct pages --- codemeta/templates/softwaresourcecode.html | 7 +++- codemeta/templates/targetproduct.html | 40 ++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/codemeta/templates/softwaresourcecode.html b/codemeta/templates/softwaresourcecode.html index aedac02..92c2f87 100644 --- a/codemeta/templates/softwaresourcecode.html +++ b/codemeta/templates/softwaresourcecode.html @@ -64,12 +64,17 @@

Screenshots

{% for url, res2 in get_triples(g, sscres, SDO.screenshot, SDO.url) %} - + {% if g.value(res2, SDO.caption) %} + screenshot: {{ g.value(res2, SDO.caption) }} + {% else %} + screenshot + {% endif %} {% endfor %}
{% endif %} {% if g.value(sscres, CODEMETA.referencePublication) or g.value(sscres, SDO.citation) %} +

References

diff --git a/codemeta/templates/targetproduct.html b/codemeta/templates/targetproduct.html index 08c5270..1c6f5fe 100644 --- a/codemeta/templates/targetproduct.html +++ b/codemeta/templates/targetproduct.html @@ -44,6 +44,46 @@

{{ g.value(targetres, STYPE.executableName) {% endif %} + {% if g.value(targetres, SDO.screenshot) %} +

Screenshots

+ +
+ {% for url, res2 in get_triples(g, targetres, SDO.screenshot, SDO.url) %} + {% if g.value(res2, SDO.caption) %} + screenshot: {{ g.value(res2, SDO.caption) }} + {% else %} + screenshot + {% endif %} + {% endfor %} +
+ {% endif %} + + {% if g.value(targetres, CODEMETA.referencePublication) or g.value(targetres, SDO.citation) %} + +

References

+ +
+
    + {% for title, ref in get_triples(g, targetres, CODEMETA.referencePublication, contextgraph=contextgraph) %} + {% if ref %} +
  • {% include 'reference.html' %}
  • + {% else %} +
  • {{ title }}
  • + {% endif %} + {% endfor %} + + {% for title, ref in get_triples(g, targetres, SDO.citation, contextgraph=contextgraph) %} + {% if ref %} +
  • {% include 'reference.html' %}
  • + {% else %} +
  • {{ title }}
  • + {% endif %} + {% endfor %} +
+
+ + {% endif %} +
Type