Skip to content

Commit 07a35ba

Browse files
committed
Add 'Ask GIS' panel
Why these changes are being introduced: We want to provide users multiple paths to request help from the GIS team. Relevant ticket(s): https://mitlibraries.atlassian.net/browse/GDT-129 How this addresses that need: This adds an 'Ask GIS' link to all views except the index: * On the results page with reuslts, in the filter sidebar below the filters. * On the results page with no results, in a sidebar to the right. * On the full record page, in the sidebar below fact panels. There is a minor difference in placement for the results view in smaller viewports, which is accommodated with media queries. Side effects of this change: The new `ask` partial contains both the logic for the existing 'Ask Us' link and the 'Ask GIS' link. In order to minimize the complexity, both use the same markup. This removes the descriptive paragraph for 'Ask Us' and changes the header from 'Ask Us' to 'Need help?', both of which seem like usability improvements.
1 parent 911752f commit 07a35ba

File tree

5 files changed

+52
-10
lines changed

5 files changed

+52
-10
lines changed

app/assets/stylesheets/partials/_panels.scss

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,26 @@
7676
#advanced-search-panel legend {
7777
color: #000
7878
}
79+
80+
.ask-us {
81+
margin-top: 3rem;
82+
a {
83+
margin-top: 0.5rem;
84+
&:after {
85+
padding-left: 1rem;
86+
font-family: FontAwesome;
87+
content: '\f075';
88+
}
89+
}
90+
&.view-md {
91+
@media (min-width: $bp-screen-md) {
92+
display: none;
93+
}
94+
}
95+
&.view-lg {
96+
display: none;
97+
@media (min-width: $bp-screen-md) {
98+
display: block;
99+
}
100+
}
101+
}

app/assets/stylesheets/partials/_results.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
margin-bottom: 3rem;
77
background-color: $white-t;
88
padding: 15px;
9+
10+
.no-results {
11+
margin-left: -15px;
12+
}
13+
14+
.no-results + .ask-us {
15+
margin-top: 0rem;
16+
}
917
}
1018

1119
.result {

app/views/record/_sidebar.html.erb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,5 @@
88
</div>
99
<% end %>
1010

11-
<div class="bit askus">
12-
<h3 class="title">Ask Us</h3>
13-
<p>Not finding what you're looking for? We're here to help with anything from quick questions to in-depth research.</p>
14-
<p>
15-
<a class="btn button-secondary" href="https://libraries.mit.edu/ask/">Ask Us</a>
16-
</p>
17-
</div>
11+
<%= render 'shared/ask' %>
1812
</div>

app/views/search/results.html.erb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,21 @@
4848

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

51-
<div class="<%= 'layout-1q3q' if @filters.present? %> layout-band top-space">
51+
<div class="<%= @filters.present? ? 'layout-1q3q' : 'layout-3q1q' %> layout-band top-space">
5252
<% if @filters.present? %>
5353
<aside class="col1q filter-container">
5454
<div id="filters">
5555
<h2 class="hd-3">Filter your results</h2>
5656
<h3 class="hd-4"><em><%= results_summary(@pagination[:hits]) %></em></h3>
5757
<% @filters&.each_with_index do |(category, values), index| %>
5858
<% if index == 0 %>
59-
<%= render(partial: 'search/filter', locals: {category: category, values: values, first: true}) %>
59+
<%= render(partial: 'search/filter', locals: {category: category, values: values, first: true }) %>
6060
<% else %>
6161
<%= render(partial: 'search/filter', locals: {category: category, values: values, first: false }) %>
6262
<% end %>
6363
<% end %>
6464
</div>
65+
<%= render partial: 'shared/ask', locals: { display: 'view-lg' } %>
6566
</aside>
6667
<% end %>
6768

@@ -71,15 +72,17 @@
7172
<%= render(partial: 'search/result', collection: @results) %>
7273
</ul>
7374
<% else %>
74-
<div id="results">
75+
<div id="results" class="no-results">
7576
<p class="hd-2">No results found for your search</p>
7677
</div>
7778
<% end %>
7879
</div>
80+
<%= render partial: 'shared/ask', locals: { display: 'aside' } if @results.blank? %>
7981

8082
<% if @results.present? %>
8183
<div id="pagination">
8284
<%= render partial: "pagination" %>
8385
</div>
86+
<%= render partial: 'shared/ask', locals: { display: 'view-md' } %>
8487
<% end %>
8588
</div>

app/views/shared/_ask.html.erb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<% if display == 'view-aside' %>
2+
<div class="col1qr-sidebar">
3+
<% end %>
4+
<div class="bit ask-us <%= display %>">
5+
<h3 class="title">Need help?</h3>
6+
<% if Flipflop.enabled?(:gdt) %>
7+
<a class="btn button-secondary" href="https://libraries.mit.edu/ask-gis">Ask GIS</a>
8+
<% else %>
9+
<a class="btn button-secondary" href="https://libraries.mit.edu/ask/">Ask Us</a>
10+
<% end %>
11+
</div>
12+
<% if display == 'view-aside' %>
13+
</div>
14+
<% end %>

0 commit comments

Comments
 (0)