mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-10-26 15:56:34 +01:00
- Introduced a new `cosmetic_context` processor to provide custom CSS data to templates. - Updated `settings.py` to include the new context processor. - Modified multiple HTML templates to utilize the `cosmetic` variable for dynamic CSS styling. - Enhanced user interface elements with improved styling and accessibility features, including ARIA labels for form controls.
26 lines
733 B
Python
26 lines
733 B
Python
# -*- coding: utf-8 -*-
|
|
from .views import VERSION, BUILD
|
|
|
|
def version_context(request):
|
|
"""Add version information to all templates"""
|
|
return {
|
|
'CYBERPANEL_VERSION': VERSION,
|
|
'CYBERPANEL_BUILD': BUILD,
|
|
'CYBERPANEL_FULL_VERSION': f"{VERSION}.{BUILD}"
|
|
}
|
|
|
|
def cosmetic_context(request):
|
|
"""Add cosmetic data (custom CSS) to all templates"""
|
|
try:
|
|
from .models import CyberPanelCosmetic
|
|
cosmetic = CyberPanelCosmetic.objects.get(pk=1)
|
|
return {
|
|
'cosmetic': cosmetic
|
|
}
|
|
except:
|
|
from .models import CyberPanelCosmetic
|
|
cosmetic = CyberPanelCosmetic()
|
|
cosmetic.save()
|
|
return {
|
|
'cosmetic': cosmetic
|
|
} |