61 lines
1.4 KiB
HTML
61 lines
1.4 KiB
HTML
{# CREATED BY FRANCESCO MANGIACRAPA
|
|
Display a grid of group items.
|
|
|
|
groups - A list of groups.
|
|
|
|
Example:
|
|
|
|
{% snippet "group/snippets/group_list.html" %}
|
|
|
|
#}
|
|
|
|
<script>
|
|
changeView = function (divId) {
|
|
var e = document.getElementById(divId);
|
|
var vis = e.style.display;
|
|
|
|
if(vis=='block'){
|
|
e.style.display = 'none';
|
|
document.getElementById("hierarchy").innerHTML = "Show Hierarchy";
|
|
}else {
|
|
e.style.display = 'block';
|
|
document.getElementById("hierarchy").innerHTML = "Hide Hierarchy";
|
|
}
|
|
}
|
|
</script>
|
|
|
|
{#
|
|
Display a hierarchical tree of groups
|
|
|
|
|
|
Example:
|
|
|
|
{% snippet "group/snippets/group_tree.html" %}
|
|
|
|
#}
|
|
|
|
{# CKAN 2.6.X #}
|
|
{% set top_nodes = h.group_tree(type_='group') %}
|
|
{# CKAN 2.5.X
|
|
{% set top_nodes=h.get_action('group_tree', {'type': 'group'}) %}
|
|
#}
|
|
<div style=" margin-top: 5px; margin-bottom: 10px;">
|
|
<a id="hierarchy" href="javascript:changeView('Groups_Hierarchy');">Show Hierarchy</a>
|
|
</div>
|
|
<div id='Groups_Hierarchy' style="display: none;">
|
|
<h3>Group Hierarchy</h3>
|
|
<div id="publisher-tree" style="margin-bottom: 5px; margin-top: 5px;">
|
|
{% snippet 'group/snippets/group_tree.html', top_nodes=top_nodes %}
|
|
</div>
|
|
</div>
|
|
|
|
{% block group_list %}
|
|
<ul class="media-grid" data-module="media-grid">
|
|
{% block group_list_inner %}
|
|
{% for group in groups %}
|
|
{% snippet "group/snippets/group_item.html", group=group, position=loop.index, top_nodes=top_nodes %}
|
|
{% endfor %}
|
|
{% endblock %}
|
|
</ul>
|
|
{% endblock %}
|