Skip to content

Commit 2c95203

Browse files
Merge pull request #8900 from braze-inc/dedicated-feedback
add dedicated feedback page
2 parents 110f042 + 9fa77e2 commit 2c95203

File tree

2 files changed

+186
-0
lines changed

2 files changed

+186
-0
lines changed

_docs/_hidden/other/feedback.md

+183
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
---
2+
nav_title: Documentation Feedback
3+
permalink: /feedback/
4+
hide_toc: true
5+
---
6+
7+
<fieldset style="margin-top: 60px;">
8+
<legend style="font-size: 2.5rem;color: #212123;font-weight:bold;">Documentation Feedback</legend>
9+
<div id="feedback">
10+
<div id="feedback_section">
11+
Have ideas to improve our docs or noticed something wrong? We’d love to hear from you! Our team reviews every submission to keep making things better.<br /><br />
12+
13+
<b>How useful do you find Braze docs, on average?</b><br />
14+
15+
<div id="feedback_answer_star">
16+
<ul class="list-inline rating-list">
17+
<li class="inline-star feedback-star" tabindex="0"><i class="fas fa-star" data-value="Very Helpful" title="Very Helpful"></i><br />5<br />Very useful</li>
18+
<li class="inline-star feedback-star" tabindex="0"><i class="fas fa-star" data-value="Helpful" title="Helpful"></i></li>
19+
<li class="inline-star feedback-star" tabindex="0"><i class="fas fa-star" data-value="Somewhat Helpful" title="Somewhat Helpful"></i><br />3<br />Somewhat useful</li>
20+
<li class="inline-star feedback-star" tabindex="0"><i class="fas fa-star" data-value="Unhelpful" title="Unhelpful"></i></li>
21+
<li class="inline-star feedback-star" tabindex="0"><i class="fas fa-star" data-value="Very Unhelpful" title="Very Unhelpful"></i><br />1<br />Not useful</li>
22+
</ul>
23+
</div>
24+
<div style="margin-top: 15px;">
25+
<b>Share your feedback</b> <br />
26+
<textarea id="feedback_comment" placeholder="&quot;I couldn’t find any information about this error message&quot;"></textarea><br />
27+
Have questions? Contact our support team for assistance.
28+
</div>
29+
<button type="submit" name="submit_feedback" value="SUBMIT FEEDBACK" class="btn btn-black" id="feedback_submit" role="button" style="margin-top:15px;"> SUBMIT FEEDBACK </button>
30+
</div>
31+
<div id="feedback_msg">
32+
</div>
33+
34+
<hr style="border: 1px solid grey;margin-top:30px;"/>
35+
36+
<h3> Help us make these docs great</h3>
37+
38+
Braze Docs is an open source project that everyone is welcome to contribute to. Join 288+ contributors and submit your first pull request today. <br /><br />
39+
40+
41+
<button type="submit" onclick="location.href='{{site.baseurl}}/contributing/home'" value="Contributing" class="btn">Start Contributing</button>
42+
43+
</div>
44+
</fieldset>
45+
46+
<style type="text/css">
47+
#feedback {
48+
font-size: 16px;
49+
}
50+
#feedback_answer_star {
51+
display: inline-block;
52+
}
53+
#feedback_answer_star > ul {
54+
display: flex;
55+
list-style: none !important;
56+
margin: 0 !important;
57+
line-height: 1;
58+
}
59+
#feedback_answer_star > ul > li {
60+
list-style: none;
61+
padding: 10px 5px;
62+
width: 65px;
63+
color: #999999 !important;
64+
}
65+
#feedback_answer_star > ul > li:hover,
66+
#feedback_answer_star .rating-list li:hover~li {
67+
color: #000000 !important;
68+
}
69+
#feedback_answer_star > ul > li.active {
70+
color: #000000 !important;
71+
}
72+
#feedback_answer_star > ul > li > i {
73+
font-size: 35px;
74+
}
75+
76+
#feedback_comment {
77+
margin-top: 15px;
78+
width: 100%;
79+
max-width: 680px;
80+
height: 140px !important;
81+
border: 2px solid grey !important;
82+
border-radius: 3px;
83+
}
84+
#feedback_msg {
85+
margin-top: 10px;
86+
}
87+
88+
#feedback_msg.error {
89+
color: red;
90+
font-weight: bold;
91+
}
92+
.feedback-star {
93+
font-size: 14px;
94+
text-align: center;
95+
padding-top: 5px;
96+
line-height: 1em;
97+
}
98+
</style>
99+
<script type="text/javascript">
100+
var feedback_site = '{{site.baseurl}}{{page.url}}';
101+
var feedback_article_title = '{{page.article_title}}';
102+
var feedback_nav_title = '{{page.nav_title}}';
103+
var feedback_helpful = '';
104+
105+
$('#feedback_answer_star li').on('click', function(e){
106+
e.preventDefault();
107+
var li = $(this);
108+
var ul = li.parent();
109+
var i = li.children('i');
110+
feedback_helpful = i.attr('data-value') || '';
111+
var lis = ul.children('li');
112+
var is_sel = false;
113+
lis.each(function (f,c){
114+
var el = $(this)
115+
var star = el.children('i');
116+
if (star.attr('data-value') == feedback_helpful){
117+
is_sel = true;
118+
}
119+
if (is_sel){
120+
el.addClass('active');
121+
}
122+
else {
123+
el.removeClass('active');
124+
}
125+
})
126+
});
127+
128+
129+
$('#feedback_submit').on('click',function(e){
130+
var title = 'Documentations Feedback';
131+
var comment = $('#feedback_comment').val().trim();
132+
var feedback_div = $('#feedback_msg');
133+
var submit_data = {
134+
'Helpful': feedback_helpful,
135+
'URL': feedback_site,
136+
'Article Title': title,
137+
'Nav Title': title,
138+
'Params': window.location.search,
139+
"Language": page_language,
140+
'Feedback': comment
141+
};
142+
if (!feedback_helpful || !comment){
143+
feedback_div.fadeIn();
144+
feedback_div.addClass('error');
145+
feedback_div.html('Please provide a rating and feedback');
146+
feedback_div.fadeOut(2000).removeClass('error');
147+
return;
148+
}
149+
$('#feedback_submit').hide();
150+
151+
if (typeof (appboy) !== 'undefined') {
152+
appboy.logCustomEvent(
153+
"Documentations Feedback Comment", {
154+
"Feedback": feedback_helpful,
155+
"Article Title": title,
156+
"Nav Title": title,
157+
"URL": feedback_site,
158+
"Language": page_language,
159+
"Comment": comment
160+
}
161+
);
162+
}
163+
164+
var jqxhr = $.ajax({
165+
url: 'https://c9616da7-4322-4bed-9b51-917c1874fb31.trayapp.io/feedback',
166+
method: "GET",
167+
dataType: "json",
168+
data: submit_data
169+
}).done(function(dt) {
170+
feedback_div.html('');
171+
if (dt['result'] == 'success'){
172+
$('#feedback_section').hide();
173+
feedback_div.html('We truly value every piece of feedback. Thank you for your response.');
174+
feedback_div.fadeIn("slow");
175+
}
176+
else {
177+
feedback_div.html('Error. Please try again at a later time.');
178+
$('#feedback_submit').show();
179+
}
180+
feedback_div.fadeIn("slow");
181+
});
182+
});
183+
</script>

assets/css/_feedback.scss

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
&:hover, &:hover ~ li {
3434
color: #000000;
3535
}
36+
&.active {
37+
color: #000000;
38+
}
3639
}
3740
}
3841

0 commit comments

Comments
 (0)