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
+38 -5
Interdiff #2 โ†’ #3
menu/.sqlx/query-069d278baf0c78799bcc919daec41ecd2a331e10d5a315a7eb133289c1689167.json

This file has not been changed.

menu/.sqlx/query-069d278baf0c78799bcc919daec41ecd2a331e10d5a315a7eb133289c1689167.json.license

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.

+3 -1
menu/src/html/index.html
··· 14 14 15 15 <body> 16 16 <div id="logo"><div><span>Menu</span><img src="/_/public/logo.svg"></div></div> 17 - <table> 17 + <span class="actions">(<a href="/_/create">New link</a>) (<a href="/menu">Learn more</a>)</span> 18 + <table class="autogrid links"> 18 19 <tr> 19 20 <th>From</th> 20 21 <th>To</th> ··· 23 24 </tr> 24 25 {links:dangerous_raw} 25 26 </table> 27 + <span class="actions">(<a href="/_/create">New link</a>) (<a href="/menu">Learn more</a>)</span> 26 28 </body> 27 29 </html>
+23 -4
menu/src/html/public/tables.css
··· 4 4 * SPDX-License-Identifier: MIT 5 5 */ 6 6 7 - table { 8 - border-spacing: 0; 7 + table.autogrid { 8 + width: 100%; 9 + display: grid; 10 + justify-content: stretch; 9 11 } 10 12 11 - th, td { 13 + table.links { 14 + grid-template-columns: minmax(min-content, max-content) minmax(0, 1fr) minmax(min-content, max-content) minmax(min-content, max-content); 15 + } 16 + 17 + .autogrid tbody { 18 + display: contents; 19 + } 20 + 21 + .autogrid tr { 22 + margin: 0; 23 + display: contents; 24 + } 25 + 26 + .autogrid :is(th, td) { 27 + display: block; 12 28 border: 0.05em solid #144f5f; 13 29 padding: 0.5em 0.75em; 30 + margin: 0; 31 + overflow-wrap: break-word; 14 32 } 15 33 16 - table tr { 34 + table.autogrid tr { 17 35 &:first-child :is(th, td) { 18 36 /* First row */ 19 37 border-top-width: 0.1em; ··· 52 70 } 53 71 } 54 72 } 73 +
menu/src/main.rs

This file has not been changed.

+12
menu/src/html/public/logo.css
··· 26 26 font-family: sans-serif; 27 27 } 28 28 29 + .actions { 30 + align-self: start; 31 + font-size: 1rem; 32 + margin-top: 0.5rem; 33 + margin-bottom: 0.5rem; 34 + } 35 + 36 + p { 37 + max-width: 100%; 38 + overflow-wrap: break-word; 39 + } 40 + 29 41 #logo { 30 42 background: #144f5f; 31 43 border-radius: 0 0 0.5rem 0.5rem;

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