From c9b45a57d271359800a633e03d389b3d1fb7514d Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Sun, 13 Nov 2022 11:09:43 +0800 Subject: [PATCH] Use a checkbox and CSS to show info messages instead of JavaScript This works in browsers where users have disabled JavaScript, such as the Tor Browser in the Security Level called Safest. Obsoletes: https://salsa.debian.org/debbugs-team/debbugs/-/merge_requests/9 --- html/bugs.css | 5 +++++ templates/en_US/cgi/bugreport.tmpl | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/html/bugs.css b/html/bugs.css index 1fb0198..6ef12d6 100644 --- a/html/bugs.css +++ b/html/bugs.css @@ -170,6 +170,11 @@ pre.mime { color: #797979; } +/* Show info messages when uselessmessages is checked */ +#uselessmessages:checked ~ .infmessage { + display: block; +} + /* This must be separate from the other CSS to make the showing of unimportant messages work in bugreport.cgi. */ .infmessage { display: none; } diff --git a/templates/en_US/cgi/bugreport.tmpl b/templates/en_US/cgi/bugreport.tmpl index c076509..829f989 100644 --- a/templates/en_US/cgi/bugreport.tmpl +++ b/templates/en_US/cgi/bugreport.tmpl @@ -33,7 +33,7 @@ function toggle_infmessages() qq(or subscribe ). qq(to this bug.

\n); } - $output .= qq(

Toggle useless messages

); + $output .= qq(

); $output .= sprintf qq(

View this report as an mbox folder, ). qq(status mbox, maintainer mbox

\n), html_escape(bug_links(bug=>$bug_num, links_only=>1,options=>{mbox=>'yes'})), -- 2.39.2