Skip to content

Commit 4d611a4

Browse files
committed
load custom css
1 parent 8d924d1 commit 4d611a4

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

baseTemplate/templates/baseTemplate/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@
111111

112112
<!-- JS Ends -->
113113

114+
<style>
115+
{{ cosmetic.MainDashboardCSS | safe }}
116+
</style>
114117

115118
</head>
116119

plogical/httpProc.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ def render(self):
4141
self.data['ipAddress'] = ipAddress
4242
self.data['fullName'] = '%s %s' % (admin.firstName, admin.lastName)
4343

44+
### Load Custom CSS
45+
try:
46+
from baseTemplate.models import CyberPanelCosmetic
47+
cosmetic = CyberPanelCosmetic.objects.get(pk=1)
48+
self.data['cosmetic'] = cosmetic
49+
except:
50+
try:
51+
from baseTemplate.models import CyberPanelCosmetic
52+
cosmetic = CyberPanelCosmetic()
53+
cosmetic.save()
54+
self.data['cosmetic'] = cosmetic
55+
except:
56+
pass
57+
4458
self.data.update(currentACL)
4559

4660
return render(self.request, self.templateName, self.data)

0 commit comments

Comments
 (0)