Skip to content

Commit 29fd71f

Browse files
authored
Merge pull request #1335 from MITLibraries/pw102-nps-banner
Adds panel for NPS surveys
2 parents fcb079f + 42b63b1 commit 29fd71f

File tree

5 files changed

+39
-0
lines changed

5 files changed

+39
-0
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ to construct thumbnail URLs.
8585
- `TACOS_URL`: The GraphQL endpoint for the [TACOS](https://github.com/mitlibraries/tacos/) application.
8686
- `TIMDEX_TIMEOUT`: value to override the 6 second default for TIMDEX timeout.
8787

88+
### NPS Survey Environment Variables (optional)
89+
90+
- `NPS_BLURB`: Text to display before the survey link. Survey link will still display if not provided.
91+
- `NPS_LINK_TEXT`: Survey link text. If not present, survey does not display.
92+
- `NPS_URL`: Survey link URL. If not present, survey does not display.
93+
8894
## Confirming functionality after updating dependencies
8995

9096
This application has good code coverage, so most issues are detected by just running tests normally:

app/assets/stylesheets/_survey.scss

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.nps-feedback {
2+
margin-top: 1em;
3+
padding: 20px 10px;
4+
background-color: $gray-d1;
5+
color: $white;
6+
text-align: center;
7+
font-size: $fs-large;
8+
display: block;
9+
10+
a {
11+
color: $blue-bright;
12+
&:hover {
13+
color: $green;
14+
}
15+
&:active {
16+
color: $magenta;
17+
}
18+
}
19+
20+
@media (max-width: $bp-screen-md) {
21+
font-size: $fs-base;
22+
}
23+
}

app/assets/stylesheets/application.scss

+1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
@import "_search";
88
@import "_results";
99
@import "_hint";
10+
@import "_survey";
1011
@import "_print";
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<% return unless ENV.fetch('NPS_URL', false).present? %>
2+
<% return unless ENV.fetch('NPS_LINK_TEXT', false).present? %>
3+
4+
<div class="nps-feedback">
5+
<span class="nps-blurb"><%= ENV.fetch('NPS_BLURB', nil) %></span>
6+
<a class="nps-link" href="<%= ENV.fetch('NPS_URL')%>"><%= ENV.fetch('NPS_LINK_TEXT') %></a>
7+
</div>

app/views/search/bento.html.erb

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
<p>Not finding what you need? <%= link_to('Ask us', 'https://libraries.mit.edu/ask/') %></p>
2424
</div>
2525

26+
<%= render partial: "nps_feedback" if ENV.fetch('NPS_URL', false).present? %>
27+
2628
<div id="hint"></div>
2729

2830
<div class="gridband layout-2c">

0 commit comments

Comments
 (0)