Skip to content

Commit 4032322

Browse files
authored
Merge pull request #92 from ELIXIR-Belgium/search
Changes needed for new landing page RDMkit
2 parents 5b6f307 + 6487d85 commit 4032322

12 files changed

+94
-44
lines changed

_includes/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{%- capture keywords %}
77
{%- if page.related_pages %}
88
{%- for section in page.related_pages %}
9-
{%- unless section[1] == nil %}
9+
{%- unless section[1].size == 0 %}
1010
{%- for keywordstr in section[1] %}
1111
{%- assign keywordpage = site.pages | where: "page_id", keywordstr | first %}
1212
{%- if allkeywords %}

_includes/more-information-tiles.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ <h2>More information</h2>
1717
<div class="col-2 d-flex align-items-center justify-content-center">
1818
{%- assign registry = training.registry | downcase %}
1919
{%- if registry == "tess" %}
20-
<img alt="TeSS logo" class="img-fluid" src="assets/img/tess_logo.svg">
20+
<img alt="TeSS logo" class="img-fluid" src="{{ 'assets/img/tess_logo.svg' | relative_url }}">
2121
{%- elsif registry == "zenodo" %}
22-
<img alt="Zenodo logo" class="img-fluid" src="assets/img/zenodo_logo.svg">
22+
<img alt="Zenodo logo" class="img-fluid" src="{{ 'assets/img/zenodo_logo.svg' | relative_url }}">
2323
{%- elsif registry == "youtube" %}
24-
<img alt="Youtube logo" class="img-fluid" src="assets/img/youtube_logo.svg">
24+
<img alt="Youtube logo" class="img-fluid" src="{{ 'assets/img/youtube_logo.svg' | relative_url }}">
2525
{%- elsif registry == "carpentries" %}
26-
<img alt="Carpentries" class="img-fluid" src="assets/img/carpentries_logo.svg">
26+
<img alt="Carpentries" class="img-fluid" src="{{ 'assets/img/carpentries_logo.svg' | relative_url }}">
2727
{%- else %}
2828
<i class="fa-solid fa-external-link-alt text-primary fs-5"></i>
2929
{%- endif %}
@@ -53,7 +53,7 @@ <h2>More information</h2>
5353
<a class="btn bg-white hover-primary text-start" data-bs-toggle="tooltip" data-bs-placement="right" title="FAIRCookbook" href="{{ recipe.url }}">
5454
<div class="row g-1">
5555
<div class="col-2 d-flex align-items-center justify-content-center">
56-
<img alt="FAIRCookbook logo" class="img-fluid" src="assets/img/fairplus_compact_logo.svg">
56+
<img alt="FAIRCookbook logo" class="img-fluid" src="{{ 'assets/img/fairplus_compact_logo.svg' | relative_url }}">
5757
</div>
5858
<div class="col-10 d-flex align-items-center">
5959
<span class="text-start">Step-by-step process for: {{recipe.name}}</span>
@@ -69,7 +69,7 @@ <h2>More information</h2>
6969
<a class="btn bg-white hover-primary text-start" data-bs-toggle="tooltip" data-bs-placement="right" title="DSW" href="{{ site.dsw_deep_link_prefix | append: question.uuid }}">
7070
<div class="row g-1">
7171
<div class="col-2 d-flex align-items-center justify-content-center">
72-
<img alt="DSW logo" class="img-fluid" src="assets/img/dsw_compact_logo.svg">
72+
<img alt="DSW logo" class="img-fluid" src="{{ 'assets/img/dsw_compact_logo.svg' | relative_url }}">
7373
</div>
7474
<div class="col-10 d-flex align-items-center">
7575
<span class="text-start">Support for DMP on: {{question.name}}</span>
@@ -85,7 +85,7 @@ <h2>More information</h2>
8585
<a class="btn bg-white hover-primary text-start" data-bs-toggle="tooltip" data-bs-placement="right" title="FAIRsharing" href="{{ standard.url }}">
8686
<div class="row g-1">
8787
<div class="col-2 d-flex align-items-center justify-content-center">
88-
<img alt="FAIRsharing logo" class="img-fluid" src="assets/img/fairsharing_compact_logo.svg">
88+
<img alt="FAIRsharing logo" class="img-fluid" src="{{ 'assets/img/fairsharing_compact_logo.svg' | relative_url }}">
8989
</div>
9090
<div class="col-10 d-flex align-items-center">
9191
<span class="text-start">FAIRsharing collection about: {{standard.name}}</span>
@@ -101,7 +101,7 @@ <h2>More information</h2>
101101
<a class="btn bg-white hover-primary text-start" data-bs-toggle="tooltip" data-bs-placement="right" title="RDMkit" href="{{ rdmdoc.url }}">
102102
<div class="row g-1">
103103
<div class="col-2 d-flex align-items-center justify-content-center">
104-
<img alt="RDMkit logo" class="img-fluid" src="assets/img/rdmkit_compact_logo.svg">
104+
<img alt="RDMkit logo" class="img-fluid" src="{{ 'assets/img/rdmkit_compact_logo.svg' | relative_url }}">
105105
</div>
106106
<div class="col-10 d-flex align-items-center">
107107
<span class="text-start">Data management guidelines on: {{rdmdoc.name}}</span>

_includes/news.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="news">
22
{%- if include.title == true %}
3-
<h2>Whats new?</h2>
3+
<h2>What's new?</h2>
44
{%- endif %}
55
{%- assign news = site.data.news | sort: "date" %}
66
{%- assign count = 0 %}

_includes/related-pages.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ <h2>Related pages</h2>
2323
{%- assign metadata = section_pages | where:"page_id", page_id %}
2424
{%- for page_hit in metadata %}
2525
<li class="d-grid">
26-
<a class="btn bg-white hover-primary text-start" href="{{ page_hit.url | relative_url }}"><span>{{page_hit.title}}{% if page_hit.description %}</span><br><small class="text-muted">{{ page_hit.description | capitalize }}</small>{% endif %}</a>
26+
<a class="btn bg-white hover-primary text-start" href="{{ page_hit.url | relative_url }}"><span>{{page_hit.title}}{% if page_hit.description %}</span><br><small class="text-muted">{{ page_hit.description }}</small>{% endif %}</a>
2727
</li>
2828
{%- endfor %}
2929
{%- endfor %}

_includes/resource-table-all.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ <h2>Relevant tools and resources</h2>
120120
{%- if tool.related_pages %}
121121
{%- capture related_pages %}
122122
{%- for section in tool.related_pages %}
123-
{%- unless section.size == 0 %}
123+
{%- unless section[1].size == 0 %}
124124
{%- for tag in section[1] %}
125125
{%- unless tag == page.page_id %}
126126
{%- assign related_page = site.pages | where:"page_id",tag | first %}

_includes/resource-table-page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h3>Tailored to users in {{page.title}}</h3>
4040
{%- if tool.related_pages %}
4141
{%- capture related_pages %}
4242
{%- for section in tool.related_pages %}
43-
{%- unless section.size == 0 %}
43+
{%- unless section[1].size == 0 %}
4444
{%- for tag in section[1] %}
4545
{%- unless tag == page.page_id %}
4646
{%- assign related_page = site.pages | where:"page_id",tag | first %}

_includes/section-navigation-tiles.html

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<div class="col">
3838
<div class="input-group">
3939
<span class="input-group-text" id="search-label">Search</span>
40-
<input type="text" id="title-search" class="form-control" onkeyup="buttonUp();" placeholder="Type here..." aria-label="{{page.type | replace: '_', ' ' |}}" aria-describedby="search-label">
40+
<input type="text" id="title-search" class="form-control" onkeyup="StartSearch();" placeholder="Type here..." aria-label="{{page.type | replace: '_', ' ' |}}" aria-describedby="search-label">
4141
<button class="btn btn-primary" title="Button to clear search" type="button" id="clearsearch">
4242
<i class="fa-solid fa-backspace"></i>
4343
</button>
@@ -63,29 +63,72 @@
6363
<div class="col" data-affiliations="{{affiliations_classes}}" related-pages="{{related_pages_classes}}">
6464
<div class="card h-100">
6565
<div class="card-header">
66-
<a aria-label="Go to the {{current_page.title}} page" href="{{ current_page.url | relative_url }}">
66+
<a class="stretched-link" aria-label="Go to the {{current_page.title}} page" href="{{ current_page.url | relative_url }}">
6767
<h3 class="card-title m-0">{{current_page.title}}</h3>
6868
</a>
6969
</div>
7070
<div class="card-body">
7171
{%- if current_page.description %}
7272
<p class="card-text">{{ current_page.description}}</p>
7373
{%- endif %}
74+
</div>
75+
<div class="px-3 pb-3 d-flex justify-content-between">
7476
{%- if current_page.related_pages %}
77+
{%- assign nonempty = false %}
7578
{%- for section in current_page.related_pages %}
76-
{%- unless section[1] == nil %}
77-
<div>
78-
<span><b><small>{{ section[0] | replace: "_", " " | capitalize }}: </small></b></span>
79-
{%- for page_id in section[1] %}
80-
{%- assign section_pages = site.pages | where:"type", section[0] %}
81-
{%- assign metadata = section_pages | where:"page_id", page_id %}
82-
{%- for page_hit in metadata %}
83-
<a href="{{ page_hit.url | relative_url }}"><span class="badge">{{page_hit.title | truncate: 20 }}</span></a>
84-
{%- endfor %}
85-
{%- endfor %}
86-
</div>
79+
{%- unless section[1].size == 0 %}
80+
{%- assign nonempty = true %}
8781
{%- endunless %}
8882
{%- endfor %}
83+
{%- if nonempty %}
84+
<div class="dropdown">
85+
<button class="btn btn-sm dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
86+
Related pages
87+
</button>
88+
<ul class="dropdown-menu px-2 py-0 border-0 shadow">
89+
{%- for section in current_page.related_pages %}
90+
{%- unless section[1].size == 0 %}
91+
<li><h6 class="dropdown-header">{{ section[0] | replace: "_", " " | capitalize }}</h6></li>
92+
{%- for page_id in section[1] %}
93+
{%- assign section_pages = site.pages | where:"type", section[0] %}
94+
{%- assign metadata = section_pages | where:"page_id", page_id %}
95+
{%- for page_hit in metadata %}
96+
<li><a class="dropdown-item rounded" href="{{ page_hit.url | relative_url }}">{{page_hit.title }}</a></li>
97+
{%- endfor %}
98+
{%- endfor %}
99+
{%- endunless %}
100+
{%- endfor %}
101+
</ul>
102+
</div>
103+
{%- endif %}
104+
{%- endif %}
105+
{%- if current_page.dsw or current_page.faircookbook %}
106+
<div class="btn-group btn-group-sm" role="group">
107+
{%- if current_page.faircookbook %}
108+
<div class="btn-group btn-group-sm" role="group">
109+
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
110+
<img alt="faircookbook logo" src="{{ 'assets/img/fairplus_compact_logo.svg' | relative_url }}">
111+
</button>
112+
<ul class="dropdown-menu px-2 py-0 border-0 shadow">
113+
{%- for item in current_page.faircookbook %}
114+
<li><a class="dropdown-item rounded" href="{{ item.url }}">{{item.name }}</a></li>
115+
{%- endfor %}
116+
</ul>
117+
</div>
118+
{%- endif %}
119+
{%- if current_page.dsw %}
120+
<div class="btn-group btn-group-sm" role="group">
121+
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
122+
<img alt="DSW logo" src="{{ 'assets/img/dsw_compact_logo.svg' | relative_url }}">
123+
</button>
124+
<ul class="dropdown-menu px-2 py-0 border-0 shadow">
125+
{%- for item in current_page.dsw %}
126+
<li><a class="dropdown-item rounded" href="{{ site.dsw_deep_link_prefix | append: item.uuid }}">{{item.name }}</a></li>
127+
{%- endfor %}
128+
</ul>
129+
</div>
130+
{%- endif %}
131+
</div>
89132
{%- endif %}
90133
</div>
91134
{%- if current_page.affiliations %}
@@ -100,7 +143,7 @@ <h3 class="card-title m-0">{{current_page.title}}</h3>
100143
{%- if affiliation.size == 2 %}
101144
{%- assign country_link = site.pages | where:"country_code",country | first %}
102145
{%- if country_link %}
103-
<a role="button" href="{{country_link.url}}" data-bs-toggle="tooltip" title="{{allcountries[country]}}" class="btn btn-sm bg-white hover-primary">
146+
<a role="button" href="{{'country_link.url' | relative_url}}" data-bs-toggle="tooltip" title="{{allcountries[country]}}" class="btn btn-sm bg-white hover-primary">
104147
{%- else %}
105148
<a role="button" data-bs-toggle="tooltip" title="{{allcountries[country]}}" class="btn btn-sm bg-white hover-primary disabled" aria-disabled="true">
106149
{%- endif %}
@@ -171,7 +214,7 @@ <h3 class="card-title m-0">{{current_page.title}}</h3>
171214
* Search cards
172215
*/
173216

174-
var buttonUp = () => {
217+
var StartSearch = () => {
175218
const input = document.getElementById("title-search");
176219
if (input) {
177220
const cols = document.querySelectorAll(".navigation-tiles .col");

_includes/topnav.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
<a class="nav-link ps-2 d-flex align-items-center" href="{{site.github.repository_url}}"><i class="fa-brands fa-github me-2"></i>{{site.theme_variables.git_host | default: 'GitHub' }}</a>
5656
</li>
5757
{%- endif %}
58+
{%- unless include.search == false %}
5859
<!--start search-->
5960
<li class="nav-item ms-0 ms-lg-3 my-2 my-lg-0">
6061
<div class="position-relative">
@@ -65,6 +66,7 @@
6566
</div>
6667
</li>
6768
<!--end search-->
69+
{%- endunless %}
6870
</ul>
6971
</div>
7072
</div>

assets/css/main.scss

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ main {
4343
margin-top: $spacer * 0.25;
4444
}
4545

46-
a:not(.btn) {
46+
a:not(.btn):not(.dropdown-item) {
4747
overflow-wrap: break-word;
4848
word-wrap: break-word;
4949
-ms-word-break: break-all;
@@ -56,7 +56,7 @@ main {
5656

5757
ol li,
5858
ul li {
59-
margin: 10px 0px;
59+
margin: $spacer * .5 0;
6060

6161
&::marker {
6262
color: $primary;
@@ -722,8 +722,9 @@ li.past_event,
722722
.card {
723723
background-color: $nav-card-bg;
724724

725-
.card-text {
726-
min-height: 4.5em;
725+
a:not(.stretched-link), button:not(.stretched-link) {
726+
z-index: 2;
727+
position: relative;
727728
}
728729

729730
.card-header {
@@ -734,15 +735,16 @@ li.past_event,
734735
}
735736
}
736737

737-
.badge {
738-
font-weight: inherit;
738+
button {
739739
background-color: $nav-card-badge-bg;
740740
color: $nav-card-badge-color;
741-
}
742-
743-
.badge:hover {
744-
color: $nav-card-badge-color-hover;
745-
background-color: $nav-card-badge-bg-hover;
741+
&:hover {
742+
color: $nav-card-badge-color-hover;
743+
background-color: $nav-card-badge-bg-hover;
744+
}
745+
img {
746+
height: 1.2em;
747+
}
746748
}
747749
}
748750
}

assets/js/search.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,11 @@ permalink: assets/js/search.js
9595
hideSearch();
9696
} else {
9797
showSearch();
98-
// scroll search input into view, workaround for iOS Safari
99-
window.scroll(0, -1);
100-
setTimeout(function () { window.scroll(0, 0); }, 0);
98+
var hero = document.getElementById("search-section");
99+
if(hero){
100+
document.querySelector('#search-section').scrollIntoView();
101+
}
102+
101103
}
102104
if (input === currentInput) {
103105
return;

elixir-toolkit-theme.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Gem::Specification.new do |spec|
44
spec.name = "elixir-toolkit-theme"
5-
spec.version = "1.18.0"
5+
spec.version = "1.19.0"
66
spec.authors = ["bedroesb"]
77
spec.email = ["bedro@psb.vib-ugent.be\n"]
88

pages/example_pages/general_page_3.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ national_resources:
2929
description: A general description about the resource
3030
how_to_access:
3131
instance_of:
32-
32+
related_pages:
33+
example_pages: []
3334

3435
---
3536

0 commit comments

Comments
 (0)