/
related.html
22 lines (22 loc) · 1.17 KB
/
related.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{% with item = item or pkg.related|first %}
<section class="module module-narrow module-shallow related{{ " related-empty" if not item }}">
<h2 class="module-heading"><i class="icon-medium icon-picture"></i> Related <a class="action" href="{{ h.url_for(controller='related', action='new', id=pkg.name) }}">Add Related</a></h2>
<div class="module-content media">
{% if item %}
{% with url = h.url_for(controller='related', action='list', id=pkg.name) %}
<a class="image logo" href="{{ url }}">
<img src="{{ item.image_url or "http://placehold.it/200x125" }}" width="200" height="125" />
</a>
<div class="media-content">
<h3 class="media-heading"><a href="{{ url }}">{{ item.title }}</a></h3>
<p>{{ h.markdown_extract(item.description, 70) }}</p>
</div>
{% endwith %}
{% else %}
<p>No apps, ideas, news stories or images have been
related to this dataset yet, why not add one now?</p>
<p class="action"><a class="btn" href="{{ h.url_for(controller='related', action='new', id=pkg.name) }}">Add Item</a></p>
{% endif %}
</div>
</section>
{% endwith %}