Skip to content

Commit d9cdadb

Browse files
committed
Day 7: Jazzmin UI add For Admin Dashboard and Fixed Schema Swagger UI and Serializer modifications
1 parent 7409044 commit d9cdadb

File tree

5 files changed

+501
-11
lines changed

5 files changed

+501
-11
lines changed

backend/settings.py

Lines changed: 103 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@
3434
# Application definition
3535

3636
INSTALLED_APPS = [
37+
"api",
38+
"silk",
39+
"jazzmin",
40+
"users",
3741
"django.contrib.admin",
3842
"django.contrib.auth",
3943
"django.contrib.contenttypes",
4044
"django.contrib.sessions",
4145
"django.contrib.messages",
4246
"django.contrib.staticfiles",
43-
"api",
44-
"silk",
45-
"jazzmin",
46-
"users",
4747
"rest_framework",
4848
"drf_spectacular",
4949
]
@@ -177,3 +177,102 @@
177177
"REFRESH_TOKEN_LIFETIME": timedelta(days=7),
178178
"AUTH_HEADER_TYPES": ("Bearer",),
179179
}
180+
181+
182+
JAZZMIN_SETTINGS = {
183+
"site_title": "RO Purifier Admin",
184+
"site_header": "RO Purifier Admin",
185+
"site_brand": "RO Purifier Admin",
186+
"site_icon": "images/favicon.png",
187+
# Add your own branding here
188+
"site_logo": None,
189+
"welcome_sign": "Welcome to the RO Purifier Admin Panel",
190+
# Copyright on the footer
191+
"copyright": "RO Purifier Admin",
192+
"user_avatar": None,
193+
############
194+
# Top Menu #
195+
############
196+
# Links to put along the top menu
197+
"topmenu_links": [
198+
# Url that gets reversed (Permissions can be added)
199+
{"name": "RO Purifier", "url": "home", "permissions": ["auth.view_user"]},
200+
# model admin to link to (Permissions checked against model)
201+
{"model": "auth.User"},
202+
],
203+
#############
204+
# Side Menu #
205+
#############
206+
# Whether to display the side menu
207+
"show_sidebar": True,
208+
# Whether to aut expand the menu
209+
"navigation_expanded": True,
210+
# Custom icons for side menu apps/models See https://fontawesome.com/icons?d=gallery&m=free&v=5.0.0,5.0.1,5.0.10,5.0.11,5.0.12,5.0.13,5.0.2,5.0.3,5.0.4,5.0.5,5.0.6,5.0.7,5.0.8,5.0.9,5.1.0,5.1.1,5.2.0,5.3.0,5.3.1,5.4.0,5.4.1,5.4.2,5.13.0,5.12.0,5.11.2,5.11.1,5.10.0,5.9.0,5.8.2,5.8.1,5.7.2,5.7.1,5.7.0,5.6.3,5.5.0,5.4.2
211+
# for the full list of 5.13.0 free icon classes
212+
"icons": {
213+
"auth": "fas fa-users-cog",
214+
"auth.user": "fas fa-user",
215+
"users.User": "fas fa-user",
216+
"auth.Group": "fas fa-users",
217+
"admin.LogEntry": "fas fa-file",
218+
},
219+
# # Icons that are used when one is not manually specified
220+
"default_icon_parents": "fas fa-chevron-circle-right",
221+
"default_icon_children": "fas fa-arrow-circle-right",
222+
#################
223+
# Related Modal #
224+
#################
225+
# Use modals instead of popups
226+
"related_modal_active": False,
227+
#############
228+
# UI Tweaks #
229+
#############
230+
# Relative paths to custom CSS/JS scripts (must be present in static files)
231+
# Uncomment this line once you create the bootstrap-dark.css file
232+
# "custom_css": "css/bootstrap-dark.css",
233+
"custom_js": None,
234+
# Whether to show the UI customizer on the sidebar
235+
"show_ui_builder": False,
236+
###############
237+
# Change view #
238+
###############
239+
"changeform_format": "horizontal_tabs",
240+
# override change forms on a per modeladmin basis
241+
"changeform_format_overrides": {
242+
"auth.user": "collapsible",
243+
"auth.group": "vertical_tabs",
244+
},
245+
}
246+
247+
248+
JAZZMIN_UI_TWEAKS = {
249+
"theme": "cyborg",
250+
"navbar_small_text": False,
251+
"footer_small_text": False,
252+
"body_small_text": False,
253+
"brand_small_text": False,
254+
"brand_colour": "navbar-success",
255+
"accent": "accent-teal",
256+
"navbar": "navbar-dark",
257+
"no_navbar_border": False,
258+
"navbar_fixed": False,
259+
"layout_boxed": False,
260+
"footer_fixed": False,
261+
"sidebar_fixed": False,
262+
"sidebar": "sidebar-dark-info",
263+
"sidebar_nav_small_text": False,
264+
"sidebar_disable_expand": False,
265+
"sidebar_nav_child_indent": False,
266+
"sidebar_nav_compact_style": False,
267+
"sidebar_nav_legacy_style": False,
268+
"sidebar_nav_flat_style": False,
269+
"dark_mode_theme": None,
270+
"button_classes": {
271+
"primary": "btn-primary",
272+
"secondary": "btn-secondary",
273+
"info": "btn-info",
274+
"warning": "btn-warning",
275+
"danger": "btn-danger",
276+
"success": "btn-success",
277+
},
278+
}

0 commit comments

Comments
 (0)