import re THEME_REPO_URL = "https://git.falkenthal.me/falkenthal/pretix-falkenthal-theme" PLATFORM_IMPRINT_URL = "https://tickets.falkenthal.me/impressum" PLATFORM_PRIVACY_URL = "https://tickets.falkenthal.me/datenschutz" ASSET_VERSION = "1.7.3" control_files = [ '/pretix/src/pretix/control/templates/pretixcontrol/base.html', '/pretix/src/pretix/control/templates/pretixcontrol/auth/base.html', ] platform_footer_html = ( '
' '
' 'Technischer Plattformbetrieb: FALKENTHAL' '·' f'Plattform-Impressum' '·' f'Plattform-Datenschutz' '·' f'Theme & Quellcode (AGPLv3)' '
' '
' '' ) for p in control_files: with open(p, 'r', encoding='utf-8') as f: c = f.read() c = re.sub(r']*rel=[\"\'](shortcut )?icon[\"\'][^>]*>', '', c, flags=re.I) if '/static/whitelabel/control.css' not in c: c = c.replace( '', f'' f'' f'' ) if 'falkenthal-platform-bar' not in c: c = c.replace('', platform_footer_html) with open(p, 'w', encoding='utf-8') as f: f.write(c) presale_file = '/pretix/src/pretix/presale/templates/pretixpresale/base.html' with open(presale_file, 'r', encoding='utf-8') as f: c = f.read() c = re.sub(r']*rel=[\"\'](shortcut )?icon[\"\'][^>]*>', '', c, flags=re.I) if '/static/whitelabel/presale.css' not in c: c = c.replace( '', f'' f'' f'' ) if 'falkenthal-platform-bar' not in c: c = c.replace('', platform_footer_html) with open(presale_file, 'w', encoding='utf-8') as f: f.write(c) print(f"Pretix templates patched successfully (v{ASSET_VERSION}).")