Skip to content

Commit ce291f4

Browse files
authored
Add Docs Survey (#3289)
Add Docs Survey to Tutorials Site. Will be disabled on April 14, 2025
1 parent 6493011 commit ce291f4

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

_templates/layout.html

+16-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{
2525
var div = '<div class="admonition note"><p class="admonition-title">Note</p><p><i class="fa fa-flask" aria-hidden="true">&nbsp</i> This tutorial describes a prototype feature. Prototype features are typically not available as part of binary distributions like PyPI or Conda, except sometimes behind run-time flags, and are at an early stage for feedback and testing.</p></div>'
2626
document.getElementById("pytorch-article").insertAdjacentHTML('afterBegin', div)
27-
}
27+
}
2828
</script>
2929
{%- endblock %}
3030

@@ -102,9 +102,9 @@
102102
if (googleSearchboxText) {
103103
googleSearchboxText.placeholder = placeholderText;
104104
googleSearchboxText.style.fontFamily = 'FreightSans';
105-
googleSearchboxText.style.fontSize = "1.2rem";
105+
googleSearchboxText.style.fontSize = "1.2rem";
106106
googleSearchboxText.style.color = '#262626';
107-
}
107+
}
108108
};
109109
});
110110
</script>
@@ -114,7 +114,7 @@
114114
{{ super() }}
115115
<script>
116116

117-
// Helper function to make it easier to call dataLayer.push()
117+
// Helper function to make it easier to call dataLayer.push()
118118
function gtag(){window.dataLayer.push(arguments);}
119119

120120
//add microsoft link
@@ -148,7 +148,7 @@
148148
case"saveloadrun_tutorial":
149149
url="https://docs.microsoft.com/learn/modules/intro-machine-learning-pytorch/8-inference?WT.mc_id=aiml-7486-cxa";
150150
}
151-
151+
152152
$(".pytorch-call-to-action-links").children().first().before("<a href="+url+' data-behavior="call-to-action-event" data-response="Run in Microsoft Learn" target="_blank"><div id="microsoft-learn-link" style="padding-bottom: 0.625rem;border-bottom: 1px solid #f3f4f7;padding-right: 2.5rem;display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center;-ms-flex-align: center;align-items: center;"><img class="call-to-action-img" src="../../_static/images/microsoft-logo.svg"/><div class="call-to-action-desktop-view">Run in Microsoft Learn</div><div class="call-to-action-mobile-view">Learn</div></div></a>')
153153
}
154154

@@ -210,4 +210,15 @@
210210
</script>
211211

212212
<img height="1" width="1" style="border-style:none;" alt="" src="https://www.googleadservices.com/pagead/conversion/795629140/?label=txkmCPmdtosBENSssfsC&amp;guid=ON&amp;script=0"/>
213+
214+
//temporarily add a link to survey
215+
<script>
216+
var survey = '<div class="survey-banner"><p><i class="fas fa-poll" aria-hidden="true">&nbsp </i> Take the <a href="https://forms.gle/KZ4xGL65VRMYNbbG6">PyTorch Docs/Tutorials survey</a>.</p></div>'
217+
if ($(".pytorch-call-to-action-links").length) {
218+
$(".pytorch-call-to-action-links").before(survey);
219+
} else {
220+
$("#pytorch-article").prepend(survey);
221+
}
222+
</script>
223+
213224
{% endblock %}

0 commit comments

Comments
 (0)