Skip to content

Commit 2bb2603

Browse files
authored
Merge pull request #19 from ELIXIR-Belgium/all-resources
All resources improvements
2 parents d1dca9d + 01f8b19 commit 2bb2603

File tree

4 files changed

+33
-6
lines changed

4 files changed

+33
-6
lines changed

_data/sidebars/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ subitems:
1717
subitems:
1818
- title: Contributor page
1919
url: /contributors.html
20+
- title: All resources
21+
url: /all_resources.html
2022
- title: Events
2123
url: /events.html
2224
- title: News page

_data/tool_and_resource_list.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
Tools:
21
- description: Bioconda is a bioinformatics channel for the Conda package manager
32
link: https://bioconda.github.io/
43
name: Bioconda

_includes/resource-table-all.html

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
{%- assign tools = site.data.tool_and_resource_list.Tools | where:"related_pages", include.tag %}
1+
{%- assign tools = site.data.tool_and_resource_list | where:"related_pages", include.tag %}
2+
{%- assign country_pages = site.pages | where_exp: "item", "item.search_exclude != true" | where_exp:"item","item.resources != nil" %}
23
{%- unless tools.size == 0 %}
4+
{%- if include.tag %}
35
<h2>Relevant tools and resources</h2>
6+
{%- endif %}
47
<a class="visually-hidden-focusable" href='#skip-tool-table'>Skip tool table</a>
58
<div class="table-responsive mt-4 mb-5">
69
<table id="tooltable" class="table display">
@@ -26,7 +29,6 @@ <h2>Relevant tools and resources</h2>
2629
{%- assign total_county_tools = 0 %}
2730
{%- assign instances_tool = 0 %}
2831
{%- assign query = "related_pages." | append: page.type %}
29-
{%- assign country_pages = site.pages | where: "type", "national_resources" | where: "search_exclude", "false" %}
3032
{%- for country_page in country_pages %}
3133
{%- assign instance_matches = country_page.resources | where: "instance_of", tool.name | where_exp:"resource","resource.related_pages != nil" | where: query, include.tag %}
3234
{%- assign tool_matches = country_page.resources | where_exp:"resource","resource.related_pages != nil" | where: query, include.tag %}
@@ -43,7 +45,7 @@ <h2>Relevant tools and resources</h2>
4345
<td>{{tool.name}}</td>
4446
{%- endif %}
4547
<td>{{tool.description}}
46-
{%- unless instances_tool == 0 or total_county_tools == 0 %}
48+
{%- unless instances_tool == 0 or total_county_tools == 0 or include.tag == nil %}
4749
<a href="#national-resources-button" class="d-block mt-1">
4850
<span class="badge text-white bg-primary"><i class="fas fa-arrow-circle-down me-2"></i>Different instances available</span>
4951
</a>
@@ -87,11 +89,15 @@ <h2>Relevant tools and resources</h2>
8789
{%- endunless %}
8890
{%- assign hide_ids = "resource_title" %}
8991
{%- for country_page in country_pages %}
92+
{%- if include.tag %}
9093
{%- assign tool_matches = country_page.resources| where_exp:"resource","resource.related_pages != nil" | where: query, include.tag %}
94+
{%- else %}
95+
{%- assign tool_matches = country_page.resources %}
96+
{%- endif %}
9197
{%- for tool in tool_matches %}
9298
{%- assign tool_id = tool.name | slugify %}
9399
{%- assign hide_ids = hide_ids | append: " " | append: tool_id %}
94-
<tr class="collapse multi-collapse" id="{{tool_id}}">
100+
<tr {% unless include.tag == nil %} class="collapse multi-collapse" id="{{tool_id}}"{% endunless %}>
95101
{% if tool.url %}
96102
<td><a href="{{tool.url}}">{{tool.name}}</a><a href="{{country_page.url}}" data-bs-toggle="tooltip" title="{{country_page.title}}"><span class="flag-icon ms-2 flag-icon-{{country_page.country_code | downcase }}"></span></a></td>
97103
{%- else %}
@@ -131,7 +137,7 @@ <h2>Relevant tools and resources</h2>
131137
</tbody>
132138
</table>
133139
</div>
134-
{%- unless total_county_tools == 0 %}
140+
{%- unless total_county_tools == 0 or include.tag == nil %}
135141
<a class="btn btn-primary" id="national-resources-button" data-bs-toggle="collapse" data-bs-target=".multi-collapse" role="button" aria-expanded="false" aria-controls="{{hide_ids}}">
136142
View national resources <span class="badge bg-white text-primary ms-2">{{total_county_tools}}</span>
137143
</a>

pages/example_pages/all_resources.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: Overview page example
3+
toc: false
4+
datatable: true
5+
---
6+
7+
Nam non sollicitudin sapien. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Maecenas consectetur nulla nec rutrum rhoncus. Sed non urna sem. Maecenas sed lobortis urna, hendrerit aliquet massa. Phasellus felis dui, feugiat ut sapien vel, mattis dictum eros. Suspendisse in felis sit amet dui elementum rutrum tristique eget velit. Sed hendrerit, ante sit amet hendrerit cursus, ante nibh accumsan nibh, vitae rhoncus quam ipsum placerat ante.
8+
9+
## Listing all resources
10+
11+
12+
```
13+
{% raw %}
14+
{% include resource-table-all.html %}
15+
{% endraw %}
16+
```
17+
18+
19+
{% include resource-table-all.html %}
20+

0 commit comments

Comments
 (0)