Skip to content

Commit

Permalink
Improve unknown platform issue template
Browse files Browse the repository at this point in the history
  • Loading branch information
senekor committed Sep 9, 2024
1 parent 9cb3459 commit d203dc3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
15 changes: 15 additions & 0 deletions static/scripts/tools-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,23 @@ function set_up_cycle_button() {
function fill_in_bug_report_values() {
var nav_plat = document.getElementById("nav-plat");
var nav_app = document.getElementById("nav-app");
var report_link = document.getElementById("report-unknown-platform-link");
nav_plat.textContent = navigator.platform;
nav_app.textContent = navigator.appVersion;
var issue_template = `\
<!--
PLEASE do not open an issue if you are using Android!
The Rust toolchain does not run and can't be installed on Android.
If you are on desktop, go ahead and open this issue.
-->
navigator.platform: \`${navigator.platform}\`
navigator.appVersion: \`${navigator.appVersion}\`
The website did not recognize the platform I'm on, so I am unable to install rustup.`;
report_link.href = "https://github.com/rust-lang/www.rust-lang.org/issues/new?title=Unrecognized%20platform&body=" + encodeURIComponent(issue_template);
}

var override_map = new Map ([
Expand Down
9 changes: 8 additions & 1 deletion templates/components/tools/rustup.html.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@
</div>
</div>
<br/>
<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>
<!-- This href is overwritten with a better template in static/scripts/tools-install.js -->
<a
href="https://github.com/rust-lang/www.rust-lang.org/issues/new"
id="report-unknown-platform-link"
class="button button-secondary"
>
{{fluent "tools-rustup-report"}}
</a>
<hr/>
<div>
<p>
Expand Down

0 comments on commit d203dc3

Please sign in to comment.