Skip to content

Commit 4dc4415

Browse files
committed
feat(templates): check activity plugin;
- Check if activity plugin is loaded.
1 parent 3c9b2d5 commit 4dc4415

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

changes/0016.changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Checks if the `activity` plugin is loaded to render the Activity Stream tab.

ckanext/recombinant/templates/recombinant/resource_edit.html

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,19 @@ <h3>{{ _('DataStore Dump') }}{% snippet 'snippets/sysadmin_only.html' %}</h3>
122122
</summary>
123123
{% snippet "recombinant/snippets/api_access.html", resource_id=resource.id, resource_name=resource.name, is_modal=false %}
124124
</details>
125-
<details id="activity">
126-
<summary><span class="glyphicon glyphicon-time"></span>
127-
{{ _("Activity Stream") }}
128-
</summary>
129-
{% block activity_stream %}
130-
<div class="mrgn-tp-lg"></div>
131-
<a id="activity-stream-link" href="{{ h.url_for('activity.package_activity', id=dataset.id) }}">
132-
{{ _('Activity Stream') }}
133-
</a>
134-
{% endblock %}
135-
</details>
125+
{% if h.plugin_loaded('activity') %}
126+
<details id="activity">
127+
<summary><span class="glyphicon glyphicon-time"></span>
128+
{{ _("Activity Stream") }}
129+
</summary>
130+
{% block activity_stream %}
131+
<div class="mrgn-tp-lg"></div>
132+
<a id="activity-stream-link" href="{{ h.url_for('activity.package_activity', id=dataset.id) }}">
133+
{{ _('Activity Stream') }}
134+
</a>
135+
{% endblock %}
136+
</details>
137+
{% endif %}
136138
</div>
137139
</div>
138140
{% else %}

0 commit comments

Comments
 (0)