| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
use makeover_layout as layout; |
| 42 |
use quasi_router::screen::{Act, Row}; |
| 43 |
use quasi_router::{ |
| 44 |
Action, Document, Node, RegionKind, Request, Response, RouteError, Screen as Described, Slot, |
| 45 |
}; |
| 46 |
use quasi_webview::Webview; |
| 47 |
|
| 48 |
|
| 49 |
pub const PATH: &str = "/policy"; |
| 50 |
|
| 51 |
|
| 52 |
pub const PAGE_REGION: &str = "policy"; |
| 53 |
|
| 54 |
const MEASURE: layout::Measure = layout::Measure::Wide; |
| 55 |
|
| 56 |
|
| 57 |
struct Section { |
| 58 |
heading: &'static str, |
| 59 |
|
| 60 |
|
| 61 |
body: &'static str, |
| 62 |
} |
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
const SECTIONS: &[Section] = &[ |
| 67 |
Section { |
| 68 |
heading: "What's Welcome", |
| 69 |
body: "Creative work across all supported types:\n\ |
| 70 |
\n\ |
| 71 |
- Software, plugins, presets, and templates\n\ |
| 72 |
- Audio: music, podcasts, samples, sound design\n\ |
| 73 |
- Writing: articles, guides, courses, fiction\n\ |
| 74 |
- Visual work: images, photography, design assets\n\ |
| 75 |
- Video: tutorials, performances, documentaries\n\ |
| 76 |
\n\ |
| 77 |
If you made it and it's legal to distribute, it belongs here.", |
| 78 |
}, |
| 79 |
Section { |
| 80 |
heading: "What's Not Allowed", |
| 81 |
body: "- Content that violates applicable law\n\ |
| 82 |
- Harassment, threats, or doxxing\n\ |
| 83 |
- Spam, deceptive listings, or bait-and-switch pricing\n\ |
| 84 |
- Malware, exploits, or tools designed to cause harm\n\ |
| 85 |
- Impersonation of other creators or organizations\n\ |
| 86 |
- Content you don't have the rights to distribute", |
| 87 |
}, |
| 88 |
Section { |
| 89 |
heading: "How We Handle Issues", |
| 90 |
body: "During private alpha, every creator has a direct relationship with the admin. \ |
| 91 |
If something comes up, we talk about it. No automated takedowns, no faceless \ |
| 92 |
tickets.\n\ |
| 93 |
\n\ |
| 94 |
Post-alpha, we'll introduce a formal process with written notice of any policy \ |
| 95 |
violation, an opportunity to appeal, and continued access to data export \ |
| 96 |
throughout.", |
| 97 |
}, |
| 98 |
Section { |
| 99 |
heading: "Your Rights", |
| 100 |
body: "- Full data export is always available: your content, metadata, and transaction \ |
| 101 |
history\n\ |
| 102 |
- If we ever moderate content or suspend an account, you'll get a clear \ |
| 103 |
explanation of what policy was violated\n\ |
| 104 |
- You'll have the opportunity to appeal\n\ |
| 105 |
- You can export your data even while suspended (excluding content we can't \ |
| 106 |
legally host)\n\ |
| 107 |
\n\ |
| 108 |
These commitments are part of our [creator guarantees](/docs/guarantees).", |
| 109 |
}, |
| 110 |
Section { |
| 111 |
heading: "Software Downloads", |
| 112 |
body: "Makenotwork hosts downloadable software uploaded by creators. While we take \ |
| 113 |
steps to make sure downloads are safe:\n\ |
| 114 |
\n\ |
| 115 |
- Creators are responsible for the safety and integrity of their uploads\n\ |
| 116 |
- Users should verify downloads with antivirus software before running them\n\ |
| 117 |
- We do not guarantee that any download is free of malware or other harmful \ |
| 118 |
content\n\ |
| 119 |
- Report suspicious downloads to **reports@makenot.work**", |
| 120 |
}, |
| 121 |
]; |
| 122 |
|
| 123 |
|
| 124 |
const OTHER: &[(&str, &str, &str)] = &[ |
| 125 |
( |
| 126 |
"Terms of Service", |
| 127 |
"What you agree to by using Makenotwork", |
| 128 |
"/docs/terms-of-service", |
| 129 |
), |
| 130 |
( |
| 131 |
"Privacy Policy", |
| 132 |
"What we collect, why, and how to exercise your rights", |
| 133 |
"/docs/privacy-policy", |
| 134 |
), |
| 135 |
( |
| 136 |
"Payments & Refunds", |
| 137 |
"Merchant-of-record model, refunds, chargebacks", |
| 138 |
"/docs/payments", |
| 139 |
), |
| 140 |
( |
| 141 |
"Acceptable Use", |
| 142 |
"Specific behaviour that gets accounts suspended", |
| 143 |
"/docs/acceptable-use", |
| 144 |
), |
| 145 |
( |
| 146 |
"Copyright & DMCA", |
| 147 |
"How takedowns and counter-notifications work", |
| 148 |
"/docs/copyright", |
| 149 |
), |
| 150 |
( |
| 151 |
"Appeals", |
| 152 |
"How to challenge a moderation decision", |
| 153 |
"/docs/appeals", |
| 154 |
), |
| 155 |
( |
| 156 |
"Mailing List Data Processing", |
| 157 |
"Who answers a subscriber's request about a project mailing list", |
| 158 |
"/docs/mailing-list-data-processing", |
| 159 |
), |
| 160 |
]; |
| 161 |
|
| 162 |
|
| 163 |
pub fn screen(_viewer: &super::Viewer, _request: Request) -> Result<Response, RouteError> { |
| 164 |
Ok(page_screen().into()) |
| 165 |
} |
| 166 |
|
| 167 |
|
| 168 |
fn page_screen() -> Described { |
| 169 |
let mut page = Slot::new(PAGE_REGION, RegionKind::Pane) |
| 170 |
.with(Node::page("Content Policy")) |
| 171 |
.with(Node::text( |
| 172 |
"Makenotwork exists so creators can sell their work on fair terms. This policy \ |
| 173 |
describes what belongs here, what doesn't, and how we handle problems.", |
| 174 |
)); |
| 175 |
|
| 176 |
for section in SECTIONS { |
| 177 |
page = page |
| 178 |
.with(Node::section(section.heading)) |
| 179 |
.with(super::own_prose(section.body)); |
| 180 |
} |
| 181 |
|
| 182 |
page = page |
| 183 |
.with(Node::section("Other Policies")) |
| 184 |
.with(Node::list(OTHER.iter().map(|(title, covers, route)| { |
| 185 |
Row::new(*title) |
| 186 |
.secondary(*covers) |
| 187 |
.act(Act::new("Read", Action::get(*route).navigating())) |
| 188 |
}))); |
| 189 |
|
| 190 |
page = page.with(Node::section("Questions")).with(super::own_prose( |
| 191 |
"If something's unclear or you want to check before posting, reach out at \ |
| 192 |
**policy@makenot.work**.", |
| 193 |
)); |
| 194 |
|
| 195 |
Described::single("Content Policy - Makenotwork") |
| 196 |
.measured(MEASURE) |
| 197 |
.documented( |
| 198 |
Document::default().classed(crate::shell::body_class(MEASURE, &["policy-page"])), |
| 199 |
) |
| 200 |
.summarised("What belongs on Makenotwork, what doesn't, and how problems are handled.") |
| 201 |
.with(page) |
| 202 |
} |
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
#[must_use] |
| 207 |
pub fn renderer(viewer: &super::Viewer) -> Webview { |
| 208 |
Webview::new().with_shell(viewer.document_shell().with_body_first(format!( |
| 209 |
"{}{}", |
| 210 |
crate::shell::skip_link(PAGE_REGION), |
| 211 |
crate::shell::site_header(viewer.user.as_ref()), |
| 212 |
))) |
| 213 |
} |
| 214 |
|
| 215 |
#[cfg(test)] |
| 216 |
mod tests { |
| 217 |
use super::*; |
| 218 |
|
| 219 |
fn html() -> String { |
| 220 |
use quasi_axum::Serves as _; |
| 221 |
|
| 222 |
Webview::new().screen(&page_screen()) |
| 223 |
} |
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
#[test] |
| 228 |
fn the_document_carries_the_classes_the_template_carried() { |
| 229 |
let screen = page_screen(); |
| 230 |
|
| 231 |
assert_eq!( |
| 232 |
screen.document.body_class.as_deref(), |
| 233 |
Some("padded-page policy-page") |
| 234 |
); |
| 235 |
assert!( |
| 236 |
html().contains("class=\"padded-page policy-page\""), |
| 237 |
"{}", |
| 238 |
html() |
| 239 |
); |
| 240 |
} |
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
#[test] |
| 246 |
fn the_prose_keeps_its_inline_link_and_its_emphasis() { |
| 247 |
let html = html(); |
| 248 |
|
| 249 |
assert!( |
| 250 |
html.contains(r#"href="/docs/guarantees""#), |
| 251 |
"the creator-guarantees link did not survive: {html}" |
| 252 |
); |
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
assert!( |
| 257 |
!html.contains("nofollow"), |
| 258 |
"the policy page nofollowed its own documents: {html}" |
| 259 |
); |
| 260 |
assert!( |
| 261 |
html.contains("<strong>reports@makenot.work</strong>") |
| 262 |
|| html.contains("<b>reports@makenot.work</b>"), |
| 263 |
"the reports address lost its emphasis: {html}" |
| 264 |
); |
| 265 |
} |
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
#[test] |
| 273 |
fn every_other_policy_keeps_its_row_and_its_route() { |
| 274 |
let html = html(); |
| 275 |
|
| 276 |
for (title, _, route) in OTHER { |
| 277 |
let escaped = crate::helpers::escape_html(title); |
| 278 |
assert!(html.contains(&escaped), "{title} missing"); |
| 279 |
assert!(html.contains(route), "{route} missing"); |
| 280 |
} |
| 281 |
} |
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
#[test] |
| 287 |
fn both_contact_addresses_survive_and_stay_distinct() { |
| 288 |
let html = html(); |
| 289 |
|
| 290 |
assert!(html.contains("reports@makenot.work"), "{html}"); |
| 291 |
assert!(html.contains("policy@makenot.work"), "{html}"); |
| 292 |
} |
| 293 |
|
| 294 |
|
| 295 |
#[test] |
| 296 |
fn the_page_spells_no_spinner() { |
| 297 |
let html = html(); |
| 298 |
|
| 299 |
for spelling in ["htmx-indicator", "spinner", "loading-text", "loading-state"] { |
| 300 |
assert!(!html.contains(spelling), "{spelling} survives in {html}"); |
| 301 |
} |
| 302 |
} |
| 303 |
} |
| 304 |
|