| 41 |
41 |
|
//! is a second thing to keep in step with the calculator.
|
| 42 |
42 |
|
|
| 43 |
43 |
|
use makeover_layout as layout;
|
| 44 |
|
- |
use quasi_router::screen::Row;
|
| 45 |
|
- |
use quasi_router::{
|
| 46 |
|
- |
Action, Document, Node, RegionKind, Request, Response, RouteError, Screen as Described, Slot,
|
| 47 |
|
- |
};
|
|
44 |
+ |
use quasi_declare::declare;
|
|
45 |
+ |
use quasi_router::{Document, Request, Response, RouteError};
|
| 48 |
46 |
|
use quasi_webview::Webview;
|
| 49 |
47 |
|
|
| 50 |
48 |
|
use crate::tier_prices::TierPrices;
|
| 242 |
240 |
|
},
|
| 243 |
241 |
|
];
|
| 244 |
242 |
|
|
|
243 |
+ |
/// One thing every tier includes.
|
|
244 |
+ |
struct Included {
|
|
245 |
+ |
name: &'static str,
|
|
246 |
+ |
sentence: &'static str,
|
|
247 |
+ |
}
|
|
248 |
+ |
|
| 245 |
249 |
|
/// What every tier includes, name and sentence, in the template's order.
|
| 246 |
|
- |
const UNIVERSAL_LIST: &[(&str, &str)] = &[
|
| 247 |
|
- |
(
|
| 248 |
|
- |
"0% platform fee",
|
| 249 |
|
- |
"Only ~3% payment processing. No percentage cuts, no revenue sharing.",
|
| 250 |
|
- |
),
|
| 251 |
|
- |
(
|
| 252 |
|
- |
"Full data export",
|
| 253 |
|
- |
"Download everything anytime. Projects, items, sales, contacts: all yours.",
|
| 254 |
|
- |
),
|
| 255 |
|
- |
(
|
| 256 |
|
- |
"No lock-in",
|
| 257 |
|
- |
"Month-to-month. Cancel anytime. Take your audience with you.",
|
| 258 |
|
- |
),
|
| 259 |
|
- |
(
|
| 260 |
|
- |
"Source available",
|
| 261 |
|
- |
"Read the codebase. Verify every claim about privacy and data handling.",
|
| 262 |
|
- |
),
|
|
250 |
+ |
const UNIVERSAL_LIST: &[Included] = &[
|
|
251 |
+ |
Included {
|
|
252 |
+ |
name: "0% platform fee",
|
|
253 |
+ |
sentence: "Only ~3% payment processing. No percentage cuts, no revenue sharing.",
|
|
254 |
+ |
},
|
|
255 |
+ |
Included {
|
|
256 |
+ |
name: "Full data export",
|
|
257 |
+ |
sentence: "Download everything anytime. Projects, items, sales, contacts: all yours.",
|
|
258 |
+ |
},
|
|
259 |
+ |
Included {
|
|
260 |
+ |
name: "No lock-in",
|
|
261 |
+ |
sentence: "Month-to-month. Cancel anytime. Take your audience with you.",
|
|
262 |
+ |
},
|
|
263 |
+ |
Included {
|
|
264 |
+ |
name: "Source available",
|
|
265 |
+ |
sentence: "Read the codebase. Verify every claim about privacy and data handling.",
|
|
266 |
+ |
},
|
| 263 |
267 |
|
];
|
| 264 |
268 |
|
|
|
269 |
+ |
/// One way onward off this page.
|
|
270 |
+ |
struct Onward {
|
|
271 |
+ |
label: &'static str,
|
|
272 |
+ |
route: &'static str,
|
|
273 |
+ |
}
|
|
274 |
+ |
|
| 265 |
275 |
|
/// Where the page sends a reader who is convinced, and where it sends one who
|
| 266 |
276 |
|
/// is not yet.
|
| 267 |
|
- |
const ONWARD: &[(&str, &str)] = &[
|
| 268 |
|
- |
("Pricing Calculator", "/pricing"),
|
| 269 |
|
- |
("Browse as guest", "/discover"),
|
| 270 |
|
- |
("Creator Guide", "/docs/getting-started"),
|
|
277 |
+ |
const ONWARD: &[Onward] = &[
|
|
278 |
+ |
Onward {
|
|
279 |
+ |
label: "Pricing Calculator",
|
|
280 |
+ |
route: "/pricing",
|
|
281 |
+ |
},
|
|
282 |
+ |
Onward {
|
|
283 |
+ |
label: "Browse as guest",
|
|
284 |
+ |
route: "/discover",
|
|
285 |
+ |
},
|
|
286 |
+ |
Onward {
|
|
287 |
+ |
label: "Creator Guide",
|
|
288 |
+ |
route: "/docs/getting-started",
|
|
289 |
+ |
},
|
| 271 |
290 |
|
];
|
| 272 |
291 |
|
|
| 273 |
292 |
|
/// The page. Reads no database, only the prices already in memory.
|
| 278 |
297 |
|
Ok(page_screen(&billing.tier_prices).into())
|
| 279 |
298 |
|
}
|
| 280 |
299 |
|
|
| 281 |
|
- |
/// The whole document: the title, the measure, the body.
|
| 282 |
|
- |
fn page_screen(prices: &TierPrices) -> Described {
|
| 283 |
|
- |
let mut profiles = Slot::new(PROFILES, RegionKind::Group);
|
| 284 |
|
- |
for profile in PROFILE_LIST {
|
| 285 |
|
- |
profiles = profiles.with(Node::Region(card(profile, prices)));
|
|
300 |
+ |
declare! {
|
|
301 |
+ |
/// The whole document: the title, the measure, the body.
|
|
302 |
+ |
shape page_screen(prices: &TierPrices) -> Screen;
|
|
303 |
+ |
|
|
304 |
+ |
screen single "Use Cases - Makenotwork" {
|
|
305 |
+ |
measured MEASURE;
|
|
306 |
+ |
documented Document::default().classed(crate::shell::body_class(MEASURE, &["use-cases-page"]));
|
|
307 |
+ |
summarised "A flat monthly fee and no platform cut, for musicians, podcasters, writers, \
|
|
308 |
+ |
developers and six more kinds of creator.";
|
|
309 |
+ |
|
|
310 |
+ |
region PAGE_REGION as Pane {
|
|
311 |
+ |
page "Use Cases";
|
|
312 |
+ |
text "A flat monthly fee. 0% platform cut. Who it's built for:";
|
|
313 |
+ |
|
|
314 |
+ |
section "Available now";
|
|
315 |
+ |
region PROFILES as Group {
|
|
316 |
+ |
for profile in PROFILE_LIST {
|
|
317 |
+ |
include card(profile, prices);
|
|
318 |
+ |
}
|
|
319 |
+ |
}
|
|
320 |
+ |
|
|
321 |
+ |
section "Everyone gets";
|
|
322 |
+ |
region UNIVERSAL as Group {
|
|
323 |
+ |
list {
|
|
324 |
+ |
for gets in UNIVERSAL_LIST {
|
|
325 |
+ |
row gets.name {
|
|
326 |
+ |
secondary gets.sentence;
|
|
327 |
+ |
}
|
|
328 |
+ |
}
|
|
329 |
+ |
}
|
|
330 |
+ |
}
|
|
331 |
+ |
|
|
332 |
+ |
act "Join the Alpha" to get "/join" navigating;
|
|
333 |
+ |
for onward in ONWARD {
|
|
334 |
+ |
act onward.label to get onward.route navigating;
|
|
335 |
+ |
}
|
|
336 |
+ |
}
|
| 286 |
337 |
|
}
|
| 287 |
|
- |
|
| 288 |
|
- |
let universal = Node::list(
|
| 289 |
|
- |
UNIVERSAL_LIST
|
| 290 |
|
- |
.iter()
|
| 291 |
|
- |
.map(|(name, description)| Row::new(*name).secondary(*description)),
|
| 292 |
|
- |
);
|
| 293 |
|
- |
|
| 294 |
|
- |
let mut page = Slot::new(PAGE_REGION, RegionKind::Pane)
|
| 295 |
|
- |
.with(Node::page("Use Cases"))
|
| 296 |
|
- |
.with(Node::text(
|
| 297 |
|
- |
"A flat monthly fee. 0% platform cut. Who it's built for:",
|
| 298 |
|
- |
))
|
| 299 |
|
- |
.with(Node::section("Available now"))
|
| 300 |
|
- |
.with(Node::Region(profiles))
|
| 301 |
|
- |
.with(Node::section("Everyone gets"))
|
| 302 |
|
- |
.with(Node::Region(
|
| 303 |
|
- |
Slot::new(UNIVERSAL, RegionKind::Group).with(universal),
|
| 304 |
|
- |
))
|
| 305 |
|
- |
.with(Node::act(
|
| 306 |
|
- |
"Join the Alpha",
|
| 307 |
|
- |
Action::get("/join").navigating(),
|
| 308 |
|
- |
));
|
| 309 |
|
- |
|
| 310 |
|
- |
for (label, route) in ONWARD {
|
| 311 |
|
- |
page = page.with(Node::act(*label, Action::get(*route).navigating()));
|
| 312 |
|
- |
}
|
| 313 |
|
- |
|
| 314 |
|
- |
Described::single("Use Cases - Makenotwork")
|
| 315 |
|
- |
.measured(MEASURE)
|
| 316 |
|
- |
.documented(
|
| 317 |
|
- |
Document::default().classed(crate::shell::body_class(MEASURE, &["use-cases-page"])),
|
| 318 |
|
- |
)
|
| 319 |
|
- |
.summarised(
|
| 320 |
|
- |
"A flat monthly fee and no platform cut, for musicians, podcasters, writers, \
|
| 321 |
|
- |
developers and six more kinds of creator.",
|
| 322 |
|
- |
)
|
| 323 |
|
- |
.with(page)
|
| 324 |
338 |
|
}
|
| 325 |
339 |
|
|
| 326 |
|
- |
/// One profile card: who it is for, what they get, what it costs.
|
| 327 |
|
- |
///
|
| 328 |
|
- |
/// The region is identified by the template's anchor so `/use-cases#podcasters`
|
| 329 |
|
- |
/// still lands on the right card.
|
| 330 |
|
- |
fn card(profile: &Profile, prices: &TierPrices) -> Slot {
|
| 331 |
|
- |
let features = Node::list(profile.features.iter().map(|feature| Row::new(*feature)));
|
|
340 |
+ |
declare! {
|
|
341 |
+ |
/// One profile card: who it is for, what they get, what it costs.
|
|
342 |
+ |
///
|
|
343 |
+ |
/// The region is identified by the template's anchor so `/use-cases#podcasters`
|
|
344 |
+ |
/// still lands on the right card.
|
|
345 |
+ |
shape card(profile: &Profile, prices: &TierPrices) -> Slot;
|
| 332 |
346 |
|
|
| 333 |
|
- |
Slot::new(profile.anchor, RegionKind::Group)
|
| 334 |
|
- |
.label(profile.title)
|
| 335 |
|
- |
.with(Node::text(profile.who))
|
| 336 |
|
- |
.with(Node::text(profile.description))
|
| 337 |
|
- |
.with(features)
|
| 338 |
|
- |
.with(Node::text(profile.priced.line(prices)))
|
|
347 |
+ |
region profile.anchor as Group {
|
|
348 |
+ |
label profile.title;
|
|
349 |
+ |
text profile.who;
|
|
350 |
+ |
text profile.description;
|
|
351 |
+ |
list {
|
|
352 |
+ |
for &feature in profile.features {
|
|
353 |
+ |
row feature;
|
|
354 |
+ |
}
|
|
355 |
+ |
}
|
|
356 |
+ |
text profile.priced.line(prices);
|
|
357 |
+ |
}
|
| 339 |
358 |
|
}
|
| 340 |
359 |
|
|
| 341 |
360 |
|
/// The document this screen is drawn in. Same shape as `/team`'s: the skip
|