Skip to content

Commit

Permalink
add touchpoints poll
Browse files Browse the repository at this point in the history
  • Loading branch information
kewitham committed Sep 20, 2023
1 parent b3d383b commit e64995d
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 1 deletion.
2 changes: 2 additions & 0 deletions _assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import search from "./search";
import sidenav from "./expand-sidenav";
import mobileCarousel from "./carousel";
import setCookies from "./feature-flag";
import tryToSetPageAnswer from "./touchpoints-page-helpful";

modal();
redirectModal();
Expand All @@ -19,6 +20,7 @@ search();
sidenav();
mobileCarousel();
setCookies();
tryToSetPageAnswer();

const lawsAndRegsFlag = document.cookie
.split("; ")
Expand Down
11 changes: 11 additions & 0 deletions _assets/js/touchpoints-page-helpful.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default function tryToSetPageAnswer() {
if (!document.querySelector('#touchpoints-yes-no-form')) return;

const pageAnswer = document.querySelector('#touchpoints-yes-no-form #answer_02');
if (!pageAnswer) {
setTimeout(tryToSetPageAnswer, 500);
return;
}

pageAnswer.value = window.location.href;
}
42 changes: 41 additions & 1 deletion _assets/sass/custom/_touchpoints.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
}

.usa-alert {
padding-top: 0px !important;
padding-top: 0px;
}

.usa-alert::before {
Expand All @@ -76,3 +76,43 @@
}

}

#touchpoints-yes-no-form {
padding: 1.25rem;
padding-left: 1rem;
padding-right: 1rem;

.usa-alert--success {
padding: 1.25rem;

.usa-alert__body {
padding-left: 1.25rem;
}
}

.fba-modal-title {
font-size: 1.34rem;
margin-bottom: 0;
}

#touchpoints-yes-no-form {
.question.white-bg {
background-color: #d9e8f6;
}

.questions label {
display: none;
}
}

.usa-button{
background-color: color($theme-color-primary-darker);
&:hover {
background-color: color($theme-link-hover-color) !important;
}
&:focus {
background-color: color($theme-link-hover-color) !important;
}
}

}
3 changes: 3 additions & 0 deletions _includes/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<script src="https://touchpoints.app.cloud.gov/touchpoints/73c5715c.js" async></script>
{% endif %}

<!-- Was this useful [yes/no] feedback -->
<script src="https://touchpoints.app.cloud.gov/touchpoints/a09c8a7c.js" async></script>

{% if page.title == 'Guidance & Resource Materials'%}
{% asset dist/taResources-compiled.js %}
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions _includes/touchpoints-page-helpful.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="form-wrapper" id="touchpoints-yes-no-form"></div>
3 changes: 3 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
{% include notice.html %}
{{ content }}
</main>
{% if page.page-helpful != false and page.subnavigation != true %}
{% include touchpoints-page-helpful.html %}
{% endif %}
{% include footer.html %}
{% unless page.back-to-top == nil or page.back-to-top == false %}
{% include back-to-top.html %}
Expand Down
3 changes: 3 additions & 0 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ <h4 class="usa-accordion__heading desktop:display-none">
</button>
</h4>
{% include sidenav.html collection=page.subnav %}
{% if page.page-helpful != false %}
{% include touchpoints-page-helpful.html %}
{% endif %}
</div>
{% endif %}
</div>
Expand Down
1 change: 1 addition & 0 deletions _pages/404.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ permalink: /404.html
title: Page not found
sitemap: false
sidenav: false
page-helpful: false
common-alert:
redirect: true
type: info
Expand Down
1 change: 1 addition & 0 deletions _pages/feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ lead: |-
Please tell us how we can make this site better. Thank you.
lang: "en"
sidenav: false
page-helpful: false
---
1 change: 1 addition & 0 deletions _pages/site_map.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ permalink: /site_map/
title: Sitemap
sitemap: false
sidenav: false
page-helpful: false
---

{% include sitemap-pages.html %}
Expand Down

0 comments on commit e64995d

Please sign in to comment.