-
Notifications
You must be signed in to change notification settings - Fork 2k
/
resource_item.html
62 lines (61 loc) · 2.13 KB
/
resource_item.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{% set can_edit = h.check_access('package_update', {'id':pkg.id }) %}
{% set url_action = 'resource_edit' if url_is_edit and can_edit else 'resource_read' %}
{% set url = h.url_for(controller='package', action=url_action, id=pkg.name, resource_id=res.id) %}
<li class="resource-item" data-id="{{ res.id }}">
{% block resource_item_title %}
<a class="heading" href="{{ url }}" title="{{ res.name or res.description }}">
{{ h.resource_display_name(res) | truncate(50) }}<span class="format-label" property="dc:format" data-format="{{ res.format.lower() or 'data' }}">{{ res.format }}</span>
{{ h.popular('views', res.tracking_summary.total, min=10) }}
</a>
{% endblock %}
<p class="description">
{% if res.description %}
{{ h.markdown_extract(res.description, extract_length=80) }}
{% endif %}
</p>
{% block resource_item_explore %}
{% if not url_is_edit %}
<div class="dropdown btn-group">
<a href="#" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<i class="icon-share-alt"></i>
{{ _('Explore') }}
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
{% block resource_item_explore_links %}
<li>
<a href="{{ url }}">
{% if res.can_be_previewed %}
<i class="icon-bar-chart"></i>
{{ _('Preview') }}
{% else %}
<i class="icon-info-sign"></i>
{{ _('More information') }}
{% endif %}
</a>
</li>
<li>
<a href="{{ res.url }}" class="resource-url-analytics" target="_blank">
{% if res.can_be_previewed %}
<i class="icon-download"></i>
{{ _('Download') }}
{% else %}
<i class="icon-external-link"></i>
{{ _('Go to resource') }}
{% endif %}
</a>
</li>
{% if can_edit %}
<li>
<a href="{{ h.url_for(controller='package', action='resource_edit', id=pkg.name, resource_id=res.id) }}">
<i class="icon-edit"></i>
{{ _('Edit') }}
</a>
</li>
{% endif %}
{% endblock %}
</ul>
</div>
{% endif %}
{% endblock %}
</li>