Your one-stop-cake-shop for everything Freshly Baked has to offer

fix(m): correct links on regex deletion page

With regex, we're not linking to the start/end shortlinks as they are
not necessarily valid links. We missed changing these to codeblocks on
the deletion page, so let's do that now...

+52 -3
menu/src/html/delete/success.html menu/src/html/delete/success/direct.html
+23
menu/src/html/delete/success/regex.html
··· 1 + <!-- 2 + SPDX-FileCopyrightText: 2026 Freshly Baked Cake 3 + 4 + SPDX-License-Identifier: MIT 5 + --> 6 + 7 + <html> 8 + <head> 9 + <title>Add shortlink</title> 10 + <link rel="stylesheet" href="/_/public/logo.css"/> 11 + <link rel="stylesheet" href="/_/public/colors.css"/> 12 + <link rel="stylesheet" href="/_/public/actions.css"/> 13 + </head> 14 + 15 + <body> 16 + <div id="logo"><div><span><span class="success">Deleted</span> shortlink</span><img src="/_/public/logo.svg"></div></div> 17 + <p><code>/{from}/i</code> no longer goes to <code>{current}</code></p> 18 + <ul> 19 + <li><a href="/_/create?from={from:url}&to={current:url}&format={format:url}">Recreate it</a></li> 20 + <li><a href="/">All shortlinks</a></li> 21 + </ul> 22 + </body> 23 + </html>
+21 -1
menu/src/main.rs
··· 191 191 Query(params): Query<HashMap<String, String>>, 192 192 headers: HeaderMap, 193 193 ) -> Result<Html<String>> { 194 - handle_static_page(StaticPageType::DeleteSuccess, session, &params, &headers).await 194 + match params.get("format").and_then(|s| Some(s.as_str())) { 195 + Some("direct") => { 196 + handle_static_page( 197 + StaticPageType::DeleteDirectSuccess, 198 + session, 199 + &params, 200 + &headers, 201 + ) 202 + .await 203 + } 204 + Some("regex") => { 205 + handle_static_page( 206 + StaticPageType::DeleteRegexSuccess, 207 + session, 208 + &params, 209 + &headers, 210 + ) 211 + .await 212 + } 213 + _ => Err("Invalid format".into()), 214 + } 195 215 } 196 216 async fn handle_delete_failure_page( 197 217 session: Session,
+8 -2
menu/src/static_html.rs
··· 46 46 CreateDirectSuccess, 47 47 CreateRegexSuccess, 48 48 DeleteFailure, 49 - DeleteSuccess, 49 + DeleteDirectSuccess, 50 + DeleteRegexSuccess, 50 51 Index, 51 52 } 52 53 ··· 76 77 include_String_dynamic!("./html/create/success/regex.html") 77 78 } 78 79 StaticPageType::DeleteFailure => include_String_dynamic!("./html/delete/failure.html"), 79 - StaticPageType::DeleteSuccess => include_String_dynamic!("./html/delete/success.html"), 80 + StaticPageType::DeleteDirectSuccess => { 81 + include_String_dynamic!("./html/delete/success/direct.html") 82 + } 83 + StaticPageType::DeleteRegexSuccess => { 84 + include_String_dynamic!("./html/delete/success/regex.html") 85 + } 80 86 StaticPageType::Index => include_String_dynamic!("./html/index.html"), 81 87 }; 82 88