Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
5d09c078
Commit
5d09c078
authored
3 years ago
by
jan.bednarik
Browse files
Options
Downloads
Patches
Plain Diff
tuning: Colorize dev and test env admin
parent
b884908b
No related branches found
No related tags found
2 merge requests
!454
Release
,
!453
Fix
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tuning/wagtail_hooks.py
+14
-0
14 additions, 0 deletions
tuning/wagtail_hooks.py
with
14 additions
and
0 deletions
tuning/wagtail_hooks.py
+
14
−
0
View file @
5d09c078
from
django.conf
import
settings
from
django.contrib.postgres.lookups
import
Unaccent
from
django.db.models.functions
import
Lower
from
django.utils.safestring
import
mark_safe
...
...
@@ -27,3 +28,16 @@ def add_another_welcome_panel(request, panels):
@hooks.register
(
"
construct_explorer_page_queryset
"
)
def
show_my_profile_only
(
parent_page
,
pages
,
request
):
return
pages
.
order_by
(
Unaccent
(
Lower
(
"
title
"
)))
@hooks.register
(
"
insert_global_admin_css
"
)
def
global_admin_css
():
if
settings
.
MAJAK_ENV
==
"
test
"
:
return
mark_safe
(
'
<style type=
"
text/css
"
>.sidebar__inner { background-color: #00203A }</style>
'
)
if
settings
.
MAJAK_ENV
==
"
dev
"
:
return
mark_safe
(
'
<style type=
"
text/css
"
>.sidebar__inner { background-color: #002A20 }</style>
'
)
return
""
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment