Skip to content

Changeable class on banner bar #7661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hagbarddenstore opened this issue Oct 27, 2021 · 2 comments
Closed

Changeable class on banner bar #7661

hagbarddenstore opened this issue Oct 27, 2021 · 2 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@hagbarddenstore
Copy link
Contributor

NetBox version

v3.0.8

Feature type

Change to existing functionality

Proposed functionality

Be able to change either the rendered template of the top/bottom banner or be able to set the classes it's rendered with. The cyan colour might not be what's wanted/needed for that banner.

Use case

We use the banner to differentiate between development and production environments, where different production environments may contain information that's classified differently. It would be very helpful to further visualise the "danger" of each system by changing the background colour of the banners.

Database changes

None

External dependencies

None

@hagbarddenstore hagbarddenstore added the type: feature Introduction of new functionality to the application label Oct 27, 2021
@jeremystretch
Copy link
Member

It probably makes the most sense to allow the user to toggle wrapping the banner content in the blue block. This could be done either with a separate config parameter (to control the top, bottom, and login banners), or via some autodetection method on the content itself. For instance, if the banner content starts with an HTML tag, forgo the wrapper.

@jeremystretch jeremystretch added the status: under review Further discussion is needed to determine this issue's scope and/or implementation label Oct 27, 2021
@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Dec 13, 2021
@jeremystretch
Copy link
Member

The simplest approach here is probably to just remove the hard-coded <div> element surrounding the banner content. For instance:

{% if config.BANNER_TOP %}
    {{ config.BANNER_TOP|safe }}
{% endif %}

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Dec 19, 2021
@jeremystretch jeremystretch self-assigned this Dec 19, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

2 participants