Skip to content

Commit 965e5ea

Browse files
committed
feat(searchbox): option in tess.yml
1 parent a27bd01 commit 965e5ea

3 files changed

Lines changed: 15 additions & 12 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<%# Big search box %>
2+
<div class="searchbox">
3+
<%= form_tag search_path, method: :get, role: 'search' do %>
4+
<div class="searchbox-wrapper">
5+
<input type="text" class="searchbox-field" name="q"
6+
placeholder= "<%= t('home.search_placeholder', site_name: TeSS::Config.site['title_short']) %>" ">
7+
<button type="submit" class="searchbox-btn">
8+
<i class="icon icon-h3 search-icon"></i>
9+
</button>
10+
</div>
11+
<% end %>
12+
</div>

app/views/static/home/_welcome.html.erb

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@
55
<p class="font-size-lg"><%== t 'home.subtitle' %></p>
66
</div>
77

8-
<%# Big search box %>
9-
<div class="searchbox">
10-
<%= form_tag search_path, method: :get, role: 'search' do %>
11-
<div class="searchbox-wrapper">
12-
<input type="text" class="searchbox-field" name="q"
13-
placeholder= "<%= t('home.search_placeholder', site_name: TeSS::Config.site['title_short']) %>" autofocus="autofocus">
14-
<button type="submit" class="searchbox-btn">
15-
<i class="icon icon-h3 search-icon"></i>
16-
</button>
17-
</div>
18-
<% end %>
19-
</div>
8+
<%= render partial: 'static/home/search_box' if TeSS::Config.site.dig('home_page', 'search_box') %>
9+
2010
</section>

config/tess.example.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ default: &default
112112
latest_materials: # Number of materials on home page. Leave blank to turn off
113113
featured_trainer: false
114114
counters: false # Whether or not to show number of database objects in separate blocks
115+
search_box: true # Whether or not to show the search box
115116
# The order in which the tabs appear (if feature enabled)
116117
tab_order: ['about', 'events', 'materials', 'elearning_materials', 'workflows', 'collections', 'trainers', 'content_providers', 'nodes']
117118
# The tabs that should be collapsed under the "Directory" tab. Can be left blank to hide it.

0 commit comments

Comments
 (0)