site: visitors see the design alone, not XWiki's chrome
Captain Bob, 2026-11-07: "Menu bar". For guests only, the .com pages and the .org landing page hide XWiki's top bar, breadcrumb, title block, page menu, panels, footer and tour, and the design runs the full width (a velocity check on $isGuest; the stylesheet in a literal block). Logged in, the wiki is all there. Checked on a phone and a desktop: the chrome is hidden on Main, Inquiries and TryIt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
This commit is contained in:
@@ -39,3 +39,26 @@ def lock(html, root_marker):
|
||||
html = html.replace(root_marker, root_marker.replace("<div ", '<div class="%s" ' % ROOT_CLASS, 1), 1)
|
||||
html = re.sub(r'style="([^"]*)"', _lock_style, html)
|
||||
return STYLE + "\n" + html
|
||||
|
||||
|
||||
# For visitors (guests) only, the page is the design alone: XWiki's own chrome -- the top bar with
|
||||
# Register and Log-in, the breadcrumb, the title and "Last modified", the page menu, the side panels,
|
||||
# the footer and the welcome tour -- is hidden, and the design runs the full width. Logged in, the
|
||||
# wiki is all there, to edit with. (Captain Bob, 2026-11-07: "Menu bar".)
|
||||
GUEST_CHROME = """{{velocity}}
|
||||
#if ($isGuest)
|
||||
#[[{{html clean="false"}}<style>
|
||||
#menuview, #hierarchy_breadcrumb, .document-header, #xdocFooter, #footerglobal, #leftPanels, #rightPanels,
|
||||
#leftPanelsToggle, #rightPanelsToggle, .tour, .tour-backdrop, #bootstrap_tour_restart, .xtour-restart,
|
||||
#xwikimaincontainerinner > a.btn { display: none !important; }
|
||||
html, body, #xwikimaincontainer, #xwikimaincontainerinner, #contentcontainer, #contentcolumn, .main,
|
||||
#mainContentArea, #xwikicontent, #mainContentArea .row { background-color: #0A1222 !important; }
|
||||
#contentcontainer, #contentcolumn, .main, #mainContentArea, #xwikicontent, #mainContentArea .row {
|
||||
width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; float: none !important; }
|
||||
#xwikicontent > .ssos { border: 0 !important; }
|
||||
#xwikimaincontainer { padding: 0 !important; }
|
||||
.main hr:not(.ssos hr), #xwikicontent > :not(.ssos) { display: none !important; }
|
||||
</style>{{/html}}]]#
|
||||
#end
|
||||
{{/velocity}}
|
||||
"""
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
{{velocity}}
|
||||
#if ($isGuest)
|
||||
#[[{{html clean="false"}}<style>
|
||||
#menuview, #hierarchy_breadcrumb, .document-header, #xdocFooter, #footerglobal, #leftPanels, #rightPanels,
|
||||
#leftPanelsToggle, #rightPanelsToggle, .tour, .tour-backdrop, #bootstrap_tour_restart, .xtour-restart,
|
||||
#xwikimaincontainerinner > a.btn { display: none !important; }
|
||||
html, body, #xwikimaincontainer, #xwikimaincontainerinner, #contentcontainer, #contentcolumn, .main,
|
||||
#mainContentArea, #xwikicontent, #mainContentArea .row { background-color: #0A1222 !important; }
|
||||
#contentcontainer, #contentcolumn, .main, #mainContentArea, #xwikicontent, #mainContentArea .row {
|
||||
width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; float: none !important; }
|
||||
#xwikicontent > .ssos { border: 0 !important; }
|
||||
#xwikimaincontainer { padding: 0 !important; }
|
||||
.main hr:not(.ssos hr), #xwikicontent > :not(.ssos) { display: none !important; }
|
||||
</style>{{/html}}]]#
|
||||
#end
|
||||
{{/velocity}}
|
||||
{{html clean="false"}}
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Exo+2:wght@600;700&display=swap" rel="stylesheet">
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
{{velocity}}
|
||||
#if ($isGuest)
|
||||
#[[{{html clean="false"}}<style>
|
||||
#menuview, #hierarchy_breadcrumb, .document-header, #xdocFooter, #footerglobal, #leftPanels, #rightPanels,
|
||||
#leftPanelsToggle, #rightPanelsToggle, .tour, .tour-backdrop, #bootstrap_tour_restart, .xtour-restart,
|
||||
#xwikimaincontainerinner > a.btn { display: none !important; }
|
||||
html, body, #xwikimaincontainer, #xwikimaincontainerinner, #contentcontainer, #contentcolumn, .main,
|
||||
#mainContentArea, #xwikicontent, #mainContentArea .row { background-color: #0A1222 !important; }
|
||||
#contentcontainer, #contentcolumn, .main, #mainContentArea, #xwikicontent, #mainContentArea .row {
|
||||
width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; float: none !important; }
|
||||
#xwikicontent > .ssos { border: 0 !important; }
|
||||
#xwikimaincontainer { padding: 0 !important; }
|
||||
.main hr:not(.ssos hr), #xwikicontent > :not(.ssos) { display: none !important; }
|
||||
</style>{{/html}}]]#
|
||||
#end
|
||||
{{/velocity}}
|
||||
{{html clean="false"}}
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Exo+2:wght@600;700&display=swap" rel="stylesheet">
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
{{velocity}}
|
||||
#if ($isGuest)
|
||||
#[[{{html clean="false"}}<style>
|
||||
#menuview, #hierarchy_breadcrumb, .document-header, #xdocFooter, #footerglobal, #leftPanels, #rightPanels,
|
||||
#leftPanelsToggle, #rightPanelsToggle, .tour, .tour-backdrop, #bootstrap_tour_restart, .xtour-restart,
|
||||
#xwikimaincontainerinner > a.btn { display: none !important; }
|
||||
html, body, #xwikimaincontainer, #xwikimaincontainerinner, #contentcontainer, #contentcolumn, .main,
|
||||
#mainContentArea, #xwikicontent, #mainContentArea .row { background-color: #0A1222 !important; }
|
||||
#contentcontainer, #contentcolumn, .main, #mainContentArea, #xwikicontent, #mainContentArea .row {
|
||||
width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; float: none !important; }
|
||||
#xwikicontent > .ssos { border: 0 !important; }
|
||||
#xwikimaincontainer { padding: 0 !important; }
|
||||
.main hr:not(.ssos hr), #xwikicontent > :not(.ssos) { display: none !important; }
|
||||
</style>{{/html}}]]#
|
||||
#end
|
||||
{{/velocity}}
|
||||
{{html clean="false"}}
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Exo+2:wght@600;700&display=swap" rel="stylesheet">
|
||||
|
||||
+1
-1
@@ -99,5 +99,5 @@ if __name__ == "__main__":
|
||||
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))
|
||||
f.write(colorlock.GUEST_CHROME + '{{html clean="false"}}\n%s\n%s\n{{/html}}\n' % (FONTS, html))
|
||||
print("wrote", ", ".join("%s.WebHome.xwiki" % p for p in PAGES))
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
{{velocity}}
|
||||
#if ($isGuest)
|
||||
#[[{{html clean="false"}}<style>
|
||||
#menuview, #hierarchy_breadcrumb, .document-header, #xdocFooter, #footerglobal, #leftPanels, #rightPanels,
|
||||
#leftPanelsToggle, #rightPanelsToggle, .tour, .tour-backdrop, #bootstrap_tour_restart, .xtour-restart,
|
||||
#xwikimaincontainerinner > a.btn { display: none !important; }
|
||||
html, body, #xwikimaincontainer, #xwikimaincontainerinner, #contentcontainer, #contentcolumn, .main,
|
||||
#mainContentArea, #xwikicontent, #mainContentArea .row { background-color: #0A1222 !important; }
|
||||
#contentcontainer, #contentcolumn, .main, #mainContentArea, #xwikicontent, #mainContentArea .row {
|
||||
width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; float: none !important; }
|
||||
#xwikicontent > .ssos { border: 0 !important; }
|
||||
#xwikimaincontainer { padding: 0 !important; }
|
||||
.main hr:not(.ssos hr), #xwikicontent > :not(.ssos) { display: none !important; }
|
||||
</style>{{/html}}]]#
|
||||
#end
|
||||
{{/velocity}}
|
||||
{{html clean="false"}}
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Exo+2:wght@600;700&display=swap" rel="stylesheet">
|
||||
|
||||
+3
-1
@@ -306,7 +306,9 @@ def body(name, canvas):
|
||||
def write_wiki(name):
|
||||
html = colorlock.lock(body(name, False).replace("{accent}", ACCENT), "<div style=\"background: #0A1222")
|
||||
with open("%s.WebHome.xwiki" % name, "w") as f:
|
||||
f.write('{{html clean="false"}}\n%s\n%s\n{{/html}}\n' % (FONTS, html))
|
||||
# the landing page is the public one: the design alone for visitors, as on the .com
|
||||
chrome = colorlock.GUEST_CHROME if name == "Main" else ""
|
||||
f.write(chrome + '{{html clean="false"}}\n%s\n%s\n{{/html}}\n' % (FONTS, html))
|
||||
|
||||
|
||||
def write_canvas(name, root):
|
||||
|
||||
Reference in New Issue
Block a user