Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion themes/opendk/views/collections-home.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h1 class="font-semibold text-3xl mb-1">{{ title }}</h1>
</p>

<ul class="sm:flex flex-wrap sm:-mx-4 mt-gutter">
{% for collection in collections %}
{% for collection in collections | sort(attribute='title') %}
<!-- group -->
<li class="sm:w-1/2 lg:w-1/3">
<a class="flex bg-gray-200 p-4 text-primary my-4 sm:mx-4" href="/{{ slug }}/{{ collection.name }}">
Expand Down
25 changes: 22 additions & 3 deletions themes/opendk/views/partials/data-search-results.njk
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,31 @@
</div>

<ul class="mt-2">
{% set formats = [] %}{% set colors = {
CSV: '#ffca00',
XLSX:'#3CBC8D',
XLS:'#3CBC8D',
JSON:'blue',
GeoJSON:'#2CAAF9',
WFS:'#08389c',
PDF:'#ff1010',
SHP:'violet',
HTML:'#333',
KML:'gray',
ODS:'gray'
} %}

{% for resource in package.resources %}
{% if resource.format %}
{% if resource.format not in formats %}
<span hidden>{{formats.push(resource.format)}}</span>
{% endif %}
{% endfor %}
{% for format in formats %}
{%if format %}
<li class="inline">
<a href="/{{ package.organization.name or 'dataset' }}/{{ package.name }}" data-format="{{ resource.format }}" class="bg-gray-200 text-sm text-gray-500 px-2 py-1">{{ resource.format }}</a>
<a href="/{{ package.organization.name or 'dataset' }}/{{ package.name }}" data-format="{{ format }}" class="bg-gray-600 text-sm text-gray-100 px-2 py-1" style="background:{{colors[format]}};" >{{ format }}</a>
</li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
</li>
Expand Down