Update auf Version 1.8.4

This commit is contained in:
tino committed 2026-11-10 12:55:30 +01:00
1 parent 458f661c43
commit ce9b7db8c5
7 files changed
+87 -18

No files matched your search

+56 -2
View File
@@ -1,3 +1,4 @@
import glob
import os
import re
import sys
@@ -5,7 +6,7 @@ import sys
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.8.3"
ASSET_VERSION = "1.8.4"
control_files = [
'/pretix/src/pretix/control/templates/pretixcontrol/base.html',
@@ -137,5 +138,58 @@ for err_name in ['400.html', '403.html', '403_csrf.html', '404.html', '500.html'
with open(err_path, 'w', encoding='utf-8') as f:
f.write(ec)
print(f"Pretix templates patched and verified successfully (v{ASSET_VERSION}).")
# 4. Eingebettetes Pretix-Widget (widget.js / v1.*.js):
# Einheitliche Plattform-Pflichtangaben auch direkt unter dem Inline-Widget auf externen Veranstalter-Websites!
widget_platform_bar_js = r"""
;(function(){
if (typeof document === 'undefined' || window.__falkenthalWidgetPatched) return;
window.__falkenthalWidgetPatched = true;
var BAR_HTML = '<span>Technischer Plattformbetrieb: <strong style="font-weight:600;">FALKENTHAL</strong></span>' +
' &middot; <a href="https://tickets.falkenthal.me/impressum" target="_blank" rel="noopener" style="color:inherit;text-decoration:underline;">Plattform-Impressum</a>' +
' &middot; <a href="https://tickets.falkenthal.me/datenschutz" target="_blank" rel="noopener" style="color:inherit;text-decoration:underline;">Plattform-Datenschutz</a>' +
' &middot; <a href="https://git.falkenthal.me/falkenthal/pretix-falkenthal-theme" target="_blank" rel="noopener" style="color:inherit;text-decoration:underline;">Theme &amp; Quellcode (AGPLv3)</a>';
function injectWidgetBar() {
var footers = document.querySelectorAll('.pretix-widget-attribution');
for (var i = 0; i < footers.length; i++) {
var el = footers[i];
if (!el.getAttribute('data-falkenthal-bar')) {
el.setAttribute('data-falkenthal-bar', '1');
var bar = document.createElement('div');
bar.className = 'pretix-widget-falkenthal-bar';
bar.style.cssText = 'margin-top:6px;padding-top:6px;border-top:1px solid rgba(128,128,128,0.2);font-size:11px;line-height:1.5;text-align:center;opacity:0.85;';
bar.innerHTML = BAR_HTML;
el.appendChild(bar);
}
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', injectWidgetBar);
} else {
injectWidgetBar();
}
if (typeof MutationObserver !== 'undefined') {
var obs = new MutationObserver(function() { injectWidgetBar(); });
var startObs = function() {
if (document.body) obs.observe(document.body, { childList: true, subtree: true });
};
if (document.body) startObs();
else document.addEventListener('DOMContentLoaded', startObs);
}
setInterval(injectWidgetBar, 1500);
})();
"""
widget_js_candidates = (
glob.glob('/pretix/src/pretix/presale/static/pretixpresale/js/widget/*.js')
+ glob.glob('/pretix/src/pretix/static.dist/**/widget/*.js', recursive=True)
)
for wjs in widget_js_candidates:
if os.path.isfile(wjs):
with open(wjs, 'r', encoding='utf-8') as f:
wc = f.read()
if '__falkenthalWidgetPatched' not in wc:
with open(wjs, 'a', encoding='utf-8') as f:
f.write('\n' + widget_platform_bar_js)
print(f"Pretix templates and widget assets patched and verified successfully (v{ASSET_VERSION}).")