Skip to content

Commit

Permalink
Fixed protruding links in header navbar [skip ci]
Browse files Browse the repository at this point in the history
1. All protruding plugin links rolled to dropdown button
2. Trim navbar link weight for screen less than 979px
  • Loading branch information
davydovanton committed Apr 3, 2015
1 parent ab8f11d commit 70407f4
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 10 deletions.
25 changes: 25 additions & 0 deletions web/assets/javascripts/application.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 21 additions & 5 deletions web/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ table .table-checkbox label {
padding: 0;
}

.navbar .navbar-collapse {
max-height: 400px;
}

.navbar .navbar-collapse .navbar-livereload {
display: none;
}
Expand All @@ -231,6 +235,18 @@ table .table-checkbox label {
.navbar .poll-wrapper {
margin: 4px 4px 0 0;
}

.navbar .dropdown-menu {
min-width: 120px;
}

.navbar .dropdown-menu a {
text-align: left;
}
}

.nav .dropdown {
display: none;
}

.navbar-footer .navbar ul.nav {
Expand Down Expand Up @@ -635,11 +651,6 @@ div.interval-slider input {
display: block;
}

.navbar ul.nav li a {
padding-left: 8px;
padding-right: 8px;
}

.navbar.navbar-fixed-top ul {
margin-right: 0;
}
Expand Down Expand Up @@ -680,6 +691,11 @@ div.interval-slider input {
margin: 0 -20px;
}

.navbar ul.nav li a {
padding-left: 8px;
padding-right: 8px;
}

.admin #page {
padding-top: 10px;
}
Expand Down
1 change: 1 addition & 0 deletions web/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ en: # <---- change this to your locale code
StopAll: Stop All
QuietAll: Quiet All
PollingInterval: Polling interval
Plugins: Plugins
1 change: 1 addition & 0 deletions web/locales/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ ru:
StopAll: Остановить все
QuietAll: Отдыхать всем
PollingInterval: Интервал опроса
Plugins: Плагины
24 changes: 19 additions & 5 deletions web/views/_nav.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<div class="navbar-header" data-navbar="static">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-menu">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
Expand All @@ -19,7 +19,7 @@
</div>

<div class="collapse navbar-collapse" id="navbar-menu">
<ul class="nav navbar-nav">
<ul class="nav navbar-nav" data-navbar="static">
<% Sidekiq::Web.default_tabs.each do |title, url| %>
<% if url == '' %>
<li class="<%= current_path == url ? 'active' : '' %>">
Expand All @@ -31,13 +31,27 @@
</li>
<% end %>
<% end %>

<li class="dropdown" data-navbar="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<%= t('Plugins') %> <span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<% Sidekiq::Web.custom_tabs.each do |title, url| %>
<li>
<a href="<%= root_path %><%= url %>"><%= t(title) %></a>
</li>
<% end %>
</ul>
</li>

<% Sidekiq::Web.custom_tabs.each do |title, url| %>
<li class="<%= current_path.start_with?(url) ? 'active' : '' %>">
<a href="<%= root_path %><%= url %>"><%= t(title) %></a>
<li class="<%= current_path.start_with?(url) ? 'active' : '' %>" data-navbar="custom-tab">
<a href="<%= root_path %><%= url %>"><%= t(title) %></a>
</li>
<% end %>
</ul>
<ul class="nav navbar-nav navbar-right navbar-livereload">
<ul class="nav navbar-nav navbar-right navbar-livereload" data-navbar="static">
<li>
<div class="poll-wrapper pull-right">
<%= erb :_poll %>
Expand Down

0 comments on commit 70407f4

Please sign in to comment.