better links to workspaces

This commit is contained in:
Mateusz Gruszczyński
2026-07-31 14:29:37 +02:00
parent c6e9a3dd43
commit eab9d5c7b6
5 changed files with 41 additions and 6 deletions
Generated
+1 -1
View File
@@ -2581,7 +2581,7 @@ dependencies = [
[[package]]
name = "rustpad"
version = "0.2.11"
version = "0.2.13"
dependencies = [
"argon2",
"aws-config",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "rustpad"
version = "0.2.11"
version = "0.2.13"
edition = "2024"
rust-version = "1.94"
description = "Collaborative Markdown notepad built with Axum, WebSockets and SQLite, PostgreSQL and MySQL"
+17 -1
View File
@@ -26,9 +26,25 @@ fn render_editor_page(
protected_resource_label: &str,
extra_shortcuts: &str,
) -> Response {
let (resource_aria_label, resource_breadcrumb) = if resource_kind == "note" {
(
"RustPad Workspace Note",
format!(
r#"<a id="resource-parent-link" class="resource-brand__kind" href="{}">Workspace</a><span class="resource-brand__separator" aria-hidden="true">/</span><span class="resource-brand__kind resource-brand__kind--current" aria-current="page">Note</span>"#,
escape_html(parent_url)
),
)
} else {
(
"RustPad Note",
r#"<span class="resource-brand__kind resource-brand__kind--current" aria-current="page">Note</span>"#.to_string(),
)
};
let html = include_str!("../../static/editor.html")
.replace("__RESOURCE_KIND__", resource_kind)
.replace("__RESOURCE_LABEL__", "Note")
.replace("__RESOURCE_ARIA_LABEL__", resource_aria_label)
.replace("__RESOURCE_BREADCRUMB__", &resource_breadcrumb)
.replace("__DOCUMENT_TITLE__", &escape_html(document_title))
.replace("__PARENT_TITLE__", &escape_html(parent_title))
.replace("__PARENT_URL__", &escape_html(parent_url))
+20 -1
View File
@@ -2586,7 +2586,7 @@ dialog::backdrop {
}
.hide-preview-line-numbers .preview {
padding-left: 0;
padding-left: 24px;
}
.hide-preview-line-numbers .preview-source-line::before {
@@ -6178,6 +6178,25 @@ dialog::backdrop {
text-decoration: none;
}
.resource-brand__trail {
display: flex;
align-items: center;
gap: 5px;
min-height: .8rem;
white-space: nowrap;
}
.resource-brand__separator {
color: var(--text-muted);
font-size: .68rem;
line-height: 1;
user-select: none;
}
.resource-brand__kind--current {
color: var(--text-heading);
}
.resource-brand__kind:hover,
.resource-brand__kind:focus-visible,
.resource-brand__logo:hover,
+2 -2
View File
@@ -15,9 +15,9 @@
<body class="pad-page" data-resource-kind="__RESOURCE_KIND__" data-registration-enabled="__REGISTRATION_ENABLED__">
<header class="app-header">
<div class="app-header__main">
<div class="resource-brand" aria-label="RustPad __RESOURCE_LABEL__">
<div class="resource-brand" aria-label="__RESOURCE_ARIA_LABEL__">
<a class="resource-brand__logo home-brand" href="/" aria-label="RustPad home">RustPad</a>
<a id="resource-parent-link" class="resource-brand__kind __PARENT_CLASS__" href="__PARENT_URL__">__RESOURCE_LABEL__</a>
<nav class="resource-brand__trail" aria-label="Current location">__RESOURCE_BREADCRUMB__</nav>
</div>
<span class="header-divider"></span>
<div id="document-link-copy" class="document-heading document-heading--copy" role="button" tabindex="0"