Skip to content

Commit bfae653

Browse files
committed
Add a way to provide a header image for the header
1 parent 7f92762 commit bfae653

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

app/assets/stylesheets/application.sass

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ header
121121
margin-left: 0
122122
width: 100px
123123

124+
#header_image
125+
max-height: 250px
126+
124127
#title, &:hover, &:active, &:visited
125128
color: $title-color
126129
text-decoration: none

app/helpers/home_helper.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,12 @@ def contact_text
1616
concat '.'
1717
end
1818
end
19+
20+
def header_image_path
21+
File.join('labels', Whitelabel[:label_id], 'header.png')
22+
end
23+
24+
def header_image_available?
25+
Rails.root.join('app', 'assets', 'images', header_image_path).exist?
26+
end
1927
end
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
header.d-none.d-xl-block
22
.row
3-
.col-lg-2.text-center
4-
= link_to(root_path, title: title) do
5-
=image_tag("labels/#{Whitelabel[:label_id]}.png", title: title, id: :logo)
3+
- if false && header_image_available?
4+
.col-lg-12
5+
= link_to(root_path, title: title) do
6+
= image_tag(header_image_path, title: title, id: :header_image)
7+
- else
8+
.col-lg-2.text-center
9+
= link_to(root_path, title: title) do
10+
=image_tag("labels/#{Whitelabel[:label_id]}.png", title: title, id: :logo)
611

7-
.col-lg-10
8-
= link_to(root_path, id: :title, title: title) do
9-
h1= title
10-
h2.mt-4= subtitle
12+
.col-lg-10
13+
= link_to(root_path, id: :title, title: title) do
14+
h1= title
15+
h2.mt-4= subtitle

0 commit comments

Comments
 (0)