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

feat(m): add "list links" page #169

merged opened by a.starrysky.fyi targeting main from private/minion/push-mkpovzswunnr

The main page should list all of our links, as well as allowing us to edit or delete them. I've also rewritten the templating system here to work off a regex, which is a lot more comfortable and also means that templates which aren't used can avoid being evaluated (at the cost of making a template that is used multiple times be evaluated multiple times - perhaps we should be memoizing here?)

Labels

None yet.

requested-reviewers

None yet.

approved

None yet.

tested-working

None yet.

rejected

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:uuyqs6y3pwtbteet4swt5i5y/sh.tangled.repo.pull/3mc6qjooc5c22
+14 -11
Interdiff #0 โ†’ #1
menu/.sqlx/query-1b4988d7979a505b569cfd4df711f85ea7a93074611822c91974eda5a473cff1.json

This file has not been changed.

menu/.sqlx/query-1b4988d7979a505b569cfd4df711f85ea7a93074611822c91974eda5a473cff1.json.license

This file has not been changed.

menu/Cargo.lock

This file has not been changed.

menu/Cargo.toml

This file has not been changed.

menu/src/html/index.html

This file has not been changed.

menu/src/html/public/tables.css

This file has not been changed.

+14 -11
menu/src/main.rs
··· 248 248 ); 249 249 250 250 if matches!(page_type, StaticPageType::Index) { 251 - let links_query = sqlx::query_as!(Link, r#"SELECT "from", "to", "owner" FROM direct"#,) 252 - .fetch_all( 253 - STATE 254 - .get() 255 - .expect("Server must be initialized before processing connections") 256 - .sqlx_connection 257 - .lock() 258 - .await 259 - .deref_mut(), 260 - ) 261 - .await; 251 + let links_query = sqlx::query_as!( 252 + Link, 253 + r#"SELECT "from", "to", "owner" FROM direct ORDER BY direct."from" DESC"#, 254 + ) 255 + .fetch_all( 256 + STATE 257 + .get() 258 + .expect("Server must be initialized before processing connections") 259 + .sqlx_connection 260 + .lock() 261 + .await 262 + .deref_mut(), 263 + ) 264 + .await; 262 265 263 266 let Ok(links) = links_query else { 264 267 return Err("Failed to query database".into());

History

5 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
feat(m): add "list links" page
5/5 success
expand
expand 0 comments
pull request successfully merged
1 commit
expand
feat(m): add "list links" page
5/5 success
expand
expand 0 comments
1 commit
expand
feat(m): add "list links" page
5/5 success
expand
expand 0 comments
1 commit
expand
feat(m): add "list links" page
1/5 failed, 4/5 success
expand
expand 0 comments
1 commit
expand
feat(m): add "list links" page
5/5 success
expand
expand 0 comments