Skip to content

Commit

Permalink
16394 distinguish product edition (#16924)
Browse files Browse the repository at this point in the history
* closes #16907: web ui refresh

* closes #16907: changed default widget color to primary color

* closes #16907: removed comma

* closes #16394: distinguish product edition

* Revert dashboard changes

* Clean up redundant styling (merge error)

* removed labs logo and added sub text for all editions

* fixed motif bug

* Fix "flashing" of side nav under dark mode

* Use title case for edition label

* altered edition text style

---------

Co-authored-by: Andrew Gormley <Andrew@MacBook-Pro-3.local>
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
  • Loading branch information
3 people authored Jul 19, 2024
1 parent d3e2993 commit 5e25067
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 4 deletions.
2 changes: 1 addition & 1 deletion netbox/project-static/dist/netbox.css

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions netbox/project-static/img/motif.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 53 additions & 3 deletions netbox/project-static/styles/transitional/_navigation.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Navbar and light theme styling
.navbar-vertical.navbar-expand-lg {

// Background Gradient
background: linear-gradient(180deg, rgba(0, 133, 125, 0.00) 0%, rgba(0, 133, 125, 0.10) 100%), #FFF;

// Adjust hover color & style for menu items
.navbar-collapse {
.nav-link-icon {
Expand Down Expand Up @@ -49,6 +46,55 @@
}
}
}

// Ensures theme toggle appears above background image
.navbar-nav {
z-index: 1;
}

// Logo text for non-community editions
.navbar-brand {

// Reduce logo padding on mobile view
@include media-breakpoint-down(lg) {
padding: 0.2rem 0;
}

a:hover {
text-decoration: none;
}
.netbox-edition {
font-size: .7rem;
letter-spacing: .15rem;
text-align: center;
}
}

// Navigation geometric graphic for non-community editions
img.motif {
bottom: 0;
display: none;
left:0;
mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, rgba(0, 0, 0, 0.30) 100%);
opacity: .5;
position: fixed;
user-drag: none;
user-select: none;
-moz-user-select: none;
-webkit-user-drag: none;
-webkit-user-select: none;
-ms-user-select: none;
width:18rem;

@include media-breakpoint-up(lg) {
display: block;
}
}
}

// Light theme styling
body[data-bs-theme=light] .navbar-vertical.navbar-expand-lg {
background: linear-gradient(180deg, rgba(0, 133, 125, 0.00) 0%, rgba(0, 133, 125, 0.10) 100%), #FFF;
}

// Dark theme styling
Expand Down Expand Up @@ -83,4 +129,8 @@ body[data-bs-theme=dark] .navbar-vertical.navbar-expand-lg {
.text-secondary {
color: $bright-teal!important;
}

img.motif {
opacity: .25;
}
}
6 changes: 6 additions & 0 deletions netbox/templates/base/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@

{# Sidebar #}
<aside class="navbar navbar-vertical navbar-expand-lg">

{% if settings.RELEASE.edition != 'Community' %}
<img class="motif" src="{% static 'motif.svg' %}" alt="{% trans "NetBox Motif" %}">
{% endif %}

<div class="container-fluid">

{# Menu toggle (mobile view) #}
Expand All @@ -32,6 +37,7 @@ <h1 class="navbar-brand">
<a href="{% url 'home' %}">
<img src="{% static 'logo_netbox_dark_teal.svg' %}" alt="{% trans "NetBox Logo" %}" class="navbar-brand-image hide-theme-dark">
<img src="{% static 'logo_netbox_bright_teal.svg' %}" alt="{% trans "NetBox Logo" %}" class="navbar-brand-image hide-theme-light">
<div class="netbox-edition fw-semibold mt-2">{{ settings.RELEASE.edition }}</div>
</a>
</h1>

Expand Down

0 comments on commit 5e25067

Please sign in to comment.