Skip to content

Commit 17e522b

Browse files
authored
Merge pull request #259 from MITLibraries/use-147-move-tabs
Move tab filters to search form
2 parents 2a81cec + 025651a commit 17e522b

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

app/assets/stylesheets/partials/_search.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,7 @@
192192
margin: 2rem 0;
193193
text-align: center;
194194
}
195+
196+
.tab-link {
197+
color: #fff;
198+
}

app/views/search/_form.html.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@
2727
</aside>
2828
<% end %>
2929

30+
<%= render partial: 'search/source_tabs' if @results.present? %>
31+
3032
<%= javascript_include_tag "search_form" %>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!-- Tab Navigation -->
2+
<div id="tabs" class="tab-navigation top-space">
3+
<%= link_to "Primo", results_path(params.permit(:q, :per_page, :page).merge(tab: 'primo')),
4+
class: "tab-link #{'active' if @active_tab == 'primo'}",
5+
data: { turbo_frame: "search-results", turbo_action: "advance" } %>
6+
<%= link_to "TIMDEX", results_path(params.permit(:q, :per_page, :page).merge(tab: 'timdex')),
7+
class: "tab-link #{'active' if @active_tab == 'timdex'}",
8+
data: { turbo_frame: "search-results", turbo_action: "advance" } %>
9+
</div>
10+

app/views/search/results.html.erb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@
1212

1313
<%= render(partial: 'shared/error', collection: @errors) %>
1414

15-
<!-- Tab Navigation -->
16-
<div id="tabs" class="tab-navigation top-space">
17-
<%= link_to "Primo", results_path(params.permit(:q, :per_page, :page).merge(tab: 'primo')),
18-
class: "tab-link #{'active' if @active_tab == 'primo'}",
19-
data: { turbo_frame: "search-results", turbo_action: "advance" } %>
20-
<%= link_to "TIMDEX", results_path(params.permit(:q, :per_page, :page).merge(tab: 'timdex')),
21-
class: "tab-link #{'active' if @active_tab == 'timdex'}",
22-
data: { turbo_frame: "search-results", turbo_action: "advance" } %>
23-
</div>
24-
2515
<%= render(partial: 'trigger_tacos') if tacos_enabled? %>
2616

2717
<%= turbo_frame_tag "search-results" do %>

0 commit comments

Comments
 (0)