site: the design's colours over the wikis' high-contrast theme; .org inquiries
- site/colorlock.py: both XWikis force black and white with !important (a HIGH CONTRAST DARK THEME block in the skin's cssVariablesInit.css). On our pages only, the design's colours win: each inline colour made !important, and a stylesheet scoped to the page root (.ssos) for the rest. Used by site/com/build.py and site/org/build.py; the .com reinstalled with it. - site/org/inquiries (Captain Bob, 2026-11-07): the .com's inquiries go to an admin-only master/detail on the .org -- Inquiries.WebHome (Live Data table), one page per inquiry under Inquiries.Entries with a sheet and a status, PublicInquiry (public) filing them with its author's rights and echoing nothing a visitor sends; a hidden trap field for robots. The .com form posts there. Installed and tested: a guest's inquiry filed and deleted; one whose name and message were script macros was stored as text, nothing ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
This commit is contained in:
+15
-4
@@ -11,13 +11,18 @@ one {{html}} block (which needs a page author with script rights). What changes
|
||||
- the two images become attachments of Main.WebHome (badge.jpg, captain-bob.jpg -- web-size copies
|
||||
of the canvas's uploads);
|
||||
- Try it: the drawn console becomes the real one, an iframe of try.starshipos-f18.com;
|
||||
- the forms, which have no server behind them, send by e-mail (mailto:);
|
||||
- the inquiry form posts to the .org's PublicInquiry, which files it under Inquiries there
|
||||
(admin-only, site/org/inquiries); the announcements form, which has no server, sends by e-mail;
|
||||
- a link the canvas left as a placeholder ([SSRN PAPER URL]) points at the .org until it is given.
|
||||
|
||||
install.sh puts the pages and the images on the wiki.
|
||||
"""
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
|
||||
import colorlock # noqa: E402 the design's colours over the wiki's high-contrast theme
|
||||
|
||||
ACCENT = "#F5891F"
|
||||
FONTS = ('<link rel="preconnect" href="https://fonts.googleapis.com">\n'
|
||||
@@ -69,14 +74,19 @@ def forms(html, page):
|
||||
'<button type="submit" style="min-height: 48px; padding: 0 24px')
|
||||
if page == "Inquiries":
|
||||
html = html.replace('<form aria-label="Inquiry form"',
|
||||
'<form action="mailto:info@starshipos.com?subject=StarshipOS%20inquiry" method="post" enctype="text/plain" aria-label="Inquiry form"')
|
||||
'<form action="https://starshipos-f18.org/bin/view/PublicInquiry/" method="post" aria-label="Inquiry form"')
|
||||
# a field people cannot see; a robot fills it, and PublicInquiry keeps nothing it sends
|
||||
html = html.replace('<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px">',
|
||||
'<div aria-hidden="true" style="position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden">'
|
||||
'<label for="q-website">Leave this empty</label><input id="q-website" name="website" type="text" tabindex="-1" autocomplete="off"></div>\n'
|
||||
'<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px">', 1)
|
||||
for i, n in (("q-name", "name"), ("q-email", "email"), ("q-org", "organization"), ("q-topic", "topic"),
|
||||
("q-msg", "message"), ("q-list", "announcements")):
|
||||
html = html.replace('id="%s"' % i, 'id="%s" name="%s"' % (i, n), 1)
|
||||
html = html.replace('<button type="button" style="min-height: 48px; padding: 0 28px',
|
||||
'<button type="submit" style="min-height: 48px; padding: 0 28px')
|
||||
html = html.replace("Replies usually within a few days.",
|
||||
"Opens your e-mail program. Replies usually within a few days.")
|
||||
"Replies usually within a few days.")
|
||||
return html
|
||||
|
||||
|
||||
@@ -86,7 +96,8 @@ if __name__ == "__main__":
|
||||
html = forms(body(open("canvas/%s.dc.html" % p).read()), p)
|
||||
if p == "TryIt":
|
||||
html = try_it(html)
|
||||
assert "{{" not in html and "[SSRN" not in html and ".dc.html" not in html and "_blob" not in html, p
|
||||
html = colorlock.lock(html, '<div style="background: #0A1222')
|
||||
assert "{{" not in html.replace(colorlock.STYLE, "") and "[SSRN" not in html and ".dc.html" not in html and "_blob" not in html, p
|
||||
with open("%s.WebHome.xwiki" % p, "w") as f:
|
||||
f.write('{{html clean="false"}}\n%s\n%s\n{{/html}}\n' % (FONTS, html))
|
||||
print("wrote", ", ".join("%s.WebHome.xwiki" % p for p in PAGES))
|
||||
|
||||
Reference in New Issue
Block a user