Skip to content

Commit

Permalink
html visualization: also allow screenshots and references on targetpr…
Browse files Browse the repository at this point in the history
…oduct pages
  • Loading branch information
proycon committed Mar 15, 2023
1 parent 1583ac0 commit 0f5c67e
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
7 changes: 6 additions & 1 deletion codemeta/templates/softwaresourcecode.html
Expand Up @@ -64,12 +64,17 @@ <h3>Screenshots</h3>

<div class="screenshots">
{% for url, res2 in get_triples(g, sscres, SDO.screenshot, SDO.url) %}
<img src="{{ url }}" title="{{ g.value(res2, SDO.caption) }}" />
{% if g.value(res2, SDO.caption) %}
<img src="{{ url }}" alt="screenshot: {{ g.value(res2, SDO.caption) }}" title="{{ g.value(res2, SDO.caption) }}" />
{% else %}
<img src="{{ url }}" alt="screenshot" />
{% endif %}
{% endfor %}
</div>
{% endif %}

{% if g.value(sscres, CODEMETA.referencePublication) or g.value(sscres, SDO.citation) %}

<h3>References</h3>

<div class="references">
Expand Down
40 changes: 40 additions & 0 deletions codemeta/templates/targetproduct.html
Expand Up @@ -44,6 +44,46 @@ <h2 property="stype:executableName">{{ g.value(targetres, STYPE.executableName)

{% endif %}

{% if g.value(targetres, SDO.screenshot) %}
<h3>Screenshots</h3>

<div class="screenshots">
{% for url, res2 in get_triples(g, targetres, SDO.screenshot, SDO.url) %}
{% if g.value(res2, SDO.caption) %}
<img src="{{ url }}" alt="screenshot: {{ g.value(res2, SDO.caption) }}" title="{{ g.value(res2, SDO.caption) }}" />
{% else %}
<img src="{{ url }}" alt="screenshot" />
{% endif %}
{% endfor %}
</div>
{% endif %}

{% if g.value(targetres, CODEMETA.referencePublication) or g.value(targetres, SDO.citation) %}

<h3>References</h3>

<div class="references">
<ul>
{% for title, ref in get_triples(g, targetres, CODEMETA.referencePublication, contextgraph=contextgraph) %}
{% if ref %}
<li>{% include 'reference.html' %}</li>
{% else %}
<li>{{ title }}</li>
{% endif %}
{% endfor %}

{% for title, ref in get_triples(g, targetres, SDO.citation, contextgraph=contextgraph) %}
{% if ref %}
<li>{% include 'reference.html' %}</li>
{% else %}
<li>{{ title }}</li>
{% endif %}
{% endfor %}
</ul>
</div>

{% endif %}

<div class="properties">
<dl>
<dt class="type">Type</dt>
Expand Down

0 comments on commit 0f5c67e

Please sign in to comment.