-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_form.html.erb
More file actions
42 lines (39 loc) · 1.73 KB
/
_form.html.erb
File metadata and controls
42 lines (39 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<form id="search-form" action="<%= results_path %>" method="get" role="search">
<label for="basic-search-main">What can we help you find?</label>
<div class="form-wrapper">
<div class="search-input-wrapper">
<i class="fa-regular fa-magnifying-glass"></i>
<input id="basic-search-main" type="search" class="field field-text basic-search-input" name="q" title="Keyword anywhere" value="<%= params[:q] %>" required>
<button title="Clear search" aria-label="Clear search" type="button" id="clear-search">Clear search</button>
</div>
<input id="tab-to-target" type="hidden" name="tab" value="<%= @active_tab %>">
<button type="submit" class="btn button-primary">Search</button>
</div>
<div class="search-actions" data-matomo-click="Search, Advanced Search Engaged, Tab: {{getActiveTabName}}">
<a href="https://libraries.mit.edu/search-advanced">Advanced search</a>
</div>
</form>
<% if Feature.enabled?(:boolean_picker) %>
<aside class="panel panel-info">
<div class="panel-heading">
<p>
<% if cookies[:boolean_type].present? %>
Your boolean preference for this session is: <%= cookies[:boolean_type] %>
<% else %>
No preference is set. Default boolean preference (`AND`) is enabled.
<% end %>
</p>
</div>
<div class="panel-body">
<p>Change to:</p>
<ul>
<% ENV.fetch('BOOLEAN_OPTIONS', 'AND,OR').split(',').each do |opt| %>
<li><%= link_to(opt, boolpref_path(boolean_type: opt)) %></li>
<% end %>
<li><%= link_to('Clear preference', boolpref_path()) %></li>
</ul>
</div>
</aside>
<% end %>
<%= render partial: 'search/source_tabs' if params[:q].present? %>
<%= javascript_include_tag "search_form" %>