Skip to content

Commit

Permalink
docs: GA feedback buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Loiselle committed Dec 30, 2020
1 parent 92216d1 commit 1824267
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
24 changes: 24 additions & 0 deletions doc/user/assets/sass/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -273,3 +273,27 @@ a {
}
}
}

#helpful {
border-top: 1px solid $grey;
margin-top: 3rem;
max-width: 40%;
padding-top: .5rem;

table {
table-layout: fixed;
text-align: center;
width: 100%;
}
tr {
border-style : hidden;
}
.helpful-vote {
border: 3px solid $purple;
color: $purple;
display: inline-block;
font-weight: bold;
padding: .7rem 0;
width:100%;
}
}
1 change: 1 addition & 0 deletions doc/user/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<main class="content">
{{ partial "breadcrumbs.html" . }}
{{ block "main" . }}{{ end }}
{{ partial "helpful.html" }}
<!-- Footer goes in main so the border-right of
sidebar.html can extend to the bottom of the page. -->
{{ partial "footer.html" . }}
Expand Down
28 changes: 28 additions & 0 deletions doc/user/layouts/partials/helpful.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div id="helpful">
<table>
<tr>
<td colspan=2>Did this info help?</td>
</tr>
<tr>
<td>
<!-- Use 1 for yes, 0 for no, so avg of recorded values is
page's rating -->
<a class="helpful-vote" href="#" onclick="registerWasHelpful(event, 1)">
Yes
</a>
</td>
<td>
<a class="helpful-vote" href="#" onclick="registerWasHelpful(event, 0)">
No
</a>
</td>
</tr>
</table>
</div>

<script>
function registerWasHelpful(event, val){
event.preventDefault()
gtag('event', 'docs-helpful', {'was-helpful': val});
}
</script>

0 comments on commit 1824267

Please sign in to comment.