Skip to content

Commit

Permalink
Add 'Ask GIS' panel
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jazairi committed Feb 13, 2024
1 parent 911752f commit 07a35ba
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 10 deletions.
23 changes: 23 additions & 0 deletions app/assets/stylesheets/partials/_panels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,26 @@
#advanced-search-panel legend {
color: #000
}

.ask-us {
margin-top: 3rem;
a {
margin-top: 0.5rem;
&:after {
padding-left: 1rem;
font-family: FontAwesome;
content: '\f075';
}
}
&.view-md {
@media (min-width: $bp-screen-md) {
display: none;
}
}
&.view-lg {
display: none;
@media (min-width: $bp-screen-md) {
display: block;
}
}
}
8 changes: 8 additions & 0 deletions app/assets/stylesheets/partials/_results.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
margin-bottom: 3rem;
background-color: $white-t;
padding: 15px;

.no-results {
margin-left: -15px;
}

.no-results + .ask-us {
margin-top: 0rem;
}
}

.result {
Expand Down
8 changes: 1 addition & 7 deletions app/views/record/_sidebar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,5 @@
</div>
<% end %>

<div class="bit askus">
<h3 class="title">Ask Us</h3>
<p>Not finding what you're looking for? We're here to help with anything from quick questions to in-depth research.</p>
<p>
<a class="btn button-secondary" href="https://libraries.mit.edu/ask/">Ask Us</a>
</p>
</div>
<%= render 'shared/ask' %>
</div>
9 changes: 6 additions & 3 deletions app/views/search/results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,21 @@

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

<div class="<%= 'layout-1q3q' if @filters.present? %> layout-band top-space">
<div class="<%= @filters.present? ? 'layout-1q3q' : 'layout-3q1q' %> layout-band top-space">
<% if @filters.present? %>
<aside class="col1q filter-container">
<div id="filters">
<h2 class="hd-3">Filter your results</h2>
<h3 class="hd-4"><em><%= results_summary(@pagination[:hits]) %></em></h3>
<% @filters&.each_with_index do |(category, values), index| %>
<% if index == 0 %>
<%= render(partial: 'search/filter', locals: {category: category, values: values, first: true}) %>
<%= render(partial: 'search/filter', locals: {category: category, values: values, first: true }) %>
<% else %>
<%= render(partial: 'search/filter', locals: {category: category, values: values, first: false }) %>
<% end %>
<% end %>
</div>
<%= render partial: 'shared/ask', locals: { display: 'view-lg' } %>
</aside>
<% end %>

Expand All @@ -71,15 +72,17 @@
<%= render(partial: 'search/result', collection: @results) %>
</ul>
<% else %>
<div id="results">
<div id="results" class="no-results">
<p class="hd-2">No results found for your search</p>
</div>
<% end %>
</div>
<%= render partial: 'shared/ask', locals: { display: 'aside' } if @results.blank? %>

<% if @results.present? %>
<div id="pagination">
<%= render partial: "pagination" %>
</div>
<%= render partial: 'shared/ask', locals: { display: 'view-md' } %>
<% end %>
</div>
14 changes: 14 additions & 0 deletions app/views/shared/_ask.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<% if display == 'view-aside' %>
<div class="col1qr-sidebar">
<% end %>
<div class="bit ask-us <%= display %>">
<h3 class="title">Need help?</h3>
<% if Flipflop.enabled?(:gdt) %>
<a class="btn button-secondary" href="https://libraries.mit.edu/ask-gis">Ask GIS</a>
<% else %>
<a class="btn button-secondary" href="https://libraries.mit.edu/ask/">Ask Us</a>
<% end %>
</div>
<% if display == 'view-aside' %>
</div>
<% end %>

0 comments on commit 07a35ba

Please sign in to comment.