Skip to content

Comments

Add option to have a stripe with ENVIRONMENT name on top of the page. Fixes: #1012#1131

Closed
SukiCZ wants to merge 1 commit intounfoldadmin:mainfrom
SukiCZ:feat/add-environment-stripe
Closed

Add option to have a stripe with ENVIRONMENT name on top of the page. Fixes: #1012#1131
SukiCZ wants to merge 1 commit intounfoldadmin:mainfrom
SukiCZ:feat/add-environment-stripe

Conversation

@SukiCZ
Copy link
Contributor

@SukiCZ SukiCZ commented Mar 7, 2025

This adds an option to have a stripe with env name on top of the page

image

The environment_callback should be changed to ["Development", "primary", True], last argument indicates "show stripe".

Fixes: #1012

@AmineFouzai
Copy link

@SukiCZ , You can actually use this, and it will do the same job without major changes. and give the same result
django-admin-env-notice

and add this env vars as well :
ENVIRONMENT_NAME = "RUNNING ON DEBUG SERVER"
ENVIRONMENT_COLOR = "#FF2222"
ENVIRONMENT_FLOAT = False
ENVIRONMENT_SHOW_TO_UNAUTHENTICATED = False

@lukasvinclav
Copy link
Contributor

@AmineFouzai the whole point of this PR is to introduce this functionality into Unfold so there will be no need to install any third party libraries

@lukasvinclav
Copy link
Contributor

The catch of this task is to make the environment label fullwidth and not only in the main content area. Probably I would choose little bit different colors. Background need to have bg-primary-500 dark:bg-primary-500 text-white for better contrast. If you refactor the code, please ping me on Discord to reopen the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add a stripe to display the current ENVIRONMENT setting

3 participants