File tree Expand file tree Collapse file tree
app/views/layouts/rails_admin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ Metrics/MethodLength:
118118 Max : 29 # TODO: Lower to 15
119119
120120Metrics/ModuleLength :
121- Max : 217 # TODO: Lower to 100
121+ Max : 219 # TODO: Lower to 100
122122
123123Metrics/ParameterLists :
124124 Max : 8 # TODO: Lower to 4
Original file line number Diff line number Diff line change 55 </ head >
66 < body class ="rails_admin ">
77 < div data-i18n-options ="<%= I18n . t ( "admin.js" ) . to_json %> " id ="admin-js "> </ div >
8- < nav class ="navbar navbar-expand-md fixed-top navbar-dark bg-primary border-bottom ">
8+ < nav class ="navbar navbar-expand-md fixed-top <%= RailsAdmin :: Config . navbar_css_classes . join ( ' ' ) %> ">
99 <%= render "layouts/rails_admin/navigation" %>
1010 </ nav >
1111 < div class ="container-fluid ">
Original file line number Diff line number Diff line change @@ -75,6 +75,9 @@ class << self
7575 # @see RailsAdmin.config
7676 attr_reader :registry
7777
78+ # Bootstrap CSS classes used for Navigation bar
79+ attr_accessor :navbar_css_classes
80+
7881 # show Gravatar in Navigation bar
7982 attr_accessor :show_gravatar
8083
@@ -336,6 +339,7 @@ def reset
336339 @label_methods = %i[ name title ]
337340 @main_app_name = proc { [ Rails . application . engine_name . titleize . chomp ( ' Application' ) , 'Admin' ] }
338341 @registry = { }
342+ @navbar_css_classes = %w[ navbar-dark bg-primary border-bottom ]
339343 @show_gravatar = true
340344 @navigation_static_links = { }
341345 @navigation_static_label = nil
Original file line number Diff line number Diff line change 6161 end
6262 end
6363
64+ describe 'navbar css class' do
65+ it 'is set by default' do
66+ expect ( RailsAdmin . config . navbar_css_classes ) . to eq ( %w[ navbar-dark bg-primary border-bottom ] )
67+ end
68+
69+ it 'can be configured' do
70+ RailsAdmin . config do |config |
71+ config . navbar_css_classes = %w[ navbar-light border-bottom ]
72+ end
73+ visit dashboard_path
74+ is_expected . to have_css ( 'nav.navbar.navbar-light.border-bottom' )
75+ end
76+ end
77+
6478 describe '_current_user' do # https://github.com/railsadminteam/rails_admin/issues/549
6579 it 'is accessible from the list view' do
6680 RailsAdmin . config Player do
You can’t perform that action at this time.
0 commit comments