Skip to content

Commit ef08039

Browse files
committed
Made the header image idiot-proof style wise, also added a recommended image size. (Hey that rhymed!). Closes activeadmin#560
1 parent e76badc commit ef08039

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

app/assets/stylesheets/active_admin/_header.css.scss

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@
33
@include primary-gradient;
44
@include shadow;
55
@include text-shadow(#000);
6+
height: 20px;
67
overflow: visible;
8+
position: relative;
79
padding: 9px $horizontal-page-margin;
810
z-index: 900;
911

1012
h1 {
1113
display: inline-block;
1214
color: #cdcdcd;
15+
float: left;
1316
margin-right: 20px;
1417
margin-bottom: 0px;
18+
padding-top: 3px;
1519
font-size: 1.3em;
1620
font-weight: normal;
1721

@@ -21,17 +25,28 @@
2125
&:hover {
2226
color: #fff;
2327
}
24-
2528
}
29+
30+
img {
31+
position: relative;
32+
top: -2px;
33+
}
2634
}
2735

2836
a, a:link { color: #cdcdcd; }
2937

38+
.header-item {
39+
float: left;
40+
top: 2px;
41+
position: relative;
42+
height: 20px
43+
}
44+
3045
ul#tabs {
31-
margin: 0;
32-
padding: 0;
3346
display: inline-block;
3447
height: 100%;
48+
margin: 0;
49+
padding: 0;
3550

3651
& > li {
3752
display: inline-block;
@@ -108,8 +123,11 @@
108123
}
109124

110125
#utility_nav {
111-
position: absolute; right: 25px; top: 10px;
112126
color: #aaa;
127+
float: right;
128+
display: inline-block;
129+
margin: 0;
130+
padding: 0;
113131
span, a { margin-left: 10px; }
114132

115133
a { text-decoration: none; }

lib/active_admin/views/header_renderer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ def title_text
4343
#
4444
# It uses the ActiveAdmin.tabs_renderer option
4545
def global_navigation
46-
render view_factory.global_navigation, current_menu
46+
render view_factory.global_navigation, current_menu, :class => 'header-item'
4747
end
4848

4949
def utility_navigation
50-
content_tag 'p', :id => "utility_nav" do
50+
content_tag 'p', :id => "utility_nav", :class => 'header-item' do
5151
if current_active_admin_user?
5252
html = content_tag(:span, display_name(current_active_admin_user), :class => "current_user")
5353

lib/generators/active_admin/install/templates/active_admin.rb.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ ActiveAdmin.setup do |config|
1515
# Set an optional image to be displayed for the header
1616
# instead of a string (overrides :site_title)
1717
#
18+
# Note: Recommended image height is 21px to properly fit in the header
19+
#
1820
# config.site_title_image = "/images/logo.png"
1921

2022
# == Default Namespace

0 commit comments

Comments
 (0)