code wiki / _hdl_build / nx_meet_intake.nx
nx_meet_intake.nx source
↩ module page · 119 lines · 7528 B
1// nx_meet_intake.nx -- R3+R4 (+P1 nav/clean-URLs): emit the sovereign ZERO-JS intake forms for BOTH venn sides
2// from ONE organ into web_assets/site_<slug>/apply.html (kind=apply) and hire.html (kind=hire), with the shared
3// header nav. Anti-fake is built INTO the form: a no-JS CSS honeypot (name="website"), a required "real person /
4// not AI-generated" attestation, and a verify field. POSTs to /apply or /request-talent (the daemon route, a
5// later rung). Brand from meet_<slug>.meet. license_tier: ORIGINAL
6// run: /tmp/nx_meet_intake.sov.elf <slug> <apply|hire> out: web_assets/site_<slug>/<kind>.html
7import "nx_syscalls.nx"
8import "nx_meet_lib.nx"
9import "nx_web_builder.nx"
10import "nx_brand_tokens.nx"
11const K_MAGIC_1024: i64 = 1024
12
13func ifield(fd: i64, label: *u8, name: *u8, typ: *u8, req: i64) -> i64 {
14 wb_w(fd, "<label>" as *u8); wb_w(fd, label); wb_w(fd, "</label><input type=\"" as *u8); wb_w(fd, typ)
15 wb_w(fd, "\" name=\"" as *u8); wb_w(fd, name); wb_w(fd, "\"" as *u8)
16 if req == 1 { wb_w(fd, " required" as *u8) }
17 wb_w(fd, ">\n" as *u8)
18 return 0
19}
20func iarea(fd: i64, label: *u8, name: *u8, req: i64) -> i64 {
21 wb_w(fd, "<label>" as *u8); wb_w(fd, label); wb_w(fd, "</label><textarea name=\"" as *u8); wb_w(fd, name); wb_w(fd, "\" rows=\"4\"" as *u8)
22 if req == 1 { wb_w(fd, " required" as *u8) }
23 wb_w(fd, "></textarea>\n" as *u8)
24 return 0
25}
26
27func main(argc: i64, argv: *i64) -> i64 {
28 let slug: *u8 = sys_mmap(64)
29 if argc >= 2 { meet_slug_safe(argv[1] as *u8, slug, 64) } else { meet_slug_safe("demo" as *u8, slug, 64) }
30 var ishire: i64 = 0
31 if argc >= 3 {
32 let kraw: *u8 = argv[2] as *u8
33 if meet_seq(kraw, 0, mlen(kraw), "hire" as *u8, 4) == 1 { ishire = 1 }
34 }
35 var kindname: *u8 = "apply" as *u8
36 var active: i64 = 2
37 if ishire == 1 { kindname = "hire" as *u8; active = 3 }
38
39 let cpath: *u8 = sys_mmap(256)
40 var o: i64 = mcat(cpath, 0, "web_assets/meet_" as *u8); o = mcat(cpath, o, slug); o = mcat(cpath, o, ".meet" as *u8)
41 let clp: *i64 = sys_mmap(16) as *i64; clp[0] = 0
42 var cdata: *u8 = sys_read_file(cpath, clp)
43 var cn: i64 = clp[0]
44 if (cdata as i64) == 0 { cn = 0 }
45 let brand: *u8 = sys_mmap(512)
46 meet_get_or(cdata, cn, "brand" as *u8, brand, 512, "Community Meet" as *u8)
47 let region: *u8 = sys_mmap(256)
48 meet_get_or(cdata, cn, "region" as *u8, region, 256, "the Dallas metro" as *u8)
49 let zip: *u8 = sys_mmap(32)
50 meet_get_or(cdata, cn, "zip" as *u8, zip, 32, "75071" as *u8)
51 let ebrand: *u8 = sys_mmap(K_MAGIC_1024); mesc(ebrand, 0, brand)
52 let eregion: *u8 = sys_mmap(512); mesc(eregion, 0, region)
53 let ezip: *u8 = sys_mmap(64); mesc(ezip, 0, zip)
54
55 let sdir: *u8 = sys_mmap(256)
56 o = mcat(sdir, 0, "web_assets/site_" as *u8); o = mcat(sdir, o, slug); meet_mkdir(sdir)
57 let opath: *u8 = sys_mmap(256)
58 o = mcat(opath, 0, sdir); o = mcat(opath, o, "/" as *u8); o = mcat(opath, o, kindname); o = mcat(opath, o, ".html" as *u8)
59 let foot: *u8 = sys_mmap(K_MAGIC_1024)
60 var ff: i64 = mcat(foot, 0, ebrand); ff = mcat(foot, ff, " -- " as *u8); ff = mcat(foot, ff, eregion)
61 ff = mcat(foot, ff, " (" as *u8); ff = mcat(foot, ff, ezip); ff = mcat(foot, ff, ") -- a Nishi sovereign community" as *u8)
62 let brandtok: *u8 = bt_default_brand()
63
64 var action: *u8 = "/apply" as *u8
65 var headline: *u8 = "Apply to join" as *u8
66 var sub: *u8 = "Real people only. Tell us who you are -- every member is verified before you meet anyone." as *u8
67 var submitl: *u8 = "Request an invite & apply" as *u8
68 var title: *u8 = "Apply" as *u8
69 if ishire == 1 {
70 action = "/request-talent" as *u8
71 headline = "Request vetted talent" as *u8
72 sub = "Skip the fake-resume flood. Tell us the real role -- we bring pre-verified, local candidates." as *u8
73 submitl = "Request vetted candidates" as *u8
74 title = "Request talent" as *u8
75 }
76 let pgtitle: *u8 = sys_mmap(K_MAGIC_1024)
77 var pt: i64 = mcat(pgtitle, 0, title); pt = mcat(pgtitle, pt, " -- " as *u8); pt = mcat(pgtitle, pt, ebrand)
78
79 let fd: i64 = sys_openat_wr(opath, 0x1a4)
80 if fd < 0 { mputs("nx_meet_intake: FAIL open output\n" as *u8); sys_exit(1); return 1 }
81 wb_doc_open_branded(fd, pgtitle, brandtok, bt_len(brandtok))
82 meet_nav_css(fd)
83 wb_w(fd, "<style>.intake{max-width:640px}.intake label{display:block;margin:14px 0 4px;font-weight:600}.intake input,.intake textarea{width:100%;padding:12px;font-size:1rem;border:1px solid var(--nx-color-line);border-radius:var(--nx-radius-sm);min-height:44px}.intake .att{display:flex;gap:10px;align-items:flex-start;font-weight:400;margin:18px 0}.intake .att input{width:auto;min-height:auto;margin-top:4px}.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.note{color:var(--nx-color-hero);font-weight:600;margin:14px 0}</style>\n" as *u8)
84 meet_header_nav(fd, brand, active)
85 wb_hero(fd, headline, sub, "Start" as *u8, "#form" as *u8)
86
87 wb_w(fd, "<section class=\"wrap\" id=\"form\"><form class=\"intake\" action=\"" as *u8); wb_w(fd, action); wb_w(fd, "\" method=\"post\">\n" as *u8)
88 wb_w(fd, "<div class=\"hp\" aria-hidden=\"true\"><label>Leave this field empty<input type=\"text\" name=\"website\" tabindex=\"-1\" autocomplete=\"off\"></label></div>\n" as *u8)
89
90 if ishire == 1 {
91 ifield(fd, "Your name" as *u8, "name" as *u8, "text" as *u8, 1)
92 ifield(fd, "Company" as *u8, "company" as *u8, "text" as *u8, 1)
93 ifield(fd, "Work email" as *u8, "email" as *u8, "email" as *u8, 1)
94 ifield(fd, "Phone" as *u8, "phone" as *u8, "tel" as *u8, 0)
95 ifield(fd, "Role you are hiring for" as *u8, "role" as *u8, "text" as *u8, 1)
96 ifield(fd, "Location" as *u8, "location" as *u8, "text" as *u8, 1)
97 ifield(fd, "Company website (so we can verify you)" as *u8, "company_url" as *u8, "url" as *u8, 1)
98 iarea(fd, "What you need -- the real role, not a ghost post" as *u8, "details" as *u8, 1)
99 wb_w(fd, "<label class=\"att\"><input type=\"checkbox\" name=\"attest\" required> This is a real, open role at a real company -- not a ghost posting.</label>\n" as *u8)
100 } else {
101 ifield(fd, "Full name" as *u8, "name" as *u8, "text" as *u8, 1)
102 ifield(fd, "Email" as *u8, "email" as *u8, "email" as *u8, 1)
103 ifield(fd, "Phone" as *u8, "phone" as *u8, "tel" as *u8, 0)
104 ifield(fd, "Role or field you are seeking" as *u8, "role" as *u8, "text" as *u8, 1)
105 ifield(fd, "Location (city / ZIP)" as *u8, "location" as *u8, "text" as *u8, 1)
106 iarea(fd, "Links -- portfolio, LinkedIn, or references (proof you are real)" as *u8, "proof" as *u8, 1)
107 wb_w(fd, "<label class=\"att\"><input type=\"checkbox\" name=\"attest\" required> I am a real person and this application is my own genuine work -- not AI-generated.</label>\n" as *u8)
108 }
109
110 wb_w(fd, "<p class=\"note\">Membership is curated -- verified humans only. We screen for fake profiles and AI-generated applications.</p>\n" as *u8)
111 wb_w(fd, "<button class=\"cta\" type=\"submit\">" as *u8); wb_w(fd, submitl); wb_w(fd, "</button>\n</form></section>\n" as *u8)
112 wb_footer(fd, foot)
113 wb_doc_close(fd)
114 sys_close(fd)
115
116 mputs("nx_meet_intake: slug=" as *u8); mputs(slug); mputs(" kind=" as *u8); mputs(kindname); mputs(" -> " as *u8); mputs(opath); mputs(" (nav, 0 JS, honeypot + attestation, POST " as *u8); mputs(action); mputs(")\n" as *u8)
117 sys_exit(0)
118 return 0
119}