| 208 |
208 |
|
// The two flavours of a linked value in one row. A profile
|
| 209 |
209 |
|
// is a route this server answers, so it stays inside the
|
| 210 |
210 |
|
// app; an address is not, so it leaves.
|
|
211 |
+ |
//
|
|
212 |
+ |
// Navigating (`00ee7af5`): a profile is a whole document,
|
|
213 |
+ |
// not a region, so the anchor is the whole of it and the
|
|
214 |
+ |
// swap is dropped. Without it htmx would morph a
|
|
215 |
+ |
// `<!doctype html>` page over the cell it was clicked in.
|
| 211 |
216 |
|
Cell::new(buyer.username.clone())
|
| 212 |
|
- |
.activate(Action::get(format!("/u/{}", buyer.username))),
|
|
217 |
+ |
.activate(Action::get(format!("/u/{}", buyer.username)).navigating()),
|
| 213 |
218 |
|
Cell::new(buyer.email.clone())
|
| 214 |
219 |
|
.activate(Action::external(format!("mailto:{}", buyer.email))),
|
| 215 |
220 |
|
Cell::new(buyer.purchases.clone()),
|
| 243 |
248 |
|
// is where it goes, which is the pairing the template made
|
| 244 |
249 |
|
// with a nested `{% if let %}` inside the anchor.
|
| 245 |
250 |
|
Cell::new(creator.name.clone())
|
| 246 |
|
- |
.activate(Action::get(format!("/u/{}", creator.username))),
|
|
251 |
+ |
.activate(Action::get(format!("/u/{}", creator.username)).navigating()),
|
| 247 |
252 |
|
Cell::acts([Act::new(
|
| 248 |
253 |
|
"Revoke",
|
| 249 |
254 |
|
// This screen's own route, under its own nest. The API's
|
| 347 |
352 |
|
let html = render(&buyers_table(&[buyer("ada")]));
|
| 348 |
353 |
|
|
| 349 |
354 |
|
// A read of a route this server answers: an anchor with a real href, so
|
| 350 |
|
- |
// middle-click and copy-link work and it stays in the app.
|
|
355 |
+ |
// middle-click and copy-link work and it stays in the app. Navigating,
|
|
356 |
+ |
// so the anchor is all of it: a verb here would swap a whole document
|
|
357 |
+ |
// into the cell.
|
| 351 |
358 |
|
assert!(html.contains("href=\"/u/ada\""), "{html}");
|
|
359 |
+ |
assert!(
|
|
360 |
+ |
!html.contains("hx-get=\"/u/ada\""),
|
|
361 |
+ |
"a navigation carries no verb: {html}"
|
|
362 |
+ |
);
|
| 352 |
363 |
|
assert!(
|
| 353 |
364 |
|
!html.contains("hx-get=\"mailto"),
|
| 354 |
365 |
|
"no htmx on a mailto: {html}"
|