Polish PWA assets, accessible tabs and bulk selection, harden bulk revoke tests
This commit is contained in:
@@ -188,14 +188,14 @@ pub fn CertificatesPage(vault_id: String) -> View {
|
||||
div(class="card mb-3") {
|
||||
div(class="card-body py-2") {
|
||||
input(class="form-control", placeholder="Filter by name, subject, issuer, serial or fingerprint…",
|
||||
bind:value=filter)
|
||||
aria-label="Filter certificates", bind:value=filter)
|
||||
}
|
||||
}
|
||||
div(class="card mb-3") {
|
||||
div(class="card-body") {
|
||||
div(class="d-flex flex-wrap gap-2 align-items-end") {
|
||||
div(class="me-auto") {
|
||||
div(class="small text-secondary") { (format!("{} selected", selected.get_clone().len())) }
|
||||
div(class="small text-secondary", aria-live="polite") { (format!("{} selected", selected.get_clone().len())) }
|
||||
div(class="d-flex gap-2 mt-1") {
|
||||
button(class="btn btn-sm btn-outline-light", on:click=select_all) { "Select all revocable" }
|
||||
button(class="btn btn-sm btn-outline-light", on:click=clear_selection) { "Clear" }
|
||||
@@ -259,7 +259,7 @@ fn flat_html(rows: &[CertificateSummary], vault_id: &str, selected: &[String]) -
|
||||
));
|
||||
}
|
||||
format!(
|
||||
"<div class=\"table-responsive\"><table class=\"table table-hover align-middle mb-0\"><thead><tr><th></th><th>Name</th><th>Issuer</th><th>Type</th><th>Serial</th><th>Expires</th><th>Status</th><th>SHA-256</th></tr></thead><tbody>{body}</tbody></table></div>"
|
||||
"<div class=\"table-responsive\"><table class=\"table table-hover align-middle mb-0\"><thead><tr><th scope=\"col\"><span class=\"visually-hidden\">Select</span></th><th scope=\"col\">Name</th><th scope=\"col\">Issuer</th><th scope=\"col\">Type</th><th scope=\"col\">Serial</th><th scope=\"col\">Expires</th><th scope=\"col\">Status</th><th scope=\"col\">SHA-256</th></tr></thead><tbody>{body}</tbody></table></div>"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -333,7 +333,7 @@ fn node_html(
|
||||
|
||||
fn checkbox(cert: &CertificateSummary, selected: &[String]) -> String {
|
||||
if cert.issuer_id.is_none() {
|
||||
return "<input class=\"form-check-input\" type=\"checkbox\" disabled title=\"Self-signed certificates cannot be revoked\">".to_string();
|
||||
return "<input class=\"form-check-input\" type=\"checkbox\" disabled aria-label=\"Self-signed certificates cannot be revoked\" title=\"Self-signed certificates cannot be revoked\">".to_string();
|
||||
}
|
||||
let checked = if selected.contains(&cert.id) {
|
||||
" checked"
|
||||
@@ -341,8 +341,9 @@ fn checkbox(cert: &CertificateSummary, selected: &[String]) -> String {
|
||||
""
|
||||
};
|
||||
format!(
|
||||
"<input class=\"form-check-input\" type=\"checkbox\" data-cert-id=\"{}\"{}>",
|
||||
"<input class=\"form-check-input\" type=\"checkbox\" data-cert-id=\"{}\" aria-label=\"Select {} for revocation\"{}>",
|
||||
escape(&cert.id),
|
||||
escape(&cert.name),
|
||||
checked
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user