Skip to content

Commit

Permalink
Fixes #1599: Display global search in navigation menu unless display …
Browse files Browse the repository at this point in the history
…is less than 1200px wide
  • Loading branch information
jeremystretch committed Nov 15, 2017
1 parent d888aa6 commit 124878e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 9 additions & 6 deletions netbox/project-static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ footer p {
margin: 20px 0;
}

/* Hide the username in the navigation menu on displays less than 1400px wide */
@media (max-width: 1399px) {
#navbar_user {
display: none;
}
}

/* Collapse the nav menu on displays less than 1200px wide */
@media (max-width: 1199px) {
.navbar-header {
Expand Down Expand Up @@ -72,12 +79,8 @@ footer p {
.collapse.in {
display:block !important;
}
}

/* Hide the nav search bar on displays less than 1600px wide */
@media (max-width: 1599px) {
#navbar_search {
display: none;
#navbar_user {
display: inline;
}
}

Expand Down
4 changes: 3 additions & 1 deletion netbox/templates/inc/nav_menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,9 @@
{% if request.user.is_authenticated %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" title="{{ request.user }}" role="button" aria-haspopup="true" aria-expanded="false">
{{ request.user|truncatechars:"30" }} <span class="caret"></span>
<i class="fa fa-user"></i>
<span id="navbar_user">{{ request.user|truncatechars:"30" }}</span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="{% url 'user:profile' %}"><i class="fa fa-user"></i> Profile</a></li>
Expand Down

0 comments on commit 124878e

Please sign in to comment.