better links to workspaces
This commit is contained in:
+17
-1
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user