Skip to content

Commit 315ae60

Browse files
authored
Merge pull request #2041 from rust-lang/remo/xqqkzxwpwtml
Improve unknown platform issue template
2 parents fbc04e8 + d203dc3 commit 315ae60

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

static/scripts/tools-install.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,23 @@ function set_up_cycle_button() {
157157
function fill_in_bug_report_values() {
158158
var nav_plat = document.getElementById("nav-plat");
159159
var nav_app = document.getElementById("nav-app");
160+
var report_link = document.getElementById("report-unknown-platform-link");
160161
nav_plat.textContent = navigator.platform;
161162
nav_app.textContent = navigator.appVersion;
163+
var issue_template = `\
164+
<!--
165+
PLEASE do not open an issue if you are using Android!
166+
167+
The Rust toolchain does not run and can't be installed on Android.
168+
169+
If you are on desktop, go ahead and open this issue.
170+
-->
171+
172+
navigator.platform: \`${navigator.platform}\`
173+
navigator.appVersion: \`${navigator.appVersion}\`
174+
175+
The website did not recognize the platform I'm on, so I am unable to install rustup.`;
176+
report_link.href = "https://github.com/rust-lang/www.rust-lang.org/issues/new?title=Unrecognized%20platform&body=" + encodeURIComponent(issue_template);
162177
}
163178

164179
var override_map = new Map ([

templates/components/tools/rustup.html.hbs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@
3333
</div>
3434
</div>
3535
<br/>
36-
<a href="https://github.com/rust-lang/www.rust-lang.org/issues/new?title=Unrecognized%20platform&body=navigator.platform%3A%20_please%20fill%20out_%0Anavigator.appVersion%3A%20_please%20fill%20out_%0A%0AThe%20website%20did%20not%20recognize%20the%20platform%20I%27m%20on%2C%20so%20I%20am%20unable%20to%20install%20rustup." class="button button-secondary">{{fluent "tools-rustup-report"}}</a>
36+
<!-- This href is overwritten with a better template in static/scripts/tools-install.js -->
37+
<a
38+
href="https://github.com/rust-lang/www.rust-lang.org/issues/new"
39+
id="report-unknown-platform-link"
40+
class="button button-secondary"
41+
>
42+
{{fluent "tools-rustup-report"}}
43+
</a>
3744
<hr/>
3845
<div>
3946
<p>

0 commit comments

Comments
 (0)