diff --git a/app.py b/app.py index 2e143d6..96c2385 100644 --- a/app.py +++ b/app.py @@ -427,6 +427,19 @@ def format_version(value): return result +@app.template_global() +def bootstrap_alert_category(cat): + mapping = { + 'error': 'danger', + 'fail': 'danger', + 'warning': 'warning', + 'warn': 'warning', + 'ok': 'success', + 'success': 'success', + 'info': 'info' + } + return mapping.get(cat.lower(), 'info') + def fetch_changelogs(force=False): changelog_url = "https://mikrotik.com/download/changelogs" current_date = datetime.utcnow() diff --git a/templates/base.html b/templates/base.html index 8284240..37e5b06 100644 --- a/templates/base.html +++ b/templates/base.html @@ -219,19 +219,17 @@