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, in the sidebar below the filters (or, if no
results, below the results message).
* 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:

We are using a feature flag to toggle the feature, but I wonder
if a similar feature (using a general 'Ask Us' link) would be
useful in other apps.
  • Loading branch information
jazairi committed Feb 9, 2024
1 parent 377e956 commit 1b72751
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 8 deletions.
22 changes: 22 additions & 0 deletions app/assets/stylesheets/partials/_panels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,25 @@
#advanced-search-panel legend {
color: #000
}

.ask-us {
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;
}
}
}
4 changes: 4 additions & 0 deletions app/assets/stylesheets/partials/_results.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
margin-bottom: 3rem;
background-color: $white-t;
padding: 15px;

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

.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_gis' if Flipflop.enabled?(:gdt) %>
</div>
5 changes: 4 additions & 1 deletion app/views/search/results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@
<%= 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>
<%= render partial: 'shared/ask_gis' if Flipflop.enabled?(:gdt) %>
<% end %>
</div>

Expand All @@ -69,6 +70,7 @@
<%= render(partial: 'search/filter', locals: {category: category, values: values}) %>
<% end %>
</div>
<%= render partial: 'shared/ask_gis', locals: { display: 'view-lg' } if Flipflop.enabled?(:gdt) %>
</aside>
<% end %>
</div>
Expand All @@ -77,5 +79,6 @@
<div id="pagination">
<%= render partial: "pagination" %>
</div>
<%= render partial: 'shared/ask_gis', locals: { display: 'view-md' } if Flipflop.enabled?(:gdt) %>
<% end %>
</div>
4 changes: 4 additions & 0 deletions app/views/shared/_ask_gis.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="bit ask-us <%= display %>">
<h3 class="title">Need help?</h3>
<a class="btn button-secondary" href="https://libraries.mit.edu/ask-gis">Ask GIS</a>
</div>

0 comments on commit 1b72751

Please sign in to comment.